Commit d45b1ed4 authored by Cyril Chemparathy's avatar Cyril Chemparathy Committed by Kevin Hilman

davinci: add tnetv107x keypad platform device

This patch adds a platform device definition for tnetv107x's keypad
controller.
Signed-off-by: default avatarCyril Chemparathy <cyril@ti.com>
Signed-off-by: default avatarKevin Hilman <khilman@deeprootsystems.com>
parent 70614084
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#define TNETV107X_WDOG_BASE 0x08086700 #define TNETV107X_WDOG_BASE 0x08086700
#define TNETV107X_SDIO0_BASE 0x08088700 #define TNETV107X_SDIO0_BASE 0x08088700
#define TNETV107X_SDIO1_BASE 0x08088800 #define TNETV107X_SDIO1_BASE 0x08088800
#define TNETV107X_KEYPAD_BASE 0x08088a00
#define TNETV107X_ASYNC_EMIF_CNTRL_BASE 0x08200000 #define TNETV107X_ASYNC_EMIF_CNTRL_BASE 0x08200000
#define TNETV107X_ASYNC_EMIF_DATA_CE0_BASE 0x30000000 #define TNETV107X_ASYNC_EMIF_DATA_CE0_BASE 0x30000000
#define TNETV107X_ASYNC_EMIF_DATA_CE1_BASE 0x40000000 #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,6 +299,30 @@ static int __init nand_init(int chipsel, struct davinci_nand_pdata *data)
return platform_device_register(pdev); return platform_device_register(pdev);
} }
static struct resource keypad_resources[] = {
{
.start = TNETV107X_KEYPAD_BASE,
.end = TNETV107X_KEYPAD_BASE + 0xff,
.flags = IORESOURCE_MEM,
},
{
.start = IRQ_TNETV107X_KEYPAD,
.flags = IORESOURCE_IRQ,
.name = "press",
},
{
.start = IRQ_TNETV107X_KEYPAD_FREE,
.flags = IORESOURCE_IRQ,
.name = "release",
},
};
static struct platform_device keypad_device = {
.name = "tnetv107x-keypad",
.num_resources = ARRAY_SIZE(keypad_resources),
.resource = keypad_resources,
};
void __init tnetv107x_devices_init(struct tnetv107x_device_info *info) void __init tnetv107x_devices_init(struct tnetv107x_device_info *info)
{ {
int i; int i;
...@@ -317,4 +342,9 @@ void __init tnetv107x_devices_init(struct tnetv107x_device_info *info) ...@@ -317,4 +342,9 @@ void __init tnetv107x_devices_init(struct tnetv107x_device_info *info)
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
if (info->nand_config[i]) if (info->nand_config[i])
nand_init(i, info->nand_config[i]); nand_init(i, info->nand_config[i]);
if (info->keypad_config) {
keypad_device.dev.platform_data = info->keypad_config;
platform_device_register(&keypad_device);
}
} }
...@@ -33,6 +33,8 @@ ...@@ -33,6 +33,8 @@
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
#include <linux/serial_8250.h> #include <linux/serial_8250.h>
#include <linux/input/matrix_keypad.h>
#include <mach/mmc.h> #include <mach/mmc.h>
#include <mach/nand.h> #include <mach/nand.h>
#include <mach/serial.h> #include <mach/serial.h>
...@@ -41,6 +43,7 @@ struct tnetv107x_device_info { ...@@ -41,6 +43,7 @@ struct tnetv107x_device_info {
struct davinci_uart_config *serial_config; struct davinci_uart_config *serial_config;
struct davinci_mmc_config *mmc_config[2]; /* 2 controllers */ struct davinci_mmc_config *mmc_config[2]; /* 2 controllers */
struct davinci_nand_pdata *nand_config[4]; /* 4 chipsels */ struct davinci_nand_pdata *nand_config[4]; /* 4 chipsels */
struct matrix_keypad_platform_data *keypad_config;
}; };
extern struct platform_device tnetv107x_wdt_device; extern struct platform_device tnetv107x_wdt_device;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment