diff options
| author | Thomas Gleixner <tglx@linutronix.de> | 2010-02-21 14:17:22 -0500 |
|---|---|---|
| committer | Thomas Gleixner <tglx@linutronix.de> | 2010-02-21 14:17:22 -0500 |
| commit | 5f854cfc024622e4aae14d7cf422f6ff86278688 (patch) | |
| tree | 426e77c6f6e4939c80440bf1fabcb020e3ee145b /include/linux/input | |
| parent | cc24da0742870f152ddf1002aa39dfcd83f7cf9c (diff) | |
| parent | 4ec62b2b2e6bd7ddef7b6cea6e5db7b5578a6532 (diff) | |
Forward to 2.6.33-rc8
Merge branch 'linus' into rt/head with a pile of conflicts.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/linux/input')
| -rw-r--r-- | include/linux/input/eeti_ts.h | 9 | ||||
| -rw-r--r-- | include/linux/input/matrix_keypad.h | 35 | ||||
| -rw-r--r-- | include/linux/input/sh_keysc.h | 14 | ||||
| -rw-r--r-- | include/linux/input/sparse-keymap.h | 62 |
4 files changed, 120 insertions, 0 deletions
diff --git a/include/linux/input/eeti_ts.h b/include/linux/input/eeti_ts.h new file mode 100644 index 000000000000..f875b316249d --- /dev/null +++ b/include/linux/input/eeti_ts.h | |||
| @@ -0,0 +1,9 @@ | |||
| 1 | #ifndef LINUX_INPUT_EETI_TS_H | ||
| 2 | #define LINUX_INPUT_EETI_TS_H | ||
| 3 | |||
| 4 | struct eeti_ts_platform_data { | ||
| 5 | unsigned int irq_active_high; | ||
| 6 | }; | ||
| 7 | |||
| 8 | #endif /* LINUX_INPUT_EETI_TS_H */ | ||
| 9 | |||
diff --git a/include/linux/input/matrix_keypad.h b/include/linux/input/matrix_keypad.h index 15d5903af2dd..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. |
| @@ -63,4 +66,36 @@ struct matrix_keypad_platform_data { | |||
| 63 | bool wakeup; | 66 | bool wakeup; |
| 64 | }; | 67 | }; |
| 65 | 68 | ||
| 69 | /** | ||
| 70 | * matrix_keypad_build_keymap - convert platform keymap into matrix keymap | ||
| 71 | * @keymap_data: keymap supplied by the platform code | ||
| 72 | * @row_shift: number of bits to shift row value by to advance to the next | ||
| 73 | * line in the keymap | ||
| 74 | * @keymap: expanded version of keymap that is suitable for use by | ||
| 75 | * matrix keyboad driver | ||
| 76 | * @keybit: pointer to bitmap of keys supported by input device | ||
| 77 | * | ||
| 78 | * This function converts platform keymap (encoded with KEY() macro) into | ||
| 79 | * an array of keycodes that is suitable for using in a standard matrix | ||
| 80 | * keyboard driver that uses row and col as indices. | ||
| 81 | */ | ||
| 82 | static inline void | ||
| 83 | matrix_keypad_build_keymap(const struct matrix_keymap_data *keymap_data, | ||
| 84 | unsigned int row_shift, | ||
| 85 | unsigned short *keymap, unsigned long *keybit) | ||
| 86 | { | ||
| 87 | int i; | ||
| 88 | |||
| 89 | for (i = 0; i < keymap_data->keymap_size; i++) { | ||
| 90 | unsigned int key = keymap_data->keymap[i]; | ||
| 91 | unsigned int row = KEY_ROW(key); | ||
| 92 | unsigned int col = KEY_COL(key); | ||
| 93 | unsigned short code = KEY_VAL(key); | ||
| 94 | |||
| 95 | keymap[MATRIX_SCAN_CODE(row, col, row_shift)] = code; | ||
| 96 | __set_bit(code, keybit); | ||
| 97 | } | ||
| 98 | __clear_bit(KEY_RESERVED, keybit); | ||
| 99 | } | ||
| 100 | |||
| 66 | #endif /* _MATRIX_KEYPAD_H */ | 101 | #endif /* _MATRIX_KEYPAD_H */ |
diff --git a/include/linux/input/sh_keysc.h b/include/linux/input/sh_keysc.h new file mode 100644 index 000000000000..c211b5cf08e6 --- /dev/null +++ b/include/linux/input/sh_keysc.h | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | #ifndef __SH_KEYSC_H__ | ||
| 2 | #define __SH_KEYSC_H__ | ||
| 3 | |||
| 4 | #define SH_KEYSC_MAXKEYS 30 | ||
| 5 | |||
| 6 | struct sh_keysc_info { | ||
| 7 | enum { SH_KEYSC_MODE_1, SH_KEYSC_MODE_2, SH_KEYSC_MODE_3 } mode; | ||
| 8 | int scan_timing; /* 0 -> 7, see KYCR1, SCN[2:0] */ | ||
| 9 | int delay; | ||
| 10 | int kycr2_delay; | ||
| 11 | int keycodes[SH_KEYSC_MAXKEYS]; | ||
| 12 | }; | ||
| 13 | |||
| 14 | #endif /* __SH_KEYSC_H__ */ | ||
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 | */ | ||
| 35 | struct 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 | |||
| 47 | struct key_entry *sparse_keymap_entry_from_scancode(struct input_dev *dev, | ||
| 48 | unsigned int code); | ||
| 49 | struct key_entry *sparse_keymap_entry_from_keycode(struct input_dev *dev, | ||
| 50 | unsigned int code); | ||
| 51 | int sparse_keymap_setup(struct input_dev *dev, | ||
| 52 | const struct key_entry *keymap, | ||
| 53 | int (*setup)(struct input_dev *, struct key_entry *)); | ||
| 54 | void sparse_keymap_free(struct input_dev *dev); | ||
| 55 | |||
| 56 | void sparse_keymap_report_entry(struct input_dev *dev, const struct key_entry *ke, | ||
| 57 | unsigned int value, bool autorelease); | ||
| 58 | |||
| 59 | bool sparse_keymap_report_event(struct input_dev *dev, unsigned int code, | ||
| 60 | unsigned int value, bool autorelease); | ||
| 61 | |||
| 62 | #endif /* _SPARSE_KEYMAP_H */ | ||
