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 v4 2/4] OMAP4: Keyboard device registration
Date: Wed, 16 Jun 2010 11:09:15 -0500 [thread overview]
Message-ID: <1276704555-30625-1-git-send-email-x0066660@ti.com> (raw)
In-Reply-To: <x0066660@ti.com>
Register keyboard device with hwmod framework
Signed-off-by: Abraham Arce <x0066660@ti.com>
---
arch/arm/mach-omap2/devices.c | 50 +++++++++++++++++++++++++++++++++++++++++
1 files changed, 50 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 03e6c9e..d229901 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -15,6 +15,7 @@
#include <linux/platform_device.h>
#include <linux/io.h>
#include <linux/clk.h>
+#include <linux/slab.h>
#include <mach/hardware.h>
#include <mach/irqs.h>
@@ -29,6 +30,9 @@
#include <mach/gpio.h>
#include <plat/mmc.h>
#include <plat/dma.h>
+#include <plat/omap_hwmod.h>
+#include <plat/omap_device.h>
+#include <plat/omap4-keypad.h>
#include "mux.h"
@@ -139,6 +143,52 @@ static inline void omap_init_camera(void)
}
#endif
+#ifdef CONFIG_ARCH_OMAP4
+
+struct omap_device_pm_latency omap_keyboard_latency[] = {
+ {
+ .deactivate_func = omap_device_idle_hwmods,
+ .activate_func = omap_device_enable_hwmods,
+ .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
+ },
+};
+
+int omap4_init_kp(struct omap4_keypad_platform_data *kp)
+{
+ struct omap_hwmod *oh;
+ struct omap_device *od;
+ struct omap4_keypad_platform_data *pdata;
+
+ unsigned int id = 0;
+ char *name = "omap4-keypad";
+ char *oh_name = "kbd";
+
+ 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 -EIO;
+ }
+
+ pdata = kp;
+
+ pdata->base = oh->_rt_va;
+ pdata->irq = oh->mpu_irqs[0].irq;
+
+ od = omap_device_build(name, id, oh, pdata,
+ sizeof(struct matrix_keypad_platform_data),
+ omap_keyboard_latency,
+ ARRAY_SIZE(omap_keyboard_latency), 1);
+ WARN(IS_ERR(od), "Could not build omap_device for %s %s\n",
+ name, oh_name);
+
+ return 0;
+}
+
+#endif
+
#if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE)
#define MBOX_REG_SIZE 0x120
--
1.6.3.3
next reply other threads:[~2010-06-16 16:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-16 16:09 Abraham Arce [this message]
2010-06-17 6:07 ` [PATCH v4 2/4] OMAP4: Keyboard device registration Varadarajan, Charulatha
2010-06-17 21:08 ` Kevin Hilman
2010-06-22 22:36 ` Abraham Arce
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=1276704555-30625-1-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).