[PATCH] stv0297_cs2 : Support for the new tuner code

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

 



Hi all,

This patch is very similar to this one from Andrew de Quincey <adq_dvb@xxxxxxxxxxxxx> :
http://linuxtv.org/hg/v4l-dvb?cmd=changeset;node=cdec15973d91;style=gitweb

Update the stv0297_cs2 to use the new tuner code.

Original comment :
Convert to tuner_ops calls.
Remove pll function pointers from structure.
Remove unneeded tuner calls.
Add i2c gate control function.
Remove extra exported pll gate control function.


Signed-off-by: Guy Martin <gmsoft@xxxxxxxxxxxx>

diff -r e5def6db2835 linux/drivers/media/dvb/b2c2/stv0297_cs2.c
--- a/linux/drivers/media/dvb/b2c2/stv0297_cs2.c	Fri Apr 28 13:14:45 2006
+++ b/linux/drivers/media/dvb/b2c2/stv0297_cs2.c	Sat Apr 29 01:38:06 2006
@@ -302,13 +302,13 @@
 	return 0;
 }
 
-int stv0297_cs2_enable_plli2c(struct dvb_frontend *fe)
-{
-	struct stv0297_state *state = fe->demodulator_priv;
-
-	stv0297_writeregI(state, CTRL_7, 0x78);
-	stv0297_writeregI(state, CTRL_6, 0xc8);
-
+static int stv0297_i2c_gate_ctrl(struct dvb_frontend *fe, int enable)
+{
+	struct stv0297_state *state = fe->demodulator_priv;
+	if (enable) {
+		stv0297_writeregI(state, 0x87, 0x78);
+		stv0297_writeregI(state, 0x86, 0xc8);
+	 } 
 	return 0;
 }
 
@@ -389,9 +389,6 @@
 
 	state->lastber = 0;
 
-	if (state->config->pll_init)
-		state->config->pll_init(fe);
-
 	return 0;
 }
 
@@ -438,7 +435,11 @@
 	deb_info("spectrum inversion: %s\n",inversion == INVERSION_ON ? "on" : "off");
 
 	stv0297_reset(fe);
-	state->config->pll_set(fe, p);
+	if (fe->ops->tuner_ops.set_params) {
+		fe->ops->tuner_ops.set_params(fe, p);
+		if (fe->ops->i2c_gate_ctrl) fe->ops->i2c_gate_ctrl(fe, 0);
+	}
+	
 /* clear software interrupts */
 	stv0297_writeregI(state, CTRL_2, 0x00);
 
@@ -756,6 +757,7 @@
 
 	.init = stv0297_init,
 	.sleep = stv0297_sleep,
+	.i2c_gate_ctrl = stv0297_i2c_gate_ctrl,
 
 	.set_frontend = stv0297_set_frontend,
 	.get_frontend = stv0297_get_frontend,
@@ -773,4 +775,3 @@
 MODULE_VERSION("1.0");
 
 EXPORT_SYMBOL(stv0297_cs2_attach);
-EXPORT_SYMBOL(stv0297_cs2_enable_plli2c);
diff -r e5def6db2835 linux/drivers/media/dvb/b2c2/stv0297_cs2.h
--- a/linux/drivers/media/dvb/b2c2/stv0297_cs2.h	Fri Apr 28 13:14:45 2006
+++ b/linux/drivers/media/dvb/b2c2/stv0297_cs2.h	Sat Apr 29 01:38:06 2006
@@ -39,13 +39,9 @@
 	u32 fclk;
 	u32 demodfreq;
 
-	/* PLL maintenance */
-	int (*pll_init)(struct dvb_frontend* fe);
-	int (*pll_set)(struct dvb_frontend* fe, struct dvb_frontend_parameters* params);
 };
 
 extern struct dvb_frontend* stv0297_cs2_attach(const struct stv0297_config* config,
 					   struct i2c_adapter* i2c);
-extern int stv0297_cs2_enable_plli2c(struct dvb_frontend* fe);
 
 #endif // STV0297_H
_______________________________________________

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