linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH 1/1] smipcie: add DVBSky S952 V3 support
@ 2014-11-04 14:59 Nibble Max
  0 siblings, 0 replies; 2+ messages in thread
From: Nibble Max @ 2014-11-04 14:59 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: linux-media, Olli Salonen, Antti Palosaari

Hello Mauro,

I check media_tree.git on linuxtv.org that the media tree does not include S952 V3 code.
S952 V3 card has M88RS6000 dvb frontend. S950 V3 card has M88TS2022/M88DS3103 dvb frontend.
There are 2 reasons:
1> I submit two patchs for smipcie bridge driver.
 first one for S950 V3: http://patchwork.linuxtv.org/patch/26364/ 
 later one for S950 V3 and S952 V3: http://patchwork.linuxtv.org/patch/26436
2> I do not resend the patch for smipcie bridge driver together with the updated patchs for m88rs6000t and m88ds3103.

Sorry for my wrong actions. It makes you to pick up the first one which has no S952 V3 code.
So I submit S952 V3 patch for the current media_tree.git code again.

BR,
Max

On 2014-11-04 22:46:01, Nibble Max wrote:
>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>
>---
> drivers/media/pci/smipcie/Kconfig   |  2 +
> drivers/media/pci/smipcie/smipcie.c | 78 +++++++++++++++++++++++++++++++++++++
> 2 files changed, 80 insertions(+)
>
>diff --git a/drivers/media/pci/smipcie/Kconfig b/drivers/media/pci/smipcie/Kconfig
>index 78b76ca..75a2992 100644
>--- a/drivers/media/pci/smipcie/Kconfig
>+++ b/drivers/media/pci/smipcie/Kconfig
>@@ -3,9 +3,11 @@ config DVB_SMIPCIE
> 	depends on DVB_CORE && PCI && I2C
> 	select DVB_M88DS3103 if MEDIA_SUBDRV_AUTOSELECT
> 	select MEDIA_TUNER_M88TS2022 if MEDIA_SUBDRV_AUTOSELECT
>+	select MEDIA_TUNER_M88RS6000T if MEDIA_SUBDRV_AUTOSELECT
> 	help
> 	  Support for cards with SMI PCIe bridge:
> 	  - DVBSky S950 V3
>+	  - DVBSky S952 V3
> 
> 	  Say Y or M if you own such a device and want to use it.
> 	  If unsure say N.
>diff --git a/drivers/media/pci/smipcie/smipcie.c b/drivers/media/pci/smipcie/smipcie.c
>index 6ad6cc5..d1c1463 100644
>--- a/drivers/media/pci/smipcie/smipcie.c
>+++ b/drivers/media/pci/smipcie/smipcie.c
>@@ -17,6 +17,7 @@
> #include "smipcie.h"
> #include "m88ds3103.h"
> #include "m88ts2022.h"
>+#include "m88rs6000t.h"
> 
> DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
> 
>@@ -542,6 +543,70 @@ err_tuner_i2c_device:
> 	return ret;
> }
> 
>+static const struct m88ds3103_config smi_dvbsky_m88rs6000_cfg = {
>+	.i2c_addr = 0x69,
>+	.clock = 27000000,
>+	.i2c_wr_max = 33,
>+	.ts_mode = M88DS3103_TS_PARALLEL,
>+	.ts_clk = 16000,
>+	.ts_clk_pol = 1,
>+	.agc = 0x99,
>+	.lnb_hv_pol = 0,
>+	.lnb_en_pol = 1,
>+};
>+
>+static int smi_dvbsky_m88rs6000_fe_attach(struct smi_port *port)
>+{
>+	int ret = 0;
>+	struct smi_dev *dev = port->dev;
>+	struct i2c_adapter *i2c;
>+	/* tuner I2C module */
>+	struct i2c_adapter *tuner_i2c_adapter;
>+	struct i2c_client *tuner_client;
>+	struct i2c_board_info tuner_info;
>+	struct m88rs6000t_config m88rs6000t_config;
>+
>+	memset(&tuner_info, 0, sizeof(struct i2c_board_info));
>+	i2c = (port->idx == 0) ? &dev->i2c_bus[0] : &dev->i2c_bus[1];
>+
>+	/* attach demod */
>+	port->fe = dvb_attach(m88ds3103_attach,
>+			&smi_dvbsky_m88rs6000_cfg, i2c, &tuner_i2c_adapter);
>+	if (!port->fe) {
>+		ret = -ENODEV;
>+		return ret;
>+	}
>+	/* attach tuner */
>+	m88rs6000t_config.fe = port->fe;
>+	strlcpy(tuner_info.type, "m88rs6000t", I2C_NAME_SIZE);
>+	tuner_info.addr = 0x21;
>+	tuner_info.platform_data = &m88rs6000t_config;
>+	request_module("m88rs6000t");
>+	tuner_client = i2c_new_device(tuner_i2c_adapter, &tuner_info);
>+	if (tuner_client == NULL || tuner_client->dev.driver == NULL) {
>+		ret = -ENODEV;
>+		goto err_tuner_i2c_device;
>+	}
>+
>+	if (!try_module_get(tuner_client->dev.driver->owner)) {
>+		ret = -ENODEV;
>+		goto err_tuner_i2c_module;
>+	}
>+
>+	/* delegate signal strength measurement to tuner */
>+	port->fe->ops.read_signal_strength =
>+			port->fe->ops.tuner_ops.get_rf_strength;
>+
>+	port->i2c_client_tuner = tuner_client;
>+	return ret;
>+
>+err_tuner_i2c_module:
>+	i2c_unregister_device(tuner_client);
>+err_tuner_i2c_device:
>+	dvb_frontend_detach(port->fe);
>+	return ret;
>+}
>+
> static int smi_fe_init(struct smi_port *port)
> {
> 	int ret = 0;
>@@ -556,6 +621,9 @@ static int smi_fe_init(struct smi_port *port)
> 	case DVBSKY_FE_M88DS3103:
> 		ret = smi_dvbsky_m88ds3103_fe_attach(port);
> 		break;
>+	case DVBSKY_FE_M88RS6000:
>+		ret = smi_dvbsky_m88rs6000_fe_attach(port);
>+		break;
> 	}
> 	if (ret < 0)
> 		return ret;
>@@ -917,6 +985,15 @@ static struct smi_cfg_info dvbsky_s950_cfg = {
> 	.fe_1 = DVBSKY_FE_M88DS3103,
> };
> 
>+static struct smi_cfg_info dvbsky_s952_cfg = {
>+	.type = SMI_DVBSKY_S952,
>+	.name = "DVBSky S952 V3",
>+	.ts_0 = SMI_TS_DMA_BOTH,
>+	.ts_1 = SMI_TS_DMA_BOTH,
>+	.fe_0 = DVBSKY_FE_M88RS6000,
>+	.fe_1 = DVBSKY_FE_M88RS6000,
>+};
>+
> /* PCI IDs */
> #define SMI_ID(_subvend, _subdev, _driverdata) {	\
> 	.vendor      = SMI_VID,    .device    = SMI_PID, \
>@@ -925,6 +1002,7 @@ static struct smi_cfg_info dvbsky_s950_cfg = {
> 
> static const struct pci_device_id smi_id_table[] = {
> 	SMI_ID(0x4254, 0x0550, dvbsky_s950_cfg),
>+	SMI_ID(0x4254, 0x0552, dvbsky_s952_cfg),
> 	{0}
> };
> MODULE_DEVICE_TABLE(pci, smi_id_table);
>
>-- 
>1.9.1
>


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH 1/1] smipcie: add DVBSky S952 V3 support
@ 2014-11-04 14:45 Nibble Max
  0 siblings, 0 replies; 2+ messages in thread
From: Nibble Max @ 2014-11-04 14:45 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: linux-media, Olli Salonen, Antti Palosaari, Nibble Max

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>
---
 drivers/media/pci/smipcie/Kconfig   |  2 +
 drivers/media/pci/smipcie/smipcie.c | 78 +++++++++++++++++++++++++++++++++++++
 2 files changed, 80 insertions(+)

diff --git a/drivers/media/pci/smipcie/Kconfig b/drivers/media/pci/smipcie/Kconfig
index 78b76ca..75a2992 100644
--- a/drivers/media/pci/smipcie/Kconfig
+++ b/drivers/media/pci/smipcie/Kconfig
@@ -3,9 +3,11 @@ config DVB_SMIPCIE
 	depends on DVB_CORE && PCI && I2C
 	select DVB_M88DS3103 if MEDIA_SUBDRV_AUTOSELECT
 	select MEDIA_TUNER_M88TS2022 if MEDIA_SUBDRV_AUTOSELECT
+	select MEDIA_TUNER_M88RS6000T if MEDIA_SUBDRV_AUTOSELECT
 	help
 	  Support for cards with SMI PCIe bridge:
 	  - DVBSky S950 V3
+	  - DVBSky S952 V3
 
 	  Say Y or M if you own such a device and want to use it.
 	  If unsure say N.
diff --git a/drivers/media/pci/smipcie/smipcie.c b/drivers/media/pci/smipcie/smipcie.c
index 6ad6cc5..d1c1463 100644
--- a/drivers/media/pci/smipcie/smipcie.c
+++ b/drivers/media/pci/smipcie/smipcie.c
@@ -17,6 +17,7 @@
 #include "smipcie.h"
 #include "m88ds3103.h"
 #include "m88ts2022.h"
+#include "m88rs6000t.h"
 
 DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
 
@@ -542,6 +543,70 @@ err_tuner_i2c_device:
 	return ret;
 }
 
+static const struct m88ds3103_config smi_dvbsky_m88rs6000_cfg = {
+	.i2c_addr = 0x69,
+	.clock = 27000000,
+	.i2c_wr_max = 33,
+	.ts_mode = M88DS3103_TS_PARALLEL,
+	.ts_clk = 16000,
+	.ts_clk_pol = 1,
+	.agc = 0x99,
+	.lnb_hv_pol = 0,
+	.lnb_en_pol = 1,
+};
+
+static int smi_dvbsky_m88rs6000_fe_attach(struct smi_port *port)
+{
+	int ret = 0;
+	struct smi_dev *dev = port->dev;
+	struct i2c_adapter *i2c;
+	/* tuner I2C module */
+	struct i2c_adapter *tuner_i2c_adapter;
+	struct i2c_client *tuner_client;
+	struct i2c_board_info tuner_info;
+	struct m88rs6000t_config m88rs6000t_config;
+
+	memset(&tuner_info, 0, sizeof(struct i2c_board_info));
+	i2c = (port->idx == 0) ? &dev->i2c_bus[0] : &dev->i2c_bus[1];
+
+	/* attach demod */
+	port->fe = dvb_attach(m88ds3103_attach,
+			&smi_dvbsky_m88rs6000_cfg, i2c, &tuner_i2c_adapter);
+	if (!port->fe) {
+		ret = -ENODEV;
+		return ret;
+	}
+	/* attach tuner */
+	m88rs6000t_config.fe = port->fe;
+	strlcpy(tuner_info.type, "m88rs6000t", I2C_NAME_SIZE);
+	tuner_info.addr = 0x21;
+	tuner_info.platform_data = &m88rs6000t_config;
+	request_module("m88rs6000t");
+	tuner_client = i2c_new_device(tuner_i2c_adapter, &tuner_info);
+	if (tuner_client == NULL || tuner_client->dev.driver == NULL) {
+		ret = -ENODEV;
+		goto err_tuner_i2c_device;
+	}
+
+	if (!try_module_get(tuner_client->dev.driver->owner)) {
+		ret = -ENODEV;
+		goto err_tuner_i2c_module;
+	}
+
+	/* delegate signal strength measurement to tuner */
+	port->fe->ops.read_signal_strength =
+			port->fe->ops.tuner_ops.get_rf_strength;
+
+	port->i2c_client_tuner = tuner_client;
+	return ret;
+
+err_tuner_i2c_module:
+	i2c_unregister_device(tuner_client);
+err_tuner_i2c_device:
+	dvb_frontend_detach(port->fe);
+	return ret;
+}
+
 static int smi_fe_init(struct smi_port *port)
 {
 	int ret = 0;
@@ -556,6 +621,9 @@ static int smi_fe_init(struct smi_port *port)
 	case DVBSKY_FE_M88DS3103:
 		ret = smi_dvbsky_m88ds3103_fe_attach(port);
 		break;
+	case DVBSKY_FE_M88RS6000:
+		ret = smi_dvbsky_m88rs6000_fe_attach(port);
+		break;
 	}
 	if (ret < 0)
 		return ret;
@@ -917,6 +985,15 @@ static struct smi_cfg_info dvbsky_s950_cfg = {
 	.fe_1 = DVBSKY_FE_M88DS3103,
 };
 
+static struct smi_cfg_info dvbsky_s952_cfg = {
+	.type = SMI_DVBSKY_S952,
+	.name = "DVBSky S952 V3",
+	.ts_0 = SMI_TS_DMA_BOTH,
+	.ts_1 = SMI_TS_DMA_BOTH,
+	.fe_0 = DVBSKY_FE_M88RS6000,
+	.fe_1 = DVBSKY_FE_M88RS6000,
+};
+
 /* PCI IDs */
 #define SMI_ID(_subvend, _subdev, _driverdata) {	\
 	.vendor      = SMI_VID,    .device    = SMI_PID, \
@@ -925,6 +1002,7 @@ static struct smi_cfg_info dvbsky_s950_cfg = {
 
 static const struct pci_device_id smi_id_table[] = {
 	SMI_ID(0x4254, 0x0550, dvbsky_s950_cfg),
+	SMI_ID(0x4254, 0x0552, dvbsky_s952_cfg),
 	{0}
 };
 MODULE_DEVICE_TABLE(pci, smi_id_table);

-- 
1.9.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-11-04 14:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-04 14:59 [PATCH 1/1] smipcie: add DVBSky S952 V3 support Nibble Max
  -- strict thread matches above, loose matches on Subject: below --
2014-11-04 14:45 Nibble Max

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).