Register keyboard device with hwmod framework
Signed-off-by: Abraham Arce <[email protected]>
---
arch/arm/mach-omap2/devices.c | 39 +++++++++++++++++++++++++++++++++++++++
1 files changed, 39 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 9e5d51b..226cc7a 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -28,6 +28,9 @@
#include <mach/gpio.h>
#include <plat/mmc.h>
#include <plat/dma.h>
+#include <plat/omap_device.h>
+#include <plat/omap_hwmod.h>
+#include <plat/omap4-keypad.h>
#include "mux.h"
@@ -138,6 +141,42 @@ static inline void omap_init_camera(void)
}
#endif
+struct omap_device_pm_latency omap4_keyboard_latency[] = {
+ {
+ .deactivate_func = omap_device_idle_hwmods,
+ .activate_func = omap_device_enable_hwmods,
+ .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
+ },
+};
+
+int omap4_keyboard_init(struct omap4_keypad_platform_data
+ *keypad_data)
+{
+ struct omap_device *od;
+ struct omap_hwmod *oh;
+ const char *oh_name = "kbd";
+ const char *name = "omap4-keypad";
+
+ if (!cpu_is_omap44xx())
+ return -ENODEV;
+
+ oh = omap_hwmod_lookup(oh_name);
+ if (!oh) {
+ pr_err("Could not look up %s\n", oh_name);
+ return -ENODEV;
+ }
+
+ od = omap_device_build(name, -1, oh, keypad_data,
+ sizeof(*keypad_data),
+ omap4_keyboard_latency,
+ ARRAY_SIZE(omap4_keyboard_latency), 0);
+ if (WARN(IS_ERR(od), "Could not build omap_device for %s %s\n",
+ name, oh->name))
+ return -ENODEV;
+
+ return 0;
+}
+
#if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE)
#define MBOX_REG_SIZE 0x120
--
1.6.3.3
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html