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