The patch number 8470 was added via Steven Toth <[EMAIL PROTECTED]>
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
        [EMAIL PROTECTED]

------

From: Steven Toth  <[EMAIL PROTECTED]>
cx23885: Add DViCO HDTV7 Dual Express tuner callback support.


Ensure the correct tuner gets reset on demand.

Signed-off-by: Steven Toth <[EMAIL PROTECTED]>
Signed-off-by:  <>


---

 linux/drivers/media/video/cx23885/cx23885-cards.c |   46 +++++++++-----
 1 file changed, 31 insertions(+), 15 deletions(-)

diff -r 12cdad568d2a -r 2d925110d38a 
linux/drivers/media/video/cx23885/cx23885-cards.c
--- a/linux/drivers/media/video/cx23885/cx23885-cards.c Mon Jun 30 20:23:50 
2008 -0400
+++ b/linux/drivers/media/video/cx23885/cx23885-cards.c Mon Jun 30 21:17:05 
2008 -0400
@@ -327,25 +327,41 @@ int cx23885_tuner_callback(void *priv, i
 {
        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;
+               /* 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;
                }
-               else {
-                       printk(KERN_ERR
-                               "%s(): Unknow command.\n", __func__);
-                       return -EINVAL;
-               }
-               break;
-       }
-
-       return 0; /* Should never be here */
+               break;
+       }
+
+       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)


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/2d925110d38a654e955f4646cabfd3332248da46

_______________________________________________
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to