Skip to content

Commit 5eedd8d

Browse files
nibble.maxmchehab
authored andcommitted
[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>
1 parent 0b14261 commit 5eedd8d

2 files changed

Lines changed: 80 additions & 0 deletions

File tree

‎drivers/media/pci/smipcie/Kconfig‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ config DVB_SMIPCIE
33
depends on DVB_CORE && PCI && I2C
44
select DVB_M88DS3103 if MEDIA_SUBDRV_AUTOSELECT
55
select MEDIA_TUNER_M88TS2022 if MEDIA_SUBDRV_AUTOSELECT
6+
select MEDIA_TUNER_M88RS6000T if MEDIA_SUBDRV_AUTOSELECT
67
help
78
Support for cards with SMI PCIe bridge:
89
- DVBSky S950 V3
10+
- DVBSky S952 V3
911

1012
Say Y or M if you own such a device and want to use it.
1113
If unsure say N.

‎drivers/media/pci/smipcie/smipcie.c‎

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "smipcie.h"
1818
#include "m88ds3103.h"
1919
#include "m88ts2022.h"
20+
#include "m88rs6000t.h"
2021

2122
DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
2223

@@ -542,6 +543,70 @@ static int smi_dvbsky_m88ds3103_fe_attach(struct smi_port *port)
542543
return ret;
543544
}
544545

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+
545610
static int smi_fe_init(struct smi_port *port)
546611
{
547612
int ret = 0;
@@ -556,6 +621,9 @@ static int smi_fe_init(struct smi_port *port)
556621
case DVBSKY_FE_M88DS3103:
557622
ret = smi_dvbsky_m88ds3103_fe_attach(port);
558623
break;
624+
case DVBSKY_FE_M88RS6000:
625+
ret = smi_dvbsky_m88rs6000_fe_attach(port);
626+
break;
559627
}
560628
if (ret < 0)
561629
return ret;
@@ -917,6 +985,15 @@ static struct smi_cfg_info dvbsky_s950_cfg = {
917985
.fe_1 = DVBSKY_FE_M88DS3103,
918986
};
919987

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+
920997
/* PCI IDs */
921998
#define SMI_ID(_subvend, _subdev, _driverdata) { \
922999
.vendor = SMI_VID, .device = SMI_PID, \
@@ -925,6 +1002,7 @@ static struct smi_cfg_info dvbsky_s950_cfg = {
9251002

9261003
static const struct pci_device_id smi_id_table[] = {
9271004
SMI_ID(0x4254, 0x0550, dvbsky_s950_cfg),
1005+
SMI_ID(0x4254, 0x0552, dvbsky_s952_cfg),
9281006
{0}
9291007
};
9301008
MODULE_DEVICE_TABLE(pci, smi_id_table);

0 commit comments

Comments
 (0)