summaryrefslogtreecommitdiffstats
path: root/include/linux/i2c/twl4030.h
diff options
context:
space:
mode:
authorDavid Brownell <dbrownell@users.sourceforge.net>2009-08-26 04:24:14 +0200
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2009-08-28 07:06:15 +0200
commit9d8340687c524ce61e3c9c76758c4c81303acfc0 (patch)
tree7dc56e76ca748e00f76fc635d2799323b16dfeff /include/linux/i2c/twl4030.h
parentInput: matrix-keypad - add function to build device keymap (diff)
downloadlinux-9d8340687c524ce61e3c9c76758c4c81303acfc0.tar.xz
linux-9d8340687c524ce61e3c9c76758c4c81303acfc0.zip
Input: add twl4030_keypad driver
Add a driver for the keypad controller on TWL4030 family chips. These support up to an 8x8 key matrix. The TWL4030 multifunction chips are mostly used on OMAP3 (or OMAP 2430) based boards. [dtor@mail.ru: switch to matrix-keypad framework, fix changing keymap from userspace] Reviewed-by: Trilok Soni <soni.trilok@gmail.com> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to '')
-rw-r--r--include/linux/i2c/twl4030.h19
1 files changed, 13 insertions, 6 deletions
diff --git a/include/linux/i2c/twl4030.h b/include/linux/i2c/twl4030.h
index 0dc80ef24975..3fd21d7cb6bf 100644
--- a/include/linux/i2c/twl4030.h
+++ b/include/linux/i2c/twl4030.h
@@ -25,6 +25,9 @@
#ifndef __TWL4030_H_
#define __TWL4030_H_
+#include <linux/types.h>
+#include <linux/input/matrix_keypad.h>
+
/*
* Using the twl4030 core we address registers using a pair
* { module id, relative register offset }
@@ -302,13 +305,17 @@ struct twl4030_madc_platform_data {
int irq_line;
};
+/* Boards have uniqe mappings of {col, row} --> keycode.
+ * Column and row are 4 bits, but range only from 0..7.
+ * a PERSISTENT_KEY is "always on" and never reported.
+ */
+#define PERSISTENT_KEY(c, r) KEY((c), (r), KEY_RESERVED)
+
struct twl4030_keypad_data {
- int rows;
- int cols;
- int *keymap;
- int irq;
- unsigned int keymapsize;
- unsigned int rep:1;
+ const struct matrix_keymap_data *keymap_data;
+ unsigned rows;
+ unsigned cols;
+ bool rep;
};
enum twl4030_usb_mode {