aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx23885/cx23885-cards.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/cx23885/cx23885-cards.c')
-rw-r--r--drivers/media/video/cx23885/cx23885-cards.c54
1 files changed, 42 insertions, 12 deletions
diff --git a/drivers/media/video/cx23885/cx23885-cards.c b/drivers/media/video/cx23885/cx23885-cards.c
index fd7112c11d35..a19de850955d 100644
--- a/drivers/media/video/cx23885/cx23885-cards.c
+++ b/drivers/media/video/cx23885/cx23885-cards.c
@@ -145,6 +145,7 @@ struct cx23885_board cx23885_boards[] = {
145 }, 145 },
146 [CX23885_BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP] = { 146 [CX23885_BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP] = {
147 .name = "DViCO FusionHDTV7 Dual Express", 147 .name = "DViCO FusionHDTV7 Dual Express",
148 .portb = CX23885_MPEG_DVB,
148 .portc = CX23885_MPEG_DVB, 149 .portc = CX23885_MPEG_DVB,
149 }, 150 },
150}; 151};
@@ -325,25 +326,41 @@ int cx23885_tuner_callback(void *priv, int command, int arg)
325{ 326{
326 struct cx23885_i2c *bus = priv; 327 struct cx23885_i2c *bus = priv;
327 struct cx23885_dev *dev = bus->dev; 328 struct cx23885_dev *dev = bus->dev;
329 u32 bitmask = 0;
330
331 if (command != 0) {
332 printk(KERN_ERR "%s(): Unknown command 0x%x.\n",
333 __func__, command);
334 return -EINVAL;
335 }
328 336
329 switch(dev->board) { 337 switch(dev->board) {
330 case CX23885_BOARD_HAUPPAUGE_HVR1500Q: 338 case CX23885_BOARD_HAUPPAUGE_HVR1500Q:
331 if(command == 0) { /* Tuner Reset Command from xc5000 */ 339 /* Tuner Reset Command from xc5000 */
332 /* Drive the tuner into reset and out */ 340 if (command == 0)
333 cx_clear(GP0_IO, 0x00000004); 341 bitmask = 0x04;
334 mdelay(200); 342 break;
335 cx_set(GP0_IO, 0x00000004); 343 case CX23885_BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP:
336 return 0; 344 if (command == 0) {
337 } 345
338 else { 346 /* Two identical tuners on two different i2c buses,
339 printk(KERN_ERR 347 * we need to reset the correct gpio. */
340 "%s(): Unknow command.\n", __func__); 348 if (bus->nr == 0)
341 return -EINVAL; 349 bitmask = 0x01;
350 else if (bus->nr == 1)
351 bitmask = 0x04;
342 } 352 }
343 break; 353 break;
344 } 354 }
345 355
346 return 0; /* Should never be here */ 356 if (bitmask) {
357 /* Drive the tuner into reset and back out */
358 cx_clear(GP0_IO, bitmask);
359 mdelay(200);
360 cx_set(GP0_IO, bitmask);
361 }
362
363 return 0;
347} 364}
348 365
349void cx23885_gpio_setup(struct cx23885_dev *dev) 366void cx23885_gpio_setup(struct cx23885_dev *dev)
@@ -435,6 +452,19 @@ void cx23885_gpio_setup(struct cx23885_dev *dev)
435 mdelay(20); 452 mdelay(20);
436 cx_set(GP0_IO, 0x00050005); 453 cx_set(GP0_IO, 0x00050005);
437 break; 454 break;
455 case CX23885_BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP:
456 /* GPIO-0 xc5000 tuner reset i2c bus 0 */
457 /* GPIO-1 s5h1409 demod reset i2c bus 0 */
458 /* GPIO-2 xc5000 tuner reset i2c bus 1 */
459 /* GPIO-3 s5h1409 demod reset i2c bus 0 */
460
461 /* Put the parts into reset and back */
462 cx_set(GP0_IO, 0x000f0000);
463 mdelay(20);
464 cx_clear(GP0_IO, 0x0000000f);
465 mdelay(20);
466 cx_set(GP0_IO, 0x000f000f);
467 break;
438 } 468 }
439} 469}
440 470