aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew de Quincey <adq_dvb@lidskialf.net>2006-04-18 16:47:11 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-06-25 00:59:06 -0400
commit2d15fd2f01fc76dc6856a5c551e32e4510f2b492 (patch)
treefa79693219375d724b84f39ca7c3bc5d914eb3f8
parente87d41c4952ceef7a9f760f38f9343d015279662 (diff)
V4L/DVB (3878): Convert ttpci/budget-patch to refactored tuner code
Rename pll calls to appropriate tuner calls. Remove pll functions from demod structures. Hook tuner call into tuner_ops. Add pll gate control calls where appropriate. Signed-off-by: Andrew de Quincey <adq_dvb@lidskialf.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r--drivers/media/dvb/ttpci/budget-patch.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/drivers/media/dvb/ttpci/budget-patch.c b/drivers/media/dvb/ttpci/budget-patch.c
index 1b3aaac5e763..3515f524176a 100644
--- a/drivers/media/dvb/ttpci/budget-patch.c
+++ b/drivers/media/dvb/ttpci/budget-patch.c
@@ -258,7 +258,7 @@ static int budget_patch_diseqc_send_burst(struct dvb_frontend* fe, fe_sec_mini_c
258 return 0; 258 return 0;
259} 259}
260 260
261static int alps_bsrv2_pll_set(struct dvb_frontend* fe, struct dvb_frontend_parameters* params) 261static int alps_bsrv2_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend_parameters* params)
262{ 262{
263 struct budget_patch* budget = (struct budget_patch*) fe->dvb->priv; 263 struct budget_patch* budget = (struct budget_patch*) fe->dvb->priv;
264 u8 pwr = 0; 264 u8 pwr = 0;
@@ -281,7 +281,10 @@ static int alps_bsrv2_pll_set(struct dvb_frontend* fe, struct dvb_frontend_param
281 // NOTE: since we're using a prescaler of 2, we set the 281 // NOTE: since we're using a prescaler of 2, we set the
282 // divisor frequency to 62.5kHz and divide by 125 above 282 // divisor frequency to 62.5kHz and divide by 125 above
283 283
284 if (i2c_transfer (&budget->i2c_adap, &msg, 1) != 1) return -EIO; 284 if (fe->ops->i2c_gate_ctrl)
285 fe->ops->i2c_gate_ctrl(fe, 1);
286 if (i2c_transfer (&budget->i2c_adap, &msg, 1) != 1)
287 return -EIO;
285 return 0; 288 return 0;
286} 289}
287 290
@@ -289,10 +292,9 @@ static struct ves1x93_config alps_bsrv2_config = {
289 .demod_address = 0x08, 292 .demod_address = 0x08,
290 .xin = 90100000UL, 293 .xin = 90100000UL,
291 .invert_pwm = 0, 294 .invert_pwm = 0,
292 .pll_set = alps_bsrv2_pll_set,
293}; 295};
294 296
295static int grundig_29504_451_pll_set(struct dvb_frontend* fe, struct dvb_frontend_parameters* params) 297static int grundig_29504_451_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend_parameters* params)
296{ 298{
297 struct budget_patch* budget = (struct budget_patch*) fe->dvb->priv; 299 struct budget_patch* budget = (struct budget_patch*) fe->dvb->priv;
298 u32 div; 300 u32 div;
@@ -305,13 +307,15 @@ static int grundig_29504_451_pll_set(struct dvb_frontend* fe, struct dvb_fronten
305 data[2] = 0x8e; 307 data[2] = 0x8e;
306 data[3] = 0x00; 308 data[3] = 0x00;
307 309
308 if (i2c_transfer (&budget->i2c_adap, &msg, 1) != 1) return -EIO; 310 if (fe->ops->i2c_gate_ctrl)
311 fe->ops->i2c_gate_ctrl(fe, 1);
312 if (i2c_transfer (&budget->i2c_adap, &msg, 1) != 1)
313 return -EIO;
309 return 0; 314 return 0;
310} 315}
311 316
312static struct tda8083_config grundig_29504_451_config = { 317static struct tda8083_config grundig_29504_451_config = {
313 .demod_address = 0x68, 318 .demod_address = 0x68,
314 .pll_set = grundig_29504_451_pll_set,
315}; 319};
316 320
317static void frontend_init(struct budget_patch* budget) 321static void frontend_init(struct budget_patch* budget)
@@ -323,6 +327,7 @@ static void frontend_init(struct budget_patch* budget)
323 // try the ALPS BSRV2 first of all 327 // try the ALPS BSRV2 first of all
324 budget->dvb_frontend = ves1x93_attach(&alps_bsrv2_config, &budget->i2c_adap); 328 budget->dvb_frontend = ves1x93_attach(&alps_bsrv2_config, &budget->i2c_adap);
325 if (budget->dvb_frontend) { 329 if (budget->dvb_frontend) {
330 budget->dvb_frontend->ops->tuner_ops.set_params = alps_bsrv2_tuner_set_params;
326 budget->dvb_frontend->ops->diseqc_send_master_cmd = budget_patch_diseqc_send_master_cmd; 331 budget->dvb_frontend->ops->diseqc_send_master_cmd = budget_patch_diseqc_send_master_cmd;
327 budget->dvb_frontend->ops->diseqc_send_burst = budget_patch_diseqc_send_burst; 332 budget->dvb_frontend->ops->diseqc_send_burst = budget_patch_diseqc_send_burst;
328 budget->dvb_frontend->ops->set_tone = budget_patch_set_tone; 333 budget->dvb_frontend->ops->set_tone = budget_patch_set_tone;
@@ -332,6 +337,9 @@ static void frontend_init(struct budget_patch* budget)
332 // try the ALPS BSRU6 now 337 // try the ALPS BSRU6 now
333 budget->dvb_frontend = stv0299_attach(&alps_bsru6_config, &budget->i2c_adap); 338 budget->dvb_frontend = stv0299_attach(&alps_bsru6_config, &budget->i2c_adap);
334 if (budget->dvb_frontend) { 339 if (budget->dvb_frontend) {
340 budget->dvb_frontend->ops->tuner_ops.set_params = alps_bsru6_tuner_set_params;
341 budget->dvb_frontend->tuner_priv = &budget->i2c_adap;
342
335 budget->dvb_frontend->ops->diseqc_send_master_cmd = budget_diseqc_send_master_cmd; 343 budget->dvb_frontend->ops->diseqc_send_master_cmd = budget_diseqc_send_master_cmd;
336 budget->dvb_frontend->ops->diseqc_send_burst = budget_diseqc_send_burst; 344 budget->dvb_frontend->ops->diseqc_send_burst = budget_diseqc_send_burst;
337 budget->dvb_frontend->ops->set_tone = budget_set_tone; 345 budget->dvb_frontend->ops->set_tone = budget_set_tone;
@@ -341,6 +349,7 @@ static void frontend_init(struct budget_patch* budget)
341 // Try the grundig 29504-451 349 // Try the grundig 29504-451
342 budget->dvb_frontend = tda8083_attach(&grundig_29504_451_config, &budget->i2c_adap); 350 budget->dvb_frontend = tda8083_attach(&grundig_29504_451_config, &budget->i2c_adap);
343 if (budget->dvb_frontend) { 351 if (budget->dvb_frontend) {
352 budget->dvb_frontend->ops->tuner_ops.set_params = grundig_29504_451_tuner_set_params;
344 budget->dvb_frontend->ops->diseqc_send_master_cmd = budget_diseqc_send_master_cmd; 353 budget->dvb_frontend->ops->diseqc_send_master_cmd = budget_diseqc_send_master_cmd;
345 budget->dvb_frontend->ops->diseqc_send_burst = budget_diseqc_send_burst; 354 budget->dvb_frontend->ops->diseqc_send_burst = budget_diseqc_send_burst;
346 budget->dvb_frontend->ops->set_tone = budget_set_tone; 355 budget->dvb_frontend->ops->set_tone = budget_set_tone;