diff options
Diffstat (limited to 'include/linux/i2c.h')
-rw-r--r-- | include/linux/i2c.h | 91 |
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 | */ |
398 | struct i2c_client_address_data { | 398 | struct 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) \ | ||
617 | I2C_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 \ |
624 | I2C_CLIENT_MODULE_PARM(probe, "List of adapter,address pairs to scan " \ | ||
625 | "additionally"); \ | ||
626 | I2C_CLIENT_MODULE_PARM(ignore, "List of adapter,address pairs not to " \ | ||
627 | "scan"); \ | ||
628 | static const struct i2c_client_address_data addr_data = { \ | 614 | static 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 \ |
641 | I2C_CLIENT_MODULE_PARM(force, I2C_CLIENT_FORCE_TEXT); \ | ||
642 | static const unsigned short * const forces[] = { force, NULL }; \ | ||
643 | I2C_CLIENT_INSMOD_COMMON | 621 | I2C_CLIENT_INSMOD_COMMON |
644 | 622 | ||
645 | #define I2C_CLIENT_INSMOD_1(chip1) \ | 623 | #define I2C_CLIENT_INSMOD_1(chip1) \ |
646 | enum chips { any_chip, chip1 }; \ | 624 | enum chips { any_chip, chip1 }; \ |
647 | I2C_CLIENT_MODULE_PARM(force, I2C_CLIENT_FORCE_TEXT); \ | ||
648 | I2C_CLIENT_MODULE_PARM_FORCE(chip1); \ | ||
649 | static const unsigned short * const forces[] = { force, \ | ||
650 | force_##chip1, NULL }; \ | ||
651 | I2C_CLIENT_INSMOD_COMMON | 625 | I2C_CLIENT_INSMOD_COMMON |
652 | 626 | ||
653 | #define I2C_CLIENT_INSMOD_2(chip1, chip2) \ | 627 | #define I2C_CLIENT_INSMOD_2(chip1, chip2) \ |
654 | enum chips { any_chip, chip1, chip2 }; \ | 628 | enum chips { any_chip, chip1, chip2 }; \ |
655 | I2C_CLIENT_MODULE_PARM(force, I2C_CLIENT_FORCE_TEXT); \ | ||
656 | I2C_CLIENT_MODULE_PARM_FORCE(chip1); \ | ||
657 | I2C_CLIENT_MODULE_PARM_FORCE(chip2); \ | ||
658 | static const unsigned short * const forces[] = { force, \ | ||
659 | force_##chip1, force_##chip2, NULL }; \ | ||
660 | I2C_CLIENT_INSMOD_COMMON | 629 | I2C_CLIENT_INSMOD_COMMON |
661 | 630 | ||
662 | #define I2C_CLIENT_INSMOD_3(chip1, chip2, chip3) \ | 631 | #define I2C_CLIENT_INSMOD_3(chip1, chip2, chip3) \ |
663 | enum chips { any_chip, chip1, chip2, chip3 }; \ | 632 | enum chips { any_chip, chip1, chip2, chip3 }; \ |
664 | I2C_CLIENT_MODULE_PARM(force, I2C_CLIENT_FORCE_TEXT); \ | ||
665 | I2C_CLIENT_MODULE_PARM_FORCE(chip1); \ | ||
666 | I2C_CLIENT_MODULE_PARM_FORCE(chip2); \ | ||
667 | I2C_CLIENT_MODULE_PARM_FORCE(chip3); \ | ||
668 | static const unsigned short * const forces[] = { force, \ | ||
669 | force_##chip1, force_##chip2, force_##chip3, NULL }; \ | ||
670 | I2C_CLIENT_INSMOD_COMMON | 633 | I2C_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) \ |
673 | enum chips { any_chip, chip1, chip2, chip3, chip4 }; \ | 636 | enum chips { any_chip, chip1, chip2, chip3, chip4 }; \ |
674 | I2C_CLIENT_MODULE_PARM(force, I2C_CLIENT_FORCE_TEXT); \ | ||
675 | I2C_CLIENT_MODULE_PARM_FORCE(chip1); \ | ||
676 | I2C_CLIENT_MODULE_PARM_FORCE(chip2); \ | ||
677 | I2C_CLIENT_MODULE_PARM_FORCE(chip3); \ | ||
678 | I2C_CLIENT_MODULE_PARM_FORCE(chip4); \ | ||
679 | static const unsigned short * const forces[] = { force, \ | ||
680 | force_##chip1, force_##chip2, force_##chip3, \ | ||
681 | force_##chip4, NULL}; \ | ||
682 | I2C_CLIENT_INSMOD_COMMON | 637 | I2C_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) \ |
685 | enum chips { any_chip, chip1, chip2, chip3, chip4, chip5 }; \ | 640 | enum chips { any_chip, chip1, chip2, chip3, chip4, chip5 }; \ |
686 | I2C_CLIENT_MODULE_PARM(force, I2C_CLIENT_FORCE_TEXT); \ | ||
687 | I2C_CLIENT_MODULE_PARM_FORCE(chip1); \ | ||
688 | I2C_CLIENT_MODULE_PARM_FORCE(chip2); \ | ||
689 | I2C_CLIENT_MODULE_PARM_FORCE(chip3); \ | ||
690 | I2C_CLIENT_MODULE_PARM_FORCE(chip4); \ | ||
691 | I2C_CLIENT_MODULE_PARM_FORCE(chip5); \ | ||
692 | static const unsigned short * const forces[] = { force, \ | ||
693 | force_##chip1, force_##chip2, force_##chip3, \ | ||
694 | force_##chip4, force_##chip5, NULL }; \ | ||
695 | I2C_CLIENT_INSMOD_COMMON | 641 | I2C_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) \ |
698 | enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6 }; \ | 644 | enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6 }; \ |
699 | I2C_CLIENT_MODULE_PARM(force, I2C_CLIENT_FORCE_TEXT); \ | ||
700 | I2C_CLIENT_MODULE_PARM_FORCE(chip1); \ | ||
701 | I2C_CLIENT_MODULE_PARM_FORCE(chip2); \ | ||
702 | I2C_CLIENT_MODULE_PARM_FORCE(chip3); \ | ||
703 | I2C_CLIENT_MODULE_PARM_FORCE(chip4); \ | ||
704 | I2C_CLIENT_MODULE_PARM_FORCE(chip5); \ | ||
705 | I2C_CLIENT_MODULE_PARM_FORCE(chip6); \ | ||
706 | static const unsigned short * const forces[] = { force, \ | ||
707 | force_##chip1, force_##chip2, force_##chip3, \ | ||
708 | force_##chip4, force_##chip5, force_##chip6, NULL }; \ | ||
709 | I2C_CLIENT_INSMOD_COMMON | 645 | I2C_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) \ |
712 | enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, \ | 648 | enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, \ |
713 | chip7 }; \ | 649 | chip7 }; \ |
714 | I2C_CLIENT_MODULE_PARM(force, I2C_CLIENT_FORCE_TEXT); \ | ||
715 | I2C_CLIENT_MODULE_PARM_FORCE(chip1); \ | ||
716 | I2C_CLIENT_MODULE_PARM_FORCE(chip2); \ | ||
717 | I2C_CLIENT_MODULE_PARM_FORCE(chip3); \ | ||
718 | I2C_CLIENT_MODULE_PARM_FORCE(chip4); \ | ||
719 | I2C_CLIENT_MODULE_PARM_FORCE(chip5); \ | ||
720 | I2C_CLIENT_MODULE_PARM_FORCE(chip6); \ | ||
721 | I2C_CLIENT_MODULE_PARM_FORCE(chip7); \ | ||
722 | static const unsigned short * const forces[] = { force, \ | ||
723 | force_##chip1, force_##chip2, force_##chip3, \ | ||
724 | force_##chip4, force_##chip5, force_##chip6, \ | ||
725 | force_##chip7, NULL }; \ | ||
726 | I2C_CLIENT_INSMOD_COMMON | 650 | I2C_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) \ |
729 | enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, \ | 653 | enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, \ |
730 | chip7, chip8 }; \ | 654 | chip7, chip8 }; \ |
731 | I2C_CLIENT_MODULE_PARM(force, I2C_CLIENT_FORCE_TEXT); \ | ||
732 | I2C_CLIENT_MODULE_PARM_FORCE(chip1); \ | ||
733 | I2C_CLIENT_MODULE_PARM_FORCE(chip2); \ | ||
734 | I2C_CLIENT_MODULE_PARM_FORCE(chip3); \ | ||
735 | I2C_CLIENT_MODULE_PARM_FORCE(chip4); \ | ||
736 | I2C_CLIENT_MODULE_PARM_FORCE(chip5); \ | ||
737 | I2C_CLIENT_MODULE_PARM_FORCE(chip6); \ | ||
738 | I2C_CLIENT_MODULE_PARM_FORCE(chip7); \ | ||
739 | I2C_CLIENT_MODULE_PARM_FORCE(chip8); \ | ||
740 | static 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 }; \ | ||
744 | I2C_CLIENT_INSMOD_COMMON | 655 | I2C_CLIENT_INSMOD_COMMON |
745 | #endif /* __KERNEL__ */ | 656 | #endif /* __KERNEL__ */ |
746 | #endif /* _LINUX_I2C_H */ | 657 | #endif /* _LINUX_I2C_H */ |