diff options
author | Luis Alves <ljalvs@gmail.com> | 2013-11-13 13:06:44 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2013-12-09 06:59:42 -0500 |
commit | 71b6aaafd534995255d65d6433cbae7938a8131f (patch) | |
tree | d473019894cc16733eddd1608ad450e77748bb02 /drivers/media/dvb-frontends/cx24117.c | |
parent | 9fa7c419643b8c291d9c56718804cb8cf4237e97 (diff) |
[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/media/dvb-frontends/cx24117.c')
-rw-r--r-- | drivers/media/dvb-frontends/cx24117.c | 33 |
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, | |||
917 | voltage == SEC_VOLTAGE_18 ? "SEC_VOLTAGE_18" : | 917 | voltage == SEC_VOLTAGE_18 ? "SEC_VOLTAGE_18" : |
918 | "SEC_VOLTAGE_OFF"); | 918 | "SEC_VOLTAGE_OFF"); |
919 | 919 | ||
920 | /* Set GPIO direction */ | 920 | /* Prepare a set GPIO logic level CMD */ |
921 | cmd.args[0] = CMD_SET_GPIODIR; | 921 | cmd.args[0] = CMD_SET_GPIOOUT; |
922 | cmd.args[1] = reg; | 922 | cmd.args[2] = reg; /* mask */ |
923 | cmd.args[2] = reg; | ||
924 | cmd.len = 3; | 923 | cmd.len = 3; |
925 | ret = cx24117_cmd_execute(fe, &cmd); | ||
926 | if (ret) | ||
927 | return ret; | ||
928 | 924 | ||
929 | if ((voltage == SEC_VOLTAGE_13) || | 925 | if ((voltage == SEC_VOLTAGE_13) || |
930 | (voltage == SEC_VOLTAGE_18)) { | 926 | (voltage == SEC_VOLTAGE_18)) { |
931 | /* Set GPIO logic level */ | 927 | /* power on LNB */ |
932 | cmd.args[0] = CMD_SET_GPIOOUT; | ||
933 | cmd.args[1] = reg; | 928 | cmd.args[1] = reg; |
934 | cmd.args[2] = reg; | ||
935 | cmd.len = 3; | ||
936 | ret = cx24117_cmd_execute(fe, &cmd); | 929 | ret = cx24117_cmd_execute(fe, &cmd); |
937 | if (ret != 0) | 930 | if (ret != 0) |
938 | return ret; | 931 | return ret; |
@@ -949,17 +942,17 @@ static int cx24117_set_voltage(struct dvb_frontend *fe, | |||
949 | cmd.args[1] = state->demod ? 0 : 1; | 942 | cmd.args[1] = state->demod ? 0 : 1; |
950 | cmd.args[2] = (voltage == SEC_VOLTAGE_18 ? 0x01 : 0x00); | 943 | cmd.args[2] = (voltage == SEC_VOLTAGE_18 ? 0x01 : 0x00); |
951 | cmd.len = 3; | 944 | cmd.len = 3; |
945 | ret = cx24117_cmd_execute(fe, &cmd); | ||
952 | 946 | ||
953 | /* Min delay time before DiSEqC send */ | 947 | /* Min delay time before DiSEqC send */ |
954 | msleep(20); | 948 | msleep(20); |
955 | } else { | 949 | } else { |
956 | cmd.args[0] = CMD_SET_GPIOOUT; | 950 | /* power off LNB */ |
957 | cmd.args[1] = 0x00; | 951 | cmd.args[1] = 0x00; |
958 | cmd.args[2] = reg; | 952 | ret = cx24117_cmd_execute(fe, &cmd); |
959 | cmd.len = 3; | ||
960 | } | 953 | } |
961 | 954 | ||
962 | return cx24117_cmd_execute(fe, &cmd); | 955 | return ret; |
963 | } | 956 | } |
964 | 957 | ||
965 | static int cx24117_set_tone(struct dvb_frontend *fe, | 958 | static int cx24117_set_tone(struct dvb_frontend *fe, |
@@ -1277,6 +1270,16 @@ static int cx24117_initfe(struct dvb_frontend *fe) | |||
1277 | cmd.args[2] = CX24117_OCC; | 1270 | cmd.args[2] = CX24117_OCC; |
1278 | cmd.len = 3; | 1271 | cmd.len = 3; |
1279 | ret = cx24117_cmd_execute_nolock(fe, &cmd); | 1272 | ret = cx24117_cmd_execute_nolock(fe, &cmd); |
1273 | if (ret != 0) | ||
1274 | goto exit; | ||
1275 | |||
1276 | /* Set GPIO direction */ | ||
1277 | /* Set as output - controls LNB power on/off */ | ||
1278 | cmd.args[0] = CMD_SET_GPIODIR; | ||
1279 | cmd.args[1] = 0x30; | ||
1280 | cmd.args[2] = 0x30; | ||
1281 | cmd.len = 3; | ||
1282 | ret = cx24117_cmd_execute_nolock(fe, &cmd); | ||
1280 | 1283 | ||
1281 | exit: | 1284 | exit: |
1282 | mutex_unlock(&state->priv->fe_lock); | 1285 | mutex_unlock(&state->priv->fe_lock); |