diff options
author | Cyril Chemparathy <cyril@ti.com> | 2010-09-20 12:26:41 -0400 |
---|---|---|
committer | Kevin Hilman <khilman@deeprootsystems.com> | 2010-09-24 10:40:31 -0400 |
commit | d45b1ed4e47d2f585d2acdf5b957bfc5ff465aab (patch) | |
tree | a8c8250dfadea8d6549b1cb409ca2982e8e14bcb /arch | |
parent | 70614084402ae40aef40019b991bf44d10093122 (diff) |
davinci: add tnetv107x keypad platform device
This patch adds a platform device definition for tnetv107x's keypad
controller.
Signed-off-by: Cyril Chemparathy <cyril@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-davinci/devices-tnetv107x.c | 30 | ||||
-rw-r--r-- | arch/arm/mach-davinci/include/mach/tnetv107x.h | 3 |
2 files changed, 33 insertions, 0 deletions
diff --git a/arch/arm/mach-davinci/devices-tnetv107x.c b/arch/arm/mach-davinci/devices-tnetv107x.c index 2718a3a90dff..086269fc2ee5 100644 --- a/arch/arm/mach-davinci/devices-tnetv107x.c +++ b/arch/arm/mach-davinci/devices-tnetv107x.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #define TNETV107X_WDOG_BASE 0x08086700 | 33 | #define TNETV107X_WDOG_BASE 0x08086700 |
34 | #define TNETV107X_SDIO0_BASE 0x08088700 | 34 | #define TNETV107X_SDIO0_BASE 0x08088700 |
35 | #define TNETV107X_SDIO1_BASE 0x08088800 | 35 | #define TNETV107X_SDIO1_BASE 0x08088800 |
36 | #define TNETV107X_KEYPAD_BASE 0x08088a00 | ||
36 | #define TNETV107X_ASYNC_EMIF_CNTRL_BASE 0x08200000 | 37 | #define TNETV107X_ASYNC_EMIF_CNTRL_BASE 0x08200000 |
37 | #define TNETV107X_ASYNC_EMIF_DATA_CE0_BASE 0x30000000 | 38 | #define TNETV107X_ASYNC_EMIF_DATA_CE0_BASE 0x30000000 |
38 | #define TNETV107X_ASYNC_EMIF_DATA_CE1_BASE 0x40000000 | 39 | #define TNETV107X_ASYNC_EMIF_DATA_CE1_BASE 0x40000000 |
@@ -298,6 +299,30 @@ static int __init nand_init(int chipsel, struct davinci_nand_pdata *data) | |||
298 | return platform_device_register(pdev); | 299 | return platform_device_register(pdev); |
299 | } | 300 | } |
300 | 301 | ||
302 | static struct resource keypad_resources[] = { | ||
303 | { | ||
304 | .start = TNETV107X_KEYPAD_BASE, | ||
305 | .end = TNETV107X_KEYPAD_BASE + 0xff, | ||
306 | .flags = IORESOURCE_MEM, | ||
307 | }, | ||
308 | { | ||
309 | .start = IRQ_TNETV107X_KEYPAD, | ||
310 | .flags = IORESOURCE_IRQ, | ||
311 | .name = "press", | ||
312 | }, | ||
313 | { | ||
314 | .start = IRQ_TNETV107X_KEYPAD_FREE, | ||
315 | .flags = IORESOURCE_IRQ, | ||
316 | .name = "release", | ||
317 | }, | ||
318 | }; | ||
319 | |||
320 | static struct platform_device keypad_device = { | ||
321 | .name = "tnetv107x-keypad", | ||
322 | .num_resources = ARRAY_SIZE(keypad_resources), | ||
323 | .resource = keypad_resources, | ||
324 | }; | ||
325 | |||
301 | void __init tnetv107x_devices_init(struct tnetv107x_device_info *info) | 326 | void __init tnetv107x_devices_init(struct tnetv107x_device_info *info) |
302 | { | 327 | { |
303 | int i; | 328 | int i; |
@@ -317,4 +342,9 @@ void __init tnetv107x_devices_init(struct tnetv107x_device_info *info) | |||
317 | for (i = 0; i < 4; i++) | 342 | for (i = 0; i < 4; i++) |
318 | if (info->nand_config[i]) | 343 | if (info->nand_config[i]) |
319 | nand_init(i, info->nand_config[i]); | 344 | nand_init(i, info->nand_config[i]); |
345 | |||
346 | if (info->keypad_config) { | ||
347 | keypad_device.dev.platform_data = info->keypad_config; | ||
348 | platform_device_register(&keypad_device); | ||
349 | } | ||
320 | } | 350 | } |
diff --git a/arch/arm/mach-davinci/include/mach/tnetv107x.h b/arch/arm/mach-davinci/include/mach/tnetv107x.h index c72064733123..5a681d880dcb 100644 --- a/arch/arm/mach-davinci/include/mach/tnetv107x.h +++ b/arch/arm/mach-davinci/include/mach/tnetv107x.h | |||
@@ -33,6 +33,8 @@ | |||
33 | #ifndef __ASSEMBLY__ | 33 | #ifndef __ASSEMBLY__ |
34 | 34 | ||
35 | #include <linux/serial_8250.h> | 35 | #include <linux/serial_8250.h> |
36 | #include <linux/input/matrix_keypad.h> | ||
37 | |||
36 | #include <mach/mmc.h> | 38 | #include <mach/mmc.h> |
37 | #include <mach/nand.h> | 39 | #include <mach/nand.h> |
38 | #include <mach/serial.h> | 40 | #include <mach/serial.h> |
@@ -41,6 +43,7 @@ struct tnetv107x_device_info { | |||
41 | struct davinci_uart_config *serial_config; | 43 | struct davinci_uart_config *serial_config; |
42 | struct davinci_mmc_config *mmc_config[2]; /* 2 controllers */ | 44 | struct davinci_mmc_config *mmc_config[2]; /* 2 controllers */ |
43 | struct davinci_nand_pdata *nand_config[4]; /* 4 chipsels */ | 45 | struct davinci_nand_pdata *nand_config[4]; /* 4 chipsels */ |
46 | struct matrix_keypad_platform_data *keypad_config; | ||
44 | }; | 47 | }; |
45 | 48 | ||
46 | extern struct platform_device tnetv107x_wdt_device; | 49 | extern struct platform_device tnetv107x_wdt_device; |