summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver Endriss <o.endriss@gmx.de>2009-12-12 14:09:52 +0100
committerOliver Endriss <o.endriss@gmx.de>2009-12-12 14:09:52 +0100
commitb88263bdc912467eebbc92c0a4cf99d1b86e68e4 (patch)
tree95e636812c12ffc643cbfbe1ad4926ae15745576
parent34724c2868be752e566d05022a4204efb8401aa8 (diff)
downloadmediapointer-dvb-s2-b88263bdc912467eebbc92c0a4cf99d1b86e68e4.tar.gz
mediapointer-dvb-s2-b88263bdc912467eebbc92c0a4cf99d1b86e68e4.tar.bz2
ngene: Use lnbp21 driver for LNB control
Remove local lnbp21_* routines and use the lnbp21 driver instead. Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
-rw-r--r--linux/drivers/media/video/ngene/ngene-core.c73
-rw-r--r--linux/drivers/media/video/ngene/ngene.h3
2 files changed, 13 insertions, 63 deletions
diff --git a/linux/drivers/media/video/ngene/ngene-core.c b/linux/drivers/media/video/ngene/ngene-core.c
index ad02fa16c..e410e22f5 100644
--- a/linux/drivers/media/video/ngene/ngene-core.c
+++ b/linux/drivers/media/video/ngene/ngene-core.c
@@ -53,6 +53,8 @@
#include "stv6110.h"
#endif /* NGENE_STV090X */
+#include "lnbh24.h"
+
#ifdef NGENE_COMMAND_API
#include "ngene-ioctls.h"
#endif
@@ -3335,59 +3337,6 @@ static struct dvb_device dvbdev_video = {
/****************************************************************************/
-/* LNBH21 *******************************************************************/
-/****************************************************************************/
-
-static int lnbh21_set_voltage(struct dvb_frontend *fe,
- fe_sec_voltage_t voltage)
-{
- struct ngene_channel *chan=fe->sec_priv;
-
- switch(voltage) {
- case SEC_VOLTAGE_OFF:
- chan->lnbh&=0xf3;
- dprintk("lnbh21_set_voltage SEC_VOLTAGE_OFF\n");
- break;
- case SEC_VOLTAGE_13:
- chan->lnbh|=0x04;
- chan->lnbh&=~0x08;
- dprintk("lnbh21_set_voltage SEC_VOLTAGE_13\n");
- break;
- case SEC_VOLTAGE_18:
- chan->lnbh|=0x0c;
- dprintk("lnbh21_set_voltage SEC_VOLTAGE_18\n");
- break;
- default:
- return -EINVAL;
- };
- chan->lnbh|=0x10;
- return i2c_write(&chan->i2c_adapter,
- chan->dev->card_info->lnb[chan->number], chan->lnbh);
-}
-
-static int lnbh21_set_tone(struct dvb_frontend *fe,
- fe_sec_tone_mode_t tone)
-{
- struct ngene_channel *chan=fe->sec_priv;
-
- switch (tone) {
- case SEC_TONE_ON:
- chan->lnbh|=0x20;
- dprintk("lnbh21_set_tone SEC_TONE_ON\n");
- break;
- case SEC_TONE_OFF:
- chan->lnbh&=0xdf;
- dprintk("lnbh21_set_tone SEC_TONE_OFF\n");
- break;
- default:
- return -EINVAL;
- }
- return i2c_write(&chan->i2c_adapter,
- chan->dev->card_info->lnb[chan->number], chan->lnbh);
-}
-
-
-/****************************************************************************/
/* Switch control (I2C gates, etc.) *****************************************/
/****************************************************************************/
@@ -3628,12 +3577,6 @@ static int tuner_attach_stv6110(struct ngene_channel *chan)
}
#endif /* NGENE_STV090X */
- chan->lnbh=0x40; /* use TTX */
- chan->fe->sec_priv=chan;
- chan->set_tone=chan->fe->ops.set_tone;
- chan->fe->ops.set_tone=lnbh21_set_tone;
- chan->fe->ops.set_voltage=lnbh21_set_voltage;
-
return 0;
}
@@ -3721,7 +3664,15 @@ static int demod_attach_stv0900(struct ngene_channel *chan)
chan->fe=dvb_attach(stv0900_attach, feconf, &chan->i2c_adapter, chan->number);
#endif /* NGENE_STV090X */
- return (chan->fe) ? 0 : -ENODEV;
+ if (chan->fe) {
+ if (dvb_attach(lnbh24_attach, chan->fe, &chan->i2c_adapter, 0,
+ 0, chan->dev->card_info->lnb[chan->number]))
+ return 0;
+ printk(KERN_ERR "%s: No LNBH24 found!\n", __func__);
+ dvb_frontend_detach(chan->fe);
+ }
+
+ return -ENODEV;
}
/****************************************************************************/
@@ -4168,6 +4119,8 @@ static struct stv090x_config fe_mps2 = {
.repeater_level = STV090x_RPTLEVEL_16, /* => I2CRPT.ENARPT_LEVEL */
+ .diseqc_envelope_mode = true,
+
.tuner_init = NULL,
.tuner_set_mode = NULL,
.tuner_set_frequency = NULL,
diff --git a/linux/drivers/media/video/ngene/ngene.h b/linux/drivers/media/video/ngene/ngene.h
index 4c59646f3..e47c0d8a9 100644
--- a/linux/drivers/media/video/ngene/ngene.h
+++ b/linux/drivers/media/video/ngene/ngene.h
@@ -719,9 +719,6 @@ struct ngene_channel {
int AudioDTOUpdated;
u32 AudioDTOValue;
- int (*set_tone)(struct dvb_frontend *, fe_sec_tone_mode_t);
- u8 lnbh;
-
/* stuff from analog driver */