aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/frontends/tua6100.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2011-12-23 15:56:57 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-12-31 05:36:38 -0500
commit5918288a422b8bbc0ebfd541d6cb9ed2c43b0b76 (patch)
treeb6a27663f7bb4946b17e6ec7064257f60aeae876 /drivers/media/dvb/frontends/tua6100.c
parentb738ae160a9991d133671873f68c2ccffe524d12 (diff)
[media] tua6100: use DVBv5 parameters on set_params()
Instead of using DVBv3 parameters, rely on DVBv5 parameters to set the tuner Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/frontends/tua6100.c')
-rw-r--r--drivers/media/dvb/frontends/tua6100.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/drivers/media/dvb/frontends/tua6100.c b/drivers/media/dvb/frontends/tua6100.c
index bcb95c2ef296..7842e620e6b3 100644
--- a/drivers/media/dvb/frontends/tua6100.c
+++ b/drivers/media/dvb/frontends/tua6100.c
@@ -70,6 +70,7 @@ static int tua6100_sleep(struct dvb_frontend *fe)
70static int tua6100_set_params(struct dvb_frontend *fe, 70static int tua6100_set_params(struct dvb_frontend *fe,
71 struct dvb_frontend_parameters *params) 71 struct dvb_frontend_parameters *params)
72{ 72{
73 struct dtv_frontend_properties *c = &fe->dtv_property_cache;
73 struct tua6100_priv *priv = fe->tuner_priv; 74 struct tua6100_priv *priv = fe->tuner_priv;
74 u32 div; 75 u32 div;
75 u32 prediv; 76 u32 prediv;
@@ -85,36 +86,37 @@ static int tua6100_set_params(struct dvb_frontend *fe,
85#define _ri 4000000 86#define _ri 4000000
86 87
87 // setup register 0 88 // setup register 0
88 if (params->frequency < 2000000) { 89 if (c->frequency < 2000000)
89 reg0[1] = 0x03; 90 reg0[1] = 0x03;
90 } else { 91 else
91 reg0[1] = 0x07; 92 reg0[1] = 0x07;
92 }
93 93
94 // setup register 1 94 // setup register 1
95 if (params->frequency < 1630000) { 95 if (c->frequency < 1630000)
96 reg1[1] = 0x2c; 96 reg1[1] = 0x2c;
97 } else { 97 else
98 reg1[1] = 0x0c; 98 reg1[1] = 0x0c;
99 } 99
100 if (_P == 64) 100 if (_P == 64)
101 reg1[1] |= 0x40; 101 reg1[1] |= 0x40;
102 if (params->frequency >= 1525000) 102 if (c->frequency >= 1525000)
103 reg1[1] |= 0x80; 103 reg1[1] |= 0x80;
104 104
105 // register 2 105 // register 2
106 reg2[1] = (_R >> 8) & 0x03; 106 reg2[1] = (_R >> 8) & 0x03;
107 reg2[2] = _R; 107 reg2[2] = _R;
108 if (params->frequency < 1455000) { 108 if (c->frequency < 1455000)
109 reg2[1] |= 0x1c; 109 reg2[1] |= 0x1c;
110 } else if (params->frequency < 1630000) { 110 else if (c->frequency < 1630000)
111 reg2[1] |= 0x0c; 111 reg2[1] |= 0x0c;
112 } else { 112 else
113 reg2[1] |= 0x1c; 113 reg2[1] |= 0x1c;
114 }
115 114
116 // The N divisor ratio (note: params->frequency is in kHz, but we need it in Hz) 115 /*
117 prediv = (params->frequency * _R) / (_ri / 1000); 116 * The N divisor ratio (note: c->frequency is in kHz, but we
117 * need it in Hz)
118 */
119 prediv = (c->frequency * _R) / (_ri / 1000);
118 div = prediv / _P; 120 div = prediv / _P;
119 reg1[1] |= (div >> 9) & 0x03; 121 reg1[1] |= (div >> 9) & 0x03;
120 reg1[2] = div >> 1; 122 reg1[2] = div >> 1;