]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blob - drivers/input/keyboard/twl4030-keypad.h
Merge current mainline tree into linux-omap tree
[linux-2.6-omap-h63xx.git] / drivers / input / keyboard / twl4030-keypad.h
1 /*
2  * drivers/input/keyboard/twl4030-keypad.h
3  *
4  * Copyright (C) 2006-2007 Texas Instruments, Inc.
5  *
6  * Intial Code:
7  *      Syed Mohammed Khasim <x0khasim@ti.com>
8  *
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.
13  *
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.
18  *
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
22  */
23 #ifndef __TWL4030_KEYPAD_H__
24 #define __TWL4030_KEYPAD_H__
25
26 /* Register Definitions */
27 #define REG_KEYP_CTRL_REG                       (0x0)
28 #define REG_KEY_DEB_REG                         (0x1)
29 #define REG_LK_PTV_REG                          (0x3)
30 #define REG_FULL_CODE_7_0                       (0x9)
31 #define REG_KEYP_ISR1                           (0x11)
32 #define REG_KEYP_IMR1                           (0x12)
33 #define REG_KEYP_EDR                            (0x16)
34 #define REG_KEYP_SIH_CTRL                       (0x17)
35
36 /* KEYP_CTRL_REG Fields */
37 #define BIT_KEYP_CTRL_REG_SOFT_NRST_MASK        (0x00000001)
38 #define BIT_KEYP_CTRL_REG_SOFTMODEN_MASK        (0x00000002)
39 #define BIT_KEYP_CTRL_REG_LK_EN_MASK            (0x00000004)
40 #define BIT_KEYP_CTRL_REG_TOE_EN_MASK           (0x00000008)
41 #define BIT_KEYP_CTRL_REG_TOLE_EN_MASK          (0x00000010)
42 #define BIT_KEYP_CTRL_REG_RP_EN_MASK            (0x00000020)
43 #define BIT_KEYP_CTRL_REG_KBD_ON_MASK           (0x00000040)
44
45
46 #define KEYP_CTRL_REG_MASK_NOAUTORPT            BIT_KEYP_CTRL_REG_SOFT_NRST_MASK |\
47                                                 BIT_KEYP_CTRL_REG_SOFTMODEN_MASK |\
48                                                 BIT_KEYP_CTRL_REG_KBD_ON_MASK
49
50 /* LK_PTV_REG Fields */
51 #define BIT_LK_PTV_REG_PTV                      (0x005)
52 #define BIT_LK_PTV_REG_PTV_MASK                 (0x000000E0)
53 #define BIT_PTV_REG_PTV4                        (0x4)
54
55 /* KEYP_IMR1 Fields */
56 #define KEYP_IMR1_MASK                          (0x0F)
57 #define KEYP_IMR1_UNMASK                        (0x00)
58
59 /* KEYP_EDR Fields */
60 #define BIT_KEYP_EDR_ITKPFALLING_MASK           (0x00000001)
61 #define BIT_KEYP_EDR_ITKPRISING_MASK            (0x00000002)
62 #define BIT_KEYP_EDR_ITLKFALLING_MASK           (0x00000004)
63 #define BIT_KEYP_EDR_ITLKRISING_MASK            (0x00000008)
64 #define BIT_KEYP_EDR_ITTOFALLING_MASK           (0x00000010)
65 #define BIT_KEYP_EDR_ITTORISING_MASK            (0x00000020)
66 #define BIT_KEYP_EDR_ITMISFALLING_MASK          (0x00000040)
67 #define BIT_KEYP_EDR_ITMISRISING_MASK           (0x00000080)
68
69 #define KEYP_EDR_MASK                           BIT_KEYP_EDR_ITKPFALLING_MASK |\
70                                                 BIT_KEYP_EDR_ITLKFALLING_MASK |\
71                                                 BIT_KEYP_EDR_ITTOFALLING_MASK |\
72                                                 BIT_KEYP_EDR_ITMISFALLING_MASK
73 /* KEYP_SIH_CTRL Fields */
74 #define KEYP_SIH_CTRL_MASK                      (0x04)
75
76 #endif  /* End of __TWL4030-KEYPAD_H__ */