diff options
-rw-r--r-- | linux/drivers/media/dvb/frontends/alps_bsrv2.c | 2 | ||||
-rw-r--r-- | linux/drivers/media/dvb/frontends/stv0299.c | 29 | ||||
-rw-r--r-- | linux/include/linux/dvb/frontend.h | 3 |
3 files changed, 23 insertions, 11 deletions
diff --git a/linux/drivers/media/dvb/frontends/alps_bsrv2.c b/linux/drivers/media/dvb/frontends/alps_bsrv2.c index 0c5f58da4..5557e4014 100644 --- a/linux/drivers/media/dvb/frontends/alps_bsrv2.c +++ b/linux/drivers/media/dvb/frontends/alps_bsrv2.c @@ -298,6 +298,8 @@ int ves1893_set_voltage (struct dvb_i2c_bus *i2c, fe_sec_voltage_t voltage) return ves1893_writereg (i2c, 0x1f, 0x20); case SEC_VOLTAGE_18: return ves1893_writereg (i2c, 0x1f, 0x30); + case SEC_VOLTAGE_OFF: + return ves1893_writereg (i2c, 0x1f, 0x00); default: return -EINVAL; } diff --git a/linux/drivers/media/dvb/frontends/stv0299.c b/linux/drivers/media/dvb/frontends/stv0299.c index 4b3bd1b18..e0ec6fd23 100644 --- a/linux/drivers/media/dvb/frontends/stv0299.c +++ b/linux/drivers/media/dvb/frontends/stv0299.c @@ -639,28 +639,37 @@ int stv0299_set_tone (struct dvb_i2c_bus *i2c, fe_sec_tone_mode_t tone) static int stv0299_set_voltage (struct dvb_i2c_bus *i2c, fe_sec_voltage_t voltage) { + u8 reg0x08; u8 reg0x0c; dprintk("%s: %s\n", __FUNCTION__, voltage == SEC_VOLTAGE_13 ? "SEC_VOLTAGE_13" : voltage == SEC_VOLTAGE_18 ? "SEC_VOLTAGE_18" : "??"); + reg0x08 = stv0299_readreg (i2c, 0x08); reg0x0c = stv0299_readreg (i2c, 0x0c); /** - * H/V switching over OP0, OP1 is LNB power on + * H/V switching over OP0, OP1 and OP2 are LNB power enable bits */ reg0x0c &= 0x0f; - reg0x0c |= 0x40; /* LNB power on */ - switch (voltage) { - case SEC_VOLTAGE_13: - return stv0299_writereg (i2c, 0x0c, reg0x0c); - case SEC_VOLTAGE_18: - return stv0299_writereg (i2c, 0x0c, reg0x0c | 0x10); - default: - return -EINVAL; - }; + if (voltage == SEC_VOLTAGE_OFF) { + stv0299_writereg (i2c, 0x08, reg0x08 & ~0x40); + return stv0299_writereg (i2c, 0x0c, reg0x0c & ~0x40); + } else { + stv0299_writereg (i2c, 0x08, reg0x08 | 0x40); + reg0x0c |= 0x40; /* LNB power on */ + + switch (voltage) { + case SEC_VOLTAGE_13: + return stv0299_writereg (i2c, 0x0c, reg0x0c); + case SEC_VOLTAGE_18: + return stv0299_writereg (i2c, 0x0c, reg0x0c | 0x10); + default: + return -EINVAL; + }; + } } diff --git a/linux/include/linux/dvb/frontend.h b/linux/include/linux/dvb/frontend.h index 3f6e61d93..3fa118e7a 100644 --- a/linux/include/linux/dvb/frontend.h +++ b/linux/include/linux/dvb/frontend.h @@ -99,7 +99,8 @@ struct dvb_diseqc_slave_reply { typedef enum fe_sec_voltage { SEC_VOLTAGE_13, - SEC_VOLTAGE_18 + SEC_VOLTAGE_18, + SEC_VOLTAGE_OFF } fe_sec_voltage_t; |