aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mx25/mach-mx25pdk.c
diff options
context:
space:
mode:
authorBaruch Siach <baruch@tkos.co.il>2010-05-26 08:12:11 -0400
committerSascha Hauer <s.hauer@pengutronix.de>2010-07-26 08:17:56 -0400
commitc45dd814008f8842f854aa6960dfd6c610a01873 (patch)
treec3dd21f44684be8c51c1c47bd22e7e8dfea9d89e /arch/arm/mach-mx25/mach-mx25pdk.c
parent49535a952bb7ca41dc1c59d89e36f5ff2ef1bc08 (diff)
mx25pdk: add keypad support
The keymap is taken from the Freescale supplied kernel. Signed-off-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-mx25/mach-mx25pdk.c')
-rw-r--r--arch/arm/mach-mx25/mach-mx25pdk.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/arch/arm/mach-mx25/mach-mx25pdk.c b/arch/arm/mach-mx25/mach-mx25pdk.c
index 83d74109e7d8..4a57f68860cb 100644
--- a/arch/arm/mach-mx25/mach-mx25pdk.c
+++ b/arch/arm/mach-mx25/mach-mx25pdk.c
@@ -24,6 +24,7 @@
24#include <linux/gpio.h> 24#include <linux/gpio.h>
25#include <linux/fec.h> 25#include <linux/fec.h>
26#include <linux/platform_device.h> 26#include <linux/platform_device.h>
27#include <linux/input/matrix_keypad.h>
27 28
28#include <mach/hardware.h> 29#include <mach/hardware.h>
29#include <asm/mach-types.h> 30#include <asm/mach-types.h>
@@ -80,6 +81,16 @@ static struct pad_desc mx25pdk_pads[] = {
80 MX25_PAD_LSCLK__LSCLK, 81 MX25_PAD_LSCLK__LSCLK,
81 MX25_PAD_OE_ACD__OE_ACD, 82 MX25_PAD_OE_ACD__OE_ACD,
82 MX25_PAD_CONTRAST__CONTRAST, 83 MX25_PAD_CONTRAST__CONTRAST,
84
85 /* Keypad */
86 MX25_PAD_KPP_ROW0__KPP_ROW0,
87 MX25_PAD_KPP_ROW1__KPP_ROW1,
88 MX25_PAD_KPP_ROW2__KPP_ROW2,
89 MX25_PAD_KPP_ROW3__KPP_ROW3,
90 MX25_PAD_KPP_COL0__KPP_COL0,
91 MX25_PAD_KPP_COL1__KPP_COL1,
92 MX25_PAD_KPP_COL2__KPP_COL2,
93 MX25_PAD_KPP_COL3__KPP_COL3,
83}; 94};
84 95
85static struct fec_platform_data mx25_fec_pdata = { 96static struct fec_platform_data mx25_fec_pdata = {
@@ -137,6 +148,30 @@ static struct imx_fb_platform_data mx25pdk_fb_pdata = {
137 .dmacr = 0x00020010, 148 .dmacr = 0x00020010,
138}; 149};
139 150
151static const uint32_t mx25pdk_keymap[] = {
152 KEY(0, 0, KEY_UP),
153 KEY(0, 1, KEY_DOWN),
154 KEY(0, 2, KEY_VOLUMEDOWN),
155 KEY(0, 3, KEY_HOME),
156 KEY(1, 0, KEY_RIGHT),
157 KEY(1, 1, KEY_LEFT),
158 KEY(1, 2, KEY_ENTER),
159 KEY(1, 3, KEY_VOLUMEUP),
160 KEY(2, 0, KEY_F6),
161 KEY(2, 1, KEY_F8),
162 KEY(2, 2, KEY_F9),
163 KEY(2, 3, KEY_F10),
164 KEY(3, 0, KEY_F1),
165 KEY(3, 1, KEY_F2),
166 KEY(3, 2, KEY_F3),
167 KEY(3, 3, KEY_POWER),
168};
169
170static struct matrix_keymap_data mx25pdk_keymap_data = {
171 .keymap = mx25pdk_keymap,
172 .keymap_size = ARRAY_SIZE(mx25pdk_keymap),
173};
174
140static void __init mx25pdk_init(void) 175static void __init mx25pdk_init(void)
141{ 176{
142 mxc_iomux_v3_setup_multiple_pads(mx25pdk_pads, 177 mxc_iomux_v3_setup_multiple_pads(mx25pdk_pads,
@@ -150,6 +185,7 @@ static void __init mx25pdk_init(void)
150 185
151 mx25pdk_fec_reset(); 186 mx25pdk_fec_reset();
152 mxc_register_device(&mx25_fec_device, &mx25_fec_pdata); 187 mxc_register_device(&mx25_fec_device, &mx25_fec_pdata);
188 mxc_register_device(&mx25_kpp_device, &mx25pdk_keymap_data);
153} 189}
154 190
155static void __init mx25pdk_timer_init(void) 191static void __init mx25pdk_timer_init(void)