Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

nibble.max and committed by
Mauro Carvalho Chehab
5eedd8d3 0b14261e

+80
+2
drivers/media/pci/smipcie/Kconfig
··· 3 3 depends on DVB_CORE && PCI && I2C 4 4 select DVB_M88DS3103 if MEDIA_SUBDRV_AUTOSELECT 5 5 select MEDIA_TUNER_M88TS2022 if MEDIA_SUBDRV_AUTOSELECT 6 + select MEDIA_TUNER_M88RS6000T if MEDIA_SUBDRV_AUTOSELECT 6 7 help 7 8 Support for cards with SMI PCIe bridge: 8 9 - DVBSky S950 V3 10 + - DVBSky S952 V3 9 11 10 12 Say Y or M if you own such a device and want to use it. 11 13 If unsure say N.
+78
drivers/media/pci/smipcie/smipcie.c
··· 17 17 #include "smipcie.h" 18 18 #include "m88ds3103.h" 19 19 #include "m88ts2022.h" 20 + #include "m88rs6000t.h" 20 21 21 22 DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); 22 23 ··· 543 542 return ret; 544 543 } 545 544 545 + static const struct m88ds3103_config smi_dvbsky_m88rs6000_cfg = { 546 + .i2c_addr = 0x69, 547 + .clock = 27000000, 548 + .i2c_wr_max = 33, 549 + .ts_mode = M88DS3103_TS_PARALLEL, 550 + .ts_clk = 16000, 551 + .ts_clk_pol = 1, 552 + .agc = 0x99, 553 + .lnb_hv_pol = 0, 554 + .lnb_en_pol = 1, 555 + }; 556 + 557 + static int smi_dvbsky_m88rs6000_fe_attach(struct smi_port *port) 558 + { 559 + int ret = 0; 560 + struct smi_dev *dev = port->dev; 561 + struct i2c_adapter *i2c; 562 + /* tuner I2C module */ 563 + struct i2c_adapter *tuner_i2c_adapter; 564 + struct i2c_client *tuner_client; 565 + struct i2c_board_info tuner_info; 566 + struct m88rs6000t_config m88rs6000t_config; 567 + 568 + memset(&tuner_info, 0, sizeof(struct i2c_board_info)); 569 + i2c = (port->idx == 0) ? &dev->i2c_bus[0] : &dev->i2c_bus[1]; 570 + 571 + /* attach demod */ 572 + port->fe = dvb_attach(m88ds3103_attach, 573 + &smi_dvbsky_m88rs6000_cfg, i2c, &tuner_i2c_adapter); 574 + if (!port->fe) { 575 + ret = -ENODEV; 576 + return ret; 577 + } 578 + /* attach tuner */ 579 + m88rs6000t_config.fe = port->fe; 580 + strlcpy(tuner_info.type, "m88rs6000t", I2C_NAME_SIZE); 581 + tuner_info.addr = 0x21; 582 + tuner_info.platform_data = &m88rs6000t_config; 583 + request_module("m88rs6000t"); 584 + tuner_client = i2c_new_device(tuner_i2c_adapter, &tuner_info); 585 + if (tuner_client == NULL || tuner_client->dev.driver == NULL) { 586 + ret = -ENODEV; 587 + goto err_tuner_i2c_device; 588 + } 589 + 590 + if (!try_module_get(tuner_client->dev.driver->owner)) { 591 + ret = -ENODEV; 592 + goto err_tuner_i2c_module; 593 + } 594 + 595 + /* delegate signal strength measurement to tuner */ 596 + port->fe->ops.read_signal_strength = 597 + port->fe->ops.tuner_ops.get_rf_strength; 598 + 599 + port->i2c_client_tuner = tuner_client; 600 + return ret; 601 + 602 + err_tuner_i2c_module: 603 + i2c_unregister_device(tuner_client); 604 + err_tuner_i2c_device: 605 + dvb_frontend_detach(port->fe); 606 + return ret; 607 + } 608 + 546 609 static int smi_fe_init(struct smi_port *port) 547 610 { 548 611 int ret = 0; ··· 620 555 switch (port->fe_type) { 621 556 case DVBSKY_FE_M88DS3103: 622 557 ret = smi_dvbsky_m88ds3103_fe_attach(port); 558 + break; 559 + case DVBSKY_FE_M88RS6000: 560 + ret = smi_dvbsky_m88rs6000_fe_attach(port); 623 561 break; 624 562 } 625 563 if (ret < 0) ··· 985 917 .fe_1 = DVBSKY_FE_M88DS3103, 986 918 }; 987 919 920 + static struct smi_cfg_info dvbsky_s952_cfg = { 921 + .type = SMI_DVBSKY_S952, 922 + .name = "DVBSky S952 V3", 923 + .ts_0 = SMI_TS_DMA_BOTH, 924 + .ts_1 = SMI_TS_DMA_BOTH, 925 + .fe_0 = DVBSKY_FE_M88RS6000, 926 + .fe_1 = DVBSKY_FE_M88RS6000, 927 + }; 928 + 988 929 /* PCI IDs */ 989 930 #define SMI_ID(_subvend, _subdev, _driverdata) { \ 990 931 .vendor = SMI_VID, .device = SMI_PID, \ ··· 1002 925 1003 926 static const struct pci_device_id smi_id_table[] = { 1004 927 SMI_ID(0x4254, 0x0550, dvbsky_s950_cfg), 928 + SMI_ID(0x4254, 0x0552, dvbsky_s952_cfg), 1005 929 {0} 1006 930 }; 1007 931 MODULE_DEVICE_TABLE(pci, smi_id_table);