aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/ttpci
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2011-12-23 06:06:18 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-12-31 05:33:08 -0500
commita0a9ff7f58c99bad8a57d5cafaa29b86cfda6186 (patch)
tree636f9a8e95b8f6535d481b4d7fdaefe66bba7100 /drivers/media/dvb/ttpci
parent9b54464f16ae4f0a7ce14f384294ddb30c203a21 (diff)
[media] budget-patch: 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/ttpci')
-rw-r--r--drivers/media/dvb/ttpci/budget-patch.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/drivers/media/dvb/ttpci/budget-patch.c b/drivers/media/dvb/ttpci/budget-patch.c
index 3395d1a90516..4485cccf004e 100644
--- a/drivers/media/dvb/ttpci/budget-patch.c
+++ b/drivers/media/dvb/ttpci/budget-patch.c
@@ -263,17 +263,23 @@ static int budget_patch_diseqc_send_burst(struct dvb_frontend* fe, fe_sec_mini_c
263 263
264static int alps_bsrv2_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend_parameters* params) 264static int alps_bsrv2_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend_parameters* params)
265{ 265{
266 struct dtv_frontend_properties *p = &fe->dtv_property_cache;
266 struct budget_patch* budget = (struct budget_patch*) fe->dvb->priv; 267 struct budget_patch* budget = (struct budget_patch*) fe->dvb->priv;
267 u8 pwr = 0; 268 u8 pwr = 0;
268 u8 buf[4]; 269 u8 buf[4];
269 struct i2c_msg msg = { .addr = 0x61, .flags = 0, .buf = buf, .len = sizeof(buf) }; 270 struct i2c_msg msg = { .addr = 0x61, .flags = 0, .buf = buf, .len = sizeof(buf) };
270 u32 div = (params->frequency + 479500) / 125; 271 u32 div = (p->frequency + 479500) / 125;
271 272
272 if (params->frequency > 2000000) pwr = 3; 273 if (p->frequency > 2000000)
273 else if (params->frequency > 1800000) pwr = 2; 274 pwr = 3;
274 else if (params->frequency > 1600000) pwr = 1; 275 else if (p->frequency > 1800000)
275 else if (params->frequency > 1200000) pwr = 0; 276 pwr = 2;
276 else if (params->frequency >= 1100000) pwr = 1; 277 else if (p->frequency > 1600000)
278 pwr = 1;
279 else if (p->frequency > 1200000)
280 pwr = 0;
281 else if (p->frequency >= 1100000)
282 pwr = 1;
277 else pwr = 2; 283 else pwr = 2;
278 284
279 buf[0] = (div >> 8) & 0x7f; 285 buf[0] = (div >> 8) & 0x7f;
@@ -299,12 +305,13 @@ static struct ves1x93_config alps_bsrv2_config = {
299 305
300static int grundig_29504_451_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend_parameters* params) 306static int grundig_29504_451_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend_parameters* params)
301{ 307{
308 struct dtv_frontend_properties *p = &fe->dtv_property_cache;
302 struct budget_patch* budget = (struct budget_patch*) fe->dvb->priv; 309 struct budget_patch* budget = (struct budget_patch*) fe->dvb->priv;
303 u32 div; 310 u32 div;
304 u8 data[4]; 311 u8 data[4];
305 struct i2c_msg msg = { .addr = 0x61, .flags = 0, .buf = data, .len = sizeof(data) }; 312 struct i2c_msg msg = { .addr = 0x61, .flags = 0, .buf = data, .len = sizeof(data) };
306 313
307 div = params->frequency / 125; 314 div = p->frequency / 125;
308 data[0] = (div >> 8) & 0x7f; 315 data[0] = (div >> 8) & 0x7f;
309 data[1] = div & 0xff; 316 data[1] = div & 0xff;
310 data[2] = 0x8e; 317 data[2] = 0x8e;