diff options
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/i2c.h | 44 |
1 files changed, 11 insertions, 33 deletions
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index f6f2c080ba67..fb9df1416ad5 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
@@ -110,7 +110,7 @@ extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client *client, | |||
110 | * @driver: Device driver model driver | 110 | * @driver: Device driver model driver |
111 | * @id_table: List of I2C devices supported by this driver | 111 | * @id_table: List of I2C devices supported by this driver |
112 | * @detect: Callback for device detection | 112 | * @detect: Callback for device detection |
113 | * @address_data: The I2C addresses to probe (for detect) | 113 | * @address_list: The I2C addresses to probe (for detect) |
114 | * @clients: List of detected clients we created (for i2c-core use only) | 114 | * @clients: List of detected clients we created (for i2c-core use only) |
115 | * | 115 | * |
116 | * The driver.owner field should be set to the module owner of this driver. | 116 | * The driver.owner field should be set to the module owner of this driver. |
@@ -162,7 +162,7 @@ struct i2c_driver { | |||
162 | 162 | ||
163 | /* Device detection callback for automatic device creation */ | 163 | /* Device detection callback for automatic device creation */ |
164 | int (*detect)(struct i2c_client *, struct i2c_board_info *); | 164 | int (*detect)(struct i2c_client *, struct i2c_board_info *); |
165 | const struct i2c_client_address_data *address_data; | 165 | const unsigned short *address_list; |
166 | struct list_head clients; | 166 | struct list_head clients; |
167 | }; | 167 | }; |
168 | #define to_i2c_driver(d) container_of(d, struct i2c_driver, driver) | 168 | #define to_i2c_driver(d) container_of(d, struct i2c_driver, driver) |
@@ -391,14 +391,6 @@ static inline void i2c_unlock_adapter(struct i2c_adapter *adapter) | |||
391 | #define I2C_CLASS_DDC (1<<3) /* DDC bus on graphics adapters */ | 391 | #define I2C_CLASS_DDC (1<<3) /* DDC bus on graphics adapters */ |
392 | #define I2C_CLASS_SPD (1<<7) /* SPD EEPROMs and similar */ | 392 | #define I2C_CLASS_SPD (1<<7) /* SPD EEPROMs and similar */ |
393 | 393 | ||
394 | /* i2c_client_address_data is the struct for holding default client | ||
395 | * addresses for a driver and for the parameters supplied on the | ||
396 | * command line | ||
397 | */ | ||
398 | struct i2c_client_address_data { | ||
399 | const unsigned short *normal_i2c; | ||
400 | }; | ||
401 | |||
402 | /* Internal numbers to terminate lists */ | 394 | /* Internal numbers to terminate lists */ |
403 | #define I2C_CLIENT_END 0xfffeU | 395 | #define I2C_CLIENT_END 0xfffeU |
404 | 396 | ||
@@ -610,48 +602,34 @@ union i2c_smbus_data { | |||
610 | module_param_array(var, short, &var##_num, 0); \ | 602 | module_param_array(var, short, &var##_num, 0); \ |
611 | MODULE_PARM_DESC(var, desc) | 603 | MODULE_PARM_DESC(var, desc) |
612 | 604 | ||
613 | #define I2C_CLIENT_INSMOD_COMMON \ | ||
614 | static const struct i2c_client_address_data addr_data = { \ | ||
615 | .normal_i2c = normal_i2c, \ | ||
616 | } | ||
617 | |||
618 | /* These are the ones you want to use in your own drivers. Pick the one | 605 | /* These are the ones you want to use in your own drivers. Pick the one |
619 | which matches the number of devices the driver differenciates between. */ | 606 | which matches the number of devices the driver differenciates between. */ |
620 | #define I2C_CLIENT_INSMOD \ | 607 | #define I2C_CLIENT_INSMOD |
621 | I2C_CLIENT_INSMOD_COMMON | ||
622 | 608 | ||
623 | #define I2C_CLIENT_INSMOD_1(chip1) \ | 609 | #define I2C_CLIENT_INSMOD_1(chip1) \ |
624 | enum chips { any_chip, chip1 }; \ | 610 | enum chips { any_chip, chip1 } |
625 | I2C_CLIENT_INSMOD_COMMON | ||
626 | 611 | ||
627 | #define I2C_CLIENT_INSMOD_2(chip1, chip2) \ | 612 | #define I2C_CLIENT_INSMOD_2(chip1, chip2) \ |
628 | enum chips { any_chip, chip1, chip2 }; \ | 613 | enum chips { any_chip, chip1, chip2 } |
629 | I2C_CLIENT_INSMOD_COMMON | ||
630 | 614 | ||
631 | #define I2C_CLIENT_INSMOD_3(chip1, chip2, chip3) \ | 615 | #define I2C_CLIENT_INSMOD_3(chip1, chip2, chip3) \ |
632 | enum chips { any_chip, chip1, chip2, chip3 }; \ | 616 | enum chips { any_chip, chip1, chip2, chip3 } |
633 | I2C_CLIENT_INSMOD_COMMON | ||
634 | 617 | ||
635 | #define I2C_CLIENT_INSMOD_4(chip1, chip2, chip3, chip4) \ | 618 | #define I2C_CLIENT_INSMOD_4(chip1, chip2, chip3, chip4) \ |
636 | enum chips { any_chip, chip1, chip2, chip3, chip4 }; \ | 619 | enum chips { any_chip, chip1, chip2, chip3, chip4 } |
637 | I2C_CLIENT_INSMOD_COMMON | ||
638 | 620 | ||
639 | #define I2C_CLIENT_INSMOD_5(chip1, chip2, chip3, chip4, chip5) \ | 621 | #define I2C_CLIENT_INSMOD_5(chip1, chip2, chip3, chip4, chip5) \ |
640 | enum chips { any_chip, chip1, chip2, chip3, chip4, chip5 }; \ | 622 | enum chips { any_chip, chip1, chip2, chip3, chip4, chip5 } |
641 | I2C_CLIENT_INSMOD_COMMON | ||
642 | 623 | ||
643 | #define I2C_CLIENT_INSMOD_6(chip1, chip2, chip3, chip4, chip5, chip6) \ | 624 | #define I2C_CLIENT_INSMOD_6(chip1, chip2, chip3, chip4, chip5, chip6) \ |
644 | enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6 }; \ | 625 | enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6 } |
645 | I2C_CLIENT_INSMOD_COMMON | ||
646 | 626 | ||
647 | #define I2C_CLIENT_INSMOD_7(chip1, chip2, chip3, chip4, chip5, chip6, chip7) \ | 627 | #define I2C_CLIENT_INSMOD_7(chip1, chip2, chip3, chip4, chip5, chip6, chip7) \ |
648 | enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, \ | 628 | enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, \ |
649 | chip7 }; \ | 629 | chip7 } |
650 | I2C_CLIENT_INSMOD_COMMON | ||
651 | 630 | ||
652 | #define I2C_CLIENT_INSMOD_8(chip1, chip2, chip3, chip4, chip5, chip6, chip7, chip8) \ | 631 | #define I2C_CLIENT_INSMOD_8(chip1, chip2, chip3, chip4, chip5, chip6, chip7, chip8) \ |
653 | enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, \ | 632 | enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, \ |
654 | chip7, chip8 }; \ | 633 | chip7, chip8 } |
655 | I2C_CLIENT_INSMOD_COMMON | ||
656 | #endif /* __KERNEL__ */ | 634 | #endif /* __KERNEL__ */ |
657 | #endif /* _LINUX_I2C_H */ | 635 | #endif /* _LINUX_I2C_H */ |