diff options
author | Syed Rafiuddin <rafiuddin.syed@ti.com> | 2010-12-27 00:51:45 -0500 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2011-02-17 16:42:10 -0500 |
commit | 59556765cd30467ff64a391906ad8eb68f886ad3 (patch) | |
tree | 27583c30dfd43bd476a22a28b4eca3d5b047cad9 /arch/arm/mach-omap2/devices.c | |
parent | b9b35ade88d5855de0ac3ebc3d66881f799114f9 (diff) |
OMAP4: keypad: Add the board support
-Add the platform changes for the keypad driver
-Register keyboard device with hwmod framework.
Signed-off-by: Syed Rafiuddin <rafiuddin.syed@ti.com>
Signed-off-by: Abraham Arce <x0066660@ti.com>
Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2/devices.c')
-rw-r--r-- | arch/arm/mach-omap2/devices.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index e0f0ef952bc9..8800486f9467 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <plat/dma.h> | 30 | #include <plat/dma.h> |
31 | #include <plat/omap_hwmod.h> | 31 | #include <plat/omap_hwmod.h> |
32 | #include <plat/omap_device.h> | 32 | #include <plat/omap_device.h> |
33 | #include <plat/omap4-keypad.h> | ||
33 | 34 | ||
34 | #include "mux.h" | 35 | #include "mux.h" |
35 | #include "control.h" | 36 | #include "control.h" |
@@ -141,6 +142,46 @@ static inline void omap_init_camera(void) | |||
141 | } | 142 | } |
142 | #endif | 143 | #endif |
143 | 144 | ||
145 | struct omap_device_pm_latency omap_keyboard_latency[] = { | ||
146 | { | ||
147 | .deactivate_func = omap_device_idle_hwmods, | ||
148 | .activate_func = omap_device_enable_hwmods, | ||
149 | .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST, | ||
150 | }, | ||
151 | }; | ||
152 | |||
153 | int __init omap4_keyboard_init(struct omap4_keypad_platform_data | ||
154 | *sdp4430_keypad_data) | ||
155 | { | ||
156 | struct omap_device *od; | ||
157 | struct omap_hwmod *oh; | ||
158 | struct omap4_keypad_platform_data *keypad_data; | ||
159 | unsigned int id = -1; | ||
160 | char *oh_name = "kbd"; | ||
161 | char *name = "omap4-keypad"; | ||
162 | |||
163 | oh = omap_hwmod_lookup(oh_name); | ||
164 | if (!oh) { | ||
165 | pr_err("Could not look up %s\n", oh_name); | ||
166 | return -ENODEV; | ||
167 | } | ||
168 | |||
169 | keypad_data = sdp4430_keypad_data; | ||
170 | |||
171 | od = omap_device_build(name, id, oh, keypad_data, | ||
172 | sizeof(struct omap4_keypad_platform_data), | ||
173 | omap_keyboard_latency, | ||
174 | ARRAY_SIZE(omap_keyboard_latency), 0); | ||
175 | |||
176 | if (IS_ERR(od)) { | ||
177 | WARN(1, "Cant build omap_device for %s:%s.\n", | ||
178 | name, oh->name); | ||
179 | return PTR_ERR(od); | ||
180 | } | ||
181 | |||
182 | return 0; | ||
183 | } | ||
184 | |||
144 | #if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE) | 185 | #if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE) |
145 | 186 | ||
146 | #define MBOX_REG_SIZE 0x120 | 187 | #define MBOX_REG_SIZE 0x120 |