aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSundar Iyer <sundar.iyer@stericsson.com>2010-12-21 05:23:31 -0500
committerLinus Walleij <linus.walleij@stericsson.com>2010-12-29 16:02:24 -0500
commit09c730a488c32c2cadb31cdb8dcc4df528441197 (patch)
treeda84e298a2bc5d6a6bd4cdacfdd1a2125c3e301d /include
parent11c8ea81cc639c2ea56f94a9cdaa6242ff13a3af (diff)
input/tc3589x: add tc3589x keypad support
Add support for the keypad controller module found on the TC3589X devices. This driver default adds the support for TC35893 device. Signed-off-by: Sundar Iyer <sundar.iyer@stericsson.com> Acked-by: Dmitry Torokhov <dtor@mail.ru> [Some minor fixups for compilation] Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/mfd/tc3589x.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/include/linux/mfd/tc3589x.h b/include/linux/mfd/tc3589x.h
index da00958b12d9..16c76e124f9c 100644
--- a/include/linux/mfd/tc3589x.h
+++ b/include/linux/mfd/tc3589x.h
@@ -20,6 +20,17 @@ enum tx3589x_block {
20#define TC3589x_RSTCTRL_KBDRST (1 << 1) 20#define TC3589x_RSTCTRL_KBDRST (1 << 1)
21#define TC3589x_RSTCTRL_GPIRST (1 << 0) 21#define TC3589x_RSTCTRL_GPIRST (1 << 0)
22 22
23/* Keyboard Configuration Registers */
24#define TC3589x_KBDSETTLE_REG 0x01
25#define TC3589x_KBDBOUNCE 0x02
26#define TC3589x_KBDSIZE 0x03
27#define TC3589x_KBCFG_LSB 0x04
28#define TC3589x_KBCFG_MSB 0x05
29#define TC3589x_KBDIC 0x08
30#define TC3589x_KBDMSK 0x09
31#define TC3589x_EVTCODE_FIFO 0x10
32#define TC3589x_KBDMFS 0x8F
33
23#define TC3589x_IRQST 0x91 34#define TC3589x_IRQST 0x91
24 35
25#define TC3589x_MANFCODE_MAGIC 0x03 36#define TC3589x_MANFCODE_MAGIC 0x03
@@ -35,6 +46,14 @@ enum tx3589x_block {
35#define TC3589x_EXTRSTN 0x83 46#define TC3589x_EXTRSTN 0x83
36#define TC3589x_RSTINTCLR 0x84 47#define TC3589x_RSTINTCLR 0x84
37 48
49/* Pull up/down configuration registers */
50#define TC3589x_IOCFG 0xA7
51#define TC3589x_IOPULLCFG0_LSB 0xAA
52#define TC3589x_IOPULLCFG0_MSB 0xAB
53#define TC3589x_IOPULLCFG1_LSB 0xAC
54#define TC3589x_IOPULLCFG1_MSB 0xAD
55#define TC3589x_IOPULLCFG2_LSB 0xAE
56
38#define TC3589x_GPIOIS0 0xC9 57#define TC3589x_GPIOIS0 0xC9
39#define TC3589x_GPIOIS1 0xCA 58#define TC3589x_GPIOIS1 0xCA
40#define TC3589x_GPIOIS2 0xCB 59#define TC3589x_GPIOIS2 0xCB
@@ -112,6 +131,37 @@ extern int tc3589x_block_write(struct tc3589x *tc3589x, u8 reg, u8 length,
112 const u8 *values); 131 const u8 *values);
113extern int tc3589x_set_bits(struct tc3589x *tc3589x, u8 reg, u8 mask, u8 val); 132extern int tc3589x_set_bits(struct tc3589x *tc3589x, u8 reg, u8 mask, u8 val);
114 133
134/*
135 * Keypad related platform specific constants
136 * These values may be modified for fine tuning
137 */
138#define TC_KPD_ROWS 0x8
139#define TC_KPD_COLUMNS 0x8
140#define TC_KPD_DEBOUNCE_PERIOD 0xA3
141#define TC_KPD_SETTLE_TIME 0xA3
142
143/**
144 * struct tc35893_platform_data - data structure for platform specific data
145 * @keymap_data: matrix scan code table for keycodes
146 * @krow: mask for available rows, value is 0xFF
147 * @kcol: mask for available columns, value is 0xFF
148 * @debounce_period: platform specific debounce time
149 * @settle_time: platform specific settle down time
150 * @irqtype: type of interrupt, falling or rising edge
151 * @enable_wakeup: specifies if keypad event can wake up system from sleep
152 * @no_autorepeat: flag for auto repetition
153 */
154struct tc3589x_keypad_platform_data {
155 const struct matrix_keymap_data *keymap_data;
156 u8 krow;
157 u8 kcol;
158 u8 debounce_period;
159 u8 settle_time;
160 unsigned long irqtype;
161 bool enable_wakeup;
162 bool no_autorepeat;
163};
164
115/** 165/**
116 * struct tc3589x_gpio_platform_data - TC3589x GPIO platform data 166 * struct tc3589x_gpio_platform_data - TC3589x GPIO platform data
117 * @gpio_base: first gpio number assigned to TC3589x. A maximum of 167 * @gpio_base: first gpio number assigned to TC3589x. A maximum of
@@ -130,11 +180,13 @@ struct tc3589x_gpio_platform_data {
130 * @block: bitmask of blocks to enable (use TC3589x_BLOCK_*) 180 * @block: bitmask of blocks to enable (use TC3589x_BLOCK_*)
131 * @irq_base: base IRQ number. %TC3589x_NR_IRQS irqs will be used. 181 * @irq_base: base IRQ number. %TC3589x_NR_IRQS irqs will be used.
132 * @gpio: GPIO-specific platform data 182 * @gpio: GPIO-specific platform data
183 * @keypad: keypad-specific platform data
133 */ 184 */
134struct tc3589x_platform_data { 185struct tc3589x_platform_data {
135 unsigned int block; 186 unsigned int block;
136 int irq_base; 187 int irq_base;
137 struct tc3589x_gpio_platform_data *gpio; 188 struct tc3589x_gpio_platform_data *gpio;
189 const struct tc3589x_keypad_platform_data *keypad;
138}; 190};
139 191
140#define TC3589x_NR_GPIOS 24 192#define TC3589x_NR_GPIOS 24