aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/input
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2012-03-14 00:35:51 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2012-03-14 00:37:04 -0400
commit2cd36877ad1c61429e00c099b6903ebcd936ca00 (patch)
treec9f7618f3b49c2ba5516c9023ba7e5604aa6b08c /include/linux/input
parentb51425becfe127e0c17a8501ffa079b37241ed11 (diff)
Input: of_keymap - add device tree bindings for simple key matrices
This adds a simple device tree binding for simple key matrix data and a helper to fill in the platform data. Signed-off-by: Olof Johansson <olof@lixom.net> Acked-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'include/linux/input')
-rw-r--r--include/linux/input/matrix_keypad.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/linux/input/matrix_keypad.h b/include/linux/input/matrix_keypad.h
index fe7c4b9ae27..6c07ced0af8 100644
--- a/include/linux/input/matrix_keypad.h
+++ b/include/linux/input/matrix_keypad.h
@@ -3,6 +3,7 @@
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/input.h> 5#include <linux/input.h>
6#include <linux/of.h>
6 7
7#define MATRIX_MAX_ROWS 32 8#define MATRIX_MAX_ROWS 32
8#define MATRIX_MAX_COLS 32 9#define MATRIX_MAX_COLS 32
@@ -106,4 +107,22 @@ matrix_keypad_build_keymap(const struct matrix_keymap_data *keymap_data,
106 __clear_bit(KEY_RESERVED, keybit); 107 __clear_bit(KEY_RESERVED, keybit);
107} 108}
108 109
110#ifdef CONFIG_INPUT_OF_MATRIX_KEYMAP
111struct matrix_keymap_data *
112matrix_keyboard_of_fill_keymap(struct device_node *np, const char *propname);
113
114void matrix_keyboard_of_free_keymap(const struct matrix_keymap_data *kd);
115#else
116static inline struct matrix_keymap_data *
117matrix_keyboard_of_fill_keymap(struct device_node *np, const char *propname)
118{
119 return NULL;
120}
121
122static inline void
123matrix_keyboard_of_free_keymap(const struct matrix_keymap_data *kd)
124{
125}
126#endif
127
109#endif /* _MATRIX_KEYPAD_H */ 128#endif /* _MATRIX_KEYPAD_H */