summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLuis Alves <ljalvs@gmail.com>2013-11-13 15:06:44 -0300
committerMauro Carvalho Chehab <m.chehab@samsung.com>2013-12-09 09:59:42 -0200
commit71b6aaafd534995255d65d6433cbae7938a8131f (patch)
treed473019894cc16733eddd1608ad450e77748bb02 /drivers
parent9fa7c419643b8c291d9c56718804cb8cf4237e97 (diff)
downloadlinux-next-71b6aaafd534995255d65d6433cbae7938a8131f.tar.gz
[media] cx24117: Fix LNB set_voltage function
This patch should fix/enhance the set_voltage function for the cx24117 demodulator. Signed-off-by: Luis Alves <ljalvs@gmail.com> Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/dvb-frontends/cx24117.c33
1 files changed, 18 insertions, 15 deletions
diff --git a/drivers/media/dvb-frontends/cx24117.c b/drivers/media/dvb-frontends/cx24117.c
index a6fe1aff976b..68f768a5422d 100644
--- a/drivers/media/dvb-frontends/cx24117.c
+++ b/drivers/media/dvb-frontends/cx24117.c
@@ -917,22 +917,15 @@ static int cx24117_set_voltage(struct dvb_frontend *fe,
voltage == SEC_VOLTAGE_18 ? "SEC_VOLTAGE_18" :
"SEC_VOLTAGE_OFF");
- /* Set GPIO direction */
- cmd.args[0] = CMD_SET_GPIODIR;
- cmd.args[1] = reg;
- cmd.args[2] = reg;
+ /* Prepare a set GPIO logic level CMD */
+ cmd.args[0] = CMD_SET_GPIOOUT;
+ cmd.args[2] = reg; /* mask */
cmd.len = 3;
- ret = cx24117_cmd_execute(fe, &cmd);
- if (ret)
- return ret;
if ((voltage == SEC_VOLTAGE_13) ||
(voltage == SEC_VOLTAGE_18)) {
- /* Set GPIO logic level */
- cmd.args[0] = CMD_SET_GPIOOUT;
+ /* power on LNB */
cmd.args[1] = reg;
- cmd.args[2] = reg;
- cmd.len = 3;
ret = cx24117_cmd_execute(fe, &cmd);
if (ret != 0)
return ret;
@@ -949,17 +942,17 @@ static int cx24117_set_voltage(struct dvb_frontend *fe,
cmd.args[1] = state->demod ? 0 : 1;
cmd.args[2] = (voltage == SEC_VOLTAGE_18 ? 0x01 : 0x00);
cmd.len = 3;
+ ret = cx24117_cmd_execute(fe, &cmd);
/* Min delay time before DiSEqC send */
msleep(20);
} else {
- cmd.args[0] = CMD_SET_GPIOOUT;
+ /* power off LNB */
cmd.args[1] = 0x00;
- cmd.args[2] = reg;
- cmd.len = 3;
+ ret = cx24117_cmd_execute(fe, &cmd);
}
- return cx24117_cmd_execute(fe, &cmd);
+ return ret;
}
static int cx24117_set_tone(struct dvb_frontend *fe,
@@ -1277,6 +1270,16 @@ static int cx24117_initfe(struct dvb_frontend *fe)
cmd.args[2] = CX24117_OCC;
cmd.len = 3;
ret = cx24117_cmd_execute_nolock(fe, &cmd);
+ if (ret != 0)
+ goto exit;
+
+ /* Set GPIO direction */
+ /* Set as output - controls LNB power on/off */
+ cmd.args[0] = CMD_SET_GPIODIR;
+ cmd.args[1] = 0x30;
+ cmd.args[2] = 0x30;
+ cmd.len = 3;
+ ret = cx24117_cmd_execute_nolock(fe, &cmd);
exit:
mutex_unlock(&state->priv->fe_lock);