2 * drivers/input/keyboard/twl4030-keypad.h
4 * Copyright (C) 2006-2007 Texas Instruments, Inc.
7 * Syed Mohammed Khasim <x0khasim@ti.com>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 #ifndef __TWL4030_KEYPAD_H__
24 #define __TWL4030_KEYPAD_H__
26 /* Register Definitions */
27 #define KEYP_CTRL 0x00
29 #define KEYP_LONG_KEY 0x02
30 #define KEYP_LK_PTV 0x03
31 #define KEYP_TIMEOUT_L 0x04
32 #define KEYP_TIMEOUT_H 0x05
33 #define KEYP_FULL_CODE_7_0 0x09
34 #define KEYP_ISR1 0x11
35 #define KEYP_IMR1 0x12
37 #define KEYP_SIH_CTRL 0x17
39 /* KEYP_CTRL_REG Fields */
40 #define KEYP_CTRL_SOFT_NRST 0x01
41 #define KEYP_CTRL_SOFTMODEN 0x02
42 #define KEYP_CTRL_LK_EN 0x04
43 #define KEYP_CTRL_TOE_EN 0x08
44 #define KEYP_CTRL_TOLE_EN 0x10
45 #define KEYP_CTRL_RP_EN 0x20
46 #define KEYP_CTRL_KBD_ON 0x40
49 #define KEYP_CTRL_NOAUTORPT (KEYP_CTRL_SOFT_NRST | \
50 KEYP_CTRL_SOFTMODEN | \
54 /* KEYP_DEB, KEYP_LONG_KEY, KEYP_TIMEOUT_x*/
55 #define KEYP_PERIOD_US(T, prescale) (T / (31 << (prescale + 1)) - 1)
57 /* KEYP_LK_PTV_REG Fields */
58 #define KEYP_LK_PTV_PTV_SHIFT 5
60 /* KEYP_IMR1 Fields */
61 #define KEYP_IMR1_MIS 0x08
62 #define KEYP_IMR1_TO 0x04
63 #define KEYP_IMR1_LK 0x02
64 #define KEYP_IMR1_KP 0x01
67 #define KEYP_EDR_KP_FALLING 0x01
68 #define KEYP_EDR_KP_RISING 0x02
69 #define KEYP_EDR_KP_BOTH 0x03
70 #define KEYP_EDR_LK_FALLING 0x04
71 #define KEYP_EDR_LK_RISING 0x08
72 #define KEYP_EDR_TO_FALLING 0x10
73 #define KEYP_EDR_TO_RISING 0x20
74 #define KEYP_EDR_MIS_FALLING 0x40
75 #define KEYP_EDR_MIS_RISING 0x80
77 /* KEYP_SIH_CTRL Fields */
78 #define KEYP_SIH_CTRL_COR 0x04
79 #define KEYP_SIH_CTRL_PEND_DIS 0x02
80 #define KEYP_SIH_CTRL_EXCL_EN 0x01
82 #endif /* End of __TWL4030-KEYPAD_H__ */