]> err.no Git - linux-2.6/blobdiff - drivers/media/video/cx23885/cx23885-cards.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
[linux-2.6] / drivers / media / video / cx23885 / cx23885-cards.c
index a4bac43cf9f5b455df404872571e0bc665b829c4..2d414dad5c31ac2b9c184459d6d04a6b42746dce 100644 (file)
@@ -23,6 +23,7 @@
 #include <linux/module.h>
 #include <linux/pci.h>
 #include <linux/delay.h>
+#include <media/cx25840.h>
 
 #include "cx23885.h"
 
@@ -71,23 +72,29 @@ struct cx23885_board cx23885_boards[] = {
        },
        [CX23885_BOARD_HAUPPAUGE_HVR1800] = {
                .name           = "Hauppauge WinTV-HVR1800",
+               .porta          = CX23885_ANALOG_VIDEO,
                .portc          = CX23885_MPEG_DVB,
+               .tuner_type     = TUNER_PHILIPS_TDA8290,
+               .tuner_addr     = 0x42, /* 0x84 >> 1 */
                .input          = {{
                        .type   = CX23885_VMUX_TELEVISION,
-                       .vmux   = 0,
-                       .gpio0  = 0xff00,
-               },{
-                       .type   = CX23885_VMUX_DEBUG,
-                       .vmux   = 0,
-                       .gpio0  = 0xff01,
+                       .vmux   =       CX25840_VIN7_CH3 |
+                                       CX25840_VIN5_CH2 |
+                                       CX25840_VIN2_CH1,
+                       .gpio0  = 0,
                },{
                        .type   = CX23885_VMUX_COMPOSITE1,
-                       .vmux   = 1,
-                       .gpio0  = 0xff02,
+                       .vmux   =       CX25840_VIN7_CH3 |
+                                       CX25840_VIN4_CH2 |
+                                       CX25840_VIN6_CH1,
+                       .gpio0  = 0,
                },{
                        .type   = CX23885_VMUX_SVIDEO,
-                       .vmux   = 2,
-                       .gpio0  = 0xff02,
+                       .vmux   =       CX25840_VIN7_CH3 |
+                                       CX25840_VIN4_CH2 |
+                                       CX25840_VIN8_CH1 |
+                                       CX25840_SVIDEO_ON,
+                       .gpio0  = 0,
                }},
        },
        [CX23885_BOARD_HAUPPAUGE_HVR1250] = {
@@ -237,6 +244,34 @@ static void hauppauge_eeprom(struct cx23885_dev *dev, u8 *eeprom_data)
                        dev->name, tv.model);
 }
 
+/* Tuner callback function for cx23885 boards. Currently only needed
+ * for HVR1500Q, which has an xc5000 tuner.
+ */
+int cx23885_tuner_callback(void *priv, int command, int arg)
+{
+       struct cx23885_i2c *bus = priv;
+       struct cx23885_dev *dev = bus->dev;
+
+       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", __FUNCTION__);
+                       return -EINVAL;
+               }
+               break;
+       }
+
+       return 0; /* Should never be here */
+}
+
 void cx23885_gpio_setup(struct cx23885_dev *dev)
 {
        switch(dev->board) {