linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "nibble.max" <nibble.max@gmail.com>
To: "Mauro Carvalho Chehab" <mchehab@redhat.com>
Cc: linux-media <linux-media@vger.kernel.org>
Subject: [PATCH 3/6] m88ds3103, dvbsky dvb-s2 cx23883 pci card.
Date: Sun, 15 Apr 2012 23:53:34 +0800	[thread overview]
Message-ID: <201204152353319848816@gmail.com> (raw)
In-Reply-To: 4F2185A1.2000402@redhat.com

dvbsky dvb-s2 pci based on montage m88ds3103 demodulator.

Signed-off-by: Max nibble <nibble.max@gmail.com>
---
 drivers/media/video/cx88/Kconfig      |    1 +
 drivers/media/video/cx88/cx88-cards.c |   22 +++++++++
 drivers/media/video/cx88/cx88-dvb.c   |   85 +++++++++++++++++++++++++++++++++
 drivers/media/video/cx88/cx88-input.c |    4 ++
 drivers/media/video/cx88/cx88.h       |    1 +
 5 files changed, 113 insertions(+)

diff --git a/drivers/media/video/cx88/Kconfig b/drivers/media/video/cx88/Kconfig
index 3598dc0..0daef63 100644
--- a/drivers/media/video/cx88/Kconfig
+++ b/drivers/media/video/cx88/Kconfig
@@ -57,6 +57,7 @@ config VIDEO_CX88_DVB
 	select DVB_ISL6421 if !DVB_FE_CUSTOMISE
 	select DVB_S5H1411 if !DVB_FE_CUSTOMISE
 	select DVB_CX24116 if !DVB_FE_CUSTOMISE
+	select DVB_M88DS3103 if !DVB_FE_CUSTOMISE
 	select DVB_STV0299 if !DVB_FE_CUSTOMISE
 	select DVB_STV0288 if !DVB_FE_CUSTOMISE
 	select DVB_STB6000 if !DVB_FE_CUSTOMISE
diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c
index cbd5d11..059b22d 100644
--- a/drivers/media/video/cx88/cx88-cards.c
+++ b/drivers/media/video/cx88/cx88-cards.c
@@ -2309,6 +2309,18 @@ static const struct cx88_board cx88_boards[] = {
 		} },
 		.mpeg           = CX88_MPEG_DVB,
 	},
+	[CX88_BOARD_BST_PS8312] = {
+		.name           = "Bestunar PS8312 DVB-S/S2",
+		.tuner_type     = UNSET,
+		.radio_type     = UNSET,
+		.tuner_addr     = ADDR_UNSET,
+		.radio_addr     = ADDR_UNSET,
+		.input          = {{
+			.type   = CX88_VMUX_DVB,
+			.vmux   = 0,
+		} },
+		.mpeg           = CX88_MPEG_DVB,
+	},
 };
 
 /* ------------------------------------------------------------------ */
@@ -2813,6 +2825,10 @@ static const struct cx88_subid cx88_subids[] = {
 		.subvendor = 0x1822,
 		.subdevice = 0x0023,
 		.card      = CX88_BOARD_TWINHAN_VP1027_DVBS,
+	}, {
+		.subvendor = 0x14f1,
+		.subdevice = 0x8312,
+		.card      = CX88_BOARD_BST_PS8312,
 	},
 };
 
@@ -3547,6 +3563,12 @@ static void cx88_card_setup(struct cx88_core *core)
 		cx_write(MO_SRST_IO, 1);
 		msleep(100);
 		break;
+	case  CX88_BOARD_BST_PS8312:
+		cx_write(MO_GP1_IO, 0x808000);
+		msleep(100);
+		cx_write(MO_GP1_IO, 0x808080);
+		msleep(100);		
+		break;	
 	} /*end switch() */
 
 
diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c
index 003937c..5e19ef3 100644
--- a/drivers/media/video/cx88/cx88-dvb.c
+++ b/drivers/media/video/cx88/cx88-dvb.c
@@ -54,6 +54,7 @@
 #include "stv0288.h"
 #include "stb6000.h"
 #include "cx24116.h"
+#include "m88ds3103.h"
 #include "stv0900.h"
 #include "stb6100.h"
 #include "stb6100_proc.h"
@@ -458,6 +459,56 @@ static int tevii_dvbs_set_voltage(struct dvb_frontend *fe,
 		return core->prev_set_voltage(fe, voltage);
 	return 0;
 }
+/*CX88_BOARD_BST_PS8312*/
+static int bst_dvbs_set_voltage(struct dvb_frontend *fe,
+				      fe_sec_voltage_t voltage)
+{
+	struct cx8802_dev *dev= fe->dvb->priv;
+	struct cx88_core *core = dev->core;
+
+	cx_write(MO_GP1_IO, 0x111111);
+	switch (voltage) {
+		case SEC_VOLTAGE_13:
+			cx_write(MO_GP1_IO, 0x020200);
+			break;
+		case SEC_VOLTAGE_18:
+			cx_write(MO_GP1_IO, 0x020202);
+			break;
+		case SEC_VOLTAGE_OFF:
+			cx_write(MO_GP1_IO, 0x111100);
+			break;
+	}
+
+	if (core->prev_set_voltage)
+		return core->prev_set_voltage(fe, voltage);
+	return 0;
+}
+
+static int bst_dvbs_set_voltage_v2(struct dvb_frontend *fe,
+				      fe_sec_voltage_t voltage)
+{
+	struct cx8802_dev *dev= fe->dvb->priv;
+	struct cx88_core *core = dev->core;
+
+	cx_write(MO_GP1_IO, 0x111101);
+	switch (voltage) {
+		case SEC_VOLTAGE_13:
+			cx_write(MO_GP1_IO, 0x020200);
+			break;
+		case SEC_VOLTAGE_18:
+
+			cx_write(MO_GP1_IO, 0x020202);
+			break;
+		case SEC_VOLTAGE_OFF:
+
+			cx_write(MO_GP1_IO, 0x111110);
+			break;
+	}
+
+	if (core->prev_set_voltage)
+		return core->prev_set_voltage(fe, voltage);
+	return 0;
+}
 
 static int vp1027_set_voltage(struct dvb_frontend *fe,
 				    fe_sec_voltage_t voltage)
@@ -700,6 +751,11 @@ static struct ds3000_config tevii_ds3000_config = {
 	.set_ts_params = ds3000_set_ts_param,
 };
 
+static struct m88ds3103_config dvbsky_ds3103_config = {
+	.demod_address = 0x68,
+	.set_ts_params = ds3000_set_ts_param,
+};
+
 static const struct stv0900_config prof_7301_stv0900_config = {
 	.demod_address = 0x6a,
 /*	demod_mode = 0,*/
@@ -1470,6 +1526,35 @@ static int dvb_register(struct cx8802_dev *dev)
 			fe0->dvb.frontend->ops.set_voltage =
 							tevii_dvbs_set_voltage;
 		break;
+	case CX88_BOARD_BST_PS8312:
+		fe0->dvb.frontend = dvb_attach(m88ds3103_attach,
+						&dvbsky_ds3103_config,
+						&core->i2c_adap);
+		if (fe0->dvb.frontend != NULL){
+			int ret;
+			u8 b0[] = { 0x60 };
+			u8 b1[2] = { 0 };
+			struct i2c_msg msg[] = {
+				{
+				.addr = 0x50,
+				.flags = 0,
+				.buf = b0,
+				.len = 1
+				}, {
+				.addr = 0x50,
+				.flags = I2C_M_RD,
+				.buf = b1,
+				.len = 2
+				}
+			};
+			ret = i2c_transfer(&core->i2c_adap, msg, 2);
+			printk("PS8312: config = %02x, %02x", b1[0],b1[1]);
+			if(b1[0] == 0xaa)
+				fe0->dvb.frontend->ops.set_voltage = bst_dvbs_set_voltage_v2;
+			else			
+				fe0->dvb.frontend->ops.set_voltage = bst_dvbs_set_voltage;
+		}
+		break;
 	case CX88_BOARD_OMICOM_SS4_PCI:
 	case CX88_BOARD_TBS_8920:
 	case CX88_BOARD_PROF_7300:
diff --git a/drivers/media/video/cx88/cx88-input.c b/drivers/media/video/cx88/cx88-input.c
index ebf448c..f698103 100644
--- a/drivers/media/video/cx88/cx88-input.c
+++ b/drivers/media/video/cx88/cx88-input.c
@@ -419,6 +419,10 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)
 		rc_type          = RC_TYPE_NEC;
 		ir->sampling     = 0xff00; /* address */
 		break;
+	case CX88_BOARD_BST_PS8312: 
+		ir_codes         = RC_MAP_DVBSKY;
+		ir->sampling     = 0xff00; /* address */
+		break;	
 	}
 
 	if (!ir_codes) {
diff --git a/drivers/media/video/cx88/cx88.h b/drivers/media/video/cx88/cx88.h
index c9659de..a988f14 100644
--- a/drivers/media/video/cx88/cx88.h
+++ b/drivers/media/video/cx88/cx88.h
@@ -246,6 +246,7 @@ extern const struct sram_channel const cx88_sram_channels[];
 #define CX88_BOARD_WINFAST_DTV1800H_XC4000 88
 #define CX88_BOARD_WINFAST_TV2000_XP_GLOBAL_6F36 89
 #define CX88_BOARD_WINFAST_TV2000_XP_GLOBAL_6F43 90
+#define CX88_BOARD_BST_PS8312              91
 
 enum cx88_itype {
 	CX88_VMUX_COMPOSITE1 = 1,
-- 
1.7.9.5


  parent reply	other threads:[~2012-04-15 15:53 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-22 10:38 [PATCH 1/3] m88brs2000 DVB-S frontend and tuner module Malcolm Priestley
2012-01-26 16:56 ` Mauro Carvalho Chehab
2012-01-27 22:26   ` Malcolm Priestley
2012-04-15 15:53   ` [PATCH 1/6] m88ds3103, montage dvb-s/s2 demodulator driver nibble.max
2012-04-19 18:06     ` Mauro Carvalho Chehab
2012-04-20  8:01       ` nibble.max
2012-04-19 20:08     ` Mauro Carvalho Chehab
2012-04-20  8:01     ` nibble.max
2012-04-20  9:47       ` Antti Palosaari
2012-04-20 17:24         ` Mauro Carvalho Chehab
2012-04-21  2:45         ` nibble.max
2012-04-23 16:41           ` Antti Palosaari
2012-04-23 19:51             ` Konstantin Dimitrov
2012-04-23 21:04               ` Antti Palosaari
2012-04-27 18:44                 ` Konstantin Dimitrov
2012-04-23 21:49               ` Mauro Carvalho Chehab
2012-04-27 19:01                 ` Konstantin Dimitrov
2012-04-27 19:36                   ` Mauro Carvalho Chehab
2012-04-27 20:37                     ` Konstantin Dimitrov
2012-04-27 20:40                       ` Konstantin Dimitrov
2012-04-27 20:54                         ` Antti Palosaari
2012-04-27 21:01                           ` Konstantin Dimitrov
2012-04-27 19:55                   ` Antti Palosaari
2012-04-27 20:21                     ` Konstantin Dimitrov
2012-04-27 20:42                       ` Antti Palosaari
2012-04-27 21:13                         ` Konstantin Dimitrov
2012-04-28  3:54                         ` nibble.max
2012-04-28  9:17                   ` Demod hardware pid filter implement nibble.max
2012-04-28 10:15                     ` Antti Palosaari
2012-04-24  2:45               ` Re: [PATCH 1/6] m88ds3103, montage dvb-s/s2 demodulator driver nibble.max
2012-04-26 13:03               ` nibble.max
2012-04-26 13:24                 ` Mauro Carvalho Chehab
2012-04-27  7:06                   ` [PATCH 1/6 v2] dvbsky, montage dvb-s/s2 TS202x tuner and M88DS3103 " nibble.max
2012-04-27 11:06                     ` Mauro Carvalho Chehab
2012-04-27 14:17                     ` Re: [PATCH 1/6 v2] dvbsky, montage dvb-s/s2 TS202x tuner and M88DS3103demodulator driver nibble.max
2012-04-27 14:35                       ` Mauro Carvalho Chehab
2012-04-27 18:03                         ` Konstantin Dimitrov
2012-04-27  7:06                   ` [PATCH 2/6 v2] dvbsky, dvb-s/s2 usb box nibble.max
2013-06-30  3:07                     ` Fwd: " P. van Gaans
2014-01-15 19:30                       ` Mauro Carvalho Chehab
2012-04-27  7:06                   ` [PATCH 3/6 v2] dvbsky, dvb-s/s2 PCIe card nibble.max
2012-04-27  7:07                   ` [PATCH 4/6 v2] dvbsky, dvb-s/s2 PCI card nibble.max
2012-04-27  7:07                   ` [PATCH 5/6 v2] dvbsky, remote control key map nibble.max
2012-04-27  7:07                   ` [PATCH 6/6 v2] dvbsky, remote control include header file nibble.max
2012-04-20 17:10       ` [PATCH 1/6] m88ds3103, montage dvb-s/s2 demodulator driver Mauro Carvalho Chehab
2012-04-15 15:53   ` [PATCH 2/6] m88ds3103, dvbsky dvb-s2 usb box nibble.max
2012-04-19 18:09     ` Mauro Carvalho Chehab
2012-04-20  8:08     ` nibble.max
2012-04-20 17:08       ` Mauro Carvalho Chehab
2012-04-15 15:53   ` nibble.max [this message]
2012-04-15 15:53   ` [PATCH 4/6] m88ds3103, dvbsky dvb-s2 cx23885 pcie card nibble.max
2012-04-19 18:11     ` Mauro Carvalho Chehab
2012-04-15 15:53   ` [PATCH 5/6] m88ds3103, dvbsky remote control key map nibble.max
2012-04-19 18:16     ` Mauro Carvalho Chehab
2012-04-20  8:01       ` nibble.max
2012-04-15 15:53   ` [PATCH 6/6] m88ds3103, dvbsky remote control include header file nibble.max

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201204152353319848816@gmail.com \
    --to=nibble.max@gmail.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).