diff options
| author | Michael Krufky <mkrufky@linuxtv.org> | 2012-04-08 20:39:56 -0400 |
|---|---|---|
| committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-04-19 08:44:54 -0400 |
| commit | be183dc3f73d7e8e0091c54fc3fa04d9ccb91903 (patch) | |
| tree | 3a2877b9a7191c982e57e35c431443d732c2166b | |
| parent | 409328a4dcd40a14cbe42b2e6f0c492ece3b88cc (diff) | |
[media] au0828-dvb: attach tuner based on dev->board.tuner_type on hvr950q
We can tell from the eeprom whether we have a xc5000a or xc5000c.
Attach the correct tuner based on this information.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
| -rw-r--r-- | drivers/media/video/au0828/au0828-dvb.c | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/drivers/media/video/au0828/au0828-dvb.c b/drivers/media/video/au0828/au0828-dvb.c index 518216743c9c..39ece8e24985 100644 --- a/drivers/media/video/au0828/au0828-dvb.c +++ b/drivers/media/video/au0828/au0828-dvb.c | |||
| @@ -25,6 +25,7 @@ | |||
| 25 | #include <linux/device.h> | 25 | #include <linux/device.h> |
| 26 | #include <linux/suspend.h> | 26 | #include <linux/suspend.h> |
| 27 | #include <media/v4l2-common.h> | 27 | #include <media/v4l2-common.h> |
| 28 | #include <media/tuner.h> | ||
| 28 | 29 | ||
| 29 | #include "au0828.h" | 30 | #include "au0828.h" |
| 30 | #include "au8522.h" | 31 | #include "au8522.h" |
| @@ -79,9 +80,16 @@ static struct au8522_config hauppauge_woodbury_config = { | |||
| 79 | .vsb_if = AU8522_IF_3_25MHZ, | 80 | .vsb_if = AU8522_IF_3_25MHZ, |
| 80 | }; | 81 | }; |
| 81 | 82 | ||
| 82 | static struct xc5000_config hauppauge_hvr950q_tunerconfig = { | 83 | static struct xc5000_config hauppauge_xc5000a_config = { |
| 83 | .i2c_address = 0x61, | 84 | .i2c_address = 0x61, |
| 84 | .if_khz = 6000, | 85 | .if_khz = 6000, |
| 86 | .chip_id = XC5000A, | ||
| 87 | }; | ||
| 88 | |||
| 89 | static struct xc5000_config hauppauge_xc5000c_config = { | ||
| 90 | .i2c_address = 0x61, | ||
| 91 | .if_khz = 6000, | ||
| 92 | .chip_id = XC5000C, | ||
| 85 | }; | 93 | }; |
| 86 | 94 | ||
| 87 | static struct mxl5007t_config mxl5007t_hvr950q_config = { | 95 | static struct mxl5007t_config mxl5007t_hvr950q_config = { |
| @@ -383,8 +391,19 @@ int au0828_dvb_register(struct au0828_dev *dev) | |||
| 383 | &hauppauge_hvr950q_config, | 391 | &hauppauge_hvr950q_config, |
| 384 | &dev->i2c_adap); | 392 | &dev->i2c_adap); |
| 385 | if (dvb->frontend != NULL) | 393 | if (dvb->frontend != NULL) |
| 386 | dvb_attach(xc5000_attach, dvb->frontend, &dev->i2c_adap, | 394 | switch (dev->board.tuner_type) { |
| 387 | &hauppauge_hvr950q_tunerconfig); | 395 | default: |
| 396 | case TUNER_XC5000: | ||
| 397 | dvb_attach(xc5000_attach, dvb->frontend, | ||
| 398 | &dev->i2c_adap, | ||
| 399 | &hauppauge_xc5000a_config); | ||
| 400 | break; | ||
| 401 | case TUNER_XC5000C: | ||
| 402 | dvb_attach(xc5000_attach, dvb->frontend, | ||
| 403 | &dev->i2c_adap, | ||
| 404 | &hauppauge_xc5000c_config); | ||
| 405 | break; | ||
| 406 | } | ||
| 388 | break; | 407 | break; |
| 389 | case AU0828_BOARD_HAUPPAUGE_HVR950Q_MXL: | 408 | case AU0828_BOARD_HAUPPAUGE_HVR950Q_MXL: |
| 390 | dvb->frontend = dvb_attach(au8522_attach, | 409 | dvb->frontend = dvb_attach(au8522_attach, |
| @@ -411,7 +430,7 @@ int au0828_dvb_register(struct au0828_dev *dev) | |||
| 411 | if (dvb->frontend != NULL) { | 430 | if (dvb->frontend != NULL) { |
| 412 | dvb_attach(xc5000_attach, dvb->frontend, | 431 | dvb_attach(xc5000_attach, dvb->frontend, |
| 413 | &dev->i2c_adap, | 432 | &dev->i2c_adap, |
| 414 | &hauppauge_hvr950q_tunerconfig); | 433 | &hauppauge_xc5000a_config); |
| 415 | } | 434 | } |
| 416 | break; | 435 | break; |
| 417 | default: | 436 | default: |
