aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/i2c.h
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2009-12-06 11:06:24 -0500
committerJean Delvare <khali@linux-fr.org>2009-12-06 11:06:24 -0500
commitc7b25a9e96dc89954ae8d8f473f56fae62030f84 (patch)
treecc1f924445517a16e3923112e77edbfe33cd3b25 /include/linux/i2c.h
parentabe38388e50f4d89726fd0c0cceea61563c7026b (diff)
i2c: Drop probe, ignore and force module parameters
The legacy probe and force module parameters are obsolete now, the same can be achieved using the new_device sysfs interface, which is both more flexible and cheaper (it is implemented by i2c-core rather than replicated in every driver module.) The legacy ignore module parameters can be dropped as well. Ignoring can be done by instantiating a "dummy" device at the problematic address. This is the first step of a huge cleanup to i2c-core's i2c_detect function, i2c.h's I2C_CLIENT_INSMOD* macros, and all drivers that made use of them. Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'include/linux/i2c.h')
-rw-r--r--include/linux/i2c.h91
1 files changed, 1 insertions, 90 deletions
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 52317fb5917e..419ab546b266 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, ignore or force (for detect) 113 * @address_data: 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.
@@ -397,9 +397,6 @@ static inline void i2c_unlock_adapter(struct i2c_adapter *adapter)
397 */ 397 */
398struct i2c_client_address_data { 398struct i2c_client_address_data {
399 const unsigned short *normal_i2c; 399 const unsigned short *normal_i2c;
400 const unsigned short *probe;
401 const unsigned short *ignore;
402 const unsigned short * const *forces;
403}; 400};
404 401
405/* Internal numbers to terminate lists */ 402/* Internal numbers to terminate lists */
@@ -613,134 +610,48 @@ union i2c_smbus_data {
613 module_param_array(var, short, &var##_num, 0); \ 610 module_param_array(var, short, &var##_num, 0); \
614 MODULE_PARM_DESC(var, desc) 611 MODULE_PARM_DESC(var, desc)
615 612
616#define I2C_CLIENT_MODULE_PARM_FORCE(name) \
617I2C_CLIENT_MODULE_PARM(force_##name, \
618 "List of adapter,address pairs which are " \
619 "unquestionably assumed to contain a `" \
620 # name "' chip")
621
622
623#define I2C_CLIENT_INSMOD_COMMON \ 613#define I2C_CLIENT_INSMOD_COMMON \
624I2C_CLIENT_MODULE_PARM(probe, "List of adapter,address pairs to scan " \
625 "additionally"); \
626I2C_CLIENT_MODULE_PARM(ignore, "List of adapter,address pairs not to " \
627 "scan"); \
628static const struct i2c_client_address_data addr_data = { \ 614static const struct i2c_client_address_data addr_data = { \
629 .normal_i2c = normal_i2c, \ 615 .normal_i2c = normal_i2c, \
630 .probe = probe, \
631 .ignore = ignore, \
632 .forces = forces, \
633} 616}
634 617
635#define I2C_CLIENT_FORCE_TEXT \
636 "List of adapter,address pairs to boldly assume to be present"
637
638/* These are the ones you want to use in your own drivers. Pick the one 618/* These are the ones you want to use in your own drivers. Pick the one
639 which matches the number of devices the driver differenciates between. */ 619 which matches the number of devices the driver differenciates between. */
640#define I2C_CLIENT_INSMOD \ 620#define I2C_CLIENT_INSMOD \
641I2C_CLIENT_MODULE_PARM(force, I2C_CLIENT_FORCE_TEXT); \
642static const unsigned short * const forces[] = { force, NULL }; \
643I2C_CLIENT_INSMOD_COMMON 621I2C_CLIENT_INSMOD_COMMON
644 622
645#define I2C_CLIENT_INSMOD_1(chip1) \ 623#define I2C_CLIENT_INSMOD_1(chip1) \
646enum chips { any_chip, chip1 }; \ 624enum chips { any_chip, chip1 }; \
647I2C_CLIENT_MODULE_PARM(force, I2C_CLIENT_FORCE_TEXT); \
648I2C_CLIENT_MODULE_PARM_FORCE(chip1); \
649static const unsigned short * const forces[] = { force, \
650 force_##chip1, NULL }; \
651I2C_CLIENT_INSMOD_COMMON 625I2C_CLIENT_INSMOD_COMMON
652 626
653#define I2C_CLIENT_INSMOD_2(chip1, chip2) \ 627#define I2C_CLIENT_INSMOD_2(chip1, chip2) \
654enum chips { any_chip, chip1, chip2 }; \ 628enum chips { any_chip, chip1, chip2 }; \
655I2C_CLIENT_MODULE_PARM(force, I2C_CLIENT_FORCE_TEXT); \
656I2C_CLIENT_MODULE_PARM_FORCE(chip1); \
657I2C_CLIENT_MODULE_PARM_FORCE(chip2); \
658static const unsigned short * const forces[] = { force, \
659 force_##chip1, force_##chip2, NULL }; \
660I2C_CLIENT_INSMOD_COMMON 629I2C_CLIENT_INSMOD_COMMON
661 630
662#define I2C_CLIENT_INSMOD_3(chip1, chip2, chip3) \ 631#define I2C_CLIENT_INSMOD_3(chip1, chip2, chip3) \
663enum chips { any_chip, chip1, chip2, chip3 }; \ 632enum chips { any_chip, chip1, chip2, chip3 }; \
664I2C_CLIENT_MODULE_PARM(force, I2C_CLIENT_FORCE_TEXT); \
665I2C_CLIENT_MODULE_PARM_FORCE(chip1); \
666I2C_CLIENT_MODULE_PARM_FORCE(chip2); \
667I2C_CLIENT_MODULE_PARM_FORCE(chip3); \
668static const unsigned short * const forces[] = { force, \
669 force_##chip1, force_##chip2, force_##chip3, NULL }; \
670I2C_CLIENT_INSMOD_COMMON 633I2C_CLIENT_INSMOD_COMMON
671 634
672#define I2C_CLIENT_INSMOD_4(chip1, chip2, chip3, chip4) \ 635#define I2C_CLIENT_INSMOD_4(chip1, chip2, chip3, chip4) \
673enum chips { any_chip, chip1, chip2, chip3, chip4 }; \ 636enum chips { any_chip, chip1, chip2, chip3, chip4 }; \
674I2C_CLIENT_MODULE_PARM(force, I2C_CLIENT_FORCE_TEXT); \
675I2C_CLIENT_MODULE_PARM_FORCE(chip1); \
676I2C_CLIENT_MODULE_PARM_FORCE(chip2); \
677I2C_CLIENT_MODULE_PARM_FORCE(chip3); \
678I2C_CLIENT_MODULE_PARM_FORCE(chip4); \
679static const unsigned short * const forces[] = { force, \
680 force_##chip1, force_##chip2, force_##chip3, \
681 force_##chip4, NULL}; \
682I2C_CLIENT_INSMOD_COMMON 637I2C_CLIENT_INSMOD_COMMON
683 638
684#define I2C_CLIENT_INSMOD_5(chip1, chip2, chip3, chip4, chip5) \ 639#define I2C_CLIENT_INSMOD_5(chip1, chip2, chip3, chip4, chip5) \
685enum chips { any_chip, chip1, chip2, chip3, chip4, chip5 }; \ 640enum chips { any_chip, chip1, chip2, chip3, chip4, chip5 }; \
686I2C_CLIENT_MODULE_PARM(force, I2C_CLIENT_FORCE_TEXT); \
687I2C_CLIENT_MODULE_PARM_FORCE(chip1); \
688I2C_CLIENT_MODULE_PARM_FORCE(chip2); \
689I2C_CLIENT_MODULE_PARM_FORCE(chip3); \
690I2C_CLIENT_MODULE_PARM_FORCE(chip4); \
691I2C_CLIENT_MODULE_PARM_FORCE(chip5); \
692static const unsigned short * const forces[] = { force, \
693 force_##chip1, force_##chip2, force_##chip3, \
694 force_##chip4, force_##chip5, NULL }; \
695I2C_CLIENT_INSMOD_COMMON 641I2C_CLIENT_INSMOD_COMMON
696 642
697#define I2C_CLIENT_INSMOD_6(chip1, chip2, chip3, chip4, chip5, chip6) \ 643#define I2C_CLIENT_INSMOD_6(chip1, chip2, chip3, chip4, chip5, chip6) \
698enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6 }; \ 644enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6 }; \
699I2C_CLIENT_MODULE_PARM(force, I2C_CLIENT_FORCE_TEXT); \
700I2C_CLIENT_MODULE_PARM_FORCE(chip1); \
701I2C_CLIENT_MODULE_PARM_FORCE(chip2); \
702I2C_CLIENT_MODULE_PARM_FORCE(chip3); \
703I2C_CLIENT_MODULE_PARM_FORCE(chip4); \
704I2C_CLIENT_MODULE_PARM_FORCE(chip5); \
705I2C_CLIENT_MODULE_PARM_FORCE(chip6); \
706static const unsigned short * const forces[] = { force, \
707 force_##chip1, force_##chip2, force_##chip3, \
708 force_##chip4, force_##chip5, force_##chip6, NULL }; \
709I2C_CLIENT_INSMOD_COMMON 645I2C_CLIENT_INSMOD_COMMON
710 646
711#define I2C_CLIENT_INSMOD_7(chip1, chip2, chip3, chip4, chip5, chip6, chip7) \ 647#define I2C_CLIENT_INSMOD_7(chip1, chip2, chip3, chip4, chip5, chip6, chip7) \
712enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, \ 648enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, \
713 chip7 }; \ 649 chip7 }; \
714I2C_CLIENT_MODULE_PARM(force, I2C_CLIENT_FORCE_TEXT); \
715I2C_CLIENT_MODULE_PARM_FORCE(chip1); \
716I2C_CLIENT_MODULE_PARM_FORCE(chip2); \
717I2C_CLIENT_MODULE_PARM_FORCE(chip3); \
718I2C_CLIENT_MODULE_PARM_FORCE(chip4); \
719I2C_CLIENT_MODULE_PARM_FORCE(chip5); \
720I2C_CLIENT_MODULE_PARM_FORCE(chip6); \
721I2C_CLIENT_MODULE_PARM_FORCE(chip7); \
722static const unsigned short * const forces[] = { force, \
723 force_##chip1, force_##chip2, force_##chip3, \
724 force_##chip4, force_##chip5, force_##chip6, \
725 force_##chip7, NULL }; \
726I2C_CLIENT_INSMOD_COMMON 650I2C_CLIENT_INSMOD_COMMON
727 651
728#define I2C_CLIENT_INSMOD_8(chip1, chip2, chip3, chip4, chip5, chip6, chip7, chip8) \ 652#define I2C_CLIENT_INSMOD_8(chip1, chip2, chip3, chip4, chip5, chip6, chip7, chip8) \
729enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, \ 653enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, \
730 chip7, chip8 }; \ 654 chip7, chip8 }; \
731I2C_CLIENT_MODULE_PARM(force, I2C_CLIENT_FORCE_TEXT); \
732I2C_CLIENT_MODULE_PARM_FORCE(chip1); \
733I2C_CLIENT_MODULE_PARM_FORCE(chip2); \
734I2C_CLIENT_MODULE_PARM_FORCE(chip3); \
735I2C_CLIENT_MODULE_PARM_FORCE(chip4); \
736I2C_CLIENT_MODULE_PARM_FORCE(chip5); \
737I2C_CLIENT_MODULE_PARM_FORCE(chip6); \
738I2C_CLIENT_MODULE_PARM_FORCE(chip7); \
739I2C_CLIENT_MODULE_PARM_FORCE(chip8); \
740static const unsigned short * const forces[] = { force, \
741 force_##chip1, force_##chip2, force_##chip3, \
742 force_##chip4, force_##chip5, force_##chip6, \
743 force_##chip7, force_##chip8, NULL }; \
744I2C_CLIENT_INSMOD_COMMON 655I2C_CLIENT_INSMOD_COMMON
745#endif /* __KERNEL__ */ 656#endif /* __KERNEL__ */
746#endif /* _LINUX_I2C_H */ 657#endif /* _LINUX_I2C_H */