aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgor M. Liplianin <liplianin@me.by>2009-01-17 08:16:36 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-03-30 11:42:24 -0400
commitc7bdcd0f541efcb92c407c601ff7819a4a551f6f (patch)
tree47216ed55a64dff44b06ef5a4862856989b8e90d
parent579943f5487baa7f9fd8e3189a4f357d6b06c76d (diff)
V4L/DVB (10268): Proper implement set_voltage in cx24116.
Now there is a card, which uses cx24116 to control LNB DC voltage. It is DVBWorld DVBS2 PCI-e 2005. The patch is nedded to add support for that card. 1. Rename CMD_SET_TONEPRE to CMD_LNBDCLEVEL. 2. Fill set_voltage with actually control voltage code. 3. Correct set_tone to not affect voltage. Signed-off-by: Igor M. Liplianin <liplianin@me.by> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/dvb/frontends/cx24116.c51
1 files changed, 32 insertions, 19 deletions
diff --git a/drivers/media/dvb/frontends/cx24116.c b/drivers/media/dvb/frontends/cx24116.c
index 28ad609e73f4..a146c352df59 100644
--- a/drivers/media/dvb/frontends/cx24116.c
+++ b/drivers/media/dvb/frontends/cx24116.c
@@ -15,6 +15,9 @@
15 September, 9th 2008 15 September, 9th 2008
16 Fixed locking on high symbol rates (>30000). 16 Fixed locking on high symbol rates (>30000).
17 Implement MPEG initialization parameter. 17 Implement MPEG initialization parameter.
18 January, 17th 2009
19 Fill set_voltage with actually control voltage code.
20 Correct set tone to not affect voltage.
18 21
19 This program is free software; you can redistribute it and/or modify 22 This program is free software; you can redistribute it and/or modify
20 it under the terms of the GNU General Public License as published by 23 it under the terms of the GNU General Public License as published by
@@ -146,7 +149,7 @@ enum cmds {
146 CMD_GETAGC = 0x19, 149 CMD_GETAGC = 0x19,
147 CMD_LNBCONFIG = 0x20, 150 CMD_LNBCONFIG = 0x20,
148 CMD_LNBSEND = 0x21, /* Formerly CMD_SEND_DISEQC */ 151 CMD_LNBSEND = 0x21, /* Formerly CMD_SEND_DISEQC */
149 CMD_SET_TONEPRE = 0x22, 152 CMD_LNBDCLEVEL = 0x22,
150 CMD_SET_TONE = 0x23, 153 CMD_SET_TONE = 0x23,
151 CMD_UPDFWVERS = 0x35, 154 CMD_UPDFWVERS = 0x35,
152 CMD_TUNERSLEEP = 0x36, 155 CMD_TUNERSLEEP = 0x36,
@@ -667,16 +670,6 @@ static int cx24116_load_firmware(struct dvb_frontend *fe,
667 return 0; 670 return 0;
668} 671}
669 672
670static int cx24116_set_voltage(struct dvb_frontend *fe,
671 fe_sec_voltage_t voltage)
672{
673 /* The isl6421 module will override this function in the fops. */
674 dprintk("%s() This should never appear if the isl6421 module "
675 "is loaded correctly\n", __func__);
676
677 return -EOPNOTSUPP;
678}
679
680static int cx24116_read_status(struct dvb_frontend *fe, fe_status_t *status) 673static int cx24116_read_status(struct dvb_frontend *fe, fe_status_t *status)
681{ 674{
682 struct cx24116_state *state = fe->demodulator_priv; 675 struct cx24116_state *state = fe->demodulator_priv;
@@ -837,6 +830,34 @@ static int cx24116_wait_for_lnb(struct dvb_frontend *fe)
837 return -ETIMEDOUT; /* -EBUSY ? */ 830 return -ETIMEDOUT; /* -EBUSY ? */
838} 831}
839 832
833static int cx24116_set_voltage(struct dvb_frontend *fe,
834 fe_sec_voltage_t voltage)
835{
836 struct cx24116_cmd cmd;
837 int ret;
838
839 dprintk("%s: %s\n", __func__,
840 voltage == SEC_VOLTAGE_13 ? "SEC_VOLTAGE_13" :
841 voltage == SEC_VOLTAGE_18 ? "SEC_VOLTAGE_18" : "??");
842
843 /* Wait for LNB ready */
844 ret = cx24116_wait_for_lnb(fe);
845 if (ret != 0)
846 return ret;
847
848 /* Wait for voltage/min repeat delay */
849 msleep(100);
850
851 cmd.args[0x00] = CMD_LNBDCLEVEL;
852 cmd.args[0x01] = (voltage == SEC_VOLTAGE_18 ? 0x01 : 0x00);
853 cmd.len = 0x02;
854
855 /* Min delay time before DiSEqC send */
856 msleep(15);
857
858 return cx24116_cmd_execute(fe, &cmd);
859}
860
840static int cx24116_set_tone(struct dvb_frontend *fe, 861static int cx24116_set_tone(struct dvb_frontend *fe,
841 fe_sec_tone_mode_t tone) 862 fe_sec_tone_mode_t tone)
842{ 863{
@@ -857,14 +878,6 @@ static int cx24116_set_tone(struct dvb_frontend *fe,
857 /* Min delay time after DiSEqC send */ 878 /* Min delay time after DiSEqC send */
858 msleep(15); /* XXX determine is FW does this, see send_diseqc/burst */ 879 msleep(15); /* XXX determine is FW does this, see send_diseqc/burst */
859 880
860 /* This is always done before the tone is set */
861 cmd.args[0x00] = CMD_SET_TONEPRE;
862 cmd.args[0x01] = 0x00;
863 cmd.len = 0x02;
864 ret = cx24116_cmd_execute(fe, &cmd);
865 if (ret != 0)
866 return ret;
867
868 /* Now we set the tone */ 881 /* Now we set the tone */
869 cmd.args[0x00] = CMD_SET_TONE; 882 cmd.args[0x00] = CMD_SET_TONE;
870 cmd.args[0x01] = 0x00; 883 cmd.args[0x01] = 0x00;