diff options
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 71f099b85e7c..9ee876fd367a 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c | |||
@@ -31,6 +31,7 @@ | |||
31 | #include <plat/dma.h> | 31 | #include <plat/dma.h> |
32 | #include <plat/omap_hwmod.h> | 32 | #include <plat/omap_hwmod.h> |
33 | #include <plat/omap_device.h> | 33 | #include <plat/omap_device.h> |
34 | #include <plat/omap4-keypad.h> | ||
34 | 35 | ||
35 | #include "mux.h" | 36 | #include "mux.h" |
36 | #include "control.h" | 37 | #include "control.h" |
@@ -142,6 +143,46 @@ static inline void omap_init_camera(void) | |||
142 | } | 143 | } |
143 | #endif | 144 | #endif |
144 | 145 | ||
146 | struct omap_device_pm_latency omap_keyboard_latency[] = { | ||
147 | { | ||
148 | .deactivate_func = omap_device_idle_hwmods, | ||
149 | .activate_func = omap_device_enable_hwmods, | ||
150 | .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST, | ||
151 | }, | ||
152 | }; | ||
153 | |||
154 | int __init omap4_keyboard_init(struct omap4_keypad_platform_data | ||
155 | *sdp4430_keypad_data) | ||
156 | { | ||
157 | struct omap_device *od; | ||
158 | struct omap_hwmod *oh; | ||
159 | struct omap4_keypad_platform_data *keypad_data; | ||
160 | unsigned int id = -1; | ||
161 | char *oh_name = "kbd"; | ||
162 | char *name = "omap4-keypad"; | ||
163 | |||
164 | oh = omap_hwmod_lookup(oh_name); | ||
165 | if (!oh) { | ||
166 | pr_err("Could not look up %s\n", oh_name); | ||
167 | return -ENODEV; | ||
168 | } | ||
169 | |||
170 | keypad_data = sdp4430_keypad_data; | ||
171 | |||
172 | od = omap_device_build(name, id, oh, keypad_data, | ||
173 | sizeof(struct omap4_keypad_platform_data), | ||
174 | omap_keyboard_latency, | ||
175 | ARRAY_SIZE(omap_keyboard_latency), 0); | ||
176 | |||
177 | if (IS_ERR(od)) { | ||
178 | WARN(1, "Cant build omap_device for %s:%s.\n", | ||
179 | name, oh->name); | ||
180 | return PTR_ERR(od); | ||
181 | } | ||
182 | |||
183 | return 0; | ||
184 | } | ||
185 | |||
145 | #if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE) | 186 | #if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE) |
146 | 187 | ||
147 | #define MBOX_REG_SIZE 0x120 | 188 | #define MBOX_REG_SIZE 0x120 |