]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/media/video/ivtv/ivtv-i2c.c
V4L/DVB (8379): saa7127: Make device detection optional
[linux-2.6-omap-h63xx.git] / drivers / media / video / ivtv / ivtv-i2c.c
index 9824eafee02131eb88b67045de9ce32de8f0e93e..af154238fb9afdc7817bc8e685923aa18e607950 100644 (file)
 #define IVTV_REG_I2C_GETSCL_OFFSET 0x7008
 #define IVTV_REG_I2C_GETSDA_OFFSET 0x700c
 
-#ifndef I2C_ADAP_CLASS_TV_ANALOG
-#define I2C_ADAP_CLASS_TV_ANALOG I2C_CLASS_TV_ANALOG
-#endif /* I2C_ADAP_CLASS_TV_ANALOG */
-
 #define IVTV_CS53L32A_I2C_ADDR         0x11
 #define IVTV_M52790_I2C_ADDR           0x48
 #define IVTV_CX25840_I2C_ADDR          0x44
@@ -136,16 +132,16 @@ static const u8 hw_addrs[] = {
 };
 
 /* This array should match the IVTV_HW_ defines */
-static const char * const hw_drivernames[] = {
+static const char * const hw_devicenames[] = {
        "cx25840",
        "saa7115",
-       "saa7127",
+       "saa7127_auto", /* saa7127 or saa7129 */
        "msp3400",
        "tuner",
        "wm8775",
        "cs53l32a",
        "tveeprom",
-       "saa7115",
+       "saa7114",
        "upd64031a",
        "upd64083",
        "saa717x",
@@ -167,7 +163,7 @@ int ivtv_i2c_register(struct ivtv *itv, unsigned idx)
                return -1;
        id = hw_driverids[idx];
        memset(&info, 0, sizeof(info));
-       strcpy(info.driver_name, hw_drivernames[idx]);
+       strlcpy(info.type, hw_devicenames[idx], sizeof(info.type));
        info.addr = hw_addrs[idx];
        for (i = 0; itv->i2c_clients[i] && i < I2C_CLIENTS_MAX; i++) {}
 
@@ -656,7 +652,7 @@ static const char *ivtv_i2c_id_name(u32 id)
 
        for (i = 0; i < ARRAY_SIZE(hw_driverids); i++)
                if (hw_driverids[i] == id)
-                       return hw_drivernames[i];
+                       return hw_devicenames[i];
        return "unknown device";
 }
 
@@ -667,7 +663,7 @@ static const char *ivtv_i2c_hw_name(u32 hw)
 
        for (i = 0; i < ARRAY_SIZE(hw_driverids); i++)
                if (1 << i == hw)
-                       return hw_drivernames[i];
+                       return hw_devicenames[i];
        return "unknown device";
 }
 
@@ -769,7 +765,7 @@ int init_ivtv_i2c(struct ivtv *itv)
         * same size and GPIO must be the last entry.
         */
        if (ARRAY_SIZE(hw_driverids) != ARRAY_SIZE(hw_addrs) ||
-           ARRAY_SIZE(hw_drivernames) != ARRAY_SIZE(hw_addrs) ||
+           ARRAY_SIZE(hw_devicenames) != ARRAY_SIZE(hw_addrs) ||
            IVTV_HW_GPIO != (1 << (ARRAY_SIZE(hw_addrs) - 1)) ||
            hw_driverids[ARRAY_SIZE(hw_addrs) - 1]) {
                IVTV_ERR("Mismatched I2C hardware arrays\n");