aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-12-09 22:52:01 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-12-09 22:52:01 -0500
commitfa395aaec823b9d1a5800913a6b5d0e6d1c5ced2 (patch)
treed599abe9f4f48f1737da50fa9a48dadfd08100e3 /include
parent3e7468313758913c5e4d372f35b271b96bad1298 (diff)
parent1f26978afd123deb22dd3c7dc75771a02f6e03f6 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (51 commits) Input: appletouch - give up maintainership Input: dm355evm_kbd - switch to using sparse keymap library Input: wistron_btns - switch to using sparse keymap library Input: add generic support for sparse keymaps Input: fix memory leak in force feedback core Input: wistron - remove identification strings from DMI table Input: psmouse - remove identification strings from DMI tables Input: atkbd - remove identification strings from DMI table Input: i8042 - remove identification strings from DMI tables DMI: allow omitting ident strings in DMI tables Input: psmouse - do not carry DMI data around Input: matrix-keypad - switch to using dev_pm_ops Input: keyboard - fix lack of locking when traversing handler->h_list Input: gpio_keys - scan gpio state at probe and resume time Input: keyboard - add locking around event handling Input: usbtouchscreen - add support for ET&T TC5UH touchscreen controller Input: xpad - add two new Xbox 360 devices Input: polled device - do not start polling if interval is zero Input: polled device - schedule first poll immediately Input: add S3C24XX touchscreen driver ...
Diffstat (limited to 'include')
-rw-r--r--include/linux/input-polldev.h22
-rw-r--r--include/linux/input.h13
-rw-r--r--include/linux/input/matrix_keypad.h3
-rw-r--r--include/linux/input/sparse-keymap.h62
-rw-r--r--include/linux/serio.h1
-rw-r--r--include/linux/ucb1400.h4
6 files changed, 97 insertions, 8 deletions
diff --git a/include/linux/input-polldev.h b/include/linux/input-polldev.h
index 597a0077b3c5..5e3dddf8f562 100644
--- a/include/linux/input-polldev.h
+++ b/include/linux/input-polldev.h
@@ -14,12 +14,19 @@
14 14
15/** 15/**
16 * struct input_polled_dev - simple polled input device 16 * struct input_polled_dev - simple polled input device
17 * @private: private driver data 17 * @private: private driver data.
18 * @flush: driver-supplied method that flushes device's state upon 18 * @open: driver-supplied method that prepares device for polling
19 * opening (optional) 19 * (enabled the device and maybe flushes device state).
20 * @close: driver-supplied method that is called when device is no
21 * longer being polled. Used to put device into low power mode.
20 * @poll: driver-supplied method that polls the device and posts 22 * @poll: driver-supplied method that polls the device and posts
21 * input events (mandatory). 23 * input events (mandatory).
22 * @poll_interval: specifies how often the poll() method shoudl be called. 24 * @poll_interval: specifies how often the poll() method should be called.
25 * Defaults to 500 msec unless overriden when registering the device.
26 * @poll_interval_max: specifies upper bound for the poll interval.
27 * Defaults to the initial value of @poll_interval.
28 * @poll_interval_min: specifies lower bound for the poll interval.
29 * Defaults to 0.
23 * @input: input device structire associated with the polled device. 30 * @input: input device structire associated with the polled device.
24 * Must be properly initialized by the driver (id, name, phys, bits). 31 * Must be properly initialized by the driver (id, name, phys, bits).
25 * 32 *
@@ -30,11 +37,16 @@
30struct input_polled_dev { 37struct input_polled_dev {
31 void *private; 38 void *private;
32 39
33 void (*flush)(struct input_polled_dev *dev); 40 void (*open)(struct input_polled_dev *dev);
41 void (*close)(struct input_polled_dev *dev);
34 void (*poll)(struct input_polled_dev *dev); 42 void (*poll)(struct input_polled_dev *dev);
35 unsigned int poll_interval; /* msec */ 43 unsigned int poll_interval; /* msec */
44 unsigned int poll_interval_max; /* msec */
45 unsigned int poll_interval_min; /* msec */
36 46
37 struct input_dev *input; 47 struct input_dev *input;
48
49/* private: */
38 struct delayed_work work; 50 struct delayed_work work;
39}; 51};
40 52
diff --git a/include/linux/input.h b/include/linux/input.h
index 84b501ab0d8f..7be8a6537b57 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -895,7 +895,7 @@ struct ff_periodic_effect {
895 struct ff_envelope envelope; 895 struct ff_envelope envelope;
896 896
897 __u32 custom_len; 897 __u32 custom_len;
898 __s16 *custom_data; 898 __s16 __user *custom_data;
899}; 899};
900 900
901/** 901/**
@@ -1021,9 +1021,12 @@ struct ff_effect {
1021 * @keycodesize: size of elements in keycode table 1021 * @keycodesize: size of elements in keycode table
1022 * @keycode: map of scancodes to keycodes for this device 1022 * @keycode: map of scancodes to keycodes for this device
1023 * @setkeycode: optional method to alter current keymap, used to implement 1023 * @setkeycode: optional method to alter current keymap, used to implement
1024 * sparse keymaps. If not supplied default mechanism will be used 1024 * sparse keymaps. If not supplied default mechanism will be used.
1025 * The method is being called while holding event_lock and thus must
1026 * not sleep
1025 * @getkeycode: optional method to retrieve current keymap. If not supplied 1027 * @getkeycode: optional method to retrieve current keymap. If not supplied
1026 * default mechanism will be used 1028 * default mechanism will be used. The method is being called while
1029 * holding event_lock and thus must not sleep
1027 * @ff: force feedback structure associated with the device if device 1030 * @ff: force feedback structure associated with the device if device
1028 * supports force feedback effects 1031 * supports force feedback effects
1029 * @repeat_key: stores key code of the last key pressed; used to implement 1032 * @repeat_key: stores key code of the last key pressed; used to implement
@@ -1040,6 +1043,7 @@ struct ff_effect {
1040 * @absmin: minimum values for events coming from absolute axes 1043 * @absmin: minimum values for events coming from absolute axes
1041 * @absfuzz: describes noisiness for axes 1044 * @absfuzz: describes noisiness for axes
1042 * @absflat: size of the center flat position (used by joydev) 1045 * @absflat: size of the center flat position (used by joydev)
1046 * @absres: resolution used for events coming form absolute axes
1043 * @open: this method is called when the very first user calls 1047 * @open: this method is called when the very first user calls
1044 * input_open_device(). The driver must prepare the device 1048 * input_open_device(). The driver must prepare the device
1045 * to start generating events (start polling thread, 1049 * to start generating events (start polling thread,
@@ -1294,6 +1298,9 @@ void input_unregister_device(struct input_dev *);
1294int __must_check input_register_handler(struct input_handler *); 1298int __must_check input_register_handler(struct input_handler *);
1295void input_unregister_handler(struct input_handler *); 1299void input_unregister_handler(struct input_handler *);
1296 1300
1301int input_handler_for_each_handle(struct input_handler *, void *data,
1302 int (*fn)(struct input_handle *, void *));
1303
1297int input_register_handle(struct input_handle *); 1304int input_register_handle(struct input_handle *);
1298void input_unregister_handle(struct input_handle *); 1305void input_unregister_handle(struct input_handle *);
1299 1306
diff --git a/include/linux/input/matrix_keypad.h b/include/linux/input/matrix_keypad.h
index b3cd42d50e16..3bd018baae20 100644
--- a/include/linux/input/matrix_keypad.h
+++ b/include/linux/input/matrix_keypad.h
@@ -41,6 +41,9 @@ struct matrix_keymap_data {
41 * @col_scan_delay_us: delay, measured in microseconds, that is 41 * @col_scan_delay_us: delay, measured in microseconds, that is
42 * needed before we can keypad after activating column gpio 42 * needed before we can keypad after activating column gpio
43 * @debounce_ms: debounce interval in milliseconds 43 * @debounce_ms: debounce interval in milliseconds
44 * @active_low: gpio polarity
45 * @wakeup: controls whether the device should be set up as wakeup
46 * source
44 * 47 *
45 * This structure represents platform-specific data that use used by 48 * This structure represents platform-specific data that use used by
46 * matrix_keypad driver to perform proper initialization. 49 * matrix_keypad driver to perform proper initialization.
diff --git a/include/linux/input/sparse-keymap.h b/include/linux/input/sparse-keymap.h
new file mode 100644
index 000000000000..52db62064c6e
--- /dev/null
+++ b/include/linux/input/sparse-keymap.h
@@ -0,0 +1,62 @@
1#ifndef _SPARSE_KEYMAP_H
2#define _SPARSE_KEYMAP_H
3
4/*
5 * Copyright (c) 2009 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#define KE_END 0 /* Indicates end of keymap */
13#define KE_KEY 1 /* Ordinary key/button */
14#define KE_SW 2 /* Switch (predetermined value) */
15#define KE_VSW 3 /* Switch (value supplied at runtime) */
16#define KE_IGNORE 4 /* Known entry that should be ignored */
17#define KE_LAST KE_IGNORE
18
19/**
20 * struct key_entry - keymap entry for use in sparse keymap
21 * @type: Type of the key entry (KE_KEY, KE_SW, KE_VSW, KE_END);
22 * drivers are allowed to extend the list with their own
23 * private definitions.
24 * @code: Device-specific data identifying the button/switch
25 * @keycode: KEY_* code assigned to a key/button
26 * @sw.code: SW_* code assigned to a switch
27 * @sw.value: Value that should be sent in an input even when KE_SW
28 * switch is toggled. KE_VSW switches ignore this field and
29 * expect driver to supply value for the event.
30 *
31 * This structure defines an entry in a sparse keymap used by some
32 * input devices for which traditional table-based approach is not
33 * suitable.
34 */
35struct key_entry {
36 int type; /* See KE_* above */
37 u32 code;
38 union {
39 u16 keycode; /* For KE_KEY */
40 struct { /* For KE_SW, KE_VSW */
41 u8 code;
42 u8 value; /* For KE_SW, ignored by KE_VSW */
43 } sw;
44 };
45};
46
47struct key_entry *sparse_keymap_entry_from_scancode(struct input_dev *dev,
48 unsigned int code);
49struct key_entry *sparse_keymap_entry_from_keycode(struct input_dev *dev,
50 unsigned int code);
51int sparse_keymap_setup(struct input_dev *dev,
52 const struct key_entry *keymap,
53 int (*setup)(struct input_dev *, struct key_entry *));
54void sparse_keymap_free(struct input_dev *dev);
55
56void sparse_keymap_report_entry(struct input_dev *dev, const struct key_entry *ke,
57 unsigned int value, bool autorelease);
58
59bool sparse_keymap_report_event(struct input_dev *dev, unsigned int code,
60 unsigned int value, bool autorelease);
61
62#endif /* _SPARSE_KEYMAP_H */
diff --git a/include/linux/serio.h b/include/linux/serio.h
index a640bc2afe76..e2f3044d4a4a 100644
--- a/include/linux/serio.h
+++ b/include/linux/serio.h
@@ -215,5 +215,6 @@ static inline void serio_unpin_driver(struct serio *serio)
215#define SERIO_INEXIO 0x37 215#define SERIO_INEXIO 0x37
216#define SERIO_TOUCHIT213 0x38 216#define SERIO_TOUCHIT213 0x38
217#define SERIO_W8001 0x39 217#define SERIO_W8001 0x39
218#define SERIO_DYNAPRO 0x3a
218 219
219#endif 220#endif
diff --git a/include/linux/ucb1400.h b/include/linux/ucb1400.h
index adb44066680c..1b4790911052 100644
--- a/include/linux/ucb1400.h
+++ b/include/linux/ucb1400.h
@@ -110,6 +110,10 @@ struct ucb1400 {
110 struct platform_device *ucb1400_gpio; 110 struct platform_device *ucb1400_gpio;
111}; 111};
112 112
113struct ucb1400_pdata {
114 int irq;
115};
116
113static inline u16 ucb1400_reg_read(struct snd_ac97 *ac97, u16 reg) 117static inline u16 ucb1400_reg_read(struct snd_ac97 *ac97, u16 reg)
114{ 118{
115 return ac97->bus->ops->read(ac97, reg); 119 return ac97->bus->ops->read(ac97, reg);