diff options
author | Abraham Arce <x0066660@ti.com> | 2011-04-07 08:44:07 +0100 |
---|---|---|
committer | Andy Green <andy.green@linaro.org> | 2011-04-07 08:44:07 +0100 |
commit | 1719eb6ae9be9d08246f4a7a9fcd99b26223b474 (patch) | |
tree | e39f16413c2a3d1d3361b5bd327d55414a45acba | |
parent | cd2ae5b2b9a142af13358353274a4e6790bfadff (diff) |
OMAP4: Keyboard device registration
Register keyboard device with hwmod framework
Signed-off-by: Abraham Arce <x0066660@ti.com>
Signed-off-by: Sebastien Jan <s-jan@ti.com>
-rw-r--r-- | arch/arm/mach-omap2/devices.c | 50 |
1 files changed, 49 insertions, 1 deletions
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index 2ac04f50489..fc2b07c959a 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c @@ -208,6 +208,8 @@ static inline void omap_init_camera(void) } #endif +#ifdef CONFIG_ARCH_OMAP4 /* KEYBOARD */ + struct omap_device_pm_latency omap_keyboard_latency[] = { { .deactivate_func = omap_device_idle_hwmods, @@ -216,6 +218,52 @@ struct omap_device_pm_latency omap_keyboard_latency[] = { }, }; +static int omap4_init_keypad(struct omap_hwmod *oh, void *user) +{ + struct omap_device *od; + struct omap4_keypad_platform_data *sdp4430_keypad_data; + unsigned int id = -1; + char *name = "omap4-keypad"; + + sdp4430_keypad_data = user; + + od = omap_device_build(name, id, oh, sdp4430_keypad_data, + sizeof(struct omap4_keypad_platform_data), + omap_keyboard_latency, + ARRAY_SIZE(omap_keyboard_latency), 0); + WARN(IS_ERR(od), "Could not build omap_device for %s %s\n", + name, oh->name); + + return 0; +} + +int omap4_keypad_initialization(struct omap4_keypad_platform_data + *sdp4430_keypad_data) +{ + if (!cpu_is_omap44xx()) + return -ENODEV; + + return omap_hwmod_for_each_by_class("kbd", omap4_init_keypad, + sdp4430_keypad_data); +} + +#endif /* KEYBOARD CONFIG_ARCH_OMAP4 */ + +#if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE) + +#define MBOX_REG_SIZE 0x120 + +#ifdef CONFIG_ARCH_OMAP2 +static struct resource omap2_mbox_resources[] = { + { + .start = OMAP24XX_MAILBOX_BASE, + .end = OMAP24XX_MAILBOX_BASE + MBOX_REG_SIZE - 1, + .flags = IORESOURCE_MEM, + }, +}; +#endif + + int __init omap4_keyboard_init(struct omap4_keypad_platform_data *sdp4430_keypad_data) { @@ -248,7 +296,7 @@ int __init omap4_keyboard_init(struct omap4_keypad_platform_data return 0; } -#if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE) +//#if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE) static struct omap_device_pm_latency mbox_latencies[] = { [0] = { .activate_func = omap_device_enable_hwmods, |