diff options
author | Steven Toth <stoth@hauppauge.com> | 2008-06-30 21:17:05 -0400 |
---|---|---|
committer | Steven Toth <stoth@hauppauge.com> | 2008-06-30 21:17:05 -0400 |
commit | bf0ba42500218953501a1bef8f3a1f5cc5237457 (patch) | |
tree | 9d225b9d0f255cc740e29ced2e825182979fcd85 /linux/drivers/media/video/cx23885/cx23885-cards.c | |
parent | bd1974db7aad57ce9931e4717afa1c5a7633a0d5 (diff) | |
download | mediapointer-dvb-s2-bf0ba42500218953501a1bef8f3a1f5cc5237457.tar.gz mediapointer-dvb-s2-bf0ba42500218953501a1bef8f3a1f5cc5237457.tar.bz2 |
cx23885: Add DViCO HDTV7 Dual Express tuner callback support.
From: Steven Toth <stoth@hauppauge.com>
Ensure the correct tuner gets reset on demand.
Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: <>
Diffstat (limited to 'linux/drivers/media/video/cx23885/cx23885-cards.c')
-rw-r--r-- | linux/drivers/media/video/cx23885/cx23885-cards.c | 40 |
1 files changed, 28 insertions, 12 deletions
diff --git a/linux/drivers/media/video/cx23885/cx23885-cards.c b/linux/drivers/media/video/cx23885/cx23885-cards.c index ba69f2b9a..ee01ff8bf 100644 --- a/linux/drivers/media/video/cx23885/cx23885-cards.c +++ b/linux/drivers/media/video/cx23885/cx23885-cards.c @@ -327,25 +327,41 @@ int cx23885_tuner_callback(void *priv, int command, int arg) { struct cx23885_i2c *bus = priv; struct cx23885_dev *dev = bus->dev; + u32 bitmask = 0; + + if (command != 0) { + printk(KERN_ERR "%s(): Unknown command 0x%x.\n", + __func__, command); + return -EINVAL; + } switch(dev->board) { case CX23885_BOARD_HAUPPAUGE_HVR1500Q: - if(command == 0) { /* Tuner Reset Command from xc5000 */ - /* Drive the tuner into reset and out */ - cx_clear(GP0_IO, 0x00000004); - mdelay(200); - cx_set(GP0_IO, 0x00000004); - return 0; - } - else { - printk(KERN_ERR - "%s(): Unknow command.\n", __func__); - return -EINVAL; + /* Tuner Reset Command from xc5000 */ + if (command == 0) + bitmask = 0x04; + break; + case CX23885_BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP: + if (command == 0) { + + /* Two identical tuners on two different i2c buses, + * we need to reset the correct gpio. */ + if (bus->nr == 0) + bitmask = 0x01; + else if (bus->nr == 1) + bitmask = 0x04; } break; } - return 0; /* Should never be here */ + if (bitmask) { + /* Drive the tuner into reset and back out */ + cx_clear(GP0_IO, bitmask); + mdelay(200); + cx_set(GP0_IO, bitmask); + } + + return 0; } void cx23885_gpio_setup(struct cx23885_dev *dev) |