aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDmitry Torokhov <dtor_core@ameritech.net>2006-04-26 00:14:19 -0400
committerDmitry Torokhov <dtor_core@ameritech.net>2006-04-26 00:14:19 -0400
commitddc5d3414593e4d7ad7fbd33e7f7517fcc234544 (patch)
treeacf9620d1f4900568edbc4a645ad5bb435147195 /include
parent77426d7210430b70a7f5b21c05c4e7505528937d (diff)
Input: move input_device_id to mod_devicetable.h
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'include')
-rw-r--r--include/linux/input.h104
-rw-r--r--include/linux/mod_devicetable.h48
2 files changed, 101 insertions, 51 deletions
diff --git a/include/linux/input.h b/include/linux/input.h
index 16c19d710a4d..8298b4bf5a07 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -12,8 +12,6 @@
12#ifdef __KERNEL__ 12#ifdef __KERNEL__
13#include <linux/time.h> 13#include <linux/time.h>
14#include <linux/list.h> 14#include <linux/list.h>
15#include <linux/device.h>
16#include <linux/mod_devicetable.h>
17#else 15#else
18#include <sys/time.h> 16#include <sys/time.h>
19#include <sys/ioctl.h> 17#include <sys/ioctl.h>
@@ -577,15 +575,15 @@ struct input_absinfo {
577 * Switch events 575 * Switch events
578 */ 576 */
579 577
580#define SW_0 0x00 578#define SW_0 0x00
581#define SW_1 0x01 579#define SW_1 0x01
582#define SW_2 0x02 580#define SW_2 0x02
583#define SW_3 0x03 581#define SW_3 0x03
584#define SW_4 0x04 582#define SW_4 0x04
585#define SW_5 0x05 583#define SW_5 0x05
586#define SW_6 0x06 584#define SW_6 0x06
587#define SW_7 0x07 585#define SW_7 0x07
588#define SW_MAX 0x0f 586#define SW_MAX 0x0f
589 587
590/* 588/*
591 * Misc events 589 * Misc events
@@ -805,52 +803,16 @@ struct ff_effect {
805 803
806#define FF_MAX 0x7f 804#define FF_MAX 0x7f
807 805
808struct input_device_id {
809
810 kernel_ulong_t flags;
811
812 struct input_id id;
813
814 kernel_ulong_t evbit[EV_MAX/BITS_PER_LONG+1];
815 kernel_ulong_t keybit[KEY_MAX/BITS_PER_LONG+1];
816 kernel_ulong_t relbit[REL_MAX/BITS_PER_LONG+1];
817 kernel_ulong_t absbit[ABS_MAX/BITS_PER_LONG+1];
818 kernel_ulong_t mscbit[MSC_MAX/BITS_PER_LONG+1];
819 kernel_ulong_t ledbit[LED_MAX/BITS_PER_LONG+1];
820 kernel_ulong_t sndbit[SND_MAX/BITS_PER_LONG+1];
821 kernel_ulong_t ffbit[FF_MAX/BITS_PER_LONG+1];
822 kernel_ulong_t swbit[SW_MAX/BITS_PER_LONG+1];
823
824 kernel_ulong_t driver_info;
825};
826
827/*
828 * Structure for hotplug & device<->driver matching.
829 */
830
831#define INPUT_DEVICE_ID_MATCH_BUS 1
832#define INPUT_DEVICE_ID_MATCH_VENDOR 2
833#define INPUT_DEVICE_ID_MATCH_PRODUCT 4
834#define INPUT_DEVICE_ID_MATCH_VERSION 8
835
836#define INPUT_DEVICE_ID_MATCH_EVBIT 0x010
837#define INPUT_DEVICE_ID_MATCH_KEYBIT 0x020
838#define INPUT_DEVICE_ID_MATCH_RELBIT 0x040
839#define INPUT_DEVICE_ID_MATCH_ABSBIT 0x080
840#define INPUT_DEVICE_ID_MATCH_MSCIT 0x100
841#define INPUT_DEVICE_ID_MATCH_LEDBIT 0x200
842#define INPUT_DEVICE_ID_MATCH_SNDBIT 0x400
843#define INPUT_DEVICE_ID_MATCH_FFBIT 0x800
844#define INPUT_DEVICE_ID_MATCH_SWBIT 0x1000
845
846#ifdef __KERNEL__ 806#ifdef __KERNEL__
847 807
848/* 808/*
849 * In-kernel definitions. 809 * In-kernel definitions.
850 */ 810 */
851 811
812#include <linux/device.h>
852#include <linux/fs.h> 813#include <linux/fs.h>
853#include <linux/timer.h> 814#include <linux/timer.h>
815#include <linux/mod_devicetable.h>
854 816
855#define NBITS(x) (((x)/BITS_PER_LONG)+1) 817#define NBITS(x) (((x)/BITS_PER_LONG)+1)
856#define BIT(x) (1UL<<((x)%BITS_PER_LONG)) 818#define BIT(x) (1UL<<((x)%BITS_PER_LONG))
@@ -951,9 +913,49 @@ struct input_dev {
951}; 913};
952#define to_input_dev(d) container_of(d, struct input_dev, cdev) 914#define to_input_dev(d) container_of(d, struct input_dev, cdev)
953 915
954#define INPUT_DEVICE_ID_MATCH_DEVICE\ 916/*
917 * Verify that we are in sync with input_device_id mod_devicetable.h #defines
918 */
919
920#if EV_MAX != INPUT_DEVICE_ID_EV_MAX
921#error "EV_MAX and INPUT_DEVICE_ID_EV_MAX do not match"
922#endif
923
924#if KEY_MAX != INPUT_DEVICE_ID_KEY_MAX
925#error "KEY_MAX and INPUT_DEVICE_ID_KEY_MAX do not match"
926#endif
927
928#if REL_MAX != INPUT_DEVICE_ID_REL_MAX
929#error "REL_MAX and INPUT_DEVICE_ID_REL_MAX do not match"
930#endif
931
932#if ABS_MAX != INPUT_DEVICE_ID_ABS_MAX
933#error "ABS_MAX and INPUT_DEVICE_ID_ABS_MAX do not match"
934#endif
935
936#if MSC_MAX != INPUT_DEVICE_ID_MSC_MAX
937#error "MSC_MAX and INPUT_DEVICE_ID_MSC_MAX do not match"
938#endif
939
940#if LED_MAX != INPUT_DEVICE_ID_LED_MAX
941#error "LED_MAX and INPUT_DEVICE_ID_LED_MAX do not match"
942#endif
943
944#if SND_MAX != INPUT_DEVICE_ID_SND_MAX
945#error "SND_MAX and INPUT_DEVICE_ID_SND_MAX do not match"
946#endif
947
948#if FF_MAX != INPUT_DEVICE_ID_FF_MAX
949#error "FF_MAX and INPUT_DEVICE_ID_FF_MAX do not match"
950#endif
951
952#if SW_MAX != INPUT_DEVICE_ID_SW_MAX
953#error "SW_MAX and INPUT_DEVICE_ID_SW_MAX do not match"
954#endif
955
956#define INPUT_DEVICE_ID_MATCH_DEVICE \
955 (INPUT_DEVICE_ID_MATCH_BUS | INPUT_DEVICE_ID_MATCH_VENDOR | INPUT_DEVICE_ID_MATCH_PRODUCT) 957 (INPUT_DEVICE_ID_MATCH_BUS | INPUT_DEVICE_ID_MATCH_VENDOR | INPUT_DEVICE_ID_MATCH_PRODUCT)
956#define INPUT_DEVICE_ID_MATCH_DEVICE_AND_VERSION\ 958#define INPUT_DEVICE_ID_MATCH_DEVICE_AND_VERSION \
957 (INPUT_DEVICE_ID_MATCH_DEVICE | INPUT_DEVICE_ID_MATCH_VERSION) 959 (INPUT_DEVICE_ID_MATCH_DEVICE | INPUT_DEVICE_ID_MATCH_VERSION)
958 960
959struct input_handle; 961struct input_handle;
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index 7b08c11ec4cc..f6977708585c 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -249,4 +249,52 @@ struct i2c_device_id {
249 __u16 id; 249 __u16 id;
250}; 250};
251 251
252/* Input */
253#define INPUT_DEVICE_ID_EV_MAX 0x1f
254#define INPUT_DEVICE_ID_KEY_MAX 0x1ff
255#define INPUT_DEVICE_ID_REL_MAX 0x0f
256#define INPUT_DEVICE_ID_ABS_MAX 0x3f
257#define INPUT_DEVICE_ID_MSC_MAX 0x07
258#define INPUT_DEVICE_ID_LED_MAX 0x0f
259#define INPUT_DEVICE_ID_SND_MAX 0x07
260#define INPUT_DEVICE_ID_FF_MAX 0x7f
261#define INPUT_DEVICE_ID_SW_MAX 0x0f
262
263#define INPUT_DEVICE_ID_MATCH_BUS 1
264#define INPUT_DEVICE_ID_MATCH_VENDOR 2
265#define INPUT_DEVICE_ID_MATCH_PRODUCT 4
266#define INPUT_DEVICE_ID_MATCH_VERSION 8
267
268#define INPUT_DEVICE_ID_MATCH_EVBIT 0x0010
269#define INPUT_DEVICE_ID_MATCH_KEYBIT 0x0020
270#define INPUT_DEVICE_ID_MATCH_RELBIT 0x0040
271#define INPUT_DEVICE_ID_MATCH_ABSBIT 0x0080
272#define INPUT_DEVICE_ID_MATCH_MSCIT 0x0100
273#define INPUT_DEVICE_ID_MATCH_LEDBIT 0x0200
274#define INPUT_DEVICE_ID_MATCH_SNDBIT 0x0400
275#define INPUT_DEVICE_ID_MATCH_FFBIT 0x0800
276#define INPUT_DEVICE_ID_MATCH_SWBIT 0x1000
277
278struct input_device_id {
279
280 kernel_ulong_t flags;
281
282 __u16 bustype;
283 __u16 vendor;
284 __u16 product;
285 __u16 version;
286
287 kernel_ulong_t evbit[INPUT_DEVICE_ID_EV_MAX / BITS_PER_LONG + 1];
288 kernel_ulong_t keybit[INPUT_DEVICE_ID_KEY_MAX / BITS_PER_LONG + 1];
289 kernel_ulong_t relbit[INPUT_DEVICE_ID_REL_MAX / BITS_PER_LONG + 1];
290 kernel_ulong_t absbit[INPUT_DEVICE_ID_ABS_MAX / BITS_PER_LONG + 1];
291 kernel_ulong_t mscbit[INPUT_DEVICE_ID_MSC_MAX / BITS_PER_LONG + 1];
292 kernel_ulong_t ledbit[INPUT_DEVICE_ID_LED_MAX / BITS_PER_LONG + 1];
293 kernel_ulong_t sndbit[INPUT_DEVICE_ID_SND_MAX / BITS_PER_LONG + 1];
294 kernel_ulong_t ffbit[INPUT_DEVICE_ID_FF_MAX / BITS_PER_LONG + 1];
295 kernel_ulong_t swbit[INPUT_DEVICE_ID_SW_MAX / BITS_PER_LONG + 1];
296
297 kernel_ulong_t driver_info;
298};
299
252#endif /* LINUX_MOD_DEVICETABLE_H */ 300#endif /* LINUX_MOD_DEVICETABLE_H */