Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6

* 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6:
i2c/max6875: Really prevent 24RF08 corruption
i2c-amd756: Fix functionality flags
i2c: Kill the old driver matching scheme
i2c: Convert remaining new-style drivers to use module aliasing
i2c: Switch pasemi to the new device/driver matching scheme
i2c: Clean up Blackfin BF527 I2C device declarations
i2c-nforce2: Disable the second SMBus channel on the DFI Lanparty NF4 Expert
i2c: New co-maintainer

+180 -80
+3 -1
MAINTAINERS
··· 1940 1940 S: Maintained 1941 1941 1942 1942 I2C SUBSYSTEM 1943 - P: Jean Delvare 1943 + P: Jean Delvare (PC drivers, core) 1944 1944 M: khali@linux-fr.org 1945 + P: Ben Dooks (embedded platforms) 1946 + M: ben-linux@fluff.org 1945 1947 L: i2c@lm-sensors.org 1946 1948 T: quilt http://khali.linux-fr.org/devel/linux-2.6/jdelvare-i2c/ 1947 1949 S: Maintained
-2
arch/blackfin/mach-bf527/boards/ezkit.c
··· 799 799 #if defined(CONFIG_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE) 800 800 { 801 801 I2C_BOARD_INFO("pcf8574_lcd", 0x22), 802 - .type = "pcf8574_lcd", 803 802 }, 804 803 #endif 805 804 #if defined(CONFIG_TWI_KEYPAD) || defined(CONFIG_TWI_KEYPAD_MODULE) 806 805 { 807 806 I2C_BOARD_INFO("pcf8574_keypad", 0x27), 808 - .type = "pcf8574_keypad", 809 807 .irq = IRQ_PF8, 810 808 }, 811 809 #endif
+2 -5
arch/powerpc/platforms/pasemi/misc.c
··· 24 24 */ 25 25 struct i2c_driver_device { 26 26 char *of_device; 27 - char *i2c_driver; 28 27 char *i2c_type; 29 28 }; 30 29 31 30 static struct i2c_driver_device i2c_devices[] __initdata = { 32 - {"dallas,ds1338", "rtc-ds1307", "ds1338"}, 31 + {"dallas,ds1338", "ds1338"}, 33 32 }; 34 33 35 34 static int __init find_i2c_driver(struct device_node *node, ··· 39 40 for (i = 0; i < ARRAY_SIZE(i2c_devices); i++) { 40 41 if (!of_device_is_compatible(node, i2c_devices[i].of_device)) 41 42 continue; 42 - if (strlcpy(info->driver_name, i2c_devices[i].i2c_driver, 43 - KOBJ_NAME_LEN) >= KOBJ_NAME_LEN || 44 - strlcpy(info->type, i2c_devices[i].i2c_type, 43 + if (strlcpy(info->type, i2c_devices[i].i2c_type, 45 44 I2C_NAME_SIZE) >= I2C_NAME_SIZE) 46 45 return -ENOMEM; 47 46 return 0;
+1 -1
drivers/i2c/busses/i2c-amd756.c
··· 290 290 { 291 291 return I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE | 292 292 I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA | 293 - I2C_FUNC_SMBUS_BLOCK_DATA | I2C_FUNC_SMBUS_PROC_CALL; 293 + I2C_FUNC_SMBUS_BLOCK_DATA; 294 294 } 295 295 296 296 static const struct i2c_algorithm smbus_algorithm = {
+24 -4
drivers/i2c/busses/i2c-nforce2.c
··· 50 50 #include <linux/init.h> 51 51 #include <linux/i2c.h> 52 52 #include <linux/delay.h> 53 + #include <linux/dmi.h> 53 54 #include <asm/io.h> 54 55 55 56 MODULE_LICENSE("GPL"); ··· 109 108 110 109 /* Misc definitions */ 111 110 #define MAX_TIMEOUT 100 111 + 112 + /* We disable the second SMBus channel on these boards */ 113 + static struct dmi_system_id __devinitdata nforce2_dmi_blacklist2[] = { 114 + { 115 + .ident = "DFI Lanparty NF4 Expert", 116 + .matches = { 117 + DMI_MATCH(DMI_BOARD_VENDOR, "DFI Corp,LTD"), 118 + DMI_MATCH(DMI_BOARD_NAME, "LP UT NF4 Expert"), 119 + }, 120 + }, 121 + { } 122 + }; 112 123 113 124 static struct pci_driver nforce2_driver; 114 125 ··· 380 367 smbuses[0].base = 0; /* to have a check value */ 381 368 } 382 369 /* SMBus adapter 2 */ 383 - res2 = nforce2_probe_smb(dev, 5, NFORCE_PCI_SMB2, &smbuses[1], "SMB2"); 384 - if (res2 < 0) { 385 - dev_err(&dev->dev, "Error probing SMB2.\n"); 386 - smbuses[1].base = 0; /* to have a check value */ 370 + if (dmi_check_system(nforce2_dmi_blacklist2)) { 371 + dev_err(&dev->dev, "Disabling SMB2 for safety reasons.\n"); 372 + res2 = -EPERM; 373 + smbuses[1].base = 0; 374 + } else { 375 + res2 = nforce2_probe_smb(dev, 5, NFORCE_PCI_SMB2, &smbuses[1], 376 + "SMB2"); 377 + if (res2 < 0) { 378 + dev_err(&dev->dev, "Error probing SMB2.\n"); 379 + smbuses[1].base = 0; /* to have a check value */ 380 + } 387 381 } 388 382 if ((res1 < 0) && (res2 < 0)) { 389 383 /* we did not find even one of the SMBuses, so we give up */
-3
drivers/i2c/chips/max6875.c
··· 207 207 fake_client->flags = 0; 208 208 strlcpy(fake_client->name, "max6875 subclient", I2C_NAME_SIZE); 209 209 210 - /* Prevent 24RF08 corruption (in case of user error) */ 211 - i2c_smbus_write_quick(real_client, 0); 212 - 213 210 if ((err = i2c_attach_client(real_client)) != 0) 214 211 goto exit_kfree2; 215 212
+5 -17
drivers/i2c/i2c-core.c
··· 74 74 if (driver->id_table) 75 75 return i2c_match_id(driver->id_table, client) != NULL; 76 76 77 - /* new style drivers use the same kind of driver matching policy 78 - * as platform devices or SPI: compare device and driver IDs. 79 - */ 80 - return strcmp(client->driver_name, drv->name) == 0; 77 + return 0; 81 78 } 82 79 83 80 #ifdef CONFIG_HOTPLUG ··· 88 91 if (dev->driver) 89 92 return 0; 90 93 91 - if (client->driver_name[0]) { 92 - if (add_uevent_var(env, "MODALIAS=%s", client->driver_name)) 93 - return -ENOMEM; 94 - } else { 95 - if (add_uevent_var(env, "MODALIAS=%s%s", 96 - I2C_MODULE_PREFIX, client->name)) 97 - return -ENOMEM; 98 - } 94 + if (add_uevent_var(env, "MODALIAS=%s%s", 95 + I2C_MODULE_PREFIX, client->name)) 96 + return -ENOMEM; 99 97 dev_dbg(dev, "uevent\n"); 100 98 return 0; 101 99 } ··· 198 206 static ssize_t show_modalias(struct device *dev, struct device_attribute *attr, char *buf) 199 207 { 200 208 struct i2c_client *client = to_i2c_client(dev); 201 - return client->driver_name[0] 202 - ? sprintf(buf, "%s\n", client->driver_name) 203 - : sprintf(buf, "%s%s\n", I2C_MODULE_PREFIX, client->name); 209 + return sprintf(buf, "%s%s\n", I2C_MODULE_PREFIX, client->name); 204 210 } 205 211 206 212 static struct device_attribute i2c_dev_attrs[] = { ··· 272 282 client->addr = info->addr; 273 283 client->irq = info->irq; 274 284 275 - strlcpy(client->driver_name, info->driver_name, 276 - sizeof(client->driver_name)); 277 285 strlcpy(client->name, info->type, sizeof(client->name)); 278 286 279 287 /* a new style driver may be bound to this device when we
+7
drivers/media/video/cs5345.c
··· 160 160 161 161 /* ----------------------------------------------------------------------- */ 162 162 163 + static const struct i2c_device_id cs5345_id[] = { 164 + { "cs5345", 0 }, 165 + { } 166 + }; 167 + MODULE_DEVICE_TABLE(i2c, cs5345_id); 168 + 163 169 static struct v4l2_i2c_driver_data v4l2_i2c_data = { 164 170 .name = "cs5345", 165 171 .driverid = I2C_DRIVERID_CS5345, 166 172 .command = cs5345_command, 167 173 .probe = cs5345_probe, 174 + .id_table = cs5345_id, 168 175 }; 169 176
+9 -1
drivers/media/video/cs53l32a.c
··· 144 144 if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) 145 145 return -EIO; 146 146 147 - snprintf(client->name, sizeof(client->name) - 1, "cs53l32a"); 147 + if (!id) 148 + strlcpy(client->name, "cs53l32a", sizeof(client->name)); 148 149 149 150 v4l_info(client, "chip found @ 0x%x (%s)\n", 150 151 client->addr << 1, client->adapter->name); ··· 176 175 return 0; 177 176 } 178 177 178 + static const struct i2c_device_id cs53l32a_id[] = { 179 + { "cs53l32a", 0 }, 180 + { } 181 + }; 182 + MODULE_DEVICE_TABLE(i2c, cs53l32a_id); 183 + 179 184 static struct v4l2_i2c_driver_data v4l2_i2c_data = { 180 185 .name = "cs53l32a", 181 186 .driverid = I2C_DRIVERID_CS53L32A, 182 187 .command = cs53l32a_command, 183 188 .probe = cs53l32a_probe, 189 + .id_table = cs53l32a_id, 184 190 }; 185 191
+4 -5
drivers/media/video/cx18/cx18-i2c.c
··· 74 74 }; 75 75 76 76 /* This array should match the CX18_HW_ defines */ 77 - static const char * const hw_drivernames[] = { 77 + static const char * const hw_devicenames[] = { 78 78 "tuner", 79 79 "tveeprom", 80 80 "cs5345", ··· 95 95 id = hw_driverids[idx]; 96 96 bus = hw_bus[idx]; 97 97 memset(&info, 0, sizeof(info)); 98 - strlcpy(info.driver_name, hw_drivernames[idx], 99 - sizeof(info.driver_name)); 98 + strlcpy(info.type, hw_devicenames[idx], sizeof(info.type)); 100 99 info.addr = hw_addrs[idx]; 101 100 for (i = 0; i < I2C_CLIENTS_MAX; i++) 102 101 if (cx->i2c_clients[i] == NULL) ··· 278 279 279 280 for (i = 0; i < ARRAY_SIZE(hw_driverids); i++) 280 281 if (hw_driverids[i] == id) 281 - return hw_drivernames[i]; 282 + return hw_devicenames[i]; 282 283 return "unknown device"; 283 284 } 284 285 ··· 289 290 290 291 for (i = 0; i < ARRAY_SIZE(hw_driverids); i++) 291 292 if (1 << i == hw) 292 - return hw_drivernames[i]; 293 + return hw_devicenames[i]; 293 294 return "unknown device"; 294 295 } 295 296
+7
drivers/media/video/cx25840/cx25840-core.c
··· 1284 1284 return 0; 1285 1285 } 1286 1286 1287 + static const struct i2c_device_id cx25840_id[] = { 1288 + { "cx25840", 0 }, 1289 + { } 1290 + }; 1291 + MODULE_DEVICE_TABLE(i2c, cx25840_id); 1292 + 1287 1293 static struct v4l2_i2c_driver_data v4l2_i2c_data = { 1288 1294 .name = "cx25840", 1289 1295 .driverid = I2C_DRIVERID_CX25840, 1290 1296 .command = cx25840_command, 1291 1297 .probe = cx25840_probe, 1292 1298 .remove = cx25840_remove, 1299 + .id_table = cx25840_id, 1293 1300 };
+6 -7
drivers/media/video/ivtv/ivtv-i2c.c
··· 136 136 }; 137 137 138 138 /* This array should match the IVTV_HW_ defines */ 139 - static const char * const hw_drivernames[] = { 139 + static const char * const hw_devicenames[] = { 140 140 "cx25840", 141 141 "saa7115", 142 142 "saa7127", ··· 145 145 "wm8775", 146 146 "cs53l32a", 147 147 "tveeprom", 148 - "saa7115", 148 + "saa7114", 149 149 "upd64031a", 150 150 "upd64083", 151 151 "saa717x", ··· 167 167 return -1; 168 168 id = hw_driverids[idx]; 169 169 memset(&info, 0, sizeof(info)); 170 - strlcpy(info.driver_name, hw_drivernames[idx], 171 - sizeof(info.driver_name)); 170 + strlcpy(info.type, hw_devicenames[idx], sizeof(info.type)); 172 171 info.addr = hw_addrs[idx]; 173 172 for (i = 0; itv->i2c_clients[i] && i < I2C_CLIENTS_MAX; i++) {} 174 173 ··· 656 657 657 658 for (i = 0; i < ARRAY_SIZE(hw_driverids); i++) 658 659 if (hw_driverids[i] == id) 659 - return hw_drivernames[i]; 660 + return hw_devicenames[i]; 660 661 return "unknown device"; 661 662 } 662 663 ··· 667 668 668 669 for (i = 0; i < ARRAY_SIZE(hw_driverids); i++) 669 670 if (1 << i == hw) 670 - return hw_drivernames[i]; 671 + return hw_devicenames[i]; 671 672 return "unknown device"; 672 673 } 673 674 ··· 769 770 * same size and GPIO must be the last entry. 770 771 */ 771 772 if (ARRAY_SIZE(hw_driverids) != ARRAY_SIZE(hw_addrs) || 772 - ARRAY_SIZE(hw_drivernames) != ARRAY_SIZE(hw_addrs) || 773 + ARRAY_SIZE(hw_devicenames) != ARRAY_SIZE(hw_addrs) || 773 774 IVTV_HW_GPIO != (1 << (ARRAY_SIZE(hw_addrs) - 1)) || 774 775 hw_driverids[ARRAY_SIZE(hw_addrs) - 1]) { 775 776 IVTV_ERR("Mismatched I2C hardware arrays\n");
+7 -2
drivers/media/video/m52790.c
··· 135 135 if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) 136 136 return -EIO; 137 137 138 - snprintf(client->name, sizeof(client->name) - 1, "m52790"); 139 - 140 138 v4l_info(client, "chip found @ 0x%x (%s)\n", 141 139 client->addr << 1, client->adapter->name); 142 140 ··· 157 159 158 160 /* ----------------------------------------------------------------------- */ 159 161 162 + static const struct i2c_device_id m52790_id[] = { 163 + { "m52790", 0 }, 164 + { } 165 + }; 166 + MODULE_DEVICE_TABLE(i2c, m52790_id); 167 + 160 168 static struct v4l2_i2c_driver_data v4l2_i2c_data = { 161 169 .name = "m52790", 162 170 .driverid = I2C_DRIVERID_M52790, 163 171 .command = m52790_command, 164 172 .probe = m52790_probe, 165 173 .remove = m52790_remove, 174 + .id_table = m52790_id, 166 175 }; 167 176
+12 -5
drivers/media/video/msp3400-driver.c
··· 815 815 int msp_product, msp_prod_hi, msp_prod_lo; 816 816 int msp_rom; 817 817 818 - snprintf(client->name, sizeof(client->name) - 1, "msp3400"); 818 + if (!id) 819 + strlcpy(client->name, "msp3400", sizeof(client->name)); 819 820 820 821 if (msp_reset(client) == -1) { 821 822 v4l_dbg(1, msp_debug, client, "msp3400 not found\n"); ··· 865 864 msp_revision = (state->rev1 & 0x0f) + '@'; 866 865 msp_hard = ((state->rev1 >> 8) & 0xff) + '@'; 867 866 msp_rom = state->rev2 & 0x1f; 868 - snprintf(client->name, sizeof(client->name), "MSP%d4%02d%c-%c%d", 869 - msp_family, msp_product, 870 - msp_revision, msp_hard, msp_rom); 871 867 /* Rev B=2, C=3, D=4, G=7 */ 872 868 state->ident = msp_family * 10000 + 4000 + msp_product * 10 + 873 869 msp_revision - '@'; ··· 929 931 } 930 932 931 933 /* hello world :-) */ 932 - v4l_info(client, "%s found @ 0x%x (%s)\n", client->name, 934 + v4l_info(client, "MSP%d4%02d%c-%c%d found @ 0x%x (%s)\n", 935 + msp_family, msp_product, 936 + msp_revision, msp_hard, msp_rom, 933 937 client->addr << 1, client->adapter->name); 934 938 v4l_info(client, "%s ", client->name); 935 939 if (state->has_nicam && state->has_radio) ··· 987 987 988 988 /* ----------------------------------------------------------------------- */ 989 989 990 + static const struct i2c_device_id msp_id[] = { 991 + { "msp3400", 0 }, 992 + { } 993 + }; 994 + MODULE_DEVICE_TABLE(i2c, msp_id); 995 + 990 996 static struct v4l2_i2c_driver_data v4l2_i2c_data = { 991 997 .name = "msp3400", 992 998 .driverid = I2C_DRIVERID_MSP3400, ··· 1001 995 .remove = msp_remove, 1002 996 .suspend = msp_suspend, 1003 997 .resume = msp_resume, 998 + .id_table = msp_id, 1004 999 }; 1005 1000 1006 1001
+28 -12
drivers/media/video/saa7115.c
··· 1456 1456 struct saa711x_state *state; 1457 1457 int i; 1458 1458 char name[17]; 1459 - u8 chip_id; 1459 + char chip_id; 1460 + int autodetect = !id || id->driver_data == 1; 1460 1461 1461 1462 /* Check if the adapter supports the needed features */ 1462 1463 if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) 1463 1464 return -EIO; 1464 - 1465 - snprintf(client->name, sizeof(client->name) - 1, "saa7115"); 1466 1465 1467 1466 for (i = 0; i < 0x0f; i++) { 1468 1467 saa711x_write(client, 0, i); ··· 1471 1472 } 1472 1473 name[i] = '\0'; 1473 1474 1474 - saa711x_write(client, 0, 5); 1475 - chip_id = saa711x_read(client, 0) & 0x0f; 1475 + chip_id = name[5]; 1476 1476 1477 1477 /* Check whether this chip is part of the saa711x series */ 1478 1478 if (memcmp(name, "1f711", 5)) { ··· 1480 1482 return -ENODEV; 1481 1483 } 1482 1484 1483 - snprintf(client->name, sizeof(client->name) - 1, "saa711%d",chip_id); 1484 - v4l_info(client, "saa711%d found (%s) @ 0x%x (%s)\n", chip_id, name, client->addr << 1, client->adapter->name); 1485 + /* Safety check */ 1486 + if (!autodetect && id->name[6] != chip_id) { 1487 + v4l_warn(client, "found saa711%c while %s was expected\n", 1488 + chip_id, id->name); 1489 + } 1490 + snprintf(client->name, sizeof(client->name), "saa711%c", chip_id); 1491 + v4l_info(client, "saa711%c found (%s) @ 0x%x (%s)\n", chip_id, name, 1492 + client->addr << 1, client->adapter->name); 1485 1493 1486 1494 state = kzalloc(sizeof(struct saa711x_state), GFP_KERNEL); 1487 1495 i2c_set_clientdata(client, state); ··· 1503 1499 state->hue = 0; 1504 1500 state->sat = 64; 1505 1501 switch (chip_id) { 1506 - case 1: 1502 + case '1': 1507 1503 state->ident = V4L2_IDENT_SAA7111; 1508 1504 break; 1509 - case 3: 1505 + case '3': 1510 1506 state->ident = V4L2_IDENT_SAA7113; 1511 1507 break; 1512 - case 4: 1508 + case '4': 1513 1509 state->ident = V4L2_IDENT_SAA7114; 1514 1510 break; 1515 - case 5: 1511 + case '5': 1516 1512 state->ident = V4L2_IDENT_SAA7115; 1517 1513 break; 1518 - case 8: 1514 + case '8': 1519 1515 state->ident = V4L2_IDENT_SAA7118; 1520 1516 break; 1521 1517 default: ··· 1557 1553 return 0; 1558 1554 } 1559 1555 1556 + static const struct i2c_device_id saa7115_id[] = { 1557 + { "saa711x", 1 }, /* autodetect */ 1558 + { "saa7111", 0 }, 1559 + { "saa7113", 0 }, 1560 + { "saa7114", 0 }, 1561 + { "saa7115", 0 }, 1562 + { "saa7118", 0 }, 1563 + { } 1564 + }; 1565 + MODULE_DEVICE_TABLE(i2c, saa7115_id); 1566 + 1560 1567 static struct v4l2_i2c_driver_data v4l2_i2c_data = { 1561 1568 .name = "saa7115", 1562 1569 .driverid = I2C_DRIVERID_SAA711X, ··· 1575 1560 .probe = saa7115_probe, 1576 1561 .remove = saa7115_remove, 1577 1562 .legacy_class = I2C_CLASS_TV_ANALOG | I2C_CLASS_TV_DIGITAL, 1563 + .id_table = saa7115_id, 1578 1564 }; 1579 1565
+7 -2
drivers/media/video/saa7127.c
··· 672 672 if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) 673 673 return -EIO; 674 674 675 - snprintf(client->name, sizeof(client->name) - 1, "saa7127"); 676 - 677 675 v4l_dbg(1, debug, client, "detecting saa7127 client on address 0x%x\n", 678 676 client->addr << 1); 679 677 ··· 739 741 740 742 /* ----------------------------------------------------------------------- */ 741 743 744 + static struct i2c_device_id saa7127_id[] = { 745 + { "saa7127", 0 }, 746 + { } 747 + }; 748 + MODULE_DEVICE_TABLE(i2c, saa7127_id); 749 + 742 750 static struct v4l2_i2c_driver_data v4l2_i2c_data = { 743 751 .name = "saa7127", 744 752 .driverid = I2C_DRIVERID_SAA7127, 745 753 .command = saa7127_command, 746 754 .probe = saa7127_probe, 747 755 .remove = saa7127_remove, 756 + .id_table = saa7127_id, 748 757 }; 749 758
+7 -2
drivers/media/video/saa717x.c
··· 1429 1429 if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) 1430 1430 return -EIO; 1431 1431 1432 - snprintf(client->name, sizeof(client->name) - 1, "saa717x"); 1433 - 1434 1432 if (saa717x_write(client, 0x5a4, 0xfe) && 1435 1433 saa717x_write(client, 0x5a5, 0x0f) && 1436 1434 saa717x_write(client, 0x5a6, 0x00) && ··· 1505 1507 1506 1508 /* ----------------------------------------------------------------------- */ 1507 1509 1510 + static const struct i2c_device_id saa717x_id[] = { 1511 + { "saa717x", 0 }, 1512 + { } 1513 + }; 1514 + MODULE_DEVICE_TABLE(i2c, saa717x_id); 1515 + 1508 1516 static struct v4l2_i2c_driver_data v4l2_i2c_data = { 1509 1517 .name = "saa717x", 1510 1518 .driverid = I2C_DRIVERID_SAA717X, ··· 1518 1514 .probe = saa717x_probe, 1519 1515 .remove = saa717x_remove, 1520 1516 .legacy_class = I2C_CLASS_TV_ANALOG | I2C_CLASS_TV_DIGITAL, 1517 + .id_table = saa717x_id, 1521 1518 };
+16 -1
drivers/media/video/tuner-core.c
··· 1115 1115 if (NULL == t) 1116 1116 return -ENOMEM; 1117 1117 t->i2c = client; 1118 - strlcpy(client->name, "(tuner unset)", sizeof(client->name)); 1119 1118 i2c_set_clientdata(client, t); 1120 1119 t->type = UNSET; 1121 1120 t->audmode = V4L2_TUNER_MODE_STEREO; ··· 1272 1273 1273 1274 list_del(&t->list); 1274 1275 kfree(t); 1276 + 1277 + /* The probing code has overwritten the device name, restore it so 1278 + that reloading the driver will work. Ideally the device name 1279 + should not be overwritten in the first place, but for now that 1280 + will do. */ 1281 + strlcpy(client->name, "tuner", I2C_NAME_SIZE); 1275 1282 return 0; 1276 1283 } 1277 1284 1278 1285 /* ----------------------------------------------------------------------- */ 1286 + 1287 + /* This driver supports many devices and the idea is to let the driver 1288 + detect which device is present. So rather than listing all supported 1289 + devices here, we pretend to support a single, fake device type. */ 1290 + static const struct i2c_device_id tuner_id[] = { 1291 + { "tuner", }, /* autodetect */ 1292 + { } 1293 + }; 1294 + MODULE_DEVICE_TABLE(i2c, tuner_id); 1279 1295 1280 1296 static struct v4l2_i2c_driver_data v4l2_i2c_data = { 1281 1297 .name = "tuner", ··· 1301 1287 .suspend = tuner_suspend, 1302 1288 .resume = tuner_resume, 1303 1289 .legacy_probe = tuner_legacy_probe, 1290 + .id_table = tuner_id, 1304 1291 }; 1305 1292 1306 1293
+6
drivers/media/video/upd64031a.c
··· 228 228 229 229 /* ----------------------------------------------------------------------- */ 230 230 231 + static const struct i2c_device_id upd64031a_id[] = { 232 + { "upd64031a", 0 }, 233 + { } 234 + }; 235 + MODULE_DEVICE_TABLE(i2c, upd64031a_id); 231 236 232 237 static struct v4l2_i2c_driver_data v4l2_i2c_data = { 233 238 .name = "upd64031a", ··· 240 235 .command = upd64031a_command, 241 236 .probe = upd64031a_probe, 242 237 .remove = upd64031a_remove, 238 + .id_table = upd64031a_id, 243 239 };
+6
drivers/media/video/upd64083.c
··· 205 205 206 206 /* ----------------------------------------------------------------------- */ 207 207 208 + static const struct i2c_device_id upd64083_id[] = { 209 + { "upd64083", 0 }, 210 + { } 211 + }; 212 + MODULE_DEVICE_TABLE(i2c, upd64083_id); 208 213 209 214 static struct v4l2_i2c_driver_data v4l2_i2c_data = { 210 215 .name = "upd64083", ··· 217 212 .command = upd64083_command, 218 213 .probe = upd64083_probe, 219 214 .remove = upd64083_remove, 215 + .id_table = upd64083_id, 220 216 };
+7 -2
drivers/media/video/vp27smpx.c
··· 130 130 if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) 131 131 return -EIO; 132 132 133 - snprintf(client->name, sizeof(client->name) - 1, "vp27smpx"); 134 - 135 133 v4l_info(client, "chip found @ 0x%x (%s)\n", 136 134 client->addr << 1, client->adapter->name); 137 135 ··· 152 154 153 155 /* ----------------------------------------------------------------------- */ 154 156 157 + static const struct i2c_device_id vp27smpx_id[] = { 158 + { "vp27smpx", 0 }, 159 + { } 160 + }; 161 + MODULE_DEVICE_TABLE(i2c, vp27smpx_id); 162 + 155 163 static struct v4l2_i2c_driver_data v4l2_i2c_data = { 156 164 .name = "vp27smpx", 157 165 .driverid = I2C_DRIVERID_VP27SMPX, 158 166 .command = vp27smpx_command, 159 167 .probe = vp27smpx_probe, 160 168 .remove = vp27smpx_remove, 169 + .id_table = vp27smpx_id, 161 170 }; 162 171
+7
drivers/media/video/wm8739.c
··· 313 313 return 0; 314 314 } 315 315 316 + static const struct i2c_device_id wm8739_id[] = { 317 + { "wm8739", 0 }, 318 + { } 319 + }; 320 + MODULE_DEVICE_TABLE(i2c, wm8739_id); 321 + 316 322 static struct v4l2_i2c_driver_data v4l2_i2c_data = { 317 323 .name = "wm8739", 318 324 .driverid = I2C_DRIVERID_WM8739, 319 325 .command = wm8739_command, 320 326 .probe = wm8739_probe, 321 327 .remove = wm8739_remove, 328 + .id_table = wm8739_id, 322 329 }; 323 330
+7
drivers/media/video/wm8775.c
··· 216 216 return 0; 217 217 } 218 218 219 + static const struct i2c_device_id wm8775_id[] = { 220 + { "wm8775", 0 }, 221 + { } 222 + }; 223 + MODULE_DEVICE_TABLE(i2c, wm8775_id); 224 + 219 225 static struct v4l2_i2c_driver_data v4l2_i2c_data = { 220 226 .name = "wm8775", 221 227 .driverid = I2C_DRIVERID_WM8775, 222 228 .command = wm8775_command, 223 229 .probe = wm8775_probe, 224 230 .remove = wm8775_remove, 231 + .id_table = wm8775_id, 225 232 }; 226 233
+1 -6
include/linux/i2c.h
··· 155 155 * @driver: device's driver, hence pointer to access routines 156 156 * @dev: Driver model device node for the slave. 157 157 * @irq: indicates the IRQ generated by this device (if any) 158 - * @driver_name: Identifies new-style driver used with this device; also 159 - * used as the module name for hotplug/coldplug modprobe support. 160 158 * @list: list of active/busy clients (DEPRECATED) 161 159 * @released: used to synchronize client releases & detaches and references 162 160 * ··· 172 174 struct i2c_driver *driver; /* and our access routines */ 173 175 struct device dev; /* the device structure */ 174 176 int irq; /* irq issued by device (or -1) */ 175 - char driver_name[KOBJ_NAME_LEN]; 176 177 struct list_head list; /* DEPRECATED */ 177 178 struct completion released; 178 179 }; ··· 197 200 198 201 /** 199 202 * struct i2c_board_info - template for device creation 200 - * @driver_name: identifies the driver to be bound to the device 201 - * @type: optional chip type information, to initialize i2c_client.name 203 + * @type: chip type, to initialize i2c_client.name 202 204 * @flags: to initialize i2c_client.flags 203 205 * @addr: stored in i2c_client.addr 204 206 * @platform_data: stored in i2c_client.dev.platform_data ··· 216 220 * with the adapter already known. 217 221 */ 218 222 struct i2c_board_info { 219 - char driver_name[KOBJ_NAME_LEN]; 220 223 char type[I2C_NAME_SIZE]; 221 224 unsigned short flags; 222 225 unsigned short addr;
+1 -2
include/linux/i2c/pcf857x.h
··· 12 12 * @context: optional parameter passed to setup() and teardown() 13 13 * 14 14 * In addition to the I2C_BOARD_INFO() state appropriate to each chip, 15 - * the i2c_board_info used with the pcf875x driver must provide the 16 - * chip "type" ("pcf8574", "pcf8574a", "pcf8575", "pcf8575c") and its 15 + * the i2c_board_info used with the pcf875x driver must provide its 17 16 * platform_data (pointer to one of these structures) with at least 18 17 * the gpio_base value initialized. 19 18 *