Commit 5d7802b2617d785ea0b8631b0605defc19ee6561

Authored by Michael Krufky
Committed by Mauro Carvalho Chehab
1 parent f438d97447

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>

Showing 1 changed file with 23 additions and 13 deletions Side-by-side Diff

drivers/media/dvb/frontends/dvb-pll.c
... ... @@ -29,7 +29,8 @@
29 29 u32 min;
30 30 u32 max;
31 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 34 u8 *initdata;
34 35 u8 *sleepdata;
35 36 int count;
... ... @@ -89,7 +90,7 @@
89 90 },
90 91 };
91 92  
92   -static void thomson_dtt759x_bw(u8 *buf,
  93 +static void thomson_dtt759x_bw(struct dvb_frontend *fe, u8 *buf,
93 94 const struct dvb_frontend_parameters *params)
94 95 {
95 96 if (BANDWIDTH_7_MHZ == params->u.ofdm.bandwidth)
... ... @@ -210,7 +211,8 @@
210 211 /* Philips TDA6650/TDA6651
211 212 * used in Panasonic ENV77H11D5
212 213 */
213   -static void tda665x_bw(u8 *buf, const struct dvb_frontend_parameters *params)
  214 +static void tda665x_bw(struct dvb_frontend *fe, u8 *buf,
  215 + const struct dvb_frontend_parameters *params)
214 216 {
215 217 if (params->u.ofdm.bandwidth == BANDWIDTH_8_MHZ)
216 218 buf[3] |= 0x08;
... ... @@ -243,7 +245,8 @@
243 245 /* Infineon TUA6034
244 246 * used in LG TDTP E102P
245 247 */
246   -static void tua6034_bw(u8 *buf, const struct dvb_frontend_parameters *params)
  248 +static void tua6034_bw(struct dvb_frontend *fe, u8 *buf,
  249 + const struct dvb_frontend_parameters *params)
247 250 {
248 251 if (BANDWIDTH_7_MHZ != params->u.ofdm.bandwidth)
249 252 buf[3] |= 0x08;
... ... @@ -283,7 +286,8 @@
283 286 /* Philips FMD1216ME
284 287 * used in Medion Hybrid PCMCIA card and USB Box
285 288 */
286   -static void fmd1216me_bw(u8 *buf, const struct dvb_frontend_parameters *params)
  289 +static void fmd1216me_bw(struct dvb_frontend *fe, u8 *buf,
  290 + const struct dvb_frontend_parameters *params)
287 291 {
288 292 if (params->u.ofdm.bandwidth == BANDWIDTH_8_MHZ &&
289 293 params->frequency >= 158870000)
... ... @@ -313,7 +317,8 @@
313 317 /* ALPS TDED4
314 318 * used in Nebula-Cards and USB boxes
315 319 */
316   -static void tded4_bw(u8 *buf, const struct dvb_frontend_parameters *params)
  320 +static void tded4_bw(struct dvb_frontend *fe, u8 *buf,
  321 + const struct dvb_frontend_parameters *params)
317 322 {
318 323 if (params->u.ofdm.bandwidth == BANDWIDTH_8_MHZ)
319 324 buf[3] |= 0x04;
... ... @@ -354,7 +359,8 @@
354 359 /* Philips TUV1236D
355 360 * used in ATI HDTV Wonder
356 361 */
357   -static void tuv1236d_rf(u8 *buf, const struct dvb_frontend_parameters *params)
  362 +static void tuv1236d_rf(struct dvb_frontend *fe, u8 *buf,
  363 + const struct dvb_frontend_parameters *params)
358 364 {
359 365 switch (params->u.vsb.modulation) {
360 366 case QAM_64:
... ... @@ -420,7 +426,8 @@
420 426 /*
421 427 * Philips TD1316 Tuner.
422 428 */
423   -static void td1316_bw(u8 *buf, const struct dvb_frontend_parameters *params)
  429 +static void td1316_bw(struct dvb_frontend *fe, u8 *buf,
  430 + const struct dvb_frontend_parameters *params)
424 431 {
425 432 u8 band;
426 433  
... ... @@ -474,7 +481,8 @@
474 481 }
475 482 };
476 483  
477   -static void opera1_bw(u8 *buf, const struct dvb_frontend_parameters *params)
  484 +static void opera1_bw(struct dvb_frontend *fe, u8 *buf,
  485 + const struct dvb_frontend_parameters *params)
478 486 {
479 487 if (params->u.ofdm.bandwidth == BANDWIDTH_8_MHZ)
480 488 buf[2] |= 0x08;
481 489  
... ... @@ -567,9 +575,11 @@
567 575 module_param(debug, int, 0644);
568 576 MODULE_PARM_DESC(debug, "enable verbose debug messages");
569 577  
570   -static int dvb_pll_configure(struct dvb_pll_desc *desc, u8 *buf,
  578 +static int dvb_pll_configure(struct dvb_frontend *fe, u8 *buf,
571 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 583 u32 div;
574 584 int i;
575 585  
... ... @@ -597,7 +607,7 @@
597 607 buf[3] = desc->entries[i].cb;
598 608  
599 609 if (desc->set)
600   - desc->set(buf, params);
  610 + desc->set(fe, buf, params);
601 611  
602 612 if (debug)
603 613 printk("pll: %s: div=%d | buf=0x%02x,0x%02x,0x%02x,0x%02x\n",
... ... @@ -654,7 +664,7 @@
654 664 if (priv->i2c == NULL)
655 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 668 return result;
659 669 else
660 670 frequency = result;
... ... @@ -682,7 +692,7 @@
682 692 if (buf_len < 5)
683 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 696 return result;
687 697 else
688 698 frequency = result;