aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-04 21:13:17 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-04 21:16:12 -0400
commita3d52136ee8f7399859f9a0824470fd49b1d1a00 (patch)
treeac0fd3d1efc356029cbbc5e413f778f7231cd909 /include
parent5b339915762d30b21995aa7263e74081f2f1110a (diff)
parent84767d00a8fd54dd97866561f6e2ee246c8e1cdc (diff)
Merge branch 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/dtor/input
* 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/dtor/input: (65 commits) Input: gpio_keys - add support for switches (EV_SW) Input: cobalt_btns - convert to use polldev library Input: add skeleton for simple polled devices Input: update some documentation Input: wistron - fix typo in keymap for Acer TM610 Input: add input_set_capability() helper Input: i8042 - add Fujitsu touchscreen/touchpad PNP IDs Input: i8042 - add Panasonic CF-29 to nomux list Input: lifebook - split into 2 devices Input: lifebook - add signature of Panasonic CF-29 Input: lifebook - activate 6-byte protocol on select models Input: lifebook - work properly on Panasonic CF-18 Input: cobalt buttons - separate device and driver registration Input: ati_remote - make button repeat sensitivity configurable Input: pxa27x - do not use deprecated SA_INTERRUPT flag Input: ucb1400 - make delays configurable Input: misc devices - switch to using input_dev->dev.parent Input: joysticks - switch to using input_dev->dev.parent Input: touchscreens - switch to using input_dev->dev.parent Input: mice - switch to using input_dev->dev.parent ... Fixed up conflicts with core device model removal of "struct subsystem" manually. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/asm-arm/arch-pxa/pxa27x_keyboard.h13
-rw-r--r--include/linux/gpio_keys.h3
-rw-r--r--include/linux/hp_sdc.h1
-rw-r--r--include/linux/input-polldev.h46
-rw-r--r--include/linux/input.h52
5 files changed, 85 insertions, 30 deletions
diff --git a/include/asm-arm/arch-pxa/pxa27x_keyboard.h b/include/asm-arm/arch-pxa/pxa27x_keyboard.h
new file mode 100644
index 000000000000..3aaff923b2ca
--- /dev/null
+++ b/include/asm-arm/arch-pxa/pxa27x_keyboard.h
@@ -0,0 +1,13 @@
1#define PXAKBD_MAXROW 8
2#define PXAKBD_MAXCOL 8
3
4struct pxa27x_keyboard_platform_data {
5 int nr_rows, nr_cols;
6 int keycodes[PXAKBD_MAXROW][PXAKBD_MAXCOL];
7 int gpio_modes[PXAKBD_MAXROW + PXAKBD_MAXCOL];
8
9#ifdef CONFIG_PM
10 u32 reg_kpc;
11 u32 reg_kprec;
12#endif
13};
diff --git a/include/linux/gpio_keys.h b/include/linux/gpio_keys.h
index 2b217c7b9312..265d17830a0f 100644
--- a/include/linux/gpio_keys.h
+++ b/include/linux/gpio_keys.h
@@ -3,10 +3,11 @@
3 3
4struct gpio_keys_button { 4struct gpio_keys_button {
5 /* Configuration parameters */ 5 /* Configuration parameters */
6 int keycode; 6 int code; /* input event code (KEY_*, SW_*) */
7 int gpio; 7 int gpio;
8 int active_low; 8 int active_low;
9 char *desc; 9 char *desc;
10 int type; /* input event type (EV_KEY, EV_SW) */
10}; 11};
11 12
12struct gpio_keys_platform_data { 13struct gpio_keys_platform_data {
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 327122548c4d..439954d09752 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
@@ -914,33 +915,6 @@ struct ff_effect {
914#define BIT(x) (1UL<<((x)%BITS_PER_LONG)) 915#define BIT(x) (1UL<<((x)%BITS_PER_LONG))
915#define LONG(x) ((x)/BITS_PER_LONG) 916#define LONG(x) ((x)/BITS_PER_LONG)
916 917
917#define INPUT_KEYCODE(dev, scancode) ((dev->keycodesize == 1) ? ((u8*)dev->keycode)[scancode] : \
918 ((dev->keycodesize == 2) ? ((u16*)dev->keycode)[scancode] : (((u32*)dev->keycode)[scancode])))
919
920#define SET_INPUT_KEYCODE(dev, scancode, val) \
921 ({ unsigned __old; \
922 switch (dev->keycodesize) { \
923 case 1: { \
924 u8 *k = (u8 *)dev->keycode; \
925 __old = k[scancode]; \
926 k[scancode] = val; \
927 break; \
928 } \
929 case 2: { \
930 u16 *k = (u16 *)dev->keycode; \
931 __old = k[scancode]; \
932 k[scancode] = val; \
933 break; \
934 } \
935 default: { \
936 u32 *k = (u32 *)dev->keycode; \
937 __old = k[scancode]; \
938 k[scancode] = val; \
939 break; \
940 } \
941 } \
942 __old; })
943
944struct input_dev { 918struct input_dev {
945 919
946 void *private; 920 void *private;
@@ -963,6 +937,8 @@ struct input_dev {
963 unsigned int keycodemax; 937 unsigned int keycodemax;
964 unsigned int keycodesize; 938 unsigned int keycodesize;
965 void *keycode; 939 void *keycode;
940 int (*setkeycode)(struct input_dev *dev, int scancode, int keycode);
941 int (*getkeycode)(struct input_dev *dev, int scancode, int *keycode);
966 942
967 struct ff_device *ff; 943 struct ff_device *ff;
968 944
@@ -997,6 +973,9 @@ struct input_dev {
997 unsigned int users; 973 unsigned int users;
998 974
999 struct class_device cdev; 975 struct class_device cdev;
976 union { /* temporarily so while we switching to struct device */
977 struct device *parent;
978 } dev;
1000 979
1001 struct list_head h_list; 980 struct list_head h_list;
1002 struct list_head node; 981 struct list_head node;
@@ -1075,7 +1054,7 @@ struct input_handler {
1075 void *private; 1054 void *private;
1076 1055
1077 void (*event)(struct input_handle *handle, unsigned int type, unsigned int code, int value); 1056 void (*event)(struct input_handle *handle, unsigned int type, unsigned int code, int value);
1078 struct input_handle* (*connect)(struct input_handler *handler, struct input_dev *dev, const struct input_device_id *id); 1057 int (*connect)(struct input_handler *handler, struct input_dev *dev, const struct input_device_id *id);
1079 void (*disconnect)(struct input_handle *handle); 1058 void (*disconnect)(struct input_handle *handle);
1080 void (*start)(struct input_handle *handle); 1059 void (*start)(struct input_handle *handle);
1081 1060
@@ -1105,7 +1084,7 @@ struct input_handle {
1105}; 1084};
1106 1085
1107#define to_dev(n) container_of(n,struct input_dev,node) 1086#define to_dev(n) container_of(n,struct input_dev,node)
1108#define to_handler(n) container_of(n,struct input_handler,node); 1087#define to_handler(n) container_of(n,struct input_handler,node)
1109#define to_handle(n) container_of(n,struct input_handle,d_node) 1088#define to_handle(n) container_of(n,struct input_handle,d_node)
1110#define to_handle_h(n) container_of(n,struct input_handle,h_node) 1089#define to_handle_h(n) container_of(n,struct input_handle,h_node)
1111 1090
@@ -1122,12 +1101,25 @@ static inline void input_put_device(struct input_dev *dev)
1122 class_device_put(&dev->cdev); 1101 class_device_put(&dev->cdev);
1123} 1102}
1124 1103
1104static inline void *input_get_drvdata(struct input_dev *dev)
1105{
1106 return dev->private;
1107}
1108
1109static inline void input_set_drvdata(struct input_dev *dev, void *data)
1110{
1111 dev->private = data;
1112}
1113
1125int input_register_device(struct input_dev *); 1114int input_register_device(struct input_dev *);
1126void input_unregister_device(struct input_dev *); 1115void input_unregister_device(struct input_dev *);
1127 1116
1128int input_register_handler(struct input_handler *); 1117int input_register_handler(struct input_handler *);
1129void input_unregister_handler(struct input_handler *); 1118void input_unregister_handler(struct input_handler *);
1130 1119
1120int input_register_handle(struct input_handle *);
1121void input_unregister_handle(struct input_handle *);
1122
1131int input_grab_device(struct input_handle *); 1123int input_grab_device(struct input_handle *);
1132void input_release_device(struct input_handle *); 1124void input_release_device(struct input_handle *);
1133 1125
@@ -1169,6 +1161,8 @@ static inline void input_sync(struct input_dev *dev)
1169 input_event(dev, EV_SYN, SYN_REPORT, 0); 1161 input_event(dev, EV_SYN, SYN_REPORT, 0);
1170} 1162}
1171 1163
1164void input_set_capability(struct input_dev *dev, unsigned int type, unsigned int code);
1165
1172static inline void input_set_abs_params(struct input_dev *dev, int axis, int min, int max, int fuzz, int flat) 1166static inline void input_set_abs_params(struct input_dev *dev, int axis, int min, int max, int fuzz, int flat)
1173{ 1167{
1174 dev->absmin[axis] = min; 1168 dev->absmin[axis] = min;