]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/media/video/au0828/au0828-cards.c
Merge branch 'core/softlockup' of git://git.kernel.org/pub/scm/linux/kernel/git/tip...
[linux-2.6-omap-h63xx.git] / drivers / media / video / au0828 / au0828-cards.c
index a12c92c037460afa77a5b3663521f57353a011df..053bbe8c8e3aaf89bd8850c5196400fdeb34e129 100644 (file)
@@ -46,6 +46,7 @@ struct au0828_board au0828_boards[] = {
                .name   = "Hauppauge HVR850",
                .tuner_type = TUNER_XC5000,
                .tuner_addr = 0x61,
+               .i2c_clk_divider = AU0828_I2C_CLK_30KHZ,
                .input = {
                        {
                                .type = AU0828_VMUX_TELEVISION,
@@ -70,6 +71,13 @@ struct au0828_board au0828_boards[] = {
                .name   = "Hauppauge HVR950Q",
                .tuner_type = TUNER_XC5000,
                .tuner_addr = 0x61,
+               /* The au0828 hardware i2c implementation does not properly
+                  support the xc5000's i2c clock stretching.  So we need to
+                  lower the clock frequency enough where the 15us clock
+                  stretch fits inside of a normal clock cycle, or else the
+                  au0828 fails to set the STOP bit.  A 30 KHz clock puts the
+                  clock pulse width at 18us */
+               .i2c_clk_divider = AU0828_I2C_CLK_30KHZ,
                .input = {
                        {
                                .type = AU0828_VMUX_TELEVISION,
@@ -94,16 +102,19 @@ struct au0828_board au0828_boards[] = {
                .name   = "Hauppauge HVR950Q rev xxF8",
                .tuner_type = UNSET,
                .tuner_addr = ADDR_UNSET,
+               .i2c_clk_divider = AU0828_I2C_CLK_250KHZ,
        },
        [AU0828_BOARD_DVICO_FUSIONHDTV7] = {
                .name   = "DViCO FusionHDTV USB",
                .tuner_type = UNSET,
                .tuner_addr = ADDR_UNSET,
+               .i2c_clk_divider = AU0828_I2C_CLK_250KHZ,
        },
        [AU0828_BOARD_HAUPPAUGE_WOODBURY] = {
                .name = "Hauppauge Woodbury",
                .tuner_type = UNSET,
                .tuner_addr = ADDR_UNSET,
+               .i2c_clk_divider = AU0828_I2C_CLK_250KHZ,
        },
 };
 
@@ -150,13 +161,13 @@ static void hauppauge_eeprom(struct au0828_dev *dev, u8 *eeprom_data)
        /* Make sure we support the board model */
        switch (tv.model) {
        case 72000: /* WinTV-HVR950q (Retail, IR, ATSC/QAM */
-       case 72001: /* WinTV-HVR950q (Retail, IR, ATSC/QAM and basic analog video */
-       case 72211: /* WinTV-HVR950q (OEM, IR, ATSC/QAM and basic analog video */
-       case 72221: /* WinTV-HVR950q (OEM, IR, ATSC/QAM and basic analog video */
-       case 72231: /* WinTV-HVR950q (OEM, IR, ATSC/QAM and basic analog video */
-       case 72241: /* WinTV-HVR950q (OEM, No IR, ATSC/QAM and basic analog video */
-       case 72251: /* WinTV-HVR950q (Retail, IR, ATSC/QAM and basic analog video */
-       case 72301: /* WinTV-HVR850 (Retail, IR, ATSC and basic analog video */
+       case 72001: /* WinTV-HVR950q (Retail, IR, ATSC/QAM and analog video */
+       case 72211: /* WinTV-HVR950q (OEM, IR, ATSC/QAM and analog video */
+       case 72221: /* WinTV-HVR950q (OEM, IR, ATSC/QAM and analog video */
+       case 72231: /* WinTV-HVR950q (OEM, IR, ATSC/QAM and analog video */
+       case 72241: /* WinTV-HVR950q (OEM, No IR, ATSC/QAM and analog video */
+       case 72251: /* WinTV-HVR950q (Retail, IR, ATSC/QAM and analog video */
+       case 72301: /* WinTV-HVR850 (Retail, IR, ATSC and analog video */
        case 72500: /* WinTV-HVR950q (OEM, No IR, ATSC/QAM */
                break;
        default:
@@ -200,27 +211,26 @@ void au0828_card_setup(struct au0828_dev *dev)
                /* Load the analog demodulator driver (note this would need to
                   be abstracted out if we ever need to support a different
                   demod) */
-               sd = v4l2_i2c_new_subdev(&dev->i2c_adap, "au8522", "au8522",
-                                        0x8e >> 1);
-               if (sd == NULL) {
-                       printk("analog subdev registration failure\n");
-               }
+               sd = v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
+                               "au8522", "au8522", 0x8e >> 1);
+               if (sd == NULL)
+                       printk(KERN_ERR "analog subdev registration failed\n");
        }
 
        /* Setup tuners */
        if (dev->board.tuner_type != TUNER_ABSENT) {
                /* Load the tuner module, which does the attach */
-               sd = v4l2_i2c_new_subdev(&dev->i2c_adap, "tuner", "tuner",
-                                        dev->board.tuner_addr);
-               if (sd == NULL) {
-                       printk("analog tuner subdev registration failure\n");
-               }
+               sd = v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
+                               "tuner", "tuner", dev->board.tuner_addr);
+               if (sd == NULL)
+                       printk(KERN_ERR "tuner subdev registration fail\n");
 
                tun_setup.mode_mask      = mode_mask;
                tun_setup.type           = dev->board.tuner_type;
                tun_setup.addr           = dev->board.tuner_addr;
                tun_setup.tuner_callback = au0828_tuner_callback;
-               au0828_call_i2c_clients(dev, TUNER_SET_TYPE_ADDR, &tun_setup);
+               v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_type_addr,
+                                    &tun_setup);
        }
 }