aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@linuxtv.org>2007-09-07 17:03:58 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-10-09 21:14:45 -0400
commit5d7802b2617d785ea0b8631b0605defc19ee6561 (patch)
treeeafd32220d566e21629c85c1b60079aeecbecd8c /drivers/media/dvb
parentf438d97447d4ccd241db8477f62a0647b9e8220e (diff)
V4L/DVB (6226): dvb-pll: pass fe pointer into dvb_pll_configure() and set() functions
The pll-specific set() function will need access to the dvb_pll_priv structure for new functionality. This patch gives access to this structure to the required functions. Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/dvb')
-rw-r--r--drivers/media/dvb/frontends/dvb-pll.c36
1 files changed, 23 insertions, 13 deletions
diff --git a/drivers/media/dvb/frontends/dvb-pll.c b/drivers/media/dvb/frontends/dvb-pll.c
index 11f7d5939bd9..59ae4ece65ab 100644
--- a/drivers/media/dvb/frontends/dvb-pll.c
+++ b/drivers/media/dvb/frontends/dvb-pll.c
@@ -29,7 +29,8 @@ struct dvb_pll_desc {
29 u32 min; 29 u32 min;
30 u32 max; 30 u32 max;
31 u32 iffreq; 31 u32 iffreq;
32 void (*set)(u8 *buf, const struct dvb_frontend_parameters *params); 32 void (*set)(struct dvb_frontend *fe, u8 *buf,
33 const struct dvb_frontend_parameters *params);
33 u8 *initdata; 34 u8 *initdata;
34 u8 *sleepdata; 35 u8 *sleepdata;
35 int count; 36 int count;
@@ -89,7 +90,7 @@ static struct dvb_pll_desc dvb_pll_thomson_dtt7610 = {
89 }, 90 },
90}; 91};
91 92
92static void thomson_dtt759x_bw(u8 *buf, 93static void thomson_dtt759x_bw(struct dvb_frontend *fe, u8 *buf,
93 const struct dvb_frontend_parameters *params) 94 const struct dvb_frontend_parameters *params)
94{ 95{
95 if (BANDWIDTH_7_MHZ == params->u.ofdm.bandwidth) 96 if (BANDWIDTH_7_MHZ == params->u.ofdm.bandwidth)
@@ -210,7 +211,8 @@ static struct dvb_pll_desc dvb_pll_env57h1xd5 = {
210/* Philips TDA6650/TDA6651 211/* Philips TDA6650/TDA6651
211 * used in Panasonic ENV77H11D5 212 * used in Panasonic ENV77H11D5
212 */ 213 */
213static void tda665x_bw(u8 *buf, const struct dvb_frontend_parameters *params) 214static void tda665x_bw(struct dvb_frontend *fe, u8 *buf,
215 const struct dvb_frontend_parameters *params)
214{ 216{
215 if (params->u.ofdm.bandwidth == BANDWIDTH_8_MHZ) 217 if (params->u.ofdm.bandwidth == BANDWIDTH_8_MHZ)
216 buf[3] |= 0x08; 218 buf[3] |= 0x08;
@@ -243,7 +245,8 @@ static struct dvb_pll_desc dvb_pll_tda665x = {
243/* Infineon TUA6034 245/* Infineon TUA6034
244 * used in LG TDTP E102P 246 * used in LG TDTP E102P
245 */ 247 */
246static void tua6034_bw(u8 *buf, const struct dvb_frontend_parameters *params) 248static void tua6034_bw(struct dvb_frontend *fe, u8 *buf,
249 const struct dvb_frontend_parameters *params)
247{ 250{
248 if (BANDWIDTH_7_MHZ != params->u.ofdm.bandwidth) 251 if (BANDWIDTH_7_MHZ != params->u.ofdm.bandwidth)
249 buf[3] |= 0x08; 252 buf[3] |= 0x08;
@@ -283,7 +286,8 @@ static struct dvb_pll_desc dvb_pll_lg_tdvs_h06xf = {
283/* Philips FMD1216ME 286/* Philips FMD1216ME
284 * used in Medion Hybrid PCMCIA card and USB Box 287 * used in Medion Hybrid PCMCIA card and USB Box
285 */ 288 */
286static void fmd1216me_bw(u8 *buf, const struct dvb_frontend_parameters *params) 289static void fmd1216me_bw(struct dvb_frontend *fe, u8 *buf,
290 const struct dvb_frontend_parameters *params)
287{ 291{
288 if (params->u.ofdm.bandwidth == BANDWIDTH_8_MHZ && 292 if (params->u.ofdm.bandwidth == BANDWIDTH_8_MHZ &&
289 params->frequency >= 158870000) 293 params->frequency >= 158870000)
@@ -313,7 +317,8 @@ static struct dvb_pll_desc dvb_pll_fmd1216me = {
313/* ALPS TDED4 317/* ALPS TDED4
314 * used in Nebula-Cards and USB boxes 318 * used in Nebula-Cards and USB boxes
315 */ 319 */
316static void tded4_bw(u8 *buf, const struct dvb_frontend_parameters *params) 320static void tded4_bw(struct dvb_frontend *fe, u8 *buf,
321 const struct dvb_frontend_parameters *params)
317{ 322{
318 if (params->u.ofdm.bandwidth == BANDWIDTH_8_MHZ) 323 if (params->u.ofdm.bandwidth == BANDWIDTH_8_MHZ)
319 buf[3] |= 0x04; 324 buf[3] |= 0x04;
@@ -354,7 +359,8 @@ static struct dvb_pll_desc dvb_pll_tdhu2 = {
354/* Philips TUV1236D 359/* Philips TUV1236D
355 * used in ATI HDTV Wonder 360 * used in ATI HDTV Wonder
356 */ 361 */
357static void tuv1236d_rf(u8 *buf, const struct dvb_frontend_parameters *params) 362static void tuv1236d_rf(struct dvb_frontend *fe, u8 *buf,
363 const struct dvb_frontend_parameters *params)
358{ 364{
359 switch (params->u.vsb.modulation) { 365 switch (params->u.vsb.modulation) {
360 case QAM_64: 366 case QAM_64:
@@ -420,7 +426,8 @@ static struct dvb_pll_desc dvb_pll_philips_sd1878_tda8261 = {
420/* 426/*
421 * Philips TD1316 Tuner. 427 * Philips TD1316 Tuner.
422 */ 428 */
423static void td1316_bw(u8 *buf, const struct dvb_frontend_parameters *params) 429static void td1316_bw(struct dvb_frontend *fe, u8 *buf,
430 const struct dvb_frontend_parameters *params)
424{ 431{
425 u8 band; 432 u8 band;
426 433
@@ -474,7 +481,8 @@ static struct dvb_pll_desc dvb_pll_thomson_fe6600 = {
474 } 481 }
475}; 482};
476 483
477static void opera1_bw(u8 *buf, const struct dvb_frontend_parameters *params) 484static void opera1_bw(struct dvb_frontend *fe, u8 *buf,
485 const struct dvb_frontend_parameters *params)
478{ 486{
479 if (params->u.ofdm.bandwidth == BANDWIDTH_8_MHZ) 487 if (params->u.ofdm.bandwidth == BANDWIDTH_8_MHZ)
480 buf[2] |= 0x08; 488 buf[2] |= 0x08;
@@ -567,9 +575,11 @@ static int debug = 0;
567module_param(debug, int, 0644); 575module_param(debug, int, 0644);
568MODULE_PARM_DESC(debug, "enable verbose debug messages"); 576MODULE_PARM_DESC(debug, "enable verbose debug messages");
569 577
570static int dvb_pll_configure(struct dvb_pll_desc *desc, u8 *buf, 578static int dvb_pll_configure(struct dvb_frontend *fe, u8 *buf,
571 const struct dvb_frontend_parameters *params) 579 const struct dvb_frontend_parameters *params)
572{ 580{
581 struct dvb_pll_priv *priv = fe->tuner_priv;
582 struct dvb_pll_desc *desc = priv->pll_desc;
573 u32 div; 583 u32 div;
574 int i; 584 int i;
575 585
@@ -597,7 +607,7 @@ static int dvb_pll_configure(struct dvb_pll_desc *desc, u8 *buf,
597 buf[3] = desc->entries[i].cb; 607 buf[3] = desc->entries[i].cb;
598 608
599 if (desc->set) 609 if (desc->set)
600 desc->set(buf, params); 610 desc->set(fe, buf, params);
601 611
602 if (debug) 612 if (debug)
603 printk("pll: %s: div=%d | buf=0x%02x,0x%02x,0x%02x,0x%02x\n", 613 printk("pll: %s: div=%d | buf=0x%02x,0x%02x,0x%02x,0x%02x\n",
@@ -654,7 +664,7 @@ static int dvb_pll_set_params(struct dvb_frontend *fe,
654 if (priv->i2c == NULL) 664 if (priv->i2c == NULL)
655 return -EINVAL; 665 return -EINVAL;
656 666
657 if ((result = dvb_pll_configure(priv->pll_desc, buf, params)) < 0) 667 if ((result = dvb_pll_configure(fe, buf, params)) < 0)
658 return result; 668 return result;
659 else 669 else
660 frequency = result; 670 frequency = result;
@@ -682,7 +692,7 @@ static int dvb_pll_calc_regs(struct dvb_frontend *fe,
682 if (buf_len < 5) 692 if (buf_len < 5)
683 return -EINVAL; 693 return -EINVAL;
684 694
685 if ((result = dvb_pll_configure(priv->pll_desc, buf+1, params)) < 0) 695 if ((result = dvb_pll_configure(fe, buf+1, params)) < 0)
686 return result; 696 return result;
687 else 697 else
688 frequency = result; 698 frequency = result;