aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/hp_sdc.h1
-rw-r--r--include/linux/input-polldev.h46
-rw-r--r--include/linux/input.h52
3 files changed, 70 insertions, 29 deletions
diff --git a/include/linux/hp_sdc.h b/include/linux/hp_sdc.h
index debd71515312..9db3d454887f 100644
--- a/include/linux/hp_sdc.h
+++ b/include/linux/hp_sdc.h
@@ -71,6 +71,7 @@ typedef struct {
71 struct semaphore *semaphore; /* Semaphore to sleep on. */ 71 struct semaphore *semaphore; /* Semaphore to sleep on. */
72 } act; 72 } act;
73} hp_sdc_transaction; 73} hp_sdc_transaction;
74int __hp_sdc_enqueue_transaction(hp_sdc_transaction *this);
74int hp_sdc_enqueue_transaction(hp_sdc_transaction *this); 75int hp_sdc_enqueue_transaction(hp_sdc_transaction *this);
75int hp_sdc_dequeue_transaction(hp_sdc_transaction *this); 76int hp_sdc_dequeue_transaction(hp_sdc_transaction *this);
76 77
diff --git a/include/linux/input-polldev.h b/include/linux/input-polldev.h
new file mode 100644
index 000000000000..597a0077b3c5
--- /dev/null
+++ b/include/linux/input-polldev.h
@@ -0,0 +1,46 @@
1#ifndef _INPUT_POLLDEV_H
2#define _INPUT_POLLDEV_H
3
4/*
5 * Copyright (c) 2007 Dmitry Torokhov
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 */
11
12#include <linux/input.h>
13#include <linux/workqueue.h>
14
15/**
16 * struct input_polled_dev - simple polled input device
17 * @private: private driver data
18 * @flush: driver-supplied method that flushes device's state upon
19 * opening (optional)
20 * @poll: driver-supplied method that polls the device and posts
21 * input events (mandatory).
22 * @poll_interval: specifies how often the poll() method shoudl be called.
23 * @input: input device structire associated with the polled device.
24 * Must be properly initialized by the driver (id, name, phys, bits).
25 *
26 * Polled input device provides a skeleton for supporting simple input
27 * devices that do not raise interrupts but have to be periodically
28 * scanned or polled to detect changes in their state.
29 */
30struct input_polled_dev {
31 void *private;
32
33 void (*flush)(struct input_polled_dev *dev);
34 void (*poll)(struct input_polled_dev *dev);
35 unsigned int poll_interval; /* msec */
36
37 struct input_dev *input;
38 struct delayed_work work;
39};
40
41struct input_polled_dev *input_allocate_polled_device(void);
42void input_free_polled_device(struct input_polled_dev *dev);
43int input_register_polled_device(struct input_polled_dev *dev);
44void input_unregister_polled_device(struct input_polled_dev *dev);
45
46#endif
diff --git a/include/linux/input.h b/include/linux/input.h
index bde65c8a3519..1789ee9df4dd 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -506,6 +506,7 @@ struct input_absinfo {
506#define KEY_VOICEMAIL 0x1ac 506#define KEY_VOICEMAIL 0x1ac
507#define KEY_ADDRESSBOOK 0x1ad 507#define KEY_ADDRESSBOOK 0x1ad
508#define KEY_MESSENGER 0x1ae 508#define KEY_MESSENGER 0x1ae
509#define KEY_DISPLAYTOGGLE 0x1af /* Turn display (LCD) on and off */
509 510
510#define KEY_DEL_EOL 0x1c0 511#define KEY_DEL_EOL 0x1c0
511#define KEY_DEL_EOS 0x1c1 512#define KEY_DEL_EOS 0x1c1
@@ -913,33 +914,6 @@ struct ff_effect {
913#define BIT(x) (1UL<<((x)%BITS_PER_LONG)) 914#define BIT(x) (1UL<<((x)%BITS_PER_LONG))
914#define LONG(x) ((x)/BITS_PER_LONG) 915#define LONG(x) ((x)/BITS_PER_LONG)
915 916
916#define INPUT_KEYCODE(dev, scancode) ((dev->keycodesize == 1) ? ((u8*)dev->keycode)[scancode] : \
917 ((dev->keycodesize == 2) ? ((u16*)dev->keycode)[scancode] : (((u32*)dev->keycode)[scancode])))
918
919#define SET_INPUT_KEYCODE(dev, scancode, val) \
920 ({ unsigned __old; \
921 switch (dev->keycodesize) { \
922 case 1: { \
923 u8 *k = (u8 *)dev->keycode; \
924 __old = k[scancode]; \
925 k[scancode] = val; \
926 break; \
927 } \
928 case 2: { \
929 u16 *k = (u16 *)dev->keycode; \
930 __old = k[scancode]; \
931 k[scancode] = val; \
932 break; \
933 } \
934 default: { \
935 u32 *k = (u32 *)dev->keycode; \
936 __old = k[scancode]; \
937 k[scancode] = val; \
938 break; \
939 } \
940 } \
941 __old; })
942
943struct input_dev { 917struct input_dev {
944 918
945 void *private; 919 void *private;
@@ -962,6 +936,8 @@ struct input_dev {
962 unsigned int keycodemax; 936 unsigned int keycodemax;
963 unsigned int keycodesize; 937 unsigned int keycodesize;
964 void *keycode; 938 void *keycode;
939 int (*setkeycode)(struct input_dev *dev, int scancode, int keycode);
940 int (*getkeycode)(struct input_dev *dev, int scancode, int *keycode);
965 941
966 struct ff_device *ff; 942 struct ff_device *ff;
967 943
@@ -996,6 +972,9 @@ struct input_dev {
996 unsigned int users; 972 unsigned int users;
997 973
998 struct class_device cdev; 974 struct class_device cdev;
975 union { /* temporarily so while we switching to struct device */
976 struct device *parent;
977 } dev;
999 978
1000 struct list_head h_list; 979 struct list_head h_list;
1001 struct list_head node; 980 struct list_head node;
@@ -1074,7 +1053,7 @@ struct input_handler {
1074 void *private; 1053 void *private;
1075 1054
1076 void (*event)(struct input_handle *handle, unsigned int type, unsigned int code, int value); 1055 void (*event)(struct input_handle *handle, unsigned int type, unsigned int code, int value);
1077 struct input_handle* (*connect)(struct input_handler *handler, struct input_dev *dev, const struct input_device_id *id); 1056 int (*connect)(struct input_handler *handler, struct input_dev *dev, const struct input_device_id *id);
1078 void (*disconnect)(struct input_handle *handle); 1057 void (*disconnect)(struct input_handle *handle);
1079 void (*start)(struct input_handle *handle); 1058 void (*start)(struct input_handle *handle);
1080 1059
@@ -1104,7 +1083,7 @@ struct input_handle {
1104}; 1083};
1105 1084
1106#define to_dev(n) container_of(n,struct input_dev,node) 1085#define to_dev(n) container_of(n,struct input_dev,node)
1107#define to_handler(n) container_of(n,struct input_handler,node); 1086#define to_handler(n) container_of(n,struct input_handler,node)
1108#define to_handle(n) container_of(n,struct input_handle,d_node) 1087#define to_handle(n) container_of(n,struct input_handle,d_node)
1109#define to_handle_h(n) container_of(n,struct input_handle,h_node) 1088#define to_handle_h(n) container_of(n,struct input_handle,h_node)
1110 1089
@@ -1121,12 +1100,25 @@ static inline void input_put_device(struct input_dev *dev)
1121 class_device_put(&dev->cdev); 1100 class_device_put(&dev->cdev);
1122} 1101}
1123 1102
1103static inline void *input_get_drvdata(struct input_dev *dev)
1104{
1105 return dev->private;
1106}
1107
1108static inline void input_set_drvdata(struct input_dev *dev, void *data)
1109{
1110 dev->private = data;
1111}
1112
1124int input_register_device(struct input_dev *); 1113int input_register_device(struct input_dev *);
1125void input_unregister_device(struct input_dev *); 1114void input_unregister_device(struct input_dev *);
1126 1115
1127int input_register_handler(struct input_handler *); 1116int input_register_handler(struct input_handler *);
1128void input_unregister_handler(struct input_handler *); 1117void input_unregister_handler(struct input_handler *);
1129 1118
1119int input_register_handle(struct input_handle *);
1120void input_unregister_handle(struct input_handle *);
1121
1130int input_grab_device(struct input_handle *); 1122int input_grab_device(struct input_handle *);
1131void input_release_device(struct input_handle *); 1123void input_release_device(struct input_handle *);
1132 1124
@@ -1168,6 +1160,8 @@ static inline void input_sync(struct input_dev *dev)
1168 input_event(dev, EV_SYN, SYN_REPORT, 0); 1160 input_event(dev, EV_SYN, SYN_REPORT, 0);
1169} 1161}
1170 1162
1163void input_set_capability(struct input_dev *dev, unsigned int type, unsigned int code);
1164
1171static inline void input_set_abs_params(struct input_dev *dev, int axis, int min, int max, int fuzz, int flat) 1165static inline void input_set_abs_params(struct input_dev *dev, int axis, int min, int max, int fuzz, int flat)
1172{ 1166{
1173 dev->absmin[axis] = min; 1167 dev->absmin[axis] = min;