From: Abraham Arce <x0066660@ti.com>
To: linux-input@vger.kernel.org, linux-omap@vger.kernel.org
Cc: Abraham Arce <x0066660@ti.com>
Subject: [PATCH v6 6/8] OMAP4: Keyboard device registration
Date: Thu, 30 Sep 2010 00:29:23 -0500 [thread overview]
Message-ID: <1285824565-24906-7-git-send-email-x0066660@ti.com> (raw)
In-Reply-To: <1285824565-24906-1-git-send-email-x0066660@ti.com>
Register keyboard device with hwmod framework
Signed-off-by: Abraham Arce <x0066660@ti.com>
---
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
prev parent reply other threads:[~2010-09-30 5:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-30 5:29 [PATCH v6 0/8] OMAP4 Keyboard Controller Support Abraham Arce
2010-09-30 5:29 ` [PATCH v6 1/8] OMAP4: hwmod data: add keyboard controller Abraham Arce
2010-09-30 5:29 ` [PATCH v6 2/8] Input: omap4 - use platform device helpers Abraham Arce
2010-09-30 5:29 ` [PATCH v6 3/8] Input: omap4 - SYSCONFIG register configuration Abraham Arce
2010-09-30 5:29 ` [PATCH v6 4/8] Input: omap4 - Interrupt line configuration Abraham Arce
2010-09-30 5:29 ` Abraham Arce [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1285824565-24906-7-git-send-email-x0066660@ti.com \
--to=x0066660@ti.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).