From cca59d4cebece620b7fb818ae4db1467002a0720 Mon Sep 17 00:00:00 2001 From: tsukumi Date: Tue, 4 Jun 2024 05:02:57 +0900 Subject: [PATCH 1/7] =?UTF-8?q?driver:=20ISDB2056N=20=E3=81=A7=E8=A1=9B?= =?UTF-8?q?=E6=98=9F=E6=94=BE=E9=80=81=E3=82=92=E9=81=B8=E5=B1=80=E3=81=A7?= =?UTF-8?q?=E3=81=8D=E3=81=AA=E3=81=84=E5=95=8F=E9=A1=8C=E3=81=8C=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=E3=81=95=E3=82=8C=E3=81=9D=E3=81=86=E3=81=AA=E5=A4=89?= =?UTF-8?q?=E6=9B=B4=E3=82=92=E8=A9=A6=E3=81=99=20=E5=AE=9F=E9=9A=9B?= =?UTF-8?q?=E3=81=AB=E5=8B=95=E3=81=8F=E3=81=A8=E3=81=AF=E9=99=90=E3=82=89?= =?UTF-8?q?=E3=81=AA=E3=81=84=E3=81=97=E3=80=81=E3=81=93=E3=81=AE=E5=A4=89?= =?UTF-8?q?=E6=9B=B4=E3=81=AB=E3=82=88=E3=82=8A=E9=96=93=E9=81=95=E3=81=84?= =?UTF-8?q?=E3=81=AA=E3=81=8F=E6=97=A7=E3=83=AD=E3=83=83=E3=83=88=E3=81=A7?= =?UTF-8?q?=E3=81=82=E3=82=8B=20ISDB2056=20=E3=81=A7=E3=81=AF=E3=83=89?= =?UTF-8?q?=E3=83=A9=E3=82=A4=E3=83=90=E3=81=8C=E6=AD=A3=E5=B8=B8=E5=8B=95?= =?UTF-8?q?=E4=BD=9C=E3=81=97=E3=81=AA=E3=81=8F=E3=81=AA=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- driver/isdb2056_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/driver/isdb2056_device.c b/driver/isdb2056_device.c index 0842055..53b8964 100644 --- a/driver/isdb2056_device.c +++ b/driver/isdb2056_device.c @@ -887,7 +887,7 @@ static int isdb2056_device_load_config(struct isdb2056_device *isdb2056, chrdev2056->tc90522_s.dev = dev; chrdev2056->tc90522_s.i2c = &it930x->i2c_master[2]; - chrdev2056->tc90522_s.i2c_addr = 0x11; + chrdev2056->tc90522_s.i2c_addr = 0x13; chrdev2056->tc90522_s.is_secondary = false; chrdev2056->r850.dev = dev; From be06a0025004cbbba879a1771d7eda231cf5ebf9 Mon Sep 17 00:00:00 2001 From: tsukumi Date: Wed, 5 Jun 2024 05:20:19 +0900 Subject: [PATCH 2/7] =?UTF-8?q?driver:=20ISDB2056N=20=E3=81=A7=E8=A1=9B?= =?UTF-8?q?=E6=98=9F=E6=94=BE=E9=80=81=E3=81=AE=E5=8F=97=E4=BF=A1=E7=B5=90?= =?UTF-8?q?=E6=9E=9C=E3=81=8C=E3=82=A8=E3=83=A9=E3=83=BC=E3=83=91=E3=82=B1?= =?UTF-8?q?=E3=83=83=E3=83=88=E3=81=A0=E3=82=89=E3=81=91=E3=81=AB=E3=81=AA?= =?UTF-8?q?=E3=82=8B=E5=95=8F=E9=A1=8C=E3=81=8C=E4=BF=AE=E6=AD=A3=E3=81=95?= =?UTF-8?q?=E3=82=8C=E3=81=9D=E3=81=86=E3=81=AA=E5=A4=89=E6=9B=B4=E3=82=92?= =?UTF-8?q?=E8=A9=A6=E3=81=99=20ISDB2056=20->=20ISDB2056N=20=E3=81=A7?= =?UTF-8?q?=E3=81=AF=20TS=20=E5=BE=A9=E8=AA=BF=20IC=20=E3=81=8C=20TC90522X?= =?UTF-8?q?BG=20=E3=81=AB=E5=A4=89=E6=9B=B4=E3=81=95=E3=82=8C=E3=81=9F?= =?UTF-8?q?=E5=BD=B1=E9=9F=BF=E3=81=8B=20I2C=20=E3=83=90=E3=82=B9=E3=82=84?= =?UTF-8?q?=E7=89=A9=E7=90=86=E7=9A=84=E3=81=AA=E6=8E=A5=E7=B6=9A=E3=83=90?= =?UTF-8?q?=E3=82=B9=E3=81=8C=E5=A4=89=E6=9B=B4=E3=81=95=E3=82=8C=E3=81=A6?= =?UTF-8?q?=E3=81=84=E3=82=8B=E3=82=88=E3=81=86=E3=81=A7=E3=80=81=E6=81=90?= =?UTF-8?q?=E3=82=89=E3=81=8F=20ISDB-S=20=E5=81=B4=E3=81=AE=20TC90522XBG?= =?UTF-8?q?=20=E8=A8=AD=E5=AE=9A=E3=81=AE=20is=5Fsecondary=20=E3=82=92=20t?= =?UTF-8?q?rue=20=E3=81=AB=E3=81=99=E3=82=8C=E3=81=B0=E8=A1=8C=E3=81=91?= =?UTF-8?q?=E3=82=8B=E3=81=AE=E3=81=A7=E3=81=AF=E3=81=A8=E4=BA=88=E6=83=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- driver/isdb2056_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/driver/isdb2056_device.c b/driver/isdb2056_device.c index 53b8964..95a5837 100644 --- a/driver/isdb2056_device.c +++ b/driver/isdb2056_device.c @@ -888,7 +888,7 @@ static int isdb2056_device_load_config(struct isdb2056_device *isdb2056, chrdev2056->tc90522_s.dev = dev; chrdev2056->tc90522_s.i2c = &it930x->i2c_master[2]; chrdev2056->tc90522_s.i2c_addr = 0x13; - chrdev2056->tc90522_s.is_secondary = false; + chrdev2056->tc90522_s.is_secondary = true; chrdev2056->r850.dev = dev; chrdev2056->r850.i2c = &chrdev2056->tc90522_t.i2c_master; From 363657dc885f0bbdb13a36dd6245d39538755c3f Mon Sep 17 00:00:00 2001 From: tsukumi Date: Tue, 2 Jul 2024 05:17:06 +0900 Subject: [PATCH 3/7] =?UTF-8?q?driver:=20ISDB2056N=20=E3=81=A7=E8=A1=9B?= =?UTF-8?q?=E6=98=9F=E6=94=BE=E9=80=81=E3=81=8C=E3=82=A8=E3=83=A9=E3=83=BC?= =?UTF-8?q?=E3=83=91=E3=82=B1=E3=83=83=E3=83=88=E3=81=B0=E3=81=8B=E3=82=8A?= =?UTF-8?q?=E3=81=A7=E6=AD=A3=E5=B8=B8=E3=81=AB=E5=8F=97=E4=BF=A1=E3=81=A7?= =?UTF-8?q?=E3=81=8D=E3=81=AA=E3=81=84=E5=95=8F=E9=A1=8C=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 今のところ地上波/BS/CS全てドロップもなく魔法のように受信できている 無名の有志のパッチに感謝… ref: https://mevius.5ch.net/test/read.cgi/avi/1662431792/380 ref: https://pastebin.com/XbVWUcSi --- driver/isdb2056_device.c | 9 +++++++-- driver/isdb2056_device.h | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/driver/isdb2056_device.c b/driver/isdb2056_device.c index 95a5837..ad8a716 100644 --- a/driver/isdb2056_device.c +++ b/driver/isdb2056_device.c @@ -514,11 +514,11 @@ static int isdb2056_chrdev_tune(struct ptx_chrdev *chrdev, break; } - ret = tc90522_write_reg(&chrdev2056->tc90522_s, 0x07, 0x77); + ret = tc90522_write_reg(&chrdev2056->tc90522_s0, 0x07, 0x77); if (ret) break; - ret = tc90522_write_reg(&chrdev2056->tc90522_s, 0x08, 0x10); + ret = tc90522_write_reg(&chrdev2056->tc90522_s0, 0x08, 0x37); if (ret) break; @@ -885,6 +885,11 @@ static int isdb2056_device_load_config(struct isdb2056_device *isdb2056, chrdev2056->tc90522_t.i2c_addr = 0x10; chrdev2056->tc90522_t.is_secondary = false; + chrdev2056->tc90522_s0.dev = dev; + chrdev2056->tc90522_s0.i2c = &it930x->i2c_master[2]; + chrdev2056->tc90522_s0.i2c_addr = 0x11; + chrdev2056->tc90522_s0.is_secondary = false; + chrdev2056->tc90522_s.dev = dev; chrdev2056->tc90522_s.i2c = &it930x->i2c_master[2]; chrdev2056->tc90522_s.i2c_addr = 0x13; diff --git a/driver/isdb2056_device.h b/driver/isdb2056_device.h index 23bf872..509de82 100644 --- a/driver/isdb2056_device.h +++ b/driver/isdb2056_device.h @@ -26,6 +26,7 @@ struct isdb2056_chrdev { struct ptx_chrdev *chrdev; struct tc90522_demod tc90522_t; struct tc90522_demod tc90522_s; + struct tc90522_demod tc90522_s0; struct r850_tuner r850; struct rt710_tuner rt710; }; From 8e90591121c3d79cd10c186e6748c935c5ff2767 Mon Sep 17 00:00:00 2001 From: tsukumi Date: Tue, 2 Jul 2024 06:52:49 +0900 Subject: [PATCH 4/7] =?UTF-8?q?README:=20=E3=83=89=E3=82=AD=E3=83=A5?= =?UTF-8?q?=E3=83=A1=E3=83=B3=E3=83=88=E3=82=92=E5=8A=A0=E7=AD=86=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 878ee46..da15a42 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,7 @@ PLEX 社の [Webサイト](http://plex-net.co.jp) にて配布されている公 - DTV02-1T1S-U (実験的・Windows 非対応) - DTV02A-1T1S-U (Windows 非対応) + - DTV02A-1T1S-U の 2023年9月以降のロット (Digibest ISDB2056N) にも対応しています。 - DTV02A-4TS-P ## インストール (Windows) @@ -299,7 +300,7 @@ BonDriver は専用のものが必要になるため、公式 (Jacky版) BonDriv recpt1 や [BonDriverProxy_Linux](https://github.com/u-n-k-n-o-w-n/BonDriverProxy_Linux) 等の PT シリーズ用 chardev ドライバに対応したソフトウェアを使用することで、TS データを受信することが可能です。 recpt1 は、PLEX 社より配布されているものを使用する必要はありません。 -BonDriverProxy_Linux と、PLEX PX-MLT5PEやe-Better DTV02A-1T1S-U などのデバイスファイル1つで ISDB-T と ISDB-S のどちらも受信可能なチューナーを組み合わせて使用する場合は、BonDriver として BonDriverProxy_Linux に同梱されている BonDriver_LinuxPT の代わりに、[BonDriver_LinuxPTX](https://github.com/nns779/BonDriver_LinuxPTX) を使用してください。 +BonDriverProxy_Linux と、PLEX PX-MLT5PE や e-Better DTV02A-1T1S-U などのデバイスファイル1つで ISDB-T と ISDB-S のどちらも受信可能なチューナーを組み合わせて使用する場合は、BonDriver として BonDriverProxy_Linux に同梱されている BonDriver_LinuxPT の代わりに、[BonDriver_LinuxPTX](https://github.com/nns779/BonDriver_LinuxPTX) を使用してください。 ## LNB電源の出力 From 963e578ad12e125b1545e48d52768950cf853e6c Mon Sep 17 00:00:00 2001 From: tsukumi Date: Tue, 2 Jul 2024 19:50:22 +0900 Subject: [PATCH 5/7] =?UTF-8?q?driver:=20=E4=B8=80=E9=83=A8=E3=83=87?= =?UTF-8?q?=E3=83=90=E3=82=A4=E3=82=B9=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB?= =?UTF-8?q?=E3=81=AE=E3=83=91=E3=83=BC=E3=83=9F=E3=83=83=E3=82=B7=E3=83=A7?= =?UTF-8?q?=E3=83=B3=E3=81=8C=20644=20=E3=81=AB=E8=A8=AD=E5=AE=9A=E3=81=95?= =?UTF-8?q?=E3=82=8C=E3=82=8B=E5=95=8F=E9=A1=8C=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- etc/99-px4video.rules | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/etc/99-px4video.rules b/etc/99-px4video.rules index e9f4f3b..70b0788 100644 --- a/etc/99-px4video.rules +++ b/etc/99-px4video.rules @@ -2,6 +2,6 @@ KERNEL=="px4video*", GROUP="video", MODE="0664" KERNEL=="pxmlt5video*", GROUP="video", MODE="0664" KERNEL=="pxmlt8video*", GROUP="video", MODE="0664" KERNEL=="isdb2056video*", GROUP="video", MODE="0664" -KERNEL=="isdb6014video*", GROUP="video", MODE="0644" -KERNEL=="pxm1urvideo*", GROUP="video", MODE="0644" -KERNEL=="pxs1urvideo*", GROUP="video", MODE="0644" +KERNEL=="isdb6014video*", GROUP="video", MODE="0664" +KERNEL=="pxm1urvideo*", GROUP="video", MODE="0664" +KERNEL=="pxs1urvideo*", GROUP="video", MODE="0664" From b17286c8286bf8a289d11b4bfec6fde11db5034d Mon Sep 17 00:00:00 2001 From: tsukumi Date: Tue, 2 Jul 2024 20:14:11 +0900 Subject: [PATCH 6/7] =?UTF-8?q?README:=20=E3=83=89=E3=82=AD=E3=83=A5?= =?UTF-8?q?=E3=83=A1=E3=83=B3=E3=83=88=E3=82=92=E5=8A=A0=E7=AD=86=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index da15a42..2bfb7ab 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,7 @@ PLEX 社の [Webサイト](http://plex-net.co.jp) にて配布されている公 動作確認は Ubuntu 20.04 LTS (x64) で行っています。 +- チップ構成が一部変更された、ロット番号 2309 (2023年9月) 以降の DTV02A-1T1S-U に対応 - [otya 氏のフォーク](https://github.com/otya128/px4_drv) での更新を取り込み安定性と互換性を改善 - [techmadot 氏のフォーク](https://github.com/techmadot/px4_drv) の内容を取り込み PX-M1UR / PX-S1UR に対応 (実験的) - [kznrluk 氏のフォーク](https://github.com/kznrluk/px4_drv) の内容を取り込み Linux カーネル 6.4 系以降の API 変更に対応 @@ -62,7 +63,8 @@ PLEX 社の [Webサイト](http://plex-net.co.jp) にて配布されている公 - DTV02-1T1S-U (実験的・Windows 非対応) - DTV02A-1T1S-U (Windows 非対応) - - DTV02A-1T1S-U の 2023年9月以降のロット (Digibest ISDB2056N) にも対応しています。 + - チップ構成が一部変更された、ロット番号 2309 (2023年9月) 以降の DTV02A-1T1S-U にも対応しています。 + 手元の実機では問題なく動作していますが、長期間の動作テストは行えていないため、未知の不具合があるかもしれません。 - DTV02A-4TS-P ## インストール (Windows) @@ -176,7 +178,7 @@ gcc, make, カーネルソース/ヘッダ, dkms がインストールされて それでもカーネルモジュールが正常にロードされない場合は、インストールから再度やり直してください。 -> [!IMPORTANT] +> [!IMPORTANT] > **px4_drv や Linux カーネルの更新後、px4_drv は自動再ロードされない場合があります。** > **px4_drv や Linux カーネルを更新した際は、可能な限りすぐに PC を再起動することを強く推奨します。** > すぐに再起動ができない状況では、必ず `sudo modprobe px4_drv` を実行してください。 @@ -240,6 +242,10 @@ gcc, make, カーネルソース/ヘッダ, dkms がインストールされて すべてのチューナーにおいて、ISDB-T と ISDB-S のどちらも受信可能です。 +> [!NOTE] +> ロット番号 2309 以降の DTV02A-1T1S-U を接続した場合も、デバイスファイル名は `/dev/isdb2056video*` となります。 +> `/dev/isdb2056nvideo*` ではないので注意してください。 + ##### e-Better DTV02A-4TS-P を接続した場合 $ ls /dev/isdb6014video* @@ -396,17 +402,17 @@ PX-MLT8PE は、同一基板上に PX-MLT5PE 相当のデバイスと、3チャ DTV02-1T1S-U/DTV02A-1T1S-U は、ISDB-T 側の TS シリアル出力を ISDB-S 側と共有しています。そのため、同時に受信できるチャンネル数は1チャンネルのみです。 -- DTV02-1T1S-U/DTV02A-1T1S-U (Digibest ISDB2056) +- DTV02-1T1S-U/DTV02A-1T1S-U (ロット番号 2309 以前: Digibest ISDB2056) - USB Bridge: ITE IT9303FN - ISDB-T/S Demodulator: Toshiba TC90532XBG - Terrestrial Tuner: RafaelMicro R850 - Satellite Tuner: RafaelMicro RT710 -DTV02A-1T1S-U の 2023年9月以降のロットでは、ISDB-T/S Demodulator IC が TC90532XBG (ISDB-T×1TS + ISDB-S×1TS) から TC90522XBG (ISDB-T×2TS + ISDB-S×2TS) に変更されています。([詳細](https://web.archive.org/web/20130513083035/http://www.semicon.toshiba.co.jp/product/new_products/assp/1275558_37644.html)) +ロット番号 2309 (2023年9月) 以降の DTV02A-1T1S-U では、ISDB-T/S Demodulator IC が TC90532XBG (ISDB-T×1TS + ISDB-S×1TS) から TC90522XBG (ISDB-T×2TS + ISDB-S×2TS) に変更されています。([詳細](https://web.archive.org/web/20130513083035/http://www.semicon.toshiba.co.jp/product/new_products/assp/1275558_37644.html)) この変更に伴い、内部名称が ISDB2056 から ISDB2056N に変更されています。 -- DTV02A-1T1S-U (2023年9月以降ロット: Digibest ISDB2056N) +- DTV02A-1T1S-U (ロット番号 2309 以降: Digibest ISDB2056N) - USB Bridge: ITE IT9303FN - ISDB-T/S Demodulator: Toshiba TC90522XBG (TC90532XBG -> TC90522XBG) From 1b1610987dc8af3b73742ad8b4a84221c1d986ea Mon Sep 17 00:00:00 2001 From: tsukumi Date: Tue, 2 Jul 2024 20:51:14 +0900 Subject: [PATCH 7/7] =?UTF-8?q?driver:=20ISDB2056=20=E3=81=A8=20ISDB2056N?= =?UTF-8?q?=20=E3=81=AE=E5=90=8C=E6=99=82=E5=88=A9=E7=94=A8=E3=81=AB?= =?UTF-8?q?=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 今までは既存の ISDB2056 向けドライバを ISDB2056N 向けに改造していたため逆に既存の ISDB2056 では動作しなくなっていた この変更により、両方のデバイスを /dev/isdb2056video* として区別なく扱えるようになる --- driver/isdb2056_device.c | 46 ++++++++++++++++++++++++++++++++++++---- driver/isdb2056_device.h | 7 ++++++ driver/ptx_chrdev.c | 20 +++++++++++++++++ driver/px4_usb.c | 14 ++++++------ 4 files changed, 76 insertions(+), 11 deletions(-) diff --git a/driver/isdb2056_device.c b/driver/isdb2056_device.c index ad8a716..be111a1 100644 --- a/driver/isdb2056_device.c +++ b/driver/isdb2056_device.c @@ -514,11 +514,33 @@ static int isdb2056_chrdev_tune(struct ptx_chrdev *chrdev, break; } - ret = tc90522_write_reg(&chrdev2056->tc90522_s0, 0x07, 0x77); + switch (isdb2056->isdb2056_model) { + case ISDB2056_MODEL: + ret = tc90522_write_reg(&chrdev2056->tc90522_s, 0x07, 0x77); + break; + case ISDB2056N_MODEL: + ret = tc90522_write_reg(&chrdev2056->tc90522_s0, 0x07, 0x77); + break; + default: + dev_err(isdb2056->dev, "isdb2056_chrdev_tune: undefined model (model: %d)\n", isdb2056->isdb2056_model); + ret = -EINVAL; + break; + } if (ret) break; - ret = tc90522_write_reg(&chrdev2056->tc90522_s0, 0x08, 0x37); + switch (isdb2056->isdb2056_model) { + case ISDB2056_MODEL: + ret = tc90522_write_reg(&chrdev2056->tc90522_s, 0x08, 0x10); + break; + case ISDB2056N_MODEL: + ret = tc90522_write_reg(&chrdev2056->tc90522_s0, 0x08, 0x37); + break; + default: + dev_err(isdb2056->dev, "isdb2056_chrdev_tune: undefined model (model: %d)\n", isdb2056->isdb2056_model); + ret = -EINVAL; + break; + } if (ret) break; @@ -885,6 +907,7 @@ static int isdb2056_device_load_config(struct isdb2056_device *isdb2056, chrdev2056->tc90522_t.i2c_addr = 0x10; chrdev2056->tc90522_t.is_secondary = false; + // This structure (tc90522_s0) is only required by ISDB2056N, but it is initialized in common just to be safe chrdev2056->tc90522_s0.dev = dev; chrdev2056->tc90522_s0.i2c = &it930x->i2c_master[2]; chrdev2056->tc90522_s0.i2c_addr = 0x11; @@ -892,8 +915,21 @@ static int isdb2056_device_load_config(struct isdb2056_device *isdb2056, chrdev2056->tc90522_s.dev = dev; chrdev2056->tc90522_s.i2c = &it930x->i2c_master[2]; - chrdev2056->tc90522_s.i2c_addr = 0x13; - chrdev2056->tc90522_s.is_secondary = true; + switch (isdb2056->isdb2056_model) { + case ISDB2056_MODEL: + // ISDB2056 TS demodulator: Toshiba TC90532XBG + chrdev2056->tc90522_s.i2c_addr = 0x11; + chrdev2056->tc90522_s.is_secondary = false; + break; + case ISDB2056N_MODEL: + // ISDB2056N TS demodulator: Toshiba TC90522XBG + chrdev2056->tc90522_s.i2c_addr = 0x13; + chrdev2056->tc90522_s.is_secondary = true; + break; + default: + dev_err(dev, "isdb2056_device_load_config: undefined model (model: %d)\n", isdb2056->isdb2056_model); + return -EINVAL; + } chrdev2056->r850.dev = dev; chrdev2056->r850.i2c = &chrdev2056->tc90522_t.i2c_master; @@ -925,6 +961,7 @@ static int isdb2056_device_load_config(struct isdb2056_device *isdb2056, } int isdb2056_device_init(struct isdb2056_device *isdb2056, struct device *dev, + enum isdb2056_model isdb2056_model, struct ptx_chrdev_context *chrdev_ctx, struct completion *quit_completion) { @@ -945,6 +982,7 @@ int isdb2056_device_init(struct isdb2056_device *isdb2056, struct device *dev, kref_init(&isdb2056->kref); isdb2056->dev = dev; + isdb2056->isdb2056_model = isdb2056_model; isdb2056->quit_completion = quit_completion; stream_ctx = kzalloc(sizeof(*stream_ctx), GFP_KERNEL); diff --git a/driver/isdb2056_device.h b/driver/isdb2056_device.h index 509de82..c918ce9 100644 --- a/driver/isdb2056_device.h +++ b/driver/isdb2056_device.h @@ -22,6 +22,11 @@ #define ISDB2056_CHRDEV_NUM 1 +enum isdb2056_model { + ISDB2056_MODEL = 0, + ISDB2056N_MODEL, +}; + struct isdb2056_chrdev { struct ptx_chrdev *chrdev; struct tc90522_demod tc90522_t; @@ -35,6 +40,7 @@ struct isdb2056_device { struct kref kref; atomic_t available; struct device *dev; + enum isdb2056_model isdb2056_model; struct completion *quit_completion; struct ptx_chrdev_group *chrdev_group; struct isdb2056_chrdev chrdev2056; @@ -43,6 +49,7 @@ struct isdb2056_device { }; int isdb2056_device_init(struct isdb2056_device *isdb2056, struct device *dev, + enum isdb2056_model isdb2056_model, struct ptx_chrdev_context *chrdev_ctx, struct completion *quit_completion); void isdb2056_device_term(struct isdb2056_device *isdb2056); diff --git a/driver/ptx_chrdev.c b/driver/ptx_chrdev.c index 7af7269..c41c76c 100644 --- a/driver/ptx_chrdev.c +++ b/driver/ptx_chrdev.c @@ -7,6 +7,7 @@ #include "print_format.h" #include "ptx_chrdev.h" +#include "isdb2056_device.h" #include #include @@ -894,6 +895,25 @@ int ptx_chrdev_context_add_group(struct ptx_chrdev_context *chrdev_ctx, for (i = 0; i < num; i++) { dev_info(dev, "/dev/%s%u\n", chrdev_ctx->devname, base + i); + if (strncmp(chrdev_ctx->devname, "isdb2056", 8) == 0) { + // If the device is ISDB2056 or ISDB2056N, print the model name + struct ptx_chrdev *chrdev = &group->chrdev[i]; + struct isdb2056_chrdev *chrdev2056 = chrdev->priv; + struct isdb2056_device *isdb2056 = container_of(chrdev2056, struct isdb2056_device, chrdev2056); + const char *model_name; + switch (isdb2056->isdb2056_model) { + case ISDB2056_MODEL: + model_name = "ISDB2056"; + break; + case ISDB2056N_MODEL: + model_name = "ISDB2056N"; + break; + default: + model_name = "Unknown"; + break; + } + dev_info(dev, "/dev/%s%u: Digibest %s\n", chrdev_ctx->devname, base + i, model_name); + } device_create(chrdev_ctx->class, dev, MKDEV(MAJOR(chrdev_ctx->dev_base), group->minor_base + i), diff --git a/driver/px4_usb.c b/driver/px4_usb.c index c56723c..2e747a8 100644 --- a/driver/px4_usb.c +++ b/driver/px4_usb.c @@ -54,12 +54,12 @@ #ifndef PXM1UR_USB_MAX_DEVICE #define PXM1UR_USB_MAX_DEVICE 64 #endif -#define PXM1UR_USB_MAX_CHRDEV (PXM1UR_USB_MAX_DEVICE * ISDB2056_CHRDEV_NUM) +#define PXM1UR_USB_MAX_CHRDEV (PXM1UR_USB_MAX_DEVICE * M1UR_CHRDEV_NUM) #ifndef PXS1UR_USB_MAX_DEVICE #define PXS1UR_USB_MAX_DEVICE 64 #endif -#define PXS1UR_USB_MAX_CHRDEV (PXS1UR_USB_MAX_DEVICE * ISDB2056_CHRDEV_NUM) +#define PXS1UR_USB_MAX_CHRDEV (PXS1UR_USB_MAX_DEVICE * S1UR_CHRDEV_NUM) struct px4_usb_context { @@ -69,8 +69,8 @@ struct px4_usb_context { struct px4_device px4; struct pxmlt_device pxmlt; struct isdb2056_device isdb2056; - struct s1ur_device s1ur; struct m1ur_device m1ur; + struct s1ur_device s1ur; } ctx; }; @@ -187,7 +187,7 @@ static int px4_usb_probe(struct usb_interface *intf, break; ctx->type = ISDB2056_USB_DEVICE; - ret = isdb2056_device_init(&ctx->ctx.isdb2056, dev, + ret = isdb2056_device_init(&ctx->ctx.isdb2056, dev, ISDB2056_MODEL, px4_usb_chrdev_ctx[ISDB2056_USB_DEVICE], &ctx->quit_completion); break; @@ -199,7 +199,7 @@ static int px4_usb_probe(struct usb_interface *intf, break; ctx->type = ISDB2056_USB_DEVICE; - ret = isdb2056_device_init(&ctx->ctx.isdb2056, dev, + ret = isdb2056_device_init(&ctx->ctx.isdb2056, dev, ISDB2056N_MODEL, px4_usb_chrdev_ctx[ISDB2056_USB_DEVICE], &ctx->quit_completion); break; @@ -218,7 +218,7 @@ static int px4_usb_probe(struct usb_interface *intf, case USB_PID_PX_M1UR: ret = px4_usb_init_bridge(dev, usb_dev, - &ctx->ctx.isdb2056.it930x); + &ctx->ctx.m1ur.it930x); if (ret) break; @@ -230,7 +230,7 @@ static int px4_usb_probe(struct usb_interface *intf, case USB_PID_PX_S1UR: ret = px4_usb_init_bridge(dev, usb_dev, - &ctx->ctx.s1ur.it930x); + &ctx->ctx.s1ur.it930x); if (ret) break;