diff options
author | Igor M. Liplianin <liplianin@me.by> | 2011-01-25 15:05:00 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-03-21 19:32:18 -0400 |
commit | 557f48d5720b45dae07788bc9976762c363b8ad0 (patch) | |
tree | ded89ce2854e7c9d88e88f35c85465abdb0a48c3 /drivers | |
parent | 78db854757aa4110f9c6873d1529b851037a3405 (diff) |
[media] cx23885: implement tuner_bus parameter for cx23885_board structure
There is two external I2C buses in cx23885 chip.
Currently, analog tuners supported for second I2C bus only
In NetUP Dual DVB-T/C CI RF card tuners connected to first bus
So, in order to support analog tuners sitting on first bus
we need modifications.
Signed-off-by: Igor M. Liplianin <liplianin@netup.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/video/cx23885/cx23885-cards.c | 5 | ||||
-rw-r--r-- | drivers/media/video/cx23885/cx23885-core.c | 5 | ||||
-rw-r--r-- | drivers/media/video/cx23885/cx23885-video.c | 7 | ||||
-rw-r--r-- | drivers/media/video/cx23885/cx23885.h | 2 |
4 files changed, 14 insertions, 5 deletions
diff --git a/drivers/media/video/cx23885/cx23885-cards.c b/drivers/media/video/cx23885/cx23885-cards.c index a3fe26cf6367..fb2045af499f 100644 --- a/drivers/media/video/cx23885/cx23885-cards.c +++ b/drivers/media/video/cx23885/cx23885-cards.c | |||
@@ -94,6 +94,7 @@ struct cx23885_board cx23885_boards[] = { | |||
94 | .portc = CX23885_MPEG_DVB, | 94 | .portc = CX23885_MPEG_DVB, |
95 | .tuner_type = TUNER_PHILIPS_TDA8290, | 95 | .tuner_type = TUNER_PHILIPS_TDA8290, |
96 | .tuner_addr = 0x42, /* 0x84 >> 1 */ | 96 | .tuner_addr = 0x42, /* 0x84 >> 1 */ |
97 | .tuner_bus = 1, | ||
97 | .input = {{ | 98 | .input = {{ |
98 | .type = CX23885_VMUX_TELEVISION, | 99 | .type = CX23885_VMUX_TELEVISION, |
99 | .vmux = CX25840_VIN7_CH3 | | 100 | .vmux = CX25840_VIN7_CH3 | |
@@ -216,6 +217,7 @@ struct cx23885_board cx23885_boards[] = { | |||
216 | .name = "Mygica X8506 DMB-TH", | 217 | .name = "Mygica X8506 DMB-TH", |
217 | .tuner_type = TUNER_XC5000, | 218 | .tuner_type = TUNER_XC5000, |
218 | .tuner_addr = 0x61, | 219 | .tuner_addr = 0x61, |
220 | .tuner_bus = 1, | ||
219 | .porta = CX23885_ANALOG_VIDEO, | 221 | .porta = CX23885_ANALOG_VIDEO, |
220 | .portb = CX23885_MPEG_DVB, | 222 | .portb = CX23885_MPEG_DVB, |
221 | .input = { | 223 | .input = { |
@@ -245,6 +247,7 @@ struct cx23885_board cx23885_boards[] = { | |||
245 | .name = "Magic-Pro ProHDTV Extreme 2", | 247 | .name = "Magic-Pro ProHDTV Extreme 2", |
246 | .tuner_type = TUNER_XC5000, | 248 | .tuner_type = TUNER_XC5000, |
247 | .tuner_addr = 0x61, | 249 | .tuner_addr = 0x61, |
250 | .tuner_bus = 1, | ||
248 | .porta = CX23885_ANALOG_VIDEO, | 251 | .porta = CX23885_ANALOG_VIDEO, |
249 | .portb = CX23885_MPEG_DVB, | 252 | .portb = CX23885_MPEG_DVB, |
250 | .input = { | 253 | .input = { |
@@ -293,6 +296,7 @@ struct cx23885_board cx23885_boards[] = { | |||
293 | .porta = CX23885_ANALOG_VIDEO, | 296 | .porta = CX23885_ANALOG_VIDEO, |
294 | .tuner_type = TUNER_XC2028, | 297 | .tuner_type = TUNER_XC2028, |
295 | .tuner_addr = 0x61, | 298 | .tuner_addr = 0x61, |
299 | .tuner_bus = 1, | ||
296 | .input = {{ | 300 | .input = {{ |
297 | .type = CX23885_VMUX_TELEVISION, | 301 | .type = CX23885_VMUX_TELEVISION, |
298 | .vmux = CX25840_VIN2_CH1 | | 302 | .vmux = CX25840_VIN2_CH1 | |
@@ -317,6 +321,7 @@ struct cx23885_board cx23885_boards[] = { | |||
317 | .name = "GoTView X5 3D Hybrid", | 321 | .name = "GoTView X5 3D Hybrid", |
318 | .tuner_type = TUNER_XC5000, | 322 | .tuner_type = TUNER_XC5000, |
319 | .tuner_addr = 0x64, | 323 | .tuner_addr = 0x64, |
324 | .tuner_bus = 1, | ||
320 | .porta = CX23885_ANALOG_VIDEO, | 325 | .porta = CX23885_ANALOG_VIDEO, |
321 | .portb = CX23885_MPEG_DVB, | 326 | .portb = CX23885_MPEG_DVB, |
322 | .input = {{ | 327 | .input = {{ |
diff --git a/drivers/media/video/cx23885/cx23885-core.c b/drivers/media/video/cx23885/cx23885-core.c index 9ad4c9c577e0..d621d76f3a9a 100644 --- a/drivers/media/video/cx23885/cx23885-core.c +++ b/drivers/media/video/cx23885/cx23885-core.c | |||
@@ -970,11 +970,12 @@ static int cx23885_dev_setup(struct cx23885_dev *dev) | |||
970 | /* Assume some sensible defaults */ | 970 | /* Assume some sensible defaults */ |
971 | dev->tuner_type = cx23885_boards[dev->board].tuner_type; | 971 | dev->tuner_type = cx23885_boards[dev->board].tuner_type; |
972 | dev->tuner_addr = cx23885_boards[dev->board].tuner_addr; | 972 | dev->tuner_addr = cx23885_boards[dev->board].tuner_addr; |
973 | dev->tuner_bus = cx23885_boards[dev->board].tuner_bus; | ||
973 | dev->radio_type = cx23885_boards[dev->board].radio_type; | 974 | dev->radio_type = cx23885_boards[dev->board].radio_type; |
974 | dev->radio_addr = cx23885_boards[dev->board].radio_addr; | 975 | dev->radio_addr = cx23885_boards[dev->board].radio_addr; |
975 | 976 | ||
976 | dprintk(1, "%s() tuner_type = 0x%x tuner_addr = 0x%x\n", | 977 | dprintk(1, "%s() tuner_type = 0x%x tuner_addr = 0x%x tuner_bus = %d\n", |
977 | __func__, dev->tuner_type, dev->tuner_addr); | 978 | __func__, dev->tuner_type, dev->tuner_addr, dev->tuner_bus); |
978 | dprintk(1, "%s() radio_type = 0x%x radio_addr = 0x%x\n", | 979 | dprintk(1, "%s() radio_type = 0x%x radio_addr = 0x%x\n", |
979 | __func__, dev->radio_type, dev->radio_addr); | 980 | __func__, dev->radio_type, dev->radio_addr); |
980 | 981 | ||
diff --git a/drivers/media/video/cx23885/cx23885-video.c b/drivers/media/video/cx23885/cx23885-video.c index 644fcb808c0b..ee57f6bedbe3 100644 --- a/drivers/media/video/cx23885/cx23885-video.c +++ b/drivers/media/video/cx23885/cx23885-video.c | |||
@@ -1468,16 +1468,17 @@ int cx23885_video_register(struct cx23885_dev *dev) | |||
1468 | 1468 | ||
1469 | cx23885_irq_add_enable(dev, 0x01); | 1469 | cx23885_irq_add_enable(dev, 0x01); |
1470 | 1470 | ||
1471 | if (TUNER_ABSENT != dev->tuner_type) { | 1471 | if ((TUNER_ABSENT != dev->tuner_type) && |
1472 | ((dev->tuner_bus == 0) || (dev->tuner_bus == 1))) { | ||
1472 | struct v4l2_subdev *sd = NULL; | 1473 | struct v4l2_subdev *sd = NULL; |
1473 | 1474 | ||
1474 | if (dev->tuner_addr) | 1475 | if (dev->tuner_addr) |
1475 | sd = v4l2_i2c_new_subdev(&dev->v4l2_dev, | 1476 | sd = v4l2_i2c_new_subdev(&dev->v4l2_dev, |
1476 | &dev->i2c_bus[1].i2c_adap, | 1477 | &dev->i2c_bus[dev->tuner_bus].i2c_adap, |
1477 | "tuner", dev->tuner_addr, NULL); | 1478 | "tuner", dev->tuner_addr, NULL); |
1478 | else | 1479 | else |
1479 | sd = v4l2_i2c_new_subdev(&dev->v4l2_dev, | 1480 | sd = v4l2_i2c_new_subdev(&dev->v4l2_dev, |
1480 | &dev->i2c_bus[1].i2c_adap, | 1481 | &dev->i2c_bus[dev->tuner_bus].i2c_adap, |
1481 | "tuner", 0, v4l2_i2c_tuner_addrs(ADDRS_TV)); | 1482 | "tuner", 0, v4l2_i2c_tuner_addrs(ADDRS_TV)); |
1482 | if (sd) { | 1483 | if (sd) { |
1483 | struct tuner_setup tun_setup; | 1484 | struct tuner_setup tun_setup; |
diff --git a/drivers/media/video/cx23885/cx23885.h b/drivers/media/video/cx23885/cx23885.h index 8b77feabc594..d8c76b05e4d7 100644 --- a/drivers/media/video/cx23885/cx23885.h +++ b/drivers/media/video/cx23885/cx23885.h | |||
@@ -209,6 +209,7 @@ struct cx23885_board { | |||
209 | unsigned int radio_type; | 209 | unsigned int radio_type; |
210 | unsigned char tuner_addr; | 210 | unsigned char tuner_addr; |
211 | unsigned char radio_addr; | 211 | unsigned char radio_addr; |
212 | unsigned int tuner_bus; | ||
212 | 213 | ||
213 | /* Vendors can and do run the PCIe bridge at different | 214 | /* Vendors can and do run the PCIe bridge at different |
214 | * clock rates, driven physically by crystals on the PCBs. | 215 | * clock rates, driven physically by crystals on the PCBs. |
@@ -364,6 +365,7 @@ struct cx23885_dev { | |||
364 | v4l2_std_id tvnorm; | 365 | v4l2_std_id tvnorm; |
365 | unsigned int tuner_type; | 366 | unsigned int tuner_type; |
366 | unsigned char tuner_addr; | 367 | unsigned char tuner_addr; |
368 | unsigned int tuner_bus; | ||
367 | unsigned int radio_type; | 369 | unsigned int radio_type; |
368 | unsigned char radio_addr; | 370 | unsigned char radio_addr; |
369 | unsigned int has_radio; | 371 | unsigned int has_radio; |