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://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging

* 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
macintosh: Don't assume i2c device probing always succeeds
i2c: Hide probe errors caused by ACPI resource conflicts
i2c: Minor documentation update
mfd: AB3100 drop unused module parameters
Staging: IIO: tsl2561: Drop unused module parameters
leds: leds-pca9532 - Drop unused module parameters
ltc4215/ltc4245: Discard obsolete detect methods
ds2482: Discard obsolete detect method
max6875: Discard obsolete detect method
i2c: Move misc devices documentation

+64 -257
+4 -3
Documentation/hwmon/ltc4215
··· 22 22 ----------- 23 23 24 24 This driver does not probe for LTC4215 devices, due to the fact that some 25 - of the possible addresses are unfriendly to probing. You will need to use 26 - the "force" parameter to tell the driver where to find the device. 25 + of the possible addresses are unfriendly to probing. You will have to 26 + instantiate the devices explicitly. 27 27 28 28 Example: the following will load the driver for an LTC4215 at address 0x44 29 29 on I2C bus #0: 30 - $ modprobe ltc4215 force=0,0x44 30 + $ modprobe ltc4215 31 + $ echo ltc4215 0x44 > /sys/bus/i2c/devices/i2c-0/new_device 31 32 32 33 33 34 Sysfs entries
+4 -3
Documentation/hwmon/ltc4245
··· 23 23 ----------- 24 24 25 25 This driver does not probe for LTC4245 devices, due to the fact that some 26 - of the possible addresses are unfriendly to probing. You will need to use 27 - the "force" parameter to tell the driver where to find the device. 26 + of the possible addresses are unfriendly to probing. You will have to 27 + instantiate the devices explicitly. 28 28 29 29 Example: the following will load the driver for an LTC4245 at address 0x23 30 30 on I2C bus #1: 31 - $ modprobe ltc4245 force=1,0x23 31 + $ modprobe ltc4245 32 + $ echo ltc4245 0x23 > /sys/bus/i2c/devices/i2c-1/new_device 32 33 33 34 34 35 Sysfs entries
Documentation/i2c/chips/eeprom Documentation/misc-devices/eeprom
+4 -2
Documentation/i2c/chips/max6875 Documentation/misc-devices/max6875
··· 42 42 43 43 Valid addresses for the MAX6875 are 0x50 and 0x52. 44 44 Valid addresses for the MAX6874 are 0x50, 0x52, 0x54 and 0x56. 45 - The driver does not probe any address, so you must force the address. 45 + The driver does not probe any address, so you explicitly instantiate the 46 + devices. 46 47 47 48 Example: 48 - $ modprobe max6875 force=0,0x50 49 + $ modprobe max6875 50 + $ echo max6875 0x50 > /sys/bus/i2c/devices/i2c-0/new_device 49 51 50 52 The MAX6874/MAX6875 ignores address bit 0, so this driver attaches to multiple 51 53 addresses. For example, for address 0x50, it also reserves 0x51.
+1 -1
Documentation/i2c/instantiating-devices
··· 188 188 deleted. 189 189 190 190 Example: 191 - # echo eeprom 0x50 > /sys/class/i2c-adapter/i2c-3/new_device 191 + # echo eeprom 0x50 > /sys/bus/i2c/devices/i2c-3/new_device 192 192 193 193 While this interface should only be used when in-kernel device declaration 194 194 can't be done, there is a variety of cases where it can be helpful:
+3 -3
Documentation/w1/masters/ds2482
··· 24 24 25 25 Valid addresses are 0x18, 0x19, 0x1a, and 0x1b. 26 26 However, the device cannot be detected without writing to the i2c bus, so no 27 - detection is done. 28 - You should force the device address. 27 + detection is done. You should instantiate the device explicitly. 29 28 30 - $ modprobe ds2482 force=0,0x18 29 + $ modprobe ds2482 30 + $ echo ds2482 0x18 > /sys/bus/i2c/devices/i2c-0/new_device 31 31
+5 -42
drivers/hwmon/ltc4215.c
··· 20 20 #include <linux/hwmon.h> 21 21 #include <linux/hwmon-sysfs.h> 22 22 23 - static const unsigned short normal_i2c[] = { I2C_CLIENT_END }; 24 - 25 - /* Insmod parameters */ 26 - I2C_CLIENT_INSMOD_1(ltc4215); 27 - 28 23 /* Here are names of the chip's registers (a.k.a. commands) */ 29 24 enum ltc4215_cmd { 30 25 LTC4215_CONTROL = 0x00, /* rw */ ··· 241 246 static int ltc4215_probe(struct i2c_client *client, 242 247 const struct i2c_device_id *id) 243 248 { 249 + struct i2c_adapter *adapter = client->adapter; 244 250 struct ltc4215_data *data; 245 251 int ret; 252 + 253 + if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) 254 + return -ENODEV; 246 255 247 256 data = kzalloc(sizeof(*data), GFP_KERNEL); 248 257 if (!data) { ··· 293 294 return 0; 294 295 } 295 296 296 - static int ltc4215_detect(struct i2c_client *client, 297 - int kind, 298 - struct i2c_board_info *info) 299 - { 300 - struct i2c_adapter *adapter = client->adapter; 301 - 302 - if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) 303 - return -ENODEV; 304 - 305 - if (kind < 0) { /* probed detection - check the chip type */ 306 - s32 v; /* 8 bits from the chip, or -ERRNO */ 307 - 308 - /* 309 - * Register 0x01 bit b7 is reserved, expect 0 310 - * Register 0x03 bit b6 and b7 are reserved, expect 0 311 - */ 312 - v = i2c_smbus_read_byte_data(client, LTC4215_ALERT); 313 - if (v < 0 || (v & (1 << 7)) != 0) 314 - return -ENODEV; 315 - 316 - v = i2c_smbus_read_byte_data(client, LTC4215_FAULT); 317 - if (v < 0 || (v & ((1 << 6) | (1 << 7))) != 0) 318 - return -ENODEV; 319 - } 320 - 321 - strlcpy(info->type, "ltc4215", I2C_NAME_SIZE); 322 - dev_info(&adapter->dev, "ltc4215 %s at address 0x%02x\n", 323 - kind < 0 ? "probed" : "forced", 324 - client->addr); 325 - 326 - return 0; 327 - } 328 - 329 297 static const struct i2c_device_id ltc4215_id[] = { 330 - { "ltc4215", ltc4215 }, 298 + { "ltc4215", 0 }, 331 299 { } 332 300 }; 333 301 MODULE_DEVICE_TABLE(i2c, ltc4215_id); 334 302 335 303 /* This is the driver that will be inserted */ 336 304 static struct i2c_driver ltc4215_driver = { 337 - .class = I2C_CLASS_HWMON, 338 305 .driver = { 339 306 .name = "ltc4215", 340 307 }, 341 308 .probe = ltc4215_probe, 342 309 .remove = ltc4215_remove, 343 310 .id_table = ltc4215_id, 344 - .detect = ltc4215_detect, 345 - .address_data = &addr_data, 346 311 }; 347 312 348 313 static int __init ltc4215_init(void)
+5 -126
drivers/hwmon/ltc4245.c
··· 22 22 #include <linux/hwmon.h> 23 23 #include <linux/hwmon-sysfs.h> 24 24 25 - /* Valid addresses are 0x20 - 0x3f 26 - * 27 - * For now, we do not probe, since some of these addresses 28 - * are known to be unfriendly to probing */ 29 - static const unsigned short normal_i2c[] = { I2C_CLIENT_END }; 30 - 31 - /* Insmod parameters */ 32 - I2C_CLIENT_INSMOD_1(ltc4245); 33 - 34 25 /* Here are names of the chip's registers (a.k.a. commands) */ 35 26 enum ltc4245_cmd { 36 27 LTC4245_STATUS = 0x00, /* readonly */ ··· 360 369 static int ltc4245_probe(struct i2c_client *client, 361 370 const struct i2c_device_id *id) 362 371 { 372 + struct i2c_adapter *adapter = client->adapter; 363 373 struct ltc4245_data *data; 364 374 int ret; 375 + 376 + if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) 377 + return -ENODEV; 365 378 366 379 data = kzalloc(sizeof(*data), GFP_KERNEL); 367 380 if (!data) { ··· 413 418 return 0; 414 419 } 415 420 416 - /* Check that some bits in a control register appear at all possible 417 - * locations without changing value 418 - * 419 - * @client: the i2c client to use 420 - * @reg: the register to read 421 - * @bits: the bits to check (0xff checks all bits, 422 - * 0x03 checks only the last two bits) 423 - * 424 - * return -ERRNO if the register read failed 425 - * return -ENODEV if the register value doesn't stay constant at all 426 - * possible addresses 427 - * 428 - * return 0 for success 429 - */ 430 - static int ltc4245_check_control_reg(struct i2c_client *client, u8 reg, u8 bits) 431 - { 432 - int i; 433 - s32 v, voff1, voff2; 434 - 435 - /* Read register and check for error */ 436 - v = i2c_smbus_read_byte_data(client, reg); 437 - if (v < 0) 438 - return v; 439 - 440 - v &= bits; 441 - 442 - for (i = 0x00; i < 0xff; i += 0x20) { 443 - 444 - voff1 = i2c_smbus_read_byte_data(client, reg + i); 445 - if (voff1 < 0) 446 - return voff1; 447 - 448 - voff2 = i2c_smbus_read_byte_data(client, reg + i + 0x08); 449 - if (voff2 < 0) 450 - return voff2; 451 - 452 - voff1 &= bits; 453 - voff2 &= bits; 454 - 455 - if (v != voff1 || v != voff2) 456 - return -ENODEV; 457 - } 458 - 459 - return 0; 460 - } 461 - 462 - static int ltc4245_detect(struct i2c_client *client, 463 - int kind, 464 - struct i2c_board_info *info) 465 - { 466 - struct i2c_adapter *adapter = client->adapter; 467 - 468 - if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) 469 - return -ENODEV; 470 - 471 - if (kind < 0) { /* probed detection - check the chip type */ 472 - s32 v; /* 8 bits from the chip, or -ERRNO */ 473 - 474 - /* Chip registers 0x00-0x07 are control registers 475 - * Chip registers 0x10-0x1f are data registers 476 - * 477 - * Address bits b7-b5 are ignored. This makes the chip "repeat" 478 - * in steps of 0x20. Any control registers should appear with 479 - * the same values across all duplicated addresses. 480 - * 481 - * Register 0x02 bit b2 is reserved, expect 0 482 - * Register 0x07 bits b7 to b4 are reserved, expect 0 483 - * 484 - * Registers 0x01, 0x02 are control registers and should not 485 - * change on their own. 486 - * 487 - * Register 0x06 bits b6 and b7 are control bits, and should 488 - * not change on their own. 489 - * 490 - * Register 0x07 bits b3 to b0 are control bits, and should 491 - * not change on their own. 492 - */ 493 - 494 - /* read register 0x02 reserved bit, expect 0 */ 495 - v = i2c_smbus_read_byte_data(client, LTC4245_CONTROL); 496 - if (v < 0 || (v & 0x04) != 0) 497 - return -ENODEV; 498 - 499 - /* read register 0x07 reserved bits, expect 0 */ 500 - v = i2c_smbus_read_byte_data(client, LTC4245_ADCADR); 501 - if (v < 0 || (v & 0xf0) != 0) 502 - return -ENODEV; 503 - 504 - /* check that the alert register appears at all locations */ 505 - if (ltc4245_check_control_reg(client, LTC4245_ALERT, 0xff)) 506 - return -ENODEV; 507 - 508 - /* check that the control register appears at all locations */ 509 - if (ltc4245_check_control_reg(client, LTC4245_CONTROL, 0xff)) 510 - return -ENODEV; 511 - 512 - /* check that register 0x06 bits b6 and b7 stay constant */ 513 - if (ltc4245_check_control_reg(client, LTC4245_GPIO, 0xc0)) 514 - return -ENODEV; 515 - 516 - /* check that register 0x07 bits b3-b0 stay constant */ 517 - if (ltc4245_check_control_reg(client, LTC4245_ADCADR, 0x0f)) 518 - return -ENODEV; 519 - } 520 - 521 - strlcpy(info->type, "ltc4245", I2C_NAME_SIZE); 522 - dev_info(&adapter->dev, "ltc4245 %s at address 0x%02x\n", 523 - kind < 0 ? "probed" : "forced", 524 - client->addr); 525 - 526 - return 0; 527 - } 528 - 529 421 static const struct i2c_device_id ltc4245_id[] = { 530 - { "ltc4245", ltc4245 }, 422 + { "ltc4245", 0 }, 531 423 { } 532 424 }; 533 425 MODULE_DEVICE_TABLE(i2c, ltc4245_id); 534 426 535 427 /* This is the driver that will be inserted */ 536 428 static struct i2c_driver ltc4245_driver = { 537 - .class = I2C_CLASS_HWMON, 538 429 .driver = { 539 430 .name = "ltc4245", 540 431 }, 541 432 .probe = ltc4245_probe, 542 433 .remove = ltc4245_remove, 543 434 .id_table = ltc4245_id, 544 - .detect = ltc4245_detect, 545 - .address_data = &addr_data, 546 435 }; 547 436 548 437 static int __init ltc4245_init(void)
+1 -1
drivers/i2c/busses/i2c-amd756.c
··· 364 364 error = acpi_check_region(amd756_ioport, SMB_IOSIZE, 365 365 amd756_driver.name); 366 366 if (error) 367 - return error; 367 + return -ENODEV; 368 368 369 369 if (!request_region(amd756_ioport, SMB_IOSIZE, amd756_driver.name)) { 370 370 dev_err(&pdev->dev, "SMB region 0x%x already in use!\n",
+3 -1
drivers/i2c/busses/i2c-amd8111.c
··· 376 376 smbus->size = pci_resource_len(dev, 0); 377 377 378 378 error = acpi_check_resource_conflict(&dev->resource[0]); 379 - if (error) 379 + if (error) { 380 + error = -ENODEV; 380 381 goto out_kfree; 382 + } 381 383 382 384 if (!request_region(smbus->base, smbus->size, amd8111_driver.name)) { 383 385 error = -EBUSY;
+3 -1
drivers/i2c/busses/i2c-i801.c
··· 732 732 } 733 733 734 734 err = acpi_check_resource_conflict(&dev->resource[SMBBAR]); 735 - if (err) 735 + if (err) { 736 + err = -ENODEV; 736 737 goto exit; 738 + } 737 739 738 740 err = pci_request_region(dev, SMBBAR, i801_driver.name); 739 741 if (err) {
+1 -1
drivers/i2c/busses/i2c-isch.c
··· 281 281 return -ENODEV; 282 282 } 283 283 if (acpi_check_region(sch_smba, SMBIOSIZE, sch_driver.name)) 284 - return -EBUSY; 284 + return -ENODEV; 285 285 if (!request_region(sch_smba, SMBIOSIZE, sch_driver.name)) { 286 286 dev_err(&dev->dev, "SMBus region 0x%x already in use!\n", 287 287 sch_smba);
+2 -2
drivers/i2c/busses/i2c-piix4.c
··· 169 169 } 170 170 171 171 if (acpi_check_region(piix4_smba, SMBIOSIZE, piix4_driver.name)) 172 - return -EBUSY; 172 + return -ENODEV; 173 173 174 174 if (!request_region(piix4_smba, SMBIOSIZE, piix4_driver.name)) { 175 175 dev_err(&PIIX4_dev->dev, "SMBus region 0x%x already in use!\n", ··· 260 260 261 261 piix4_smba = ((smba_en_hi << 8) | smba_en_lo) & 0xffe0; 262 262 if (acpi_check_region(piix4_smba, SMBIOSIZE, piix4_driver.name)) 263 - return -EBUSY; 263 + return -ENODEV; 264 264 265 265 if (!request_region(piix4_smba, SMBIOSIZE, piix4_driver.name)) { 266 266 dev_err(&PIIX4_dev->dev, "SMBus region 0x%x already in use!\n",
+1 -1
drivers/i2c/busses/i2c-sis96x.c
··· 280 280 281 281 retval = acpi_check_resource_conflict(&dev->resource[SIS96x_BAR]); 282 282 if (retval) 283 - return retval; 283 + return -ENODEV; 284 284 285 285 /* Everything is happy, let's grab the memory and set things up. */ 286 286 if (!request_region(sis96x_smbus_base, SMB_IOSIZE,
+1 -1
drivers/i2c/busses/i2c-viapro.c
··· 365 365 found: 366 366 error = acpi_check_region(vt596_smba, 8, vt596_driver.name); 367 367 if (error) 368 - return error; 368 + return -ENODEV; 369 369 370 370 if (!request_region(vt596_smba, 8, vt596_driver.name)) { 371 371 dev_err(&pdev->dev, "SMBus region 0x%x already in use!\n",
-3
drivers/leds/leds-pca9532.c
··· 19 19 #include <linux/workqueue.h> 20 20 #include <linux/leds-pca9532.h> 21 21 22 - static const unsigned short normal_i2c[] = { /*0x60,*/ I2C_CLIENT_END}; 23 - I2C_CLIENT_INSMOD_1(pca9532); 24 - 25 22 #define PCA9532_REG_PSC(i) (0x2+(i)*2) 26 23 #define PCA9532_REG_PWM(i) (0x3+(i)*2) 27 24 #define PCA9532_REG_LS0 0x6
+3 -1
drivers/macintosh/therm_adt746x.c
··· 124 124 return data; 125 125 } 126 126 127 + static struct i2c_driver thermostat_driver; 128 + 127 129 static int 128 130 attach_thermostat(struct i2c_adapter *adapter) 129 131 { ··· 150 148 * Let i2c-core delete that device on driver removal. 151 149 * This is safe because i2c-core holds the core_lock mutex for us. 152 150 */ 153 - list_add_tail(&client->detected, &client->driver->clients); 151 + list_add_tail(&client->detected, &thermostat_driver.clients); 154 152 return 0; 155 153 } 156 154
+3 -1
drivers/macintosh/therm_pm72.c
··· 286 286 }, 287 287 }; 288 288 289 + static struct i2c_driver therm_pm72_driver; 290 + 289 291 /* 290 292 * Utility function to create an i2c_client structure and 291 293 * attach it to one of u3 adapters ··· 320 318 * Let i2c-core delete that device on driver removal. 321 319 * This is safe because i2c-core holds the core_lock mutex for us. 322 320 */ 323 - list_add_tail(&clt->detected, &clt->driver->clients); 321 + list_add_tail(&clt->detected, &therm_pm72_driver.clients); 324 322 return clt; 325 323 } 326 324
+3 -1
drivers/macintosh/windfarm_lm75_sensor.c
··· 115 115 return rc; 116 116 } 117 117 118 + static struct i2c_driver wf_lm75_driver; 119 + 118 120 static struct i2c_client *wf_lm75_create(struct i2c_adapter *adapter, 119 121 u8 addr, int ds1775, 120 122 const char *loc) ··· 159 157 * Let i2c-core delete that device on driver removal. 160 158 * This is safe because i2c-core holds the core_lock mutex for us. 161 159 */ 162 - list_add_tail(&client->detected, &client->driver->clients); 160 + list_add_tail(&client->detected, &wf_lm75_driver.clients); 163 161 return client; 164 162 fail: 165 163 return NULL;
+3 -1
drivers/macintosh/windfarm_max6690_sensor.c
··· 88 88 return rc; 89 89 } 90 90 91 + static struct i2c_driver wf_max6690_driver; 92 + 91 93 static struct i2c_client *wf_max6690_create(struct i2c_adapter *adapter, 92 94 u8 addr, const char *loc) 93 95 { ··· 121 119 * Let i2c-core delete that device on driver removal. 122 120 * This is safe because i2c-core holds the core_lock mutex for us. 123 121 */ 124 - list_add_tail(&client->detected, &client->driver->clients); 122 + list_add_tail(&client->detected, &wf_max6690_driver.clients); 125 123 return client; 126 124 127 125 fail:
+3 -1
drivers/macintosh/windfarm_smu_sat.c
··· 194 194 .owner = THIS_MODULE, 195 195 }; 196 196 197 + static struct i2c_driver wf_sat_driver; 198 + 197 199 static void wf_sat_create(struct i2c_adapter *adapter, struct device_node *dev) 198 200 { 199 201 struct i2c_board_info info; ··· 224 222 * Let i2c-core delete that device on driver removal. 225 223 * This is safe because i2c-core holds the core_lock mutex for us. 226 224 */ 227 - list_add_tail(&client->detected, &client->driver->clients); 225 + list_add_tail(&client->detected, &wf_sat_driver.clients); 228 226 } 229 227 230 228 static int wf_sat_probe(struct i2c_client *client,
+1 -3
drivers/mfd/ab3100-core.c
··· 57 57 * The AB3100 is usually assigned address 0x48 (7-bit) 58 58 * The chip is defined in the platform i2c_board_data section. 59 59 */ 60 - static unsigned short normal_i2c[] = { 0x48, I2C_CLIENT_END }; 61 - I2C_CLIENT_INSMOD_1(ab3100); 62 60 63 61 u8 ab3100_get_chip_type(struct ab3100 *ab3100) 64 62 { ··· 964 966 } 965 967 966 968 static const struct i2c_device_id ab3100_id[] = { 967 - { "ab3100", ab3100 }, 969 + { "ab3100", 0 }, 968 970 { } 969 971 }; 970 972 MODULE_DEVICE_TABLE(i2c, ab3100_id);
+5 -24
drivers/misc/eeprom/max6875.c
··· 33 33 #include <linux/i2c.h> 34 34 #include <linux/mutex.h> 35 35 36 - /* Do not scan - the MAX6875 access method will write to some EEPROM chips */ 37 - static const unsigned short normal_i2c[] = { I2C_CLIENT_END }; 38 - 39 - /* Insmod parameters */ 40 - I2C_CLIENT_INSMOD_1(max6875); 41 - 42 36 /* The MAX6875 can only read/write 16 bytes at a time */ 43 37 #define SLICE_SIZE 16 44 38 #define SLICE_BITS 4 ··· 140 146 .read = max6875_read, 141 147 }; 142 148 143 - /* Return 0 if detection is successful, -ENODEV otherwise */ 144 - static int max6875_detect(struct i2c_client *client, int kind, 145 - struct i2c_board_info *info) 149 + static int max6875_probe(struct i2c_client *client, 150 + const struct i2c_device_id *id) 146 151 { 147 152 struct i2c_adapter *adapter = client->adapter; 153 + struct max6875_data *data; 154 + int err; 148 155 149 156 if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_WRITE_BYTE_DATA 150 157 | I2C_FUNC_SMBUS_READ_BYTE)) 151 158 return -ENODEV; 152 159 153 - /* Only check even addresses */ 160 + /* Only bind to even addresses */ 154 161 if (client->addr & 1) 155 162 return -ENODEV; 156 - 157 - strlcpy(info->type, "max6875", I2C_NAME_SIZE); 158 - 159 - return 0; 160 - } 161 - 162 - static int max6875_probe(struct i2c_client *client, 163 - const struct i2c_device_id *id) 164 - { 165 - struct max6875_data *data; 166 - int err; 167 163 168 164 if (!(data = kzalloc(sizeof(struct max6875_data), GFP_KERNEL))) 169 165 return -ENOMEM; ··· 206 222 .probe = max6875_probe, 207 223 .remove = max6875_remove, 208 224 .id_table = max6875_id, 209 - 210 - .detect = max6875_detect, 211 - .address_data = &addr_data, 212 225 }; 213 226 214 227 static int __init max6875_init(void)
-4
drivers/staging/iio/light/tsl2561.c
··· 239 239 return tsl2561_powerdown(client); 240 240 } 241 241 242 - static unsigned short normal_i2c[] = { 0x29, 0x39, 0x49, I2C_CLIENT_END }; 243 - 244 - I2C_CLIENT_INSMOD; 245 - 246 242 static const struct i2c_device_id tsl2561_id[] = { 247 243 { "tsl2561", 0 }, 248 244 { }
+5 -30
drivers/w1/masters/ds2482.c
··· 24 24 #include "../w1_int.h" 25 25 26 26 /** 27 - * Address is selected using 2 pins, resulting in 4 possible addresses. 28 - * 0x18, 0x19, 0x1a, 0x1b 29 - * However, the chip cannot be detected without doing an i2c write, 30 - * so use the force module parameter. 31 - */ 32 - static const unsigned short normal_i2c[] = { I2C_CLIENT_END }; 33 - 34 - /** 35 - * Insmod parameters 36 - */ 37 - I2C_CLIENT_INSMOD_1(ds2482); 38 - 39 - /** 40 27 * The DS2482 registers - there are 3 registers that are addressed by a read 41 28 * pointer. The read pointer is set by the last command executed. 42 29 * ··· 83 96 84 97 static int ds2482_probe(struct i2c_client *client, 85 98 const struct i2c_device_id *id); 86 - static int ds2482_detect(struct i2c_client *client, int kind, 87 - struct i2c_board_info *info); 88 99 static int ds2482_remove(struct i2c_client *client); 89 100 90 101 ··· 102 117 .probe = ds2482_probe, 103 118 .remove = ds2482_remove, 104 119 .id_table = ds2482_id, 105 - .detect = ds2482_detect, 106 - .address_data = &addr_data, 107 120 }; 108 121 109 122 /* ··· 408 425 } 409 426 410 427 411 - static int ds2482_detect(struct i2c_client *client, int kind, 412 - struct i2c_board_info *info) 413 - { 414 - if (!i2c_check_functionality(client->adapter, 415 - I2C_FUNC_SMBUS_WRITE_BYTE_DATA | 416 - I2C_FUNC_SMBUS_BYTE)) 417 - return -ENODEV; 418 - 419 - strlcpy(info->type, "ds2482", I2C_NAME_SIZE); 420 - 421 - return 0; 422 - } 423 - 424 428 static int ds2482_probe(struct i2c_client *client, 425 429 const struct i2c_device_id *id) 426 430 { ··· 415 445 int err = -ENODEV; 416 446 int temp1; 417 447 int idx; 448 + 449 + if (!i2c_check_functionality(client->adapter, 450 + I2C_FUNC_SMBUS_WRITE_BYTE_DATA | 451 + I2C_FUNC_SMBUS_BYTE)) 452 + return -ENODEV; 418 453 419 454 if (!(data = kzalloc(sizeof(struct ds2482_data), GFP_KERNEL))) { 420 455 err = -ENOMEM;