aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/i2c/tc35894xbg.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/i2c/tc35894xbg.h')
-rw-r--r--include/linux/i2c/tc35894xbg.h72
1 files changed, 72 insertions, 0 deletions
diff --git a/include/linux/i2c/tc35894xbg.h b/include/linux/i2c/tc35894xbg.h
new file mode 100644
index 00000000000..7e3fec345a8
--- /dev/null
+++ b/include/linux/i2c/tc35894xbg.h
@@ -0,0 +1,72 @@
+/*
+ * tc35894xbg.h - Configuration for TC35894XBG keypad driver.
+ *
+ * (C) Copyright 2010 Intel Corporation
+ * Author: Charlie Paul (z8cpaul@windriver.com)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; version 2
+ * of the License.
+ */
+
+#ifndef __LINUX_TC35894XBG_H
+#define __LINUX_TC35894XBG_H
+
+#include <linux/types.h>
+
+/*
+ * Largest keycode that the chip can send, plus one,
+ * so keys can be mapped directly at the index of the
+ * TC35894XBG keycode instead of subtracting one.
+ */
+#define TC35894XBG_KEYMAP_SIZE (0x7f + 1)
+
+#define SHIFT_NEEDED (0x1000)
+
+#define KEY_EXCLAM (KEY_1 + SHIFT_NEEDED) /* '!' -> shift+1 */
+#define KEY_AT (KEY_2 + SHIFT_NEEDED) /* '@' -> shift+2 */
+#define KEY_NUMBER_SIGN (KEY_3 + SHIFT_NEEDED) /* '#' -> shift+3 */
+#define KEY_DOLLAR_SIGN (KEY_4 + SHIFT_NEEDED) /* '$' -> shift+4 */
+#define KEY_NOR (KEY_6 + SHIFT_NEEDED) /* '^' -> shift+6 */
+#define KEY_PERCENT (KEY_5 + SHIFT_NEEDED) /* '%' -> shift+5 */
+#define KEY_AMPERSAND (KEY_7 + SHIFT_NEEDED) /* '&' -> shift+7 */
+#define KEY_PLUS (KEY_EQUAL + SHIFT_NEEDED) /* '+' -> shift+= */
+
+#define KEY_BAR (KEY_BACKSLASH + SHIFT_NEEDED) /* '|' -> shift+\ */
+#define KEY_COLON (KEY_SEMICOLON + SHIFT_NEEDED) /* ':' -> shift+; */
+#define KEY_UNDERSCORE (KEY_MINUS + SHIFT_NEEDED) /* '_' -> shift+- */
+#define KEY_QUOTE_DBL (KEY_APOSTROPHE + SHIFT_NEEDED) /* '"' -> shift+' */
+
+
+#define TC_MAX_KEYMAPS (2)
+#define TC_DEFAULT_KEYMAP (0)
+#define TC_ALT_KEYMAP (1)
+#define TC35894XBG_MAX_FIFO (8)
+
+
+struct tc35894xbg_platform_data {
+
+ unsigned char debounce_time; /* Time to watch for bouncing, in ms. */
+ unsigned char settle_time; /* Idle time until sleep, in ms. */
+ unsigned char col_setting; /* Sets up ball settings in reg 0x04 */
+ unsigned char rowcol_setting; /* Sets up ball settings in reg 0x05 */
+
+ int gpio_reset; /* reset output GPIO index (-1 if not implemented) */
+ int gpio_irq; /* interrupt GPIO */
+ int keymap_size;
+ int size_x;
+ int size_y;
+ int function_key;
+ int right_shift_key;
+
+ void (*reset_ctrl)(struct i2c_client *client, int value);
+
+ int n_keymaps;
+ unsigned short keymap[TC_MAX_KEYMAPS][TC35894XBG_KEYMAP_SIZE];
+
+ /* Device name. */
+ const char *name;
+};
+
+#endif /* __LINUX_TC35894XBG_H */