diff options
Diffstat (limited to 'include/linux/input.h')
-rw-r--r-- | include/linux/input.h | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/include/linux/input.h b/include/linux/input.h index d7836311ada9..f623c745c21c 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
@@ -12,6 +12,7 @@ | |||
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> | ||
15 | #else | 16 | #else |
16 | #include <sys/time.h> | 17 | #include <sys/time.h> |
17 | #include <sys/ioctl.h> | 18 | #include <sys/ioctl.h> |
@@ -890,11 +891,15 @@ struct input_dev { | |||
890 | struct semaphore sem; /* serializes open and close operations */ | 891 | struct semaphore sem; /* serializes open and close operations */ |
891 | unsigned int users; | 892 | unsigned int users; |
892 | 893 | ||
893 | struct device *dev; | 894 | struct class_device cdev; |
895 | struct device *dev; /* will be removed soon */ | ||
896 | |||
897 | int dynalloc; /* temporarily */ | ||
894 | 898 | ||
895 | struct list_head h_list; | 899 | struct list_head h_list; |
896 | struct list_head node; | 900 | struct list_head node; |
897 | }; | 901 | }; |
902 | #define to_input_dev(d) container_of(d, struct input_dev, cdev) | ||
898 | 903 | ||
899 | /* | 904 | /* |
900 | * Structure for hotplug & device<->driver matching. | 905 | * Structure for hotplug & device<->driver matching. |
@@ -985,6 +990,23 @@ static inline void init_input_dev(struct input_dev *dev) | |||
985 | INIT_LIST_HEAD(&dev->node); | 990 | INIT_LIST_HEAD(&dev->node); |
986 | } | 991 | } |
987 | 992 | ||
993 | struct input_dev *input_allocate_device(void); | ||
994 | |||
995 | static inline void input_free_device(struct input_dev *dev) | ||
996 | { | ||
997 | kfree(dev); | ||
998 | } | ||
999 | |||
1000 | static inline struct input_dev *input_get_device(struct input_dev *dev) | ||
1001 | { | ||
1002 | return to_input_dev(class_device_get(&dev->cdev)); | ||
1003 | } | ||
1004 | |||
1005 | static inline void input_put_device(struct input_dev *dev) | ||
1006 | { | ||
1007 | class_device_put(&dev->cdev); | ||
1008 | } | ||
1009 | |||
988 | void input_register_device(struct input_dev *); | 1010 | void input_register_device(struct input_dev *); |
989 | void input_unregister_device(struct input_dev *); | 1011 | void input_unregister_device(struct input_dev *); |
990 | 1012 | ||
@@ -1053,7 +1075,7 @@ static inline void input_set_abs_params(struct input_dev *dev, int axis, int min | |||
1053 | dev->absbit[LONG(axis)] |= BIT(axis); | 1075 | dev->absbit[LONG(axis)] |= BIT(axis); |
1054 | } | 1076 | } |
1055 | 1077 | ||
1056 | extern struct class *input_class; | 1078 | extern struct class input_class; |
1057 | 1079 | ||
1058 | #endif | 1080 | #endif |
1059 | #endif | 1081 | #endif |