[PATCH] PCI-e TBS 6920 DVB-S2, cx23885 and cx24116, for hg import

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



# HG changeset patch
# User Igor M. Liplianin <liplianin@xxxxx>
# Date 1228529008 -7200
# Node ID 613005dd083064292620597adfce3a2b301c4719
# Parent  39b022c4204d853825816153aa24acecb4eb21d5
Add TBS 6920 PCI-e DVB-S2 card.

From: Igor M. Liplianin <liplianin@xxxxx>

TBS 6920 PCI-e DVB-S2 card based on cx23885 PCI-Express chip, cx24116 demodulator.

Signed-off-by: Igor M. Liplianin <liplianin@xxxxx>

diff -r 39b022c4204d -r 613005dd0830 linux/drivers/media/video/cx23885/cx23885-cards.c
--- a/linux/drivers/media/video/cx23885/cx23885-cards.c	Thu Dec 04 14:37:30 2008 +0200
+++ b/linux/drivers/media/video/cx23885/cx23885-cards.c	Sat Dec 06 04:03:28 2008 +0200
@@ -159,6 +159,10 @@
 		.name		= "Leadtek Winfast PxDVR3200 H",
 		.portc		= CX23885_MPEG_DVB,
 	},
+	[CX23885_BOARD_TBS_6920] = {
+		.name		= "TurboSight TBS 6920",
+		.portb		= CX23885_MPEG_DVB,
+	},
 };
 const unsigned int cx23885_bcount = ARRAY_SIZE(cx23885_boards);
 
@@ -238,6 +242,10 @@
 		.subvendor = 0x107d,
 		.subdevice = 0x6681,
 		.card      = CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H,
+	}, {
+		.subvendor = 0x6920,
+		.subdevice = 0x8888,
+		.card      = CX23885_BOARD_TBS_6920,
 	},
 };
 const unsigned int cx23885_idcount = ARRAY_SIZE(cx23885_subids);
@@ -543,6 +551,14 @@
 		mdelay(20);
 		cx_set(GP0_IO, 0x00040004);
 		break;
+	case CX23885_BOARD_TBS_6920:
+		cx_write(MC417_CTL, 0x00000036);
+		cx_write(MC417_OEN, 0x00001000);
+		cx_clear(MC417_RWD, 0x00000800);
+		msleep(10);
+		cx_write(MC417_RWD, 0x00001800);
+		msleep(10);
+		break;
 	}
 }
 
@@ -623,6 +639,11 @@
 		ts2->ts_clk_en_val = 0x1; /* Enable TS_CLK */
 		ts2->src_sel_val   = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO;
 		break;
+	case CX23885_BOARD_TBS_6920:
+		ts1->gen_ctrl_val  = 0x5; /* Parallel */
+		ts1->ts_clk_en_val = 0x1; /* Enable TS_CLK */
+		ts1->src_sel_val   = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO;
+		break;
 	case CX23885_BOARD_HAUPPAUGE_HVR1250:
 	case CX23885_BOARD_HAUPPAUGE_HVR1500:
 	case CX23885_BOARD_HAUPPAUGE_HVR1500Q:
diff -r 39b022c4204d -r 613005dd0830 linux/drivers/media/video/cx23885/cx23885-dvb.c
--- a/linux/drivers/media/video/cx23885/cx23885-dvb.c	Thu Dec 04 14:37:30 2008 +0200
+++ b/linux/drivers/media/video/cx23885/cx23885-dvb.c	Sat Dec 06 04:03:28 2008 +0200
@@ -44,6 +44,7 @@
 #include "dib7000p.h"
 #include "dibx000_common.h"
 #include "zl10353.h"
+#include "cx24116.h"
 
 static unsigned int debug;
 
@@ -309,6 +310,39 @@
 	.no_tuner      = 1,
 };
 
+static int cx24116_reset_device(struct dvb_frontend *fe)
+{
+	struct cx23885_tsport *port = fe->dvb->priv;
+	struct cx23885_dev *dev = port->dev;
+
+	cx_clear(MC417_RWD, 0x00000800);/* GPIO-14 low */
+	msleep(10);
+	cx_set(MC417_RWD, 0x00000800);/* GPIO-14 high */
+	msleep(20);
+
+	return 0;
+}
+
+static int tbs_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage)
+{
+	struct cx23885_tsport *port = fe->dvb->priv;
+	struct cx23885_dev *dev = port->dev;
+
+	if (voltage == SEC_VOLTAGE_18)
+		cx_write(MC417_RWD, 0x00001e00);/* GPIO-13 high */
+	else if (voltage == SEC_VOLTAGE_13)
+		cx_write(MC417_RWD, 0x00001a00);/* GPIO-13 low */
+	else
+		cx_write(MC417_RWD, 0x00001800);/* GPIO-12 low */
+	return 0;
+}
+
+static struct cx24116_config tbs_cx24116_config = {
+	.demod_address = 0x05,
+	.mpg_clk_pos_pol = 0x02,
+	.reset_device = cx24116_reset_device,
+};
+
 static int dvb_register(struct cx23885_tsport *port)
 {
 	struct cx23885_dev *dev = port->dev;
@@ -526,6 +560,16 @@
 				fe->ops.tuner_ops.set_config(fe, &ctl);
 		}
 		break;
+	case CX23885_BOARD_TBS_6920:
+		i2c_bus = &dev->i2c_bus[0];
+
+		fe0->dvb.frontend = dvb_attach(cx24116_attach,
+			&tbs_cx24116_config,
+			&i2c_bus->i2c_adap);
+		if (fe0->dvb.frontend != NULL) {
+			fe0->dvb.frontend->ops.set_voltage = tbs_set_voltage;
+		}
+		break;
 	default:
 		printk(KERN_INFO "%s: The frontend of your DVB/ATSC card "
 			" isn't supported yet\n",
diff -r 39b022c4204d -r 613005dd0830 linux/drivers/media/video/cx23885/cx23885.h
--- a/linux/drivers/media/video/cx23885/cx23885.h	Thu Dec 04 14:37:30 2008 +0200
+++ b/linux/drivers/media/video/cx23885/cx23885.h	Sat Dec 06 04:03:28 2008 +0200
@@ -67,6 +67,7 @@
 #define CX23885_BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP 10
 #define CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP 11
 #define CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H 12
+#define CX23885_BOARD_TBS_6920                 13
 
 /* Currently unsupported by the driver: PAL/H, NTSC/Kr, SECAM B/G/H/LC */
 #define CX23885_NORMS (\

_______________________________________________
linux-dvb mailing list
linux-dvb@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

[Index of Archives]     [Linux Media]     [Video 4 Linux]     [Asterisk]     [Samba]     [Xorg]     [Xfree86]     [Linux USB]

  Powered by Linux