diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2005-12-07 15:40:34 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-01-04 19:18:09 -0500 |
commit | 1d8f430c15b3a345db990e285742c67c2f52f9a6 (patch) | |
tree | 7bf8ae0929ebf581c4de68e7f4be9f6ea672d453 /include/linux | |
parent | 263756ec228f1cdd49fc50b1f87001a4cebdfe12 (diff) |
[PATCH] Input: add modalias support
Here's the patch for modalias support for input classes. It uses
comma-separated numbers, and doesn't describe all the potential keys (no
module currently cares, and that would make the strings huge). The
changes to input.h are to move the definitions needed by file2alias
outside __KERNEL__. I chose not to move those definitions to
mod_devicetable.h, because there are so many that it might break compile
of something else in the kernel.
The rest is fairly straightforward.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
CC: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/input.h | 79 |
1 files changed, 41 insertions, 38 deletions
diff --git a/include/linux/input.h b/include/linux/input.h index 3c5823368ddb..bef08551a33b 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <sys/ioctl.h> | 18 | #include <sys/ioctl.h> |
19 | #include <asm/types.h> | 19 | #include <asm/types.h> |
20 | #endif | 20 | #endif |
21 | #include <linux/mod_devicetable.h> | ||
21 | 22 | ||
22 | /* | 23 | /* |
23 | * The event structure itself | 24 | * The event structure itself |
@@ -511,6 +512,8 @@ struct input_absinfo { | |||
511 | #define KEY_FN_S 0x1e3 | 512 | #define KEY_FN_S 0x1e3 |
512 | #define KEY_FN_B 0x1e4 | 513 | #define KEY_FN_B 0x1e4 |
513 | 514 | ||
515 | /* We avoid low common keys in module aliases so they don't get huge. */ | ||
516 | #define KEY_MIN_INTERESTING KEY_MUTE | ||
514 | #define KEY_MAX 0x1ff | 517 | #define KEY_MAX 0x1ff |
515 | 518 | ||
516 | /* | 519 | /* |
@@ -793,6 +796,44 @@ struct ff_effect { | |||
793 | 796 | ||
794 | #define FF_MAX 0x7f | 797 | #define FF_MAX 0x7f |
795 | 798 | ||
799 | struct input_device_id { | ||
800 | |||
801 | kernel_ulong_t flags; | ||
802 | |||
803 | struct input_id id; | ||
804 | |||
805 | kernel_ulong_t evbit[EV_MAX/BITS_PER_LONG+1]; | ||
806 | kernel_ulong_t keybit[KEY_MAX/BITS_PER_LONG+1]; | ||
807 | kernel_ulong_t relbit[REL_MAX/BITS_PER_LONG+1]; | ||
808 | kernel_ulong_t absbit[ABS_MAX/BITS_PER_LONG+1]; | ||
809 | kernel_ulong_t mscbit[MSC_MAX/BITS_PER_LONG+1]; | ||
810 | kernel_ulong_t ledbit[LED_MAX/BITS_PER_LONG+1]; | ||
811 | kernel_ulong_t sndbit[SND_MAX/BITS_PER_LONG+1]; | ||
812 | kernel_ulong_t ffbit[FF_MAX/BITS_PER_LONG+1]; | ||
813 | kernel_ulong_t swbit[SW_MAX/BITS_PER_LONG+1]; | ||
814 | |||
815 | kernel_ulong_t driver_info; | ||
816 | }; | ||
817 | |||
818 | /* | ||
819 | * Structure for hotplug & device<->driver matching. | ||
820 | */ | ||
821 | |||
822 | #define INPUT_DEVICE_ID_MATCH_BUS 1 | ||
823 | #define INPUT_DEVICE_ID_MATCH_VENDOR 2 | ||
824 | #define INPUT_DEVICE_ID_MATCH_PRODUCT 4 | ||
825 | #define INPUT_DEVICE_ID_MATCH_VERSION 8 | ||
826 | |||
827 | #define INPUT_DEVICE_ID_MATCH_EVBIT 0x010 | ||
828 | #define INPUT_DEVICE_ID_MATCH_KEYBIT 0x020 | ||
829 | #define INPUT_DEVICE_ID_MATCH_RELBIT 0x040 | ||
830 | #define INPUT_DEVICE_ID_MATCH_ABSBIT 0x080 | ||
831 | #define INPUT_DEVICE_ID_MATCH_MSCIT 0x100 | ||
832 | #define INPUT_DEVICE_ID_MATCH_LEDBIT 0x200 | ||
833 | #define INPUT_DEVICE_ID_MATCH_SNDBIT 0x400 | ||
834 | #define INPUT_DEVICE_ID_MATCH_FFBIT 0x800 | ||
835 | #define INPUT_DEVICE_ID_MATCH_SWBIT 0x1000 | ||
836 | |||
796 | #ifdef __KERNEL__ | 837 | #ifdef __KERNEL__ |
797 | 838 | ||
798 | /* | 839 | /* |
@@ -901,49 +942,11 @@ struct input_dev { | |||
901 | }; | 942 | }; |
902 | #define to_input_dev(d) container_of(d, struct input_dev, cdev) | 943 | #define to_input_dev(d) container_of(d, struct input_dev, cdev) |
903 | 944 | ||
904 | /* | ||
905 | * Structure for hotplug & device<->driver matching. | ||
906 | */ | ||
907 | |||
908 | #define INPUT_DEVICE_ID_MATCH_BUS 1 | ||
909 | #define INPUT_DEVICE_ID_MATCH_VENDOR 2 | ||
910 | #define INPUT_DEVICE_ID_MATCH_PRODUCT 4 | ||
911 | #define INPUT_DEVICE_ID_MATCH_VERSION 8 | ||
912 | |||
913 | #define INPUT_DEVICE_ID_MATCH_EVBIT 0x010 | ||
914 | #define INPUT_DEVICE_ID_MATCH_KEYBIT 0x020 | ||
915 | #define INPUT_DEVICE_ID_MATCH_RELBIT 0x040 | ||
916 | #define INPUT_DEVICE_ID_MATCH_ABSBIT 0x080 | ||
917 | #define INPUT_DEVICE_ID_MATCH_MSCIT 0x100 | ||
918 | #define INPUT_DEVICE_ID_MATCH_LEDBIT 0x200 | ||
919 | #define INPUT_DEVICE_ID_MATCH_SNDBIT 0x400 | ||
920 | #define INPUT_DEVICE_ID_MATCH_FFBIT 0x800 | ||
921 | #define INPUT_DEVICE_ID_MATCH_SWBIT 0x1000 | ||
922 | |||
923 | #define INPUT_DEVICE_ID_MATCH_DEVICE\ | 945 | #define INPUT_DEVICE_ID_MATCH_DEVICE\ |
924 | (INPUT_DEVICE_ID_MATCH_BUS | INPUT_DEVICE_ID_MATCH_VENDOR | INPUT_DEVICE_ID_MATCH_PRODUCT) | 946 | (INPUT_DEVICE_ID_MATCH_BUS | INPUT_DEVICE_ID_MATCH_VENDOR | INPUT_DEVICE_ID_MATCH_PRODUCT) |
925 | #define INPUT_DEVICE_ID_MATCH_DEVICE_AND_VERSION\ | 947 | #define INPUT_DEVICE_ID_MATCH_DEVICE_AND_VERSION\ |
926 | (INPUT_DEVICE_ID_MATCH_DEVICE | INPUT_DEVICE_ID_MATCH_VERSION) | 948 | (INPUT_DEVICE_ID_MATCH_DEVICE | INPUT_DEVICE_ID_MATCH_VERSION) |
927 | 949 | ||
928 | struct input_device_id { | ||
929 | |||
930 | unsigned long flags; | ||
931 | |||
932 | struct input_id id; | ||
933 | |||
934 | unsigned long evbit[NBITS(EV_MAX)]; | ||
935 | unsigned long keybit[NBITS(KEY_MAX)]; | ||
936 | unsigned long relbit[NBITS(REL_MAX)]; | ||
937 | unsigned long absbit[NBITS(ABS_MAX)]; | ||
938 | unsigned long mscbit[NBITS(MSC_MAX)]; | ||
939 | unsigned long ledbit[NBITS(LED_MAX)]; | ||
940 | unsigned long sndbit[NBITS(SND_MAX)]; | ||
941 | unsigned long ffbit[NBITS(FF_MAX)]; | ||
942 | unsigned long swbit[NBITS(SW_MAX)]; | ||
943 | |||
944 | unsigned long driver_info; | ||
945 | }; | ||
946 | |||
947 | struct input_handle; | 950 | struct input_handle; |
948 | 951 | ||
949 | struct input_handler { | 952 | struct input_handler { |