]> err.no Git - linux-2.6/blobdiff - drivers/media/video/cx23885/cx23885-cards.c
V4L/DVB (7006): cx23885: Track the board clock frequency and allow overrides
[linux-2.6] / drivers / media / video / cx23885 / cx23885-cards.c
index 515f415564d5b5513fcde851b07e642c6855b385..a4bac43cf9f5b455df404872571e0bc665b829c4 100644 (file)
@@ -32,6 +32,8 @@
 struct cx23885_board cx23885_boards[] = {
        [CX23885_BOARD_UNKNOWN] = {
                .name           = "UNKNOWN/GENERIC",
+               /* Ensure safe default for unknown boards */
+               .clk_freq       = 0,
                .input          = {{
                        .type   = CX23885_VMUX_COMPOSITE1,
                        .vmux   = 0,
@@ -117,7 +119,10 @@ struct cx23885_board cx23885_boards[] = {
                .name           = "Hauppauge WinTV-HVR1500Q",
                .portc          = CX23885_MPEG_DVB,
        },
-
+       [CX23885_BOARD_HAUPPAUGE_HVR1500] = {
+               .name           = "Hauppauge WinTV-HVR1500",
+               .portc          = CX23885_MPEG_DVB,
+       },
 };
 const unsigned int cx23885_bcount = ARRAY_SIZE(cx23885_boards);
 
@@ -141,6 +146,10 @@ struct cx23885_subid cx23885_subids[] = {
                .subvendor = 0x0070,
                .subdevice = 0x7801,
                .card      = CX23885_BOARD_HAUPPAUGE_HVR1800,
+       },{
+               .subvendor = 0x0070,
+               .subdevice = 0x7809,
+               .card      = CX23885_BOARD_HAUPPAUGE_HVR1800,
        },{
                .subvendor = 0x0070,
                .subdevice = 0x7911,
@@ -149,10 +158,22 @@ struct cx23885_subid cx23885_subids[] = {
                .subvendor = 0x18ac,
                .subdevice = 0xd500,
                .card      = CX23885_BOARD_DVICO_FUSIONHDTV_5_EXP,
+       },{
+               .subvendor = 0x0070,
+               .subdevice = 0x7790,
+               .card      = CX23885_BOARD_HAUPPAUGE_HVR1500Q,
        },{
                .subvendor = 0x0070,
                .subdevice = 0x7797,
                .card      = CX23885_BOARD_HAUPPAUGE_HVR1500Q,
+       },{
+               .subvendor = 0x0070,
+               .subdevice = 0x7710,
+               .card      = CX23885_BOARD_HAUPPAUGE_HVR1500,
+       },{
+               .subvendor = 0x0070,
+               .subdevice = 0x7717,
+               .card      = CX23885_BOARD_HAUPPAUGE_HVR1500,
        },
 };
 const unsigned int cx23885_idcount = ARRAY_SIZE(cx23885_subids);
@@ -193,9 +214,19 @@ static void hauppauge_eeprom(struct cx23885_dev *dev, u8 *eeprom_data)
        switch (tv.model)
        {
        case 76601: /* WinTV-HVR1800lp (PCIe, Retail, No IR, Dual channel ATSC and MPEG2 HW Encoder */
-       case 77001: /* WinTV-HVR1500 (Express Card, Retail, No IR, ATSC and Basic analog */
-       case 78501: /* WinTV-HVR1800 (PCIe, Retail, IR, Dual channel ATSC and MPEG2 HW Encoder */
-       case 78521: /* WinTV-HVR1800 (PCIe, Retail, IR, Dual channel ATSC and MPEG2 HW Encoder */
+       case 77001: /* WinTV-HVR1500 (Express Card, OEM, No IR, ATSC and Basic analog */
+       case 77011: /* WinTV-HVR1500 (Express Card, Retail, No IR, ATSC and Basic analog */
+       case 77041: /* WinTV-HVR1500Q (Express Card, OEM, No IR, ATSC/QAM and Basic analog */
+       case 77051: /* WinTV-HVR1500Q (Express Card, Retail, No IR, ATSC/QAM and Basic analog */
+       case 78011: /* WinTV-HVR1800 (PCIe, Retail, 3.5mm in, IR, No FM, Dual channel ATSC and MPEG2 HW Encoder */
+       case 78501: /* WinTV-HVR1800 (PCIe, OEM, RCA in, No IR, FM, Dual channel ATSC and MPEG2 HW Encoder */
+       case 78521: /* WinTV-HVR1800 (PCIe, OEM, RCA in, No IR, FM, Dual channel ATSC and MPEG2 HW Encoder */
+       case 78531: /* WinTV-HVR1800 (PCIe, OEM, RCA in, No IR, No FM, Dual channel ATSC and MPEG2 HW Encoder */
+       case 78631: /* WinTV-HVR1800 (PCIe, OEM, No IR, No FM, Dual channel ATSC and MPEG2 HW Encoder */
+       case 79001: /* WinTV-HVR1250 (PCIe, Retail, IR, full height, ATSC and Basic analog */
+       case 79101: /* WinTV-HVR1250 (PCIe, Retail, IR, half height, ATSC and Basic analog */
+       case 79571: /* WinTV-HVR1250 (PCIe, OEM, No IR, full height, ATSC and Basic analog */
+       case 79671: /* WinTV-HVR1250 (PCIe, OEM, No IR, half height, ATSC and Basic analog */
                break;
        default:
                printk("%s: warning: unknown hauppauge model #%d\n", dev->name, tv.model);
@@ -213,6 +244,18 @@ void cx23885_gpio_setup(struct cx23885_dev *dev)
                /* GPIO-0 cx24227 demodulator reset */
                cx_set(GP0_IO, 0x00010001); /* Bring the part out of reset */
                break;
+       case CX23885_BOARD_HAUPPAUGE_HVR1500:
+               /* GPIO-0 cx24227 demodulator */
+               /* GPIO-2 xc3028 tuner */
+
+               /* Put the parts into reset */
+               cx_set(GP0_IO, 0x00050000);
+               cx_clear(GP0_IO, 0x00000005);
+               msleep(5);
+
+               /* Bring the parts out of reset */
+               cx_set(GP0_IO, 0x00050005);
+               break;
        case CX23885_BOARD_HAUPPAUGE_HVR1500Q:
                /* GPIO-0 cx24227 demodulator reset */
                /* GPIO-2 xc5000 tuner reset */
@@ -226,7 +269,14 @@ void cx23885_gpio_setup(struct cx23885_dev *dev)
                /* GPIO-11-14 cx23417 addr0-3 */
                /* GPIO-15-18 cx23417 READY, CS, RD, WR */
                /* GPIO-19 IR_RX */
-               // FIXME: Analog requires the tuner is brought out of reset
+
+               /* Force the TDA8295A into reset and back */
+               cx_set(GP0_IO, 0x00040004);
+               mdelay(20);
+               cx_clear(GP0_IO, 0x00000004);
+               mdelay(20);
+               cx_set(GP0_IO, 0x00040004);
+               mdelay(20);
                break;
        }
 }
@@ -235,6 +285,7 @@ int cx23885_ir_init(struct cx23885_dev *dev)
 {
        switch (dev->board) {
        case CX23885_BOARD_HAUPPAUGE_HVR1250:
+       case CX23885_BOARD_HAUPPAUGE_HVR1500:
        case CX23885_BOARD_HAUPPAUGE_HVR1500Q:
        case CX23885_BOARD_HAUPPAUGE_HVR1800:
                /* FIXME: Implement me */
@@ -259,6 +310,7 @@ void cx23885_card_setup(struct cx23885_dev *dev)
 
        switch (dev->board) {
        case CX23885_BOARD_HAUPPAUGE_HVR1250:
+       case CX23885_BOARD_HAUPPAUGE_HVR1500:
        case CX23885_BOARD_HAUPPAUGE_HVR1500Q:
        case CX23885_BOARD_HAUPPAUGE_HVR1800:
        case CX23885_BOARD_HAUPPAUGE_HVR1800lp:
@@ -274,6 +326,7 @@ void cx23885_card_setup(struct cx23885_dev *dev)
                ts1->src_sel_val   = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO;
                break;
        case CX23885_BOARD_HAUPPAUGE_HVR1250:
+       case CX23885_BOARD_HAUPPAUGE_HVR1500:
        case CX23885_BOARD_HAUPPAUGE_HVR1500Q:
        case CX23885_BOARD_HAUPPAUGE_HVR1800:
        case CX23885_BOARD_HAUPPAUGE_HVR1800lp: