V4L/DVB (8470): cx23885: Add DViCO HDTV7 Dual Express tuner callback support.

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Monday, July 28, 2008 - 10:02 am

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6df516...
Commit:     6df516905b5c53b306d90be33f9c56434e8db053
Parent:     1ecc5aed1ea426dbb7e5cd9a0c980c14c879277b
Author:     Steven Toth <stoth@hauppauge.com>
AuthorDate: Mon Jun 30 22:17:05 2008 -0300
Committer:  Mauro Carvalho Chehab <mchehab@infradead.org>
CommitDate: Sat Jul 26 12:54:30 2008 -0300

    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>
---
 drivers/media/video/cx23885/cx23885-cards.c |   40 +++++++++++++++++++--------
 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 691b352..a19de85 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)
 {
 	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)
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
V4L/DVB (8470): cx23885: Add DViCO HDTV7 Dual Express tune ..., Linux Kernel Mailing ..., (Mon Jul 28, 10:02 am)