aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSteven Toth <stoth@hauppauge.com>2008-06-30 21:17:05 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-07-26 11:54:30 -0400
commit6df516905b5c53b306d90be33f9c56434e8db053 (patch)
tree7c779e32db8767d666c88e28b3979cbd659771e0 /drivers
parent1ecc5aed1ea426dbb7e5cd9a0c980c14c879277b (diff)
V4L/DVB (8470): cx23885: Add DViCO HDTV7 Dual Express tuner callback support.
Ensure the correct tuner gets reset on demand. Signed-off-by: Steven Toth <stoth@hauppauge.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/cx23885/cx23885-cards.c40
1 files changed, 28 insertions, 12 deletions
diff --git a/drivers/media/video/cx23885/cx23885-cards.c b/drivers/media/video/cx23885/cx23885-cards.c
index 691b35279c20..a19de850955d 100644
--- a/drivers/media/video/cx23885/cx23885-cards.c
+++ b/drivers/media/video/cx23885/cx23885-cards.c
@@ -326,25 +326,41 @@ int cx23885_tuner_callback(void *priv, int command, int arg)
326{ 326{
327 struct cx23885_i2c *bus = priv; 327 struct cx23885_i2c *bus = priv;
328 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 }
329 336
330 switch(dev->board) { 337 switch(dev->board) {
331 case CX23885_BOARD_HAUPPAUGE_HVR1500Q: 338 case CX23885_BOARD_HAUPPAUGE_HVR1500Q:
332 if(command == 0) { /* Tuner Reset Command from xc5000 */ 339 /* Tuner Reset Command from xc5000 */
333 /* Drive the tuner into reset and out */ 340 if (command == 0)
334 cx_clear(GP0_IO, 0x00000004); 341 bitmask = 0x04;
335 mdelay(200); 342 break;
336 cx_set(GP0_IO, 0x00000004); 343 case CX23885_BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP:
337 return 0; 344 if (command == 0) {
338 } 345
339 else { 346 /* Two identical tuners on two different i2c buses,
340 printk(KERN_ERR 347 * we need to reset the correct gpio. */
341 "%s(): Unknow command.\n", __func__); 348 if (bus->nr == 0)
342 return -EINVAL; 349 bitmask = 0x01;
350 else if (bus->nr == 1)
351 bitmask = 0x04;
343 } 352 }
344 break; 353 break;
345 } 354 }
346 355
347 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;
348} 364}
349 365
350void cx23885_gpio_setup(struct cx23885_dev *dev) 366void cx23885_gpio_setup(struct cx23885_dev *dev)