aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNibble Max <nibble.max@gmail.com>2014-11-08 06:35:20 -0500
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2014-11-25 09:32:57 -0500
commit460c8a7c25fef0712abdeeefd07bf02a8e8cb9e1 (patch)
treeee3415dca51f3705dafdef5e34103af48d5c0017
parent344e2e5ed7b3c82ac5f7a7641e4179f3215266b0 (diff)
[media] smipcie: add DVBSky T9580 V3 support
v2: - Update Kconfig file. DVBSky T9580 V3 card is the dual tuner card, which supports S/S2 and T2/T/C. 1>DVB-S/S2 frontend: M88DS3103/M88TS2022 2>DVB-T2/T/C frontend: SI2168B40/SI2157A30 2>PCIe bridge: SMI PCIe Signed-off-by: Nibble Max <nibble.max@gmail.com> Reviewed-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
-rw-r--r--drivers/media/pci/smipcie/Kconfig3
-rw-r--r--drivers/media/pci/smipcie/smipcie.c67
2 files changed, 70 insertions, 0 deletions
diff --git a/drivers/media/pci/smipcie/Kconfig b/drivers/media/pci/smipcie/Kconfig
index 57dd124079fc..c8de53f5ea28 100644
--- a/drivers/media/pci/smipcie/Kconfig
+++ b/drivers/media/pci/smipcie/Kconfig
@@ -3,12 +3,15 @@ config DVB_SMIPCIE
3 depends on DVB_CORE && PCI && I2C 3 depends on DVB_CORE && PCI && I2C
4 select I2C_ALGOBIT 4 select I2C_ALGOBIT
5 select DVB_M88DS3103 if MEDIA_SUBDRV_AUTOSELECT 5 select DVB_M88DS3103 if MEDIA_SUBDRV_AUTOSELECT
6 select DVB_SI2168 if MEDIA_SUBDRV_AUTOSELECT
6 select MEDIA_TUNER_M88TS2022 if MEDIA_SUBDRV_AUTOSELECT 7 select MEDIA_TUNER_M88TS2022 if MEDIA_SUBDRV_AUTOSELECT
7 select MEDIA_TUNER_M88RS6000T if MEDIA_SUBDRV_AUTOSELECT 8 select MEDIA_TUNER_M88RS6000T if MEDIA_SUBDRV_AUTOSELECT
9 select MEDIA_TUNER_SI2157 if MEDIA_SUBDRV_AUTOSELECT
8 help 10 help
9 Support for cards with SMI PCIe bridge: 11 Support for cards with SMI PCIe bridge:
10 - DVBSky S950 V3 12 - DVBSky S950 V3
11 - DVBSky S952 V3 13 - DVBSky S952 V3
14 - DVBSky T9580 V3
12 15
13 Say Y or M if you own such a device and want to use it. 16 Say Y or M if you own such a device and want to use it.
14 If unsure say N. 17 If unsure say N.
diff --git a/drivers/media/pci/smipcie/smipcie.c b/drivers/media/pci/smipcie/smipcie.c
index 39614a47af1e..f773350e67b9 100644
--- a/drivers/media/pci/smipcie/smipcie.c
+++ b/drivers/media/pci/smipcie/smipcie.c
@@ -18,6 +18,8 @@
18#include "m88ds3103.h" 18#include "m88ds3103.h"
19#include "m88ts2022.h" 19#include "m88ts2022.h"
20#include "m88rs6000t.h" 20#include "m88rs6000t.h"
21#include "si2168.h"
22#include "si2157.h"
21 23
22DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); 24DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
23 25
@@ -618,6 +620,58 @@ err_tuner_i2c_device:
618 return ret; 620 return ret;
619} 621}
620 622
623static int smi_dvbsky_sit2_fe_attach(struct smi_port *port)
624{
625 int ret = 0;
626 struct smi_dev *dev = port->dev;
627 struct i2c_adapter *i2c;
628 struct i2c_adapter *tuner_i2c_adapter;
629 struct i2c_client *client_tuner, *client_demod;
630 struct i2c_board_info client_info;
631 struct si2168_config si2168_config;
632 struct si2157_config si2157_config;
633
634 /* select i2c bus */
635 i2c = (port->idx == 0) ? &dev->i2c_bus[0] : &dev->i2c_bus[1];
636
637 /* attach demod */
638 memset(&si2168_config, 0, sizeof(si2168_config));
639 si2168_config.i2c_adapter = &tuner_i2c_adapter;
640 si2168_config.fe = &port->fe;
641 si2168_config.ts_mode = SI2168_TS_PARALLEL;
642
643 memset(&client_info, 0, sizeof(struct i2c_board_info));
644 strlcpy(client_info.type, "si2168", I2C_NAME_SIZE);
645 client_info.addr = 0x64;
646 client_info.platform_data = &si2168_config;
647
648 client_demod = smi_add_i2c_client(i2c, &client_info);
649 if (!client_demod) {
650 ret = -ENODEV;
651 return ret;
652 }
653 port->i2c_client_demod = client_demod;
654
655 /* attach tuner */
656 memset(&si2157_config, 0, sizeof(si2157_config));
657 si2157_config.fe = port->fe;
658
659 memset(&client_info, 0, sizeof(struct i2c_board_info));
660 strlcpy(client_info.type, "si2157", I2C_NAME_SIZE);
661 client_info.addr = 0x60;
662 client_info.platform_data = &si2157_config;
663
664 client_tuner = smi_add_i2c_client(tuner_i2c_adapter, &client_info);
665 if (!client_tuner) {
666 smi_del_i2c_client(port->i2c_client_demod);
667 port->i2c_client_demod = NULL;
668 ret = -ENODEV;
669 return ret;
670 }
671 port->i2c_client_tuner = client_tuner;
672 return ret;
673}
674
621static int smi_fe_init(struct smi_port *port) 675static int smi_fe_init(struct smi_port *port)
622{ 676{
623 int ret = 0; 677 int ret = 0;
@@ -635,6 +689,9 @@ static int smi_fe_init(struct smi_port *port)
635 case DVBSKY_FE_M88RS6000: 689 case DVBSKY_FE_M88RS6000:
636 ret = smi_dvbsky_m88rs6000_fe_attach(port); 690 ret = smi_dvbsky_m88rs6000_fe_attach(port);
637 break; 691 break;
692 case DVBSKY_FE_SIT2:
693 ret = smi_dvbsky_sit2_fe_attach(port);
694 break;
638 } 695 }
639 if (ret < 0) 696 if (ret < 0)
640 return ret; 697 return ret;
@@ -1005,6 +1062,15 @@ static struct smi_cfg_info dvbsky_s952_cfg = {
1005 .fe_1 = DVBSKY_FE_M88RS6000, 1062 .fe_1 = DVBSKY_FE_M88RS6000,
1006}; 1063};
1007 1064
1065static struct smi_cfg_info dvbsky_t9580_cfg = {
1066 .type = SMI_DVBSKY_T9580,
1067 .name = "DVBSky T9580 V3",
1068 .ts_0 = SMI_TS_DMA_BOTH,
1069 .ts_1 = SMI_TS_DMA_BOTH,
1070 .fe_0 = DVBSKY_FE_SIT2,
1071 .fe_1 = DVBSKY_FE_M88DS3103,
1072};
1073
1008/* PCI IDs */ 1074/* PCI IDs */
1009#define SMI_ID(_subvend, _subdev, _driverdata) { \ 1075#define SMI_ID(_subvend, _subdev, _driverdata) { \
1010 .vendor = SMI_VID, .device = SMI_PID, \ 1076 .vendor = SMI_VID, .device = SMI_PID, \
@@ -1014,6 +1080,7 @@ static struct smi_cfg_info dvbsky_s952_cfg = {
1014static const struct pci_device_id smi_id_table[] = { 1080static const struct pci_device_id smi_id_table[] = {
1015 SMI_ID(0x4254, 0x0550, dvbsky_s950_cfg), 1081 SMI_ID(0x4254, 0x0550, dvbsky_s950_cfg),
1016 SMI_ID(0x4254, 0x0552, dvbsky_s952_cfg), 1082 SMI_ID(0x4254, 0x0552, dvbsky_s952_cfg),
1083 SMI_ID(0x4254, 0x5580, dvbsky_t9580_cfg),
1017 {0} 1084 {0}
1018}; 1085};
1019MODULE_DEVICE_TABLE(pci, smi_id_table); 1086MODULE_DEVICE_TABLE(pci, smi_id_table);