aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/input.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2005-10-28 16:09:47 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-10-28 16:09:47 -0400
commit84860bf0644d7c45afe7ddbd30731c3e3c371fae (patch)
treed6c4b98a9c3fd9981e7fcc5d7729c9e01e327767 /include/linux/input.h
parent8caf89157d64f1eedba37113afb4b303b2b3e301 (diff)
parent6fbfddcb52d8d9fa2cd209f5ac2a1c87497d55b5 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6
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 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
993struct input_dev *input_allocate_device(void);
994
995static inline void input_free_device(struct input_dev *dev)
996{
997 kfree(dev);
998}
999
1000static inline struct input_dev *input_get_device(struct input_dev *dev)
1001{
1002 return to_input_dev(class_device_get(&dev->cdev));
1003}
1004
1005static inline void input_put_device(struct input_dev *dev)
1006{
1007 class_device_put(&dev->cdev);
1008}
1009
988void input_register_device(struct input_dev *); 1010void input_register_device(struct input_dev *);
989void input_unregister_device(struct input_dev *); 1011void 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
1056extern struct class *input_class; 1078extern struct class input_class;
1057 1079
1058#endif 1080#endif
1059#endif 1081#endif