diff options
-rw-r--r-- | drivers/media/usb/dvb-usb-v2/rtl28xxu.c | 238 | ||||
-rw-r--r-- | drivers/media/usb/dvb-usb-v2/rtl28xxu.h | 2 |
2 files changed, 120 insertions, 120 deletions
diff --git a/drivers/media/usb/dvb-usb-v2/rtl28xxu.c b/drivers/media/usb/dvb-usb-v2/rtl28xxu.c index 27cf3419d4f1..57afcbabadef 100644 --- a/drivers/media/usb/dvb-usb-v2/rtl28xxu.c +++ b/drivers/media/usb/dvb-usb-v2/rtl28xxu.c | |||
@@ -147,7 +147,7 @@ static int rtl28xxu_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[], | |||
147 | { | 147 | { |
148 | int ret; | 148 | int ret; |
149 | struct dvb_usb_device *d = i2c_get_adapdata(adap); | 149 | struct dvb_usb_device *d = i2c_get_adapdata(adap); |
150 | struct rtl28xxu_priv *priv = d->priv; | 150 | struct rtl28xxu_dev *dev = d->priv; |
151 | struct rtl28xxu_req req; | 151 | struct rtl28xxu_req req; |
152 | 152 | ||
153 | /* | 153 | /* |
@@ -184,7 +184,7 @@ static int rtl28xxu_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[], | |||
184 | } else if (msg[0].addr == 0x10) { | 184 | } else if (msg[0].addr == 0x10) { |
185 | /* method 1 - integrated demod */ | 185 | /* method 1 - integrated demod */ |
186 | req.value = (msg[0].buf[0] << 8) | (msg[0].addr << 1); | 186 | req.value = (msg[0].buf[0] << 8) | (msg[0].addr << 1); |
187 | req.index = CMD_DEMOD_RD | priv->page; | 187 | req.index = CMD_DEMOD_RD | dev->page; |
188 | req.size = msg[1].len; | 188 | req.size = msg[1].len; |
189 | req.data = &msg[1].buf[0]; | 189 | req.data = &msg[1].buf[0]; |
190 | ret = rtl28xxu_ctrl_msg(d, &req); | 190 | ret = rtl28xxu_ctrl_msg(d, &req); |
@@ -220,12 +220,12 @@ static int rtl28xxu_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[], | |||
220 | /* method 1 - integrated demod */ | 220 | /* method 1 - integrated demod */ |
221 | if (msg[0].buf[0] == 0x00) { | 221 | if (msg[0].buf[0] == 0x00) { |
222 | /* save demod page for later demod access */ | 222 | /* save demod page for later demod access */ |
223 | priv->page = msg[0].buf[1]; | 223 | dev->page = msg[0].buf[1]; |
224 | ret = 0; | 224 | ret = 0; |
225 | } else { | 225 | } else { |
226 | req.value = (msg[0].buf[0] << 8) | | 226 | req.value = (msg[0].buf[0] << 8) | |
227 | (msg[0].addr << 1); | 227 | (msg[0].addr << 1); |
228 | req.index = CMD_DEMOD_WR | priv->page; | 228 | req.index = CMD_DEMOD_WR | dev->page; |
229 | req.size = msg[0].len-1; | 229 | req.size = msg[0].len-1; |
230 | req.data = &msg[0].buf[1]; | 230 | req.data = &msg[0].buf[1]; |
231 | ret = rtl28xxu_ctrl_msg(d, &req); | 231 | ret = rtl28xxu_ctrl_msg(d, &req); |
@@ -267,7 +267,7 @@ static struct i2c_algorithm rtl28xxu_i2c_algo = { | |||
267 | 267 | ||
268 | static int rtl2831u_read_config(struct dvb_usb_device *d) | 268 | static int rtl2831u_read_config(struct dvb_usb_device *d) |
269 | { | 269 | { |
270 | struct rtl28xxu_priv *priv = d_to_priv(d); | 270 | struct rtl28xxu_dev *dev = d_to_priv(d); |
271 | int ret; | 271 | int ret; |
272 | u8 buf[1]; | 272 | u8 buf[1]; |
273 | /* open RTL2831U/RTL2830 I2C gate */ | 273 | /* open RTL2831U/RTL2830 I2C gate */ |
@@ -304,7 +304,7 @@ static int rtl2831u_read_config(struct dvb_usb_device *d) | |||
304 | /* demod needs some time to wake up */ | 304 | /* demod needs some time to wake up */ |
305 | msleep(20); | 305 | msleep(20); |
306 | 306 | ||
307 | priv->tuner_name = "NONE"; | 307 | dev->tuner_name = "NONE"; |
308 | 308 | ||
309 | /* open demod I2C gate */ | 309 | /* open demod I2C gate */ |
310 | ret = rtl28xxu_ctrl_msg(d, &req_gate_open); | 310 | ret = rtl28xxu_ctrl_msg(d, &req_gate_open); |
@@ -314,8 +314,8 @@ static int rtl2831u_read_config(struct dvb_usb_device *d) | |||
314 | /* check QT1010 ID(?) register; reg=0f val=2c */ | 314 | /* check QT1010 ID(?) register; reg=0f val=2c */ |
315 | ret = rtl28xxu_ctrl_msg(d, &req_qt1010); | 315 | ret = rtl28xxu_ctrl_msg(d, &req_qt1010); |
316 | if (ret == 0 && buf[0] == 0x2c) { | 316 | if (ret == 0 && buf[0] == 0x2c) { |
317 | priv->tuner = TUNER_RTL2830_QT1010; | 317 | dev->tuner = TUNER_RTL2830_QT1010; |
318 | priv->tuner_name = "QT1010"; | 318 | dev->tuner_name = "QT1010"; |
319 | goto found; | 319 | goto found; |
320 | } | 320 | } |
321 | 321 | ||
@@ -327,18 +327,18 @@ static int rtl2831u_read_config(struct dvb_usb_device *d) | |||
327 | /* check MT2060 ID register; reg=00 val=63 */ | 327 | /* check MT2060 ID register; reg=00 val=63 */ |
328 | ret = rtl28xxu_ctrl_msg(d, &req_mt2060); | 328 | ret = rtl28xxu_ctrl_msg(d, &req_mt2060); |
329 | if (ret == 0 && buf[0] == 0x63) { | 329 | if (ret == 0 && buf[0] == 0x63) { |
330 | priv->tuner = TUNER_RTL2830_MT2060; | 330 | dev->tuner = TUNER_RTL2830_MT2060; |
331 | priv->tuner_name = "MT2060"; | 331 | dev->tuner_name = "MT2060"; |
332 | goto found; | 332 | goto found; |
333 | } | 333 | } |
334 | 334 | ||
335 | /* assume MXL5005S */ | 335 | /* assume MXL5005S */ |
336 | priv->tuner = TUNER_RTL2830_MXL5005S; | 336 | dev->tuner = TUNER_RTL2830_MXL5005S; |
337 | priv->tuner_name = "MXL5005S"; | 337 | dev->tuner_name = "MXL5005S"; |
338 | goto found; | 338 | goto found; |
339 | 339 | ||
340 | found: | 340 | found: |
341 | dev_dbg(&d->udev->dev, "%s: tuner=%s\n", __func__, priv->tuner_name); | 341 | dev_dbg(&d->udev->dev, "%s: tuner=%s\n", __func__, dev->tuner_name); |
342 | 342 | ||
343 | return 0; | 343 | return 0; |
344 | err: | 344 | err: |
@@ -348,7 +348,7 @@ err: | |||
348 | 348 | ||
349 | static int rtl2832u_read_config(struct dvb_usb_device *d) | 349 | static int rtl2832u_read_config(struct dvb_usb_device *d) |
350 | { | 350 | { |
351 | struct rtl28xxu_priv *priv = d_to_priv(d); | 351 | struct rtl28xxu_dev *dev = d_to_priv(d); |
352 | int ret; | 352 | int ret; |
353 | u8 buf[2]; | 353 | u8 buf[2]; |
354 | /* open RTL2832U/RTL2832 I2C gate */ | 354 | /* open RTL2832U/RTL2832 I2C gate */ |
@@ -392,109 +392,109 @@ static int rtl2832u_read_config(struct dvb_usb_device *d) | |||
392 | if (ret) | 392 | if (ret) |
393 | goto err; | 393 | goto err; |
394 | 394 | ||
395 | priv->tuner_name = "NONE"; | 395 | dev->tuner_name = "NONE"; |
396 | 396 | ||
397 | /* check FC0012 ID register; reg=00 val=a1 */ | 397 | /* check FC0012 ID register; reg=00 val=a1 */ |
398 | ret = rtl28xxu_ctrl_msg(d, &req_fc0012); | 398 | ret = rtl28xxu_ctrl_msg(d, &req_fc0012); |
399 | if (ret == 0 && buf[0] == 0xa1) { | 399 | if (ret == 0 && buf[0] == 0xa1) { |
400 | priv->tuner = TUNER_RTL2832_FC0012; | 400 | dev->tuner = TUNER_RTL2832_FC0012; |
401 | priv->tuner_name = "FC0012"; | 401 | dev->tuner_name = "FC0012"; |
402 | goto tuner_found; | 402 | goto tuner_found; |
403 | } | 403 | } |
404 | 404 | ||
405 | /* check FC0013 ID register; reg=00 val=a3 */ | 405 | /* check FC0013 ID register; reg=00 val=a3 */ |
406 | ret = rtl28xxu_ctrl_msg(d, &req_fc0013); | 406 | ret = rtl28xxu_ctrl_msg(d, &req_fc0013); |
407 | if (ret == 0 && buf[0] == 0xa3) { | 407 | if (ret == 0 && buf[0] == 0xa3) { |
408 | priv->tuner = TUNER_RTL2832_FC0013; | 408 | dev->tuner = TUNER_RTL2832_FC0013; |
409 | priv->tuner_name = "FC0013"; | 409 | dev->tuner_name = "FC0013"; |
410 | goto tuner_found; | 410 | goto tuner_found; |
411 | } | 411 | } |
412 | 412 | ||
413 | /* check MT2266 ID register; reg=00 val=85 */ | 413 | /* check MT2266 ID register; reg=00 val=85 */ |
414 | ret = rtl28xxu_ctrl_msg(d, &req_mt2266); | 414 | ret = rtl28xxu_ctrl_msg(d, &req_mt2266); |
415 | if (ret == 0 && buf[0] == 0x85) { | 415 | if (ret == 0 && buf[0] == 0x85) { |
416 | priv->tuner = TUNER_RTL2832_MT2266; | 416 | dev->tuner = TUNER_RTL2832_MT2266; |
417 | priv->tuner_name = "MT2266"; | 417 | dev->tuner_name = "MT2266"; |
418 | goto tuner_found; | 418 | goto tuner_found; |
419 | } | 419 | } |
420 | 420 | ||
421 | /* check FC2580 ID register; reg=01 val=56 */ | 421 | /* check FC2580 ID register; reg=01 val=56 */ |
422 | ret = rtl28xxu_ctrl_msg(d, &req_fc2580); | 422 | ret = rtl28xxu_ctrl_msg(d, &req_fc2580); |
423 | if (ret == 0 && buf[0] == 0x56) { | 423 | if (ret == 0 && buf[0] == 0x56) { |
424 | priv->tuner = TUNER_RTL2832_FC2580; | 424 | dev->tuner = TUNER_RTL2832_FC2580; |
425 | priv->tuner_name = "FC2580"; | 425 | dev->tuner_name = "FC2580"; |
426 | goto tuner_found; | 426 | goto tuner_found; |
427 | } | 427 | } |
428 | 428 | ||
429 | /* check MT2063 ID register; reg=00 val=9e || 9c */ | 429 | /* check MT2063 ID register; reg=00 val=9e || 9c */ |
430 | ret = rtl28xxu_ctrl_msg(d, &req_mt2063); | 430 | ret = rtl28xxu_ctrl_msg(d, &req_mt2063); |
431 | if (ret == 0 && (buf[0] == 0x9e || buf[0] == 0x9c)) { | 431 | if (ret == 0 && (buf[0] == 0x9e || buf[0] == 0x9c)) { |
432 | priv->tuner = TUNER_RTL2832_MT2063; | 432 | dev->tuner = TUNER_RTL2832_MT2063; |
433 | priv->tuner_name = "MT2063"; | 433 | dev->tuner_name = "MT2063"; |
434 | goto tuner_found; | 434 | goto tuner_found; |
435 | } | 435 | } |
436 | 436 | ||
437 | /* check MAX3543 ID register; reg=00 val=38 */ | 437 | /* check MAX3543 ID register; reg=00 val=38 */ |
438 | ret = rtl28xxu_ctrl_msg(d, &req_max3543); | 438 | ret = rtl28xxu_ctrl_msg(d, &req_max3543); |
439 | if (ret == 0 && buf[0] == 0x38) { | 439 | if (ret == 0 && buf[0] == 0x38) { |
440 | priv->tuner = TUNER_RTL2832_MAX3543; | 440 | dev->tuner = TUNER_RTL2832_MAX3543; |
441 | priv->tuner_name = "MAX3543"; | 441 | dev->tuner_name = "MAX3543"; |
442 | goto tuner_found; | 442 | goto tuner_found; |
443 | } | 443 | } |
444 | 444 | ||
445 | /* check TUA9001 ID register; reg=7e val=2328 */ | 445 | /* check TUA9001 ID register; reg=7e val=2328 */ |
446 | ret = rtl28xxu_ctrl_msg(d, &req_tua9001); | 446 | ret = rtl28xxu_ctrl_msg(d, &req_tua9001); |
447 | if (ret == 0 && buf[0] == 0x23 && buf[1] == 0x28) { | 447 | if (ret == 0 && buf[0] == 0x23 && buf[1] == 0x28) { |
448 | priv->tuner = TUNER_RTL2832_TUA9001; | 448 | dev->tuner = TUNER_RTL2832_TUA9001; |
449 | priv->tuner_name = "TUA9001"; | 449 | dev->tuner_name = "TUA9001"; |
450 | goto tuner_found; | 450 | goto tuner_found; |
451 | } | 451 | } |
452 | 452 | ||
453 | /* check MXL5007R ID register; reg=d9 val=14 */ | 453 | /* check MXL5007R ID register; reg=d9 val=14 */ |
454 | ret = rtl28xxu_ctrl_msg(d, &req_mxl5007t); | 454 | ret = rtl28xxu_ctrl_msg(d, &req_mxl5007t); |
455 | if (ret == 0 && buf[0] == 0x14) { | 455 | if (ret == 0 && buf[0] == 0x14) { |
456 | priv->tuner = TUNER_RTL2832_MXL5007T; | 456 | dev->tuner = TUNER_RTL2832_MXL5007T; |
457 | priv->tuner_name = "MXL5007T"; | 457 | dev->tuner_name = "MXL5007T"; |
458 | goto tuner_found; | 458 | goto tuner_found; |
459 | } | 459 | } |
460 | 460 | ||
461 | /* check E4000 ID register; reg=02 val=40 */ | 461 | /* check E4000 ID register; reg=02 val=40 */ |
462 | ret = rtl28xxu_ctrl_msg(d, &req_e4000); | 462 | ret = rtl28xxu_ctrl_msg(d, &req_e4000); |
463 | if (ret == 0 && buf[0] == 0x40) { | 463 | if (ret == 0 && buf[0] == 0x40) { |
464 | priv->tuner = TUNER_RTL2832_E4000; | 464 | dev->tuner = TUNER_RTL2832_E4000; |
465 | priv->tuner_name = "E4000"; | 465 | dev->tuner_name = "E4000"; |
466 | goto tuner_found; | 466 | goto tuner_found; |
467 | } | 467 | } |
468 | 468 | ||
469 | /* check TDA18272 ID register; reg=00 val=c760 */ | 469 | /* check TDA18272 ID register; reg=00 val=c760 */ |
470 | ret = rtl28xxu_ctrl_msg(d, &req_tda18272); | 470 | ret = rtl28xxu_ctrl_msg(d, &req_tda18272); |
471 | if (ret == 0 && (buf[0] == 0xc7 || buf[1] == 0x60)) { | 471 | if (ret == 0 && (buf[0] == 0xc7 || buf[1] == 0x60)) { |
472 | priv->tuner = TUNER_RTL2832_TDA18272; | 472 | dev->tuner = TUNER_RTL2832_TDA18272; |
473 | priv->tuner_name = "TDA18272"; | 473 | dev->tuner_name = "TDA18272"; |
474 | goto tuner_found; | 474 | goto tuner_found; |
475 | } | 475 | } |
476 | 476 | ||
477 | /* check R820T ID register; reg=00 val=69 */ | 477 | /* check R820T ID register; reg=00 val=69 */ |
478 | ret = rtl28xxu_ctrl_msg(d, &req_r820t); | 478 | ret = rtl28xxu_ctrl_msg(d, &req_r820t); |
479 | if (ret == 0 && buf[0] == 0x69) { | 479 | if (ret == 0 && buf[0] == 0x69) { |
480 | priv->tuner = TUNER_RTL2832_R820T; | 480 | dev->tuner = TUNER_RTL2832_R820T; |
481 | priv->tuner_name = "R820T"; | 481 | dev->tuner_name = "R820T"; |
482 | goto tuner_found; | 482 | goto tuner_found; |
483 | } | 483 | } |
484 | 484 | ||
485 | /* check R828D ID register; reg=00 val=69 */ | 485 | /* check R828D ID register; reg=00 val=69 */ |
486 | ret = rtl28xxu_ctrl_msg(d, &req_r828d); | 486 | ret = rtl28xxu_ctrl_msg(d, &req_r828d); |
487 | if (ret == 0 && buf[0] == 0x69) { | 487 | if (ret == 0 && buf[0] == 0x69) { |
488 | priv->tuner = TUNER_RTL2832_R828D; | 488 | dev->tuner = TUNER_RTL2832_R828D; |
489 | priv->tuner_name = "R828D"; | 489 | dev->tuner_name = "R828D"; |
490 | goto tuner_found; | 490 | goto tuner_found; |
491 | } | 491 | } |
492 | 492 | ||
493 | tuner_found: | 493 | tuner_found: |
494 | dev_dbg(&d->udev->dev, "%s: tuner=%s\n", __func__, priv->tuner_name); | 494 | dev_dbg(&d->udev->dev, "%s: tuner=%s\n", __func__, dev->tuner_name); |
495 | 495 | ||
496 | /* probe slave demod */ | 496 | /* probe slave demod */ |
497 | if (priv->tuner == TUNER_RTL2832_R828D) { | 497 | if (dev->tuner == TUNER_RTL2832_R828D) { |
498 | /* power on MN88472 demod on GPIO0 */ | 498 | /* power on MN88472 demod on GPIO0 */ |
499 | ret = rtl28xx_wr_reg_mask(d, SYS_GPIO_OUT_VAL, 0x01, 0x01); | 499 | ret = rtl28xx_wr_reg_mask(d, SYS_GPIO_OUT_VAL, 0x01, 0x01); |
500 | if (ret) | 500 | if (ret) |
@@ -512,14 +512,14 @@ tuner_found: | |||
512 | ret = rtl28xxu_ctrl_msg(d, &req_mn88472); | 512 | ret = rtl28xxu_ctrl_msg(d, &req_mn88472); |
513 | if (ret == 0 && buf[0] == 0x02) { | 513 | if (ret == 0 && buf[0] == 0x02) { |
514 | dev_dbg(&d->udev->dev, "%s: MN88472 found\n", __func__); | 514 | dev_dbg(&d->udev->dev, "%s: MN88472 found\n", __func__); |
515 | priv->slave_demod = SLAVE_DEMOD_MN88472; | 515 | dev->slave_demod = SLAVE_DEMOD_MN88472; |
516 | goto demod_found; | 516 | goto demod_found; |
517 | } | 517 | } |
518 | 518 | ||
519 | ret = rtl28xxu_ctrl_msg(d, &req_mn88473); | 519 | ret = rtl28xxu_ctrl_msg(d, &req_mn88473); |
520 | if (ret == 0 && buf[0] == 0x03) { | 520 | if (ret == 0 && buf[0] == 0x03) { |
521 | dev_dbg(&d->udev->dev, "%s: MN88473 found\n", __func__); | 521 | dev_dbg(&d->udev->dev, "%s: MN88473 found\n", __func__); |
522 | priv->slave_demod = SLAVE_DEMOD_MN88473; | 522 | dev->slave_demod = SLAVE_DEMOD_MN88473; |
523 | goto demod_found; | 523 | goto demod_found; |
524 | } | 524 | } |
525 | } | 525 | } |
@@ -564,15 +564,15 @@ static const struct rtl2830_platform_data rtl2830_mxl5005s_platform_data = { | |||
564 | static int rtl2831u_frontend_attach(struct dvb_usb_adapter *adap) | 564 | static int rtl2831u_frontend_attach(struct dvb_usb_adapter *adap) |
565 | { | 565 | { |
566 | struct dvb_usb_device *d = adap_to_d(adap); | 566 | struct dvb_usb_device *d = adap_to_d(adap); |
567 | struct rtl28xxu_priv *priv = d_to_priv(d); | 567 | struct rtl28xxu_dev *dev = d_to_priv(d); |
568 | struct rtl2830_platform_data *pdata = &priv->rtl2830_platform_data; | 568 | struct rtl2830_platform_data *pdata = &dev->rtl2830_platform_data; |
569 | struct i2c_board_info board_info; | 569 | struct i2c_board_info board_info; |
570 | struct i2c_client *client; | 570 | struct i2c_client *client; |
571 | int ret; | 571 | int ret; |
572 | 572 | ||
573 | dev_dbg(&d->udev->dev, "%s:\n", __func__); | 573 | dev_dbg(&d->udev->dev, "%s:\n", __func__); |
574 | 574 | ||
575 | switch (priv->tuner) { | 575 | switch (dev->tuner) { |
576 | case TUNER_RTL2830_QT1010: | 576 | case TUNER_RTL2830_QT1010: |
577 | *pdata = rtl2830_qt1010_platform_data; | 577 | *pdata = rtl2830_qt1010_platform_data; |
578 | break; | 578 | break; |
@@ -584,7 +584,7 @@ static int rtl2831u_frontend_attach(struct dvb_usb_adapter *adap) | |||
584 | break; | 584 | break; |
585 | default: | 585 | default: |
586 | dev_err(&d->udev->dev, "%s: unknown tuner=%s\n", | 586 | dev_err(&d->udev->dev, "%s: unknown tuner=%s\n", |
587 | KBUILD_MODNAME, priv->tuner_name); | 587 | KBUILD_MODNAME, dev->tuner_name); |
588 | ret = -ENODEV; | 588 | ret = -ENODEV; |
589 | goto err; | 589 | goto err; |
590 | } | 590 | } |
@@ -608,9 +608,9 @@ static int rtl2831u_frontend_attach(struct dvb_usb_adapter *adap) | |||
608 | } | 608 | } |
609 | 609 | ||
610 | adap->fe[0] = pdata->get_dvb_frontend(client); | 610 | adap->fe[0] = pdata->get_dvb_frontend(client); |
611 | priv->demod_i2c_adapter = pdata->get_i2c_adapter(client); | 611 | dev->demod_i2c_adapter = pdata->get_i2c_adapter(client); |
612 | 612 | ||
613 | priv->i2c_client_demod = client; | 613 | dev->i2c_client_demod = client; |
614 | 614 | ||
615 | return 0; | 615 | return 0; |
616 | err: | 616 | err: |
@@ -728,7 +728,7 @@ static int rtl2832u_frontend_callback(void *adapter_priv, int component, | |||
728 | struct device *parent = adapter->dev.parent; | 728 | struct device *parent = adapter->dev.parent; |
729 | struct i2c_adapter *parent_adapter; | 729 | struct i2c_adapter *parent_adapter; |
730 | struct dvb_usb_device *d; | 730 | struct dvb_usb_device *d; |
731 | struct rtl28xxu_priv *priv; | 731 | struct rtl28xxu_dev *dev; |
732 | 732 | ||
733 | /* | 733 | /* |
734 | * All tuners are connected to demod muxed I2C adapter. We have to | 734 | * All tuners are connected to demod muxed I2C adapter. We have to |
@@ -742,14 +742,14 @@ static int rtl2832u_frontend_callback(void *adapter_priv, int component, | |||
742 | return -EINVAL; | 742 | return -EINVAL; |
743 | 743 | ||
744 | d = i2c_get_adapdata(parent_adapter); | 744 | d = i2c_get_adapdata(parent_adapter); |
745 | priv = d->priv; | 745 | dev = d->priv; |
746 | 746 | ||
747 | dev_dbg(&d->udev->dev, "%s: component=%d cmd=%d arg=%d\n", | 747 | dev_dbg(&d->udev->dev, "%s: component=%d cmd=%d arg=%d\n", |
748 | __func__, component, cmd, arg); | 748 | __func__, component, cmd, arg); |
749 | 749 | ||
750 | switch (component) { | 750 | switch (component) { |
751 | case DVB_FRONTEND_COMPONENT_TUNER: | 751 | case DVB_FRONTEND_COMPONENT_TUNER: |
752 | switch (priv->tuner) { | 752 | switch (dev->tuner) { |
753 | case TUNER_RTL2832_FC0012: | 753 | case TUNER_RTL2832_FC0012: |
754 | return rtl2832u_fc0012_tuner_callback(d, cmd, arg); | 754 | return rtl2832u_fc0012_tuner_callback(d, cmd, arg); |
755 | case TUNER_RTL2832_TUA9001: | 755 | case TUNER_RTL2832_TUA9001: |
@@ -765,15 +765,15 @@ static int rtl2832u_frontend_callback(void *adapter_priv, int component, | |||
765 | static int rtl2832u_frontend_attach(struct dvb_usb_adapter *adap) | 765 | static int rtl2832u_frontend_attach(struct dvb_usb_adapter *adap) |
766 | { | 766 | { |
767 | struct dvb_usb_device *d = adap_to_d(adap); | 767 | struct dvb_usb_device *d = adap_to_d(adap); |
768 | struct rtl28xxu_priv *priv = d_to_priv(d); | 768 | struct rtl28xxu_dev *dev = d_to_priv(d); |
769 | struct rtl2832_platform_data *pdata = &priv->rtl2832_platform_data; | 769 | struct rtl2832_platform_data *pdata = &dev->rtl2832_platform_data; |
770 | struct i2c_board_info board_info; | 770 | struct i2c_board_info board_info; |
771 | struct i2c_client *client; | 771 | struct i2c_client *client; |
772 | int ret; | 772 | int ret; |
773 | 773 | ||
774 | dev_dbg(&d->udev->dev, "%s:\n", __func__); | 774 | dev_dbg(&d->udev->dev, "%s:\n", __func__); |
775 | 775 | ||
776 | switch (priv->tuner) { | 776 | switch (dev->tuner) { |
777 | case TUNER_RTL2832_FC0012: | 777 | case TUNER_RTL2832_FC0012: |
778 | *pdata = rtl2832_fc0012_platform_data; | 778 | *pdata = rtl2832_fc0012_platform_data; |
779 | break; | 779 | break; |
@@ -796,7 +796,7 @@ static int rtl2832u_frontend_attach(struct dvb_usb_adapter *adap) | |||
796 | break; | 796 | break; |
797 | default: | 797 | default: |
798 | dev_err(&d->udev->dev, "%s: unknown tuner=%s\n", | 798 | dev_err(&d->udev->dev, "%s: unknown tuner=%s\n", |
799 | KBUILD_MODNAME, priv->tuner_name); | 799 | KBUILD_MODNAME, dev->tuner_name); |
800 | ret = -ENODEV; | 800 | ret = -ENODEV; |
801 | goto err; | 801 | goto err; |
802 | } | 802 | } |
@@ -820,14 +820,14 @@ static int rtl2832u_frontend_attach(struct dvb_usb_adapter *adap) | |||
820 | } | 820 | } |
821 | 821 | ||
822 | adap->fe[0] = pdata->get_dvb_frontend(client); | 822 | adap->fe[0] = pdata->get_dvb_frontend(client); |
823 | priv->demod_i2c_adapter = pdata->get_i2c_adapter(client); | 823 | dev->demod_i2c_adapter = pdata->get_i2c_adapter(client); |
824 | 824 | ||
825 | priv->i2c_client_demod = client; | 825 | dev->i2c_client_demod = client; |
826 | 826 | ||
827 | /* set fe callback */ | 827 | /* set fe callback */ |
828 | adap->fe[0]->callback = rtl2832u_frontend_callback; | 828 | adap->fe[0]->callback = rtl2832u_frontend_callback; |
829 | 829 | ||
830 | if (priv->slave_demod) { | 830 | if (dev->slave_demod) { |
831 | struct i2c_board_info info = {}; | 831 | struct i2c_board_info info = {}; |
832 | 832 | ||
833 | /* | 833 | /* |
@@ -837,7 +837,7 @@ static int rtl2832u_frontend_attach(struct dvb_usb_adapter *adap) | |||
837 | ret = 0; | 837 | ret = 0; |
838 | 838 | ||
839 | /* attach slave demodulator */ | 839 | /* attach slave demodulator */ |
840 | if (priv->slave_demod == SLAVE_DEMOD_MN88472) { | 840 | if (dev->slave_demod == SLAVE_DEMOD_MN88472) { |
841 | struct mn88472_config mn88472_config = {}; | 841 | struct mn88472_config mn88472_config = {}; |
842 | 842 | ||
843 | mn88472_config.fe = &adap->fe[1]; | 843 | mn88472_config.fe = &adap->fe[1]; |
@@ -849,17 +849,17 @@ static int rtl2832u_frontend_attach(struct dvb_usb_adapter *adap) | |||
849 | request_module(info.type); | 849 | request_module(info.type); |
850 | client = i2c_new_device(&d->i2c_adap, &info); | 850 | client = i2c_new_device(&d->i2c_adap, &info); |
851 | if (client == NULL || client->dev.driver == NULL) { | 851 | if (client == NULL || client->dev.driver == NULL) { |
852 | priv->slave_demod = SLAVE_DEMOD_NONE; | 852 | dev->slave_demod = SLAVE_DEMOD_NONE; |
853 | goto err_slave_demod_failed; | 853 | goto err_slave_demod_failed; |
854 | } | 854 | } |
855 | 855 | ||
856 | if (!try_module_get(client->dev.driver->owner)) { | 856 | if (!try_module_get(client->dev.driver->owner)) { |
857 | i2c_unregister_device(client); | 857 | i2c_unregister_device(client); |
858 | priv->slave_demod = SLAVE_DEMOD_NONE; | 858 | dev->slave_demod = SLAVE_DEMOD_NONE; |
859 | goto err_slave_demod_failed; | 859 | goto err_slave_demod_failed; |
860 | } | 860 | } |
861 | 861 | ||
862 | priv->i2c_client_slave_demod = client; | 862 | dev->i2c_client_slave_demod = client; |
863 | } else { | 863 | } else { |
864 | struct mn88473_config mn88473_config = {}; | 864 | struct mn88473_config mn88473_config = {}; |
865 | 865 | ||
@@ -871,17 +871,17 @@ static int rtl2832u_frontend_attach(struct dvb_usb_adapter *adap) | |||
871 | request_module(info.type); | 871 | request_module(info.type); |
872 | client = i2c_new_device(&d->i2c_adap, &info); | 872 | client = i2c_new_device(&d->i2c_adap, &info); |
873 | if (client == NULL || client->dev.driver == NULL) { | 873 | if (client == NULL || client->dev.driver == NULL) { |
874 | priv->slave_demod = SLAVE_DEMOD_NONE; | 874 | dev->slave_demod = SLAVE_DEMOD_NONE; |
875 | goto err_slave_demod_failed; | 875 | goto err_slave_demod_failed; |
876 | } | 876 | } |
877 | 877 | ||
878 | if (!try_module_get(client->dev.driver->owner)) { | 878 | if (!try_module_get(client->dev.driver->owner)) { |
879 | i2c_unregister_device(client); | 879 | i2c_unregister_device(client); |
880 | priv->slave_demod = SLAVE_DEMOD_NONE; | 880 | dev->slave_demod = SLAVE_DEMOD_NONE; |
881 | goto err_slave_demod_failed; | 881 | goto err_slave_demod_failed; |
882 | } | 882 | } |
883 | 883 | ||
884 | priv->i2c_client_slave_demod = client; | 884 | dev->i2c_client_slave_demod = client; |
885 | } | 885 | } |
886 | } | 886 | } |
887 | 887 | ||
@@ -895,20 +895,20 @@ err: | |||
895 | static int rtl2832u_frontend_detach(struct dvb_usb_adapter *adap) | 895 | static int rtl2832u_frontend_detach(struct dvb_usb_adapter *adap) |
896 | { | 896 | { |
897 | struct dvb_usb_device *d = adap_to_d(adap); | 897 | struct dvb_usb_device *d = adap_to_d(adap); |
898 | struct rtl28xxu_priv *priv = d_to_priv(d); | 898 | struct rtl28xxu_dev *dev = d_to_priv(d); |
899 | struct i2c_client *client; | 899 | struct i2c_client *client; |
900 | 900 | ||
901 | dev_dbg(&d->udev->dev, "%s:\n", __func__); | 901 | dev_dbg(&d->udev->dev, "%s:\n", __func__); |
902 | 902 | ||
903 | /* remove I2C slave demod */ | 903 | /* remove I2C slave demod */ |
904 | client = priv->i2c_client_slave_demod; | 904 | client = dev->i2c_client_slave_demod; |
905 | if (client) { | 905 | if (client) { |
906 | module_put(client->dev.driver->owner); | 906 | module_put(client->dev.driver->owner); |
907 | i2c_unregister_device(client); | 907 | i2c_unregister_device(client); |
908 | } | 908 | } |
909 | 909 | ||
910 | /* remove I2C demod */ | 910 | /* remove I2C demod */ |
911 | client = priv->i2c_client_demod; | 911 | client = dev->i2c_client_demod; |
912 | if (client) { | 912 | if (client) { |
913 | module_put(client->dev.driver->owner); | 913 | module_put(client->dev.driver->owner); |
914 | i2c_unregister_device(client); | 914 | i2c_unregister_device(client); |
@@ -947,31 +947,31 @@ static int rtl2831u_tuner_attach(struct dvb_usb_adapter *adap) | |||
947 | { | 947 | { |
948 | int ret; | 948 | int ret; |
949 | struct dvb_usb_device *d = adap_to_d(adap); | 949 | struct dvb_usb_device *d = adap_to_d(adap); |
950 | struct rtl28xxu_priv *priv = d_to_priv(d); | 950 | struct rtl28xxu_dev *dev = d_to_priv(d); |
951 | struct dvb_frontend *fe; | 951 | struct dvb_frontend *fe; |
952 | 952 | ||
953 | dev_dbg(&d->udev->dev, "%s:\n", __func__); | 953 | dev_dbg(&d->udev->dev, "%s:\n", __func__); |
954 | 954 | ||
955 | switch (priv->tuner) { | 955 | switch (dev->tuner) { |
956 | case TUNER_RTL2830_QT1010: | 956 | case TUNER_RTL2830_QT1010: |
957 | fe = dvb_attach(qt1010_attach, adap->fe[0], | 957 | fe = dvb_attach(qt1010_attach, adap->fe[0], |
958 | priv->demod_i2c_adapter, | 958 | dev->demod_i2c_adapter, |
959 | &rtl28xxu_qt1010_config); | 959 | &rtl28xxu_qt1010_config); |
960 | break; | 960 | break; |
961 | case TUNER_RTL2830_MT2060: | 961 | case TUNER_RTL2830_MT2060: |
962 | fe = dvb_attach(mt2060_attach, adap->fe[0], | 962 | fe = dvb_attach(mt2060_attach, adap->fe[0], |
963 | priv->demod_i2c_adapter, | 963 | dev->demod_i2c_adapter, |
964 | &rtl28xxu_mt2060_config, 1220); | 964 | &rtl28xxu_mt2060_config, 1220); |
965 | break; | 965 | break; |
966 | case TUNER_RTL2830_MXL5005S: | 966 | case TUNER_RTL2830_MXL5005S: |
967 | fe = dvb_attach(mxl5005s_attach, adap->fe[0], | 967 | fe = dvb_attach(mxl5005s_attach, adap->fe[0], |
968 | priv->demod_i2c_adapter, | 968 | dev->demod_i2c_adapter, |
969 | &rtl28xxu_mxl5005s_config); | 969 | &rtl28xxu_mxl5005s_config); |
970 | break; | 970 | break; |
971 | default: | 971 | default: |
972 | fe = NULL; | 972 | fe = NULL; |
973 | dev_err(&d->udev->dev, "%s: unknown tuner=%d\n", KBUILD_MODNAME, | 973 | dev_err(&d->udev->dev, "%s: unknown tuner=%d\n", KBUILD_MODNAME, |
974 | priv->tuner); | 974 | dev->tuner); |
975 | } | 975 | } |
976 | 976 | ||
977 | if (fe == NULL) { | 977 | if (fe == NULL) { |
@@ -1017,7 +1017,7 @@ static int rtl2832u_tuner_attach(struct dvb_usb_adapter *adap) | |||
1017 | { | 1017 | { |
1018 | int ret; | 1018 | int ret; |
1019 | struct dvb_usb_device *d = adap_to_d(adap); | 1019 | struct dvb_usb_device *d = adap_to_d(adap); |
1020 | struct rtl28xxu_priv *priv = d_to_priv(d); | 1020 | struct rtl28xxu_dev *dev = d_to_priv(d); |
1021 | struct dvb_frontend *fe = NULL; | 1021 | struct dvb_frontend *fe = NULL; |
1022 | struct i2c_board_info info; | 1022 | struct i2c_board_info info; |
1023 | struct i2c_client *client; | 1023 | struct i2c_client *client; |
@@ -1027,10 +1027,10 @@ static int rtl2832u_tuner_attach(struct dvb_usb_adapter *adap) | |||
1027 | 1027 | ||
1028 | memset(&info, 0, sizeof(struct i2c_board_info)); | 1028 | memset(&info, 0, sizeof(struct i2c_board_info)); |
1029 | 1029 | ||
1030 | switch (priv->tuner) { | 1030 | switch (dev->tuner) { |
1031 | case TUNER_RTL2832_FC0012: | 1031 | case TUNER_RTL2832_FC0012: |
1032 | fe = dvb_attach(fc0012_attach, adap->fe[0], | 1032 | fe = dvb_attach(fc0012_attach, adap->fe[0], |
1033 | priv->demod_i2c_adapter, &rtl2832u_fc0012_config); | 1033 | dev->demod_i2c_adapter, &rtl2832u_fc0012_config); |
1034 | 1034 | ||
1035 | /* since fc0012 includs reading the signal strength delegate | 1035 | /* since fc0012 includs reading the signal strength delegate |
1036 | * that to the tuner driver */ | 1036 | * that to the tuner driver */ |
@@ -1039,7 +1039,7 @@ static int rtl2832u_tuner_attach(struct dvb_usb_adapter *adap) | |||
1039 | break; | 1039 | break; |
1040 | case TUNER_RTL2832_FC0013: | 1040 | case TUNER_RTL2832_FC0013: |
1041 | fe = dvb_attach(fc0013_attach, adap->fe[0], | 1041 | fe = dvb_attach(fc0013_attach, adap->fe[0], |
1042 | priv->demod_i2c_adapter, 0xc6>>1, 0, FC_XTAL_28_8_MHZ); | 1042 | dev->demod_i2c_adapter, 0xc6>>1, 0, FC_XTAL_28_8_MHZ); |
1043 | 1043 | ||
1044 | /* fc0013 also supports signal strength reading */ | 1044 | /* fc0013 also supports signal strength reading */ |
1045 | adap->fe[0]->ops.read_signal_strength = | 1045 | adap->fe[0]->ops.read_signal_strength = |
@@ -1056,7 +1056,7 @@ static int rtl2832u_tuner_attach(struct dvb_usb_adapter *adap) | |||
1056 | info.platform_data = &e4000_config; | 1056 | info.platform_data = &e4000_config; |
1057 | 1057 | ||
1058 | request_module(info.type); | 1058 | request_module(info.type); |
1059 | client = i2c_new_device(priv->demod_i2c_adapter, &info); | 1059 | client = i2c_new_device(dev->demod_i2c_adapter, &info); |
1060 | if (client == NULL || client->dev.driver == NULL) | 1060 | if (client == NULL || client->dev.driver == NULL) |
1061 | break; | 1061 | break; |
1062 | 1062 | ||
@@ -1065,13 +1065,13 @@ static int rtl2832u_tuner_attach(struct dvb_usb_adapter *adap) | |||
1065 | break; | 1065 | break; |
1066 | } | 1066 | } |
1067 | 1067 | ||
1068 | priv->i2c_client_tuner = client; | 1068 | dev->i2c_client_tuner = client; |
1069 | subdev = i2c_get_clientdata(client); | 1069 | subdev = i2c_get_clientdata(client); |
1070 | } | 1070 | } |
1071 | break; | 1071 | break; |
1072 | case TUNER_RTL2832_FC2580: | 1072 | case TUNER_RTL2832_FC2580: |
1073 | fe = dvb_attach(fc2580_attach, adap->fe[0], | 1073 | fe = dvb_attach(fc2580_attach, adap->fe[0], |
1074 | priv->demod_i2c_adapter, | 1074 | dev->demod_i2c_adapter, |
1075 | &rtl2832u_fc2580_config); | 1075 | &rtl2832u_fc2580_config); |
1076 | break; | 1076 | break; |
1077 | case TUNER_RTL2832_TUA9001: | 1077 | case TUNER_RTL2832_TUA9001: |
@@ -1085,12 +1085,12 @@ static int rtl2832u_tuner_attach(struct dvb_usb_adapter *adap) | |||
1085 | goto err; | 1085 | goto err; |
1086 | 1086 | ||
1087 | fe = dvb_attach(tua9001_attach, adap->fe[0], | 1087 | fe = dvb_attach(tua9001_attach, adap->fe[0], |
1088 | priv->demod_i2c_adapter, | 1088 | dev->demod_i2c_adapter, |
1089 | &rtl2832u_tua9001_config); | 1089 | &rtl2832u_tua9001_config); |
1090 | break; | 1090 | break; |
1091 | case TUNER_RTL2832_R820T: | 1091 | case TUNER_RTL2832_R820T: |
1092 | fe = dvb_attach(r820t_attach, adap->fe[0], | 1092 | fe = dvb_attach(r820t_attach, adap->fe[0], |
1093 | priv->demod_i2c_adapter, | 1093 | dev->demod_i2c_adapter, |
1094 | &rtl2832u_r820t_config); | 1094 | &rtl2832u_r820t_config); |
1095 | 1095 | ||
1096 | /* Use tuner to get the signal strength */ | 1096 | /* Use tuner to get the signal strength */ |
@@ -1099,14 +1099,14 @@ static int rtl2832u_tuner_attach(struct dvb_usb_adapter *adap) | |||
1099 | break; | 1099 | break; |
1100 | case TUNER_RTL2832_R828D: | 1100 | case TUNER_RTL2832_R828D: |
1101 | fe = dvb_attach(r820t_attach, adap->fe[0], | 1101 | fe = dvb_attach(r820t_attach, adap->fe[0], |
1102 | priv->demod_i2c_adapter, | 1102 | dev->demod_i2c_adapter, |
1103 | &rtl2832u_r828d_config); | 1103 | &rtl2832u_r828d_config); |
1104 | adap->fe[0]->ops.read_signal_strength = | 1104 | adap->fe[0]->ops.read_signal_strength = |
1105 | adap->fe[0]->ops.tuner_ops.get_rf_strength; | 1105 | adap->fe[0]->ops.tuner_ops.get_rf_strength; |
1106 | 1106 | ||
1107 | if (adap->fe[1]) { | 1107 | if (adap->fe[1]) { |
1108 | fe = dvb_attach(r820t_attach, adap->fe[1], | 1108 | fe = dvb_attach(r820t_attach, adap->fe[1], |
1109 | priv->demod_i2c_adapter, | 1109 | dev->demod_i2c_adapter, |
1110 | &rtl2832u_r828d_config); | 1110 | &rtl2832u_r828d_config); |
1111 | adap->fe[1]->ops.read_signal_strength = | 1111 | adap->fe[1]->ops.read_signal_strength = |
1112 | adap->fe[1]->ops.tuner_ops.get_rf_strength; | 1112 | adap->fe[1]->ops.tuner_ops.get_rf_strength; |
@@ -1114,15 +1114,15 @@ static int rtl2832u_tuner_attach(struct dvb_usb_adapter *adap) | |||
1114 | break; | 1114 | break; |
1115 | default: | 1115 | default: |
1116 | dev_err(&d->udev->dev, "%s: unknown tuner=%d\n", KBUILD_MODNAME, | 1116 | dev_err(&d->udev->dev, "%s: unknown tuner=%d\n", KBUILD_MODNAME, |
1117 | priv->tuner); | 1117 | dev->tuner); |
1118 | } | 1118 | } |
1119 | if (fe == NULL && priv->i2c_client_tuner == NULL) { | 1119 | if (fe == NULL && dev->i2c_client_tuner == NULL) { |
1120 | ret = -ENODEV; | 1120 | ret = -ENODEV; |
1121 | goto err; | 1121 | goto err; |
1122 | } | 1122 | } |
1123 | 1123 | ||
1124 | /* register SDR */ | 1124 | /* register SDR */ |
1125 | switch (priv->tuner) { | 1125 | switch (dev->tuner) { |
1126 | struct platform_device *pdev; | 1126 | struct platform_device *pdev; |
1127 | struct rtl2832_sdr_platform_data pdata = {}; | 1127 | struct rtl2832_sdr_platform_data pdata = {}; |
1128 | 1128 | ||
@@ -1131,12 +1131,12 @@ static int rtl2832u_tuner_attach(struct dvb_usb_adapter *adap) | |||
1131 | case TUNER_RTL2832_E4000: | 1131 | case TUNER_RTL2832_E4000: |
1132 | case TUNER_RTL2832_R820T: | 1132 | case TUNER_RTL2832_R820T: |
1133 | case TUNER_RTL2832_R828D: | 1133 | case TUNER_RTL2832_R828D: |
1134 | pdata.clk = priv->rtl2832_platform_data.clk; | 1134 | pdata.clk = dev->rtl2832_platform_data.clk; |
1135 | pdata.tuner = priv->tuner; | 1135 | pdata.tuner = dev->tuner; |
1136 | pdata.i2c_client = priv->i2c_client_demod; | 1136 | pdata.i2c_client = dev->i2c_client_demod; |
1137 | pdata.bulk_read = priv->rtl2832_platform_data.bulk_read; | 1137 | pdata.bulk_read = dev->rtl2832_platform_data.bulk_read; |
1138 | pdata.bulk_write = priv->rtl2832_platform_data.bulk_write; | 1138 | pdata.bulk_write = dev->rtl2832_platform_data.bulk_write; |
1139 | pdata.update_bits = priv->rtl2832_platform_data.update_bits; | 1139 | pdata.update_bits = dev->rtl2832_platform_data.update_bits; |
1140 | pdata.dvb_frontend = adap->fe[0]; | 1140 | pdata.dvb_frontend = adap->fe[0]; |
1141 | pdata.dvb_usb_device = d; | 1141 | pdata.dvb_usb_device = d; |
1142 | pdata.v4l2_subdev = subdev; | 1142 | pdata.v4l2_subdev = subdev; |
@@ -1148,10 +1148,10 @@ static int rtl2832u_tuner_attach(struct dvb_usb_adapter *adap) | |||
1148 | &pdata, sizeof(pdata)); | 1148 | &pdata, sizeof(pdata)); |
1149 | if (pdev == NULL || pdev->dev.driver == NULL) | 1149 | if (pdev == NULL || pdev->dev.driver == NULL) |
1150 | break; | 1150 | break; |
1151 | priv->platform_device_sdr = pdev; | 1151 | dev->platform_device_sdr = pdev; |
1152 | break; | 1152 | break; |
1153 | default: | 1153 | default: |
1154 | dev_dbg(&d->udev->dev, "no SDR for tuner=%d\n", priv->tuner); | 1154 | dev_dbg(&d->udev->dev, "no SDR for tuner=%d\n", dev->tuner); |
1155 | } | 1155 | } |
1156 | 1156 | ||
1157 | return 0; | 1157 | return 0; |
@@ -1163,19 +1163,19 @@ err: | |||
1163 | static int rtl2832u_tuner_detach(struct dvb_usb_adapter *adap) | 1163 | static int rtl2832u_tuner_detach(struct dvb_usb_adapter *adap) |
1164 | { | 1164 | { |
1165 | struct dvb_usb_device *d = adap_to_d(adap); | 1165 | struct dvb_usb_device *d = adap_to_d(adap); |
1166 | struct rtl28xxu_priv *priv = d_to_priv(d); | 1166 | struct rtl28xxu_dev *dev = d_to_priv(d); |
1167 | struct i2c_client *client; | 1167 | struct i2c_client *client; |
1168 | struct platform_device *pdev; | 1168 | struct platform_device *pdev; |
1169 | 1169 | ||
1170 | dev_dbg(&d->udev->dev, "%s:\n", __func__); | 1170 | dev_dbg(&d->udev->dev, "%s:\n", __func__); |
1171 | 1171 | ||
1172 | /* remove platform SDR */ | 1172 | /* remove platform SDR */ |
1173 | pdev = priv->platform_device_sdr; | 1173 | pdev = dev->platform_device_sdr; |
1174 | if (pdev) | 1174 | if (pdev) |
1175 | platform_device_unregister(pdev); | 1175 | platform_device_unregister(pdev); |
1176 | 1176 | ||
1177 | /* remove I2C tuner */ | 1177 | /* remove I2C tuner */ |
1178 | client = priv->i2c_client_tuner; | 1178 | client = dev->i2c_client_tuner; |
1179 | if (client) { | 1179 | if (client) { |
1180 | module_put(client->dev.driver->owner); | 1180 | module_put(client->dev.driver->owner); |
1181 | i2c_unregister_device(client); | 1181 | i2c_unregister_device(client); |
@@ -1343,8 +1343,8 @@ err: | |||
1343 | static int rtl2832u_frontend_ctrl(struct dvb_frontend *fe, int onoff) | 1343 | static int rtl2832u_frontend_ctrl(struct dvb_frontend *fe, int onoff) |
1344 | { | 1344 | { |
1345 | struct dvb_usb_device *d = fe_to_d(fe); | 1345 | struct dvb_usb_device *d = fe_to_d(fe); |
1346 | struct rtl28xxu_priv *priv = fe_to_priv(fe); | 1346 | struct rtl28xxu_dev *dev = fe_to_priv(fe); |
1347 | struct rtl2832_platform_data *pdata = &priv->rtl2832_platform_data; | 1347 | struct rtl2832_platform_data *pdata = &dev->rtl2832_platform_data; |
1348 | int ret; | 1348 | int ret; |
1349 | u8 val; | 1349 | u8 val; |
1350 | 1350 | ||
@@ -1362,7 +1362,7 @@ static int rtl2832u_frontend_ctrl(struct dvb_frontend *fe, int onoff) | |||
1362 | 1362 | ||
1363 | /* bypass slave demod TS through master demod */ | 1363 | /* bypass slave demod TS through master demod */ |
1364 | if (fe->id == 1 && onoff) { | 1364 | if (fe->id == 1 && onoff) { |
1365 | ret = pdata->enable_slave_ts(priv->i2c_client_demod); | 1365 | ret = pdata->enable_slave_ts(dev->i2c_client_demod); |
1366 | if (ret) | 1366 | if (ret) |
1367 | goto err; | 1367 | goto err; |
1368 | } | 1368 | } |
@@ -1377,7 +1377,7 @@ err: | |||
1377 | static int rtl2831u_rc_query(struct dvb_usb_device *d) | 1377 | static int rtl2831u_rc_query(struct dvb_usb_device *d) |
1378 | { | 1378 | { |
1379 | int ret, i; | 1379 | int ret, i; |
1380 | struct rtl28xxu_priv *priv = d->priv; | 1380 | struct rtl28xxu_dev *dev = d->priv; |
1381 | u8 buf[5]; | 1381 | u8 buf[5]; |
1382 | u32 rc_code; | 1382 | u32 rc_code; |
1383 | struct rtl28xxu_reg_val rc_nec_tab[] = { | 1383 | struct rtl28xxu_reg_val rc_nec_tab[] = { |
@@ -1398,14 +1398,14 @@ static int rtl2831u_rc_query(struct dvb_usb_device *d) | |||
1398 | }; | 1398 | }; |
1399 | 1399 | ||
1400 | /* init remote controller */ | 1400 | /* init remote controller */ |
1401 | if (!priv->rc_active) { | 1401 | if (!dev->rc_active) { |
1402 | for (i = 0; i < ARRAY_SIZE(rc_nec_tab); i++) { | 1402 | for (i = 0; i < ARRAY_SIZE(rc_nec_tab); i++) { |
1403 | ret = rtl28xx_wr_reg(d, rc_nec_tab[i].reg, | 1403 | ret = rtl28xx_wr_reg(d, rc_nec_tab[i].reg, |
1404 | rc_nec_tab[i].val); | 1404 | rc_nec_tab[i].val); |
1405 | if (ret) | 1405 | if (ret) |
1406 | goto err; | 1406 | goto err; |
1407 | } | 1407 | } |
1408 | priv->rc_active = true; | 1408 | dev->rc_active = true; |
1409 | } | 1409 | } |
1410 | 1410 | ||
1411 | ret = rtl2831_rd_regs(d, SYS_IRRC_RP, buf, 5); | 1411 | ret = rtl2831_rd_regs(d, SYS_IRRC_RP, buf, 5); |
@@ -1460,7 +1460,7 @@ static int rtl2831u_get_rc_config(struct dvb_usb_device *d, | |||
1460 | static int rtl2832u_rc_query(struct dvb_usb_device *d) | 1460 | static int rtl2832u_rc_query(struct dvb_usb_device *d) |
1461 | { | 1461 | { |
1462 | int ret, i, len; | 1462 | int ret, i, len; |
1463 | struct rtl28xxu_priv *priv = d->priv; | 1463 | struct rtl28xxu_dev *dev = d->priv; |
1464 | struct ir_raw_event ev; | 1464 | struct ir_raw_event ev; |
1465 | u8 buf[128]; | 1465 | u8 buf[128]; |
1466 | static const struct rtl28xxu_reg_val_mask refresh_tab[] = { | 1466 | static const struct rtl28xxu_reg_val_mask refresh_tab[] = { |
@@ -1470,7 +1470,7 @@ static int rtl2832u_rc_query(struct dvb_usb_device *d) | |||
1470 | }; | 1470 | }; |
1471 | 1471 | ||
1472 | /* init remote controller */ | 1472 | /* init remote controller */ |
1473 | if (!priv->rc_active) { | 1473 | if (!dev->rc_active) { |
1474 | static const struct rtl28xxu_reg_val_mask init_tab[] = { | 1474 | static const struct rtl28xxu_reg_val_mask init_tab[] = { |
1475 | {SYS_DEMOD_CTL1, 0x00, 0x04}, | 1475 | {SYS_DEMOD_CTL1, 0x00, 0x04}, |
1476 | {SYS_DEMOD_CTL1, 0x00, 0x08}, | 1476 | {SYS_DEMOD_CTL1, 0x00, 0x08}, |
@@ -1497,7 +1497,7 @@ static int rtl2832u_rc_query(struct dvb_usb_device *d) | |||
1497 | goto err; | 1497 | goto err; |
1498 | } | 1498 | } |
1499 | 1499 | ||
1500 | priv->rc_active = true; | 1500 | dev->rc_active = true; |
1501 | } | 1501 | } |
1502 | 1502 | ||
1503 | ret = rtl28xx_rd_reg(d, IR_RX_IF, &buf[0]); | 1503 | ret = rtl28xx_rd_reg(d, IR_RX_IF, &buf[0]); |
@@ -1570,8 +1570,8 @@ static int rtl2832u_get_rc_config(struct dvb_usb_device *d, | |||
1570 | static int rtl2831u_pid_filter_ctrl(struct dvb_usb_adapter *adap, int onoff) | 1570 | static int rtl2831u_pid_filter_ctrl(struct dvb_usb_adapter *adap, int onoff) |
1571 | { | 1571 | { |
1572 | struct dvb_usb_device *d = adap_to_d(adap); | 1572 | struct dvb_usb_device *d = adap_to_d(adap); |
1573 | struct rtl28xxu_priv *priv = d_to_priv(d); | 1573 | struct rtl28xxu_dev *dev = d_to_priv(d); |
1574 | struct rtl2830_platform_data *pdata = &priv->rtl2830_platform_data; | 1574 | struct rtl2830_platform_data *pdata = &dev->rtl2830_platform_data; |
1575 | 1575 | ||
1576 | return pdata->pid_filter_ctrl(adap->fe[0], onoff); | 1576 | return pdata->pid_filter_ctrl(adap->fe[0], onoff); |
1577 | } | 1577 | } |
@@ -1579,8 +1579,8 @@ static int rtl2831u_pid_filter_ctrl(struct dvb_usb_adapter *adap, int onoff) | |||
1579 | static int rtl2832u_pid_filter_ctrl(struct dvb_usb_adapter *adap, int onoff) | 1579 | static int rtl2832u_pid_filter_ctrl(struct dvb_usb_adapter *adap, int onoff) |
1580 | { | 1580 | { |
1581 | struct dvb_usb_device *d = adap_to_d(adap); | 1581 | struct dvb_usb_device *d = adap_to_d(adap); |
1582 | struct rtl28xxu_priv *priv = d_to_priv(d); | 1582 | struct rtl28xxu_dev *dev = d_to_priv(d); |
1583 | struct rtl2832_platform_data *pdata = &priv->rtl2832_platform_data; | 1583 | struct rtl2832_platform_data *pdata = &dev->rtl2832_platform_data; |
1584 | 1584 | ||
1585 | return pdata->pid_filter_ctrl(adap->fe[0], onoff); | 1585 | return pdata->pid_filter_ctrl(adap->fe[0], onoff); |
1586 | } | 1586 | } |
@@ -1588,8 +1588,8 @@ static int rtl2832u_pid_filter_ctrl(struct dvb_usb_adapter *adap, int onoff) | |||
1588 | static int rtl2831u_pid_filter(struct dvb_usb_adapter *adap, int index, u16 pid, int onoff) | 1588 | static int rtl2831u_pid_filter(struct dvb_usb_adapter *adap, int index, u16 pid, int onoff) |
1589 | { | 1589 | { |
1590 | struct dvb_usb_device *d = adap_to_d(adap); | 1590 | struct dvb_usb_device *d = adap_to_d(adap); |
1591 | struct rtl28xxu_priv *priv = d_to_priv(d); | 1591 | struct rtl28xxu_dev *dev = d_to_priv(d); |
1592 | struct rtl2830_platform_data *pdata = &priv->rtl2830_platform_data; | 1592 | struct rtl2830_platform_data *pdata = &dev->rtl2830_platform_data; |
1593 | 1593 | ||
1594 | return pdata->pid_filter(adap->fe[0], index, pid, onoff); | 1594 | return pdata->pid_filter(adap->fe[0], index, pid, onoff); |
1595 | } | 1595 | } |
@@ -1597,8 +1597,8 @@ static int rtl2831u_pid_filter(struct dvb_usb_adapter *adap, int index, u16 pid, | |||
1597 | static int rtl2832u_pid_filter(struct dvb_usb_adapter *adap, int index, u16 pid, int onoff) | 1597 | static int rtl2832u_pid_filter(struct dvb_usb_adapter *adap, int index, u16 pid, int onoff) |
1598 | { | 1598 | { |
1599 | struct dvb_usb_device *d = adap_to_d(adap); | 1599 | struct dvb_usb_device *d = adap_to_d(adap); |
1600 | struct rtl28xxu_priv *priv = d_to_priv(d); | 1600 | struct rtl28xxu_dev *dev = d_to_priv(d); |
1601 | struct rtl2832_platform_data *pdata = &priv->rtl2832_platform_data; | 1601 | struct rtl2832_platform_data *pdata = &dev->rtl2832_platform_data; |
1602 | 1602 | ||
1603 | return pdata->pid_filter(adap->fe[0], index, pid, onoff); | 1603 | return pdata->pid_filter(adap->fe[0], index, pid, onoff); |
1604 | } | 1604 | } |
@@ -1607,7 +1607,7 @@ static const struct dvb_usb_device_properties rtl2831u_props = { | |||
1607 | .driver_name = KBUILD_MODNAME, | 1607 | .driver_name = KBUILD_MODNAME, |
1608 | .owner = THIS_MODULE, | 1608 | .owner = THIS_MODULE, |
1609 | .adapter_nr = adapter_nr, | 1609 | .adapter_nr = adapter_nr, |
1610 | .size_of_priv = sizeof(struct rtl28xxu_priv), | 1610 | .size_of_priv = sizeof(struct rtl28xxu_dev), |
1611 | 1611 | ||
1612 | .power_ctrl = rtl2831u_power_ctrl, | 1612 | .power_ctrl = rtl2831u_power_ctrl, |
1613 | .i2c_algo = &rtl28xxu_i2c_algo, | 1613 | .i2c_algo = &rtl28xxu_i2c_algo, |
@@ -1637,7 +1637,7 @@ static const struct dvb_usb_device_properties rtl2832u_props = { | |||
1637 | .driver_name = KBUILD_MODNAME, | 1637 | .driver_name = KBUILD_MODNAME, |
1638 | .owner = THIS_MODULE, | 1638 | .owner = THIS_MODULE, |
1639 | .adapter_nr = adapter_nr, | 1639 | .adapter_nr = adapter_nr, |
1640 | .size_of_priv = sizeof(struct rtl28xxu_priv), | 1640 | .size_of_priv = sizeof(struct rtl28xxu_dev), |
1641 | 1641 | ||
1642 | .power_ctrl = rtl2832u_power_ctrl, | 1642 | .power_ctrl = rtl2832u_power_ctrl, |
1643 | .frontend_ctrl = rtl2832u_frontend_ctrl, | 1643 | .frontend_ctrl = rtl2832u_frontend_ctrl, |
diff --git a/drivers/media/usb/dvb-usb-v2/rtl28xxu.h b/drivers/media/usb/dvb-usb-v2/rtl28xxu.h index 62d32491fbe4..abf0111a3fda 100644 --- a/drivers/media/usb/dvb-usb-v2/rtl28xxu.h +++ b/drivers/media/usb/dvb-usb-v2/rtl28xxu.h | |||
@@ -68,7 +68,7 @@ | |||
68 | #define CMD_I2C_DA_WR 0x0610 | 68 | #define CMD_I2C_DA_WR 0x0610 |
69 | 69 | ||
70 | 70 | ||
71 | struct rtl28xxu_priv { | 71 | struct rtl28xxu_dev { |
72 | u8 chip_id; | 72 | u8 chip_id; |
73 | u8 tuner; | 73 | u8 tuner; |
74 | char *tuner_name; | 74 | char *tuner_name; |