diff options
author | nibble.max <nibble.max@gmail.com> | 2014-11-04 09:45:58 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2014-11-04 15:22:04 -0500 |
commit | 5eedd8d3addc02b833265c8d1d15a79916916208 (patch) | |
tree | 6071f0efb8608ecf7232a347b7fe6ee06b85adc6 | |
parent | 0b14261edc8c7c7ef6d30133df9188f5a7f3d85f (diff) |
[media] smipcie: add DVBSky S952 V3 support
DVBSky S952 V3 card has a dual channels of dvb-s/s2.
1>Frontend: Integrated tuner and demod: M88RS6000
2>PCIe bridge: SMI PCIe
Signed-off-by: Nibble Max <nibble.max@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
-rw-r--r-- | drivers/media/pci/smipcie/Kconfig | 2 | ||||
-rw-r--r-- | drivers/media/pci/smipcie/smipcie.c | 78 |
2 files changed, 80 insertions, 0 deletions
diff --git a/drivers/media/pci/smipcie/Kconfig b/drivers/media/pci/smipcie/Kconfig index 78b76ca85ed4..75a299295999 100644 --- a/drivers/media/pci/smipcie/Kconfig +++ b/drivers/media/pci/smipcie/Kconfig | |||
@@ -3,9 +3,11 @@ config DVB_SMIPCIE | |||
3 | depends on DVB_CORE && PCI && I2C | 3 | depends on DVB_CORE && PCI && I2C |
4 | select DVB_M88DS3103 if MEDIA_SUBDRV_AUTOSELECT | 4 | select DVB_M88DS3103 if MEDIA_SUBDRV_AUTOSELECT |
5 | select MEDIA_TUNER_M88TS2022 if MEDIA_SUBDRV_AUTOSELECT | 5 | select MEDIA_TUNER_M88TS2022 if MEDIA_SUBDRV_AUTOSELECT |
6 | select MEDIA_TUNER_M88RS6000T if MEDIA_SUBDRV_AUTOSELECT | ||
6 | help | 7 | help |
7 | Support for cards with SMI PCIe bridge: | 8 | Support for cards with SMI PCIe bridge: |
8 | - DVBSky S950 V3 | 9 | - DVBSky S950 V3 |
10 | - DVBSky S952 V3 | ||
9 | 11 | ||
10 | Say Y or M if you own such a device and want to use it. | 12 | Say Y or M if you own such a device and want to use it. |
11 | If unsure say N. | 13 | If unsure say N. |
diff --git a/drivers/media/pci/smipcie/smipcie.c b/drivers/media/pci/smipcie/smipcie.c index 6ad6cc5c33b1..d1c14631a101 100644 --- a/drivers/media/pci/smipcie/smipcie.c +++ b/drivers/media/pci/smipcie/smipcie.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include "smipcie.h" | 17 | #include "smipcie.h" |
18 | #include "m88ds3103.h" | 18 | #include "m88ds3103.h" |
19 | #include "m88ts2022.h" | 19 | #include "m88ts2022.h" |
20 | #include "m88rs6000t.h" | ||
20 | 21 | ||
21 | DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); | 22 | DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); |
22 | 23 | ||
@@ -542,6 +543,70 @@ err_tuner_i2c_device: | |||
542 | return ret; | 543 | return ret; |
543 | } | 544 | } |
544 | 545 | ||
546 | static const struct m88ds3103_config smi_dvbsky_m88rs6000_cfg = { | ||
547 | .i2c_addr = 0x69, | ||
548 | .clock = 27000000, | ||
549 | .i2c_wr_max = 33, | ||
550 | .ts_mode = M88DS3103_TS_PARALLEL, | ||
551 | .ts_clk = 16000, | ||
552 | .ts_clk_pol = 1, | ||
553 | .agc = 0x99, | ||
554 | .lnb_hv_pol = 0, | ||
555 | .lnb_en_pol = 1, | ||
556 | }; | ||
557 | |||
558 | static int smi_dvbsky_m88rs6000_fe_attach(struct smi_port *port) | ||
559 | { | ||
560 | int ret = 0; | ||
561 | struct smi_dev *dev = port->dev; | ||
562 | struct i2c_adapter *i2c; | ||
563 | /* tuner I2C module */ | ||
564 | struct i2c_adapter *tuner_i2c_adapter; | ||
565 | struct i2c_client *tuner_client; | ||
566 | struct i2c_board_info tuner_info; | ||
567 | struct m88rs6000t_config m88rs6000t_config; | ||
568 | |||
569 | memset(&tuner_info, 0, sizeof(struct i2c_board_info)); | ||
570 | i2c = (port->idx == 0) ? &dev->i2c_bus[0] : &dev->i2c_bus[1]; | ||
571 | |||
572 | /* attach demod */ | ||
573 | port->fe = dvb_attach(m88ds3103_attach, | ||
574 | &smi_dvbsky_m88rs6000_cfg, i2c, &tuner_i2c_adapter); | ||
575 | if (!port->fe) { | ||
576 | ret = -ENODEV; | ||
577 | return ret; | ||
578 | } | ||
579 | /* attach tuner */ | ||
580 | m88rs6000t_config.fe = port->fe; | ||
581 | strlcpy(tuner_info.type, "m88rs6000t", I2C_NAME_SIZE); | ||
582 | tuner_info.addr = 0x21; | ||
583 | tuner_info.platform_data = &m88rs6000t_config; | ||
584 | request_module("m88rs6000t"); | ||
585 | tuner_client = i2c_new_device(tuner_i2c_adapter, &tuner_info); | ||
586 | if (tuner_client == NULL || tuner_client->dev.driver == NULL) { | ||
587 | ret = -ENODEV; | ||
588 | goto err_tuner_i2c_device; | ||
589 | } | ||
590 | |||
591 | if (!try_module_get(tuner_client->dev.driver->owner)) { | ||
592 | ret = -ENODEV; | ||
593 | goto err_tuner_i2c_module; | ||
594 | } | ||
595 | |||
596 | /* delegate signal strength measurement to tuner */ | ||
597 | port->fe->ops.read_signal_strength = | ||
598 | port->fe->ops.tuner_ops.get_rf_strength; | ||
599 | |||
600 | port->i2c_client_tuner = tuner_client; | ||
601 | return ret; | ||
602 | |||
603 | err_tuner_i2c_module: | ||
604 | i2c_unregister_device(tuner_client); | ||
605 | err_tuner_i2c_device: | ||
606 | dvb_frontend_detach(port->fe); | ||
607 | return ret; | ||
608 | } | ||
609 | |||
545 | static int smi_fe_init(struct smi_port *port) | 610 | static int smi_fe_init(struct smi_port *port) |
546 | { | 611 | { |
547 | int ret = 0; | 612 | int ret = 0; |
@@ -556,6 +621,9 @@ static int smi_fe_init(struct smi_port *port) | |||
556 | case DVBSKY_FE_M88DS3103: | 621 | case DVBSKY_FE_M88DS3103: |
557 | ret = smi_dvbsky_m88ds3103_fe_attach(port); | 622 | ret = smi_dvbsky_m88ds3103_fe_attach(port); |
558 | break; | 623 | break; |
624 | case DVBSKY_FE_M88RS6000: | ||
625 | ret = smi_dvbsky_m88rs6000_fe_attach(port); | ||
626 | break; | ||
559 | } | 627 | } |
560 | if (ret < 0) | 628 | if (ret < 0) |
561 | return ret; | 629 | return ret; |
@@ -917,6 +985,15 @@ static struct smi_cfg_info dvbsky_s950_cfg = { | |||
917 | .fe_1 = DVBSKY_FE_M88DS3103, | 985 | .fe_1 = DVBSKY_FE_M88DS3103, |
918 | }; | 986 | }; |
919 | 987 | ||
988 | static struct smi_cfg_info dvbsky_s952_cfg = { | ||
989 | .type = SMI_DVBSKY_S952, | ||
990 | .name = "DVBSky S952 V3", | ||
991 | .ts_0 = SMI_TS_DMA_BOTH, | ||
992 | .ts_1 = SMI_TS_DMA_BOTH, | ||
993 | .fe_0 = DVBSKY_FE_M88RS6000, | ||
994 | .fe_1 = DVBSKY_FE_M88RS6000, | ||
995 | }; | ||
996 | |||
920 | /* PCI IDs */ | 997 | /* PCI IDs */ |
921 | #define SMI_ID(_subvend, _subdev, _driverdata) { \ | 998 | #define SMI_ID(_subvend, _subdev, _driverdata) { \ |
922 | .vendor = SMI_VID, .device = SMI_PID, \ | 999 | .vendor = SMI_VID, .device = SMI_PID, \ |
@@ -925,6 +1002,7 @@ static struct smi_cfg_info dvbsky_s950_cfg = { | |||
925 | 1002 | ||
926 | static const struct pci_device_id smi_id_table[] = { | 1003 | static const struct pci_device_id smi_id_table[] = { |
927 | SMI_ID(0x4254, 0x0550, dvbsky_s950_cfg), | 1004 | SMI_ID(0x4254, 0x0550, dvbsky_s950_cfg), |
1005 | SMI_ID(0x4254, 0x0552, dvbsky_s952_cfg), | ||
928 | {0} | 1006 | {0} |
929 | }; | 1007 | }; |
930 | MODULE_DEVICE_TABLE(pci, smi_id_table); | 1008 | MODULE_DEVICE_TABLE(pci, smi_id_table); |