[linux-dvb] [PATCH 2/6] DVB-PinnSat: Fix relay handling

Edgar Toernig froese at gmx.de
Sun Jan 8 03:06:05 CET 2006


The handling of the IF-out relay was broken in earlier
versions of the driver.  The bttv part of the fix was
incorporated into 2.6.15 but the dvb part was missing
thereby making the driver non-functional.

This is the missing part.  Now the relay is activated
at the moment the frontend device is opened and de-
activated by the sleep/shutdown callback.

---

 bt8xx/dvb-bt8xx.c   |   13 +++++++++++++
 frontends/cx24110.c |   10 ++++++++++
 frontends/cx24110.h |    1 +
 3 files changed, 24 insertions(+)

--- 0.2/drivers/media/dvb/frontends/cx24110.h Sat, 07 Jan 2006 00:06:16 +0100 froese (kernel-dvb/f/41_cx24110.h 1.1 644)
+++ 0.3/drivers/media/dvb/frontends/cx24110.h Sat, 07 Jan 2006 01:12:16 +0100 froese (kernel-dvb/f/41_cx24110.h 1.2 644)
@@ -35,6 +35,7 @@
 	/* PLL maintenance */
 	int (*pll_init)(struct dvb_frontend* fe);
 	int (*pll_set)(struct dvb_frontend* fe, struct dvb_frontend_parameters* params);
+	int (*pll_sleep)(struct dvb_frontend* fe);
 };
 
 extern struct dvb_frontend* cx24110_attach(const struct cx24110_config* config,
--- 0.2/drivers/media/dvb/frontends/cx24110.c Sat, 07 Jan 2006 00:53:31 +0100 froese (kernel-dvb/f/42_cx24110.c 1.2 644)
+++ 0.3/drivers/media/dvb/frontends/cx24110.c Sat, 07 Jan 2006 01:12:16 +0100 froese (kernel-dvb/f/42_cx24110.c 1.3 644)
@@ -372,6 +372,15 @@
 	return 0;
 }
 
+static int cx24110_sleep(struct dvb_frontend *fe)
+{
+	struct cx24110_state *state = fe->demodulator_priv;
+
+	if (state->config->pll_sleep)
+		  return state->config->pll_sleep(fe);
+	return 0;
+}
+
 static int cx24110_set_voltage (struct dvb_frontend* fe, fe_sec_voltage_t voltage)
 {
 	struct cx24110_state *state = fe->demodulator_priv;
@@ -640,6 +649,7 @@
 	.release = cx24110_release,
 
 	.init = cx24110_initfe,
+	.sleep = cx24110_sleep,
 	.set_frontend = cx24110_set_frontend,
 	.get_frontend = cx24110_get_frontend,
 	.read_status = cx24110_read_status,
--- 0.2/drivers/media/dvb/bt8xx/dvb-bt8xx.c Sat, 07 Jan 2006 00:53:31 +0100 froese (kernel-dvb/h/9_dvb-bt8xx. 1.2 644)
+++ 0.3/drivers/media/dvb/bt8xx/dvb-bt8xx.c Sat, 07 Jan 2006 01:12:16 +0100 froese (kernel-dvb/h/9_dvb-bt8xx. 1.3 644)
@@ -237,6 +237,18 @@
 
 static int pinnsat_pll_init(struct dvb_frontend* fe)
 {
+	struct dvb_bt8xx_card *card = fe->dvb->priv;
+
+	bttv_gpio_enable(card->bttv_nr, 1, 1);  /* output */
+	bttv_write_gpio(card->bttv_nr, 1, 1);   /* relay on */
+	return 0;
+}
+
+static int pinnsat_pll_sleep(struct dvb_frontend* fe)
+{
+	struct dvb_bt8xx_card *card = fe->dvb->priv;
+
+	bttv_write_gpio(card->bttv_nr, 1, 0);   /* relay off */
 	return 0;
 }
 
@@ -244,6 +256,7 @@
 	.demod_address = 0x55,
 	.pll_init = pinnsat_pll_init,
 	.pll_set = cx24108_pll_set,
+	.pll_sleep = pinnsat_pll_sleep,
 };
 
 static int microtune_mt7202dtf_pll_set(struct dvb_frontend* fe, struct dvb_frontend_parameters* params)



More information about the linux-dvb mailing list