From patchwork Wed Jun 16 16:09:15 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abraham Arce X-Patchwork-Id: 106519 X-Patchwork-Delegate: tony@atomide.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o5GG9BDs009612 for ; Wed, 16 Jun 2010 16:09:17 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759262Ab0FPQJG (ORCPT ); Wed, 16 Jun 2010 12:09:06 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:50319 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759241Ab0FPQJE (ORCPT ); Wed, 16 Jun 2010 12:09:04 -0400 Received: from dlep36.itg.ti.com ([157.170.170.91]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id o5GG93Cs003508 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 16 Jun 2010 11:09:03 -0500 Received: from legion.dal.design.ti.com (localhost [127.0.0.1]) by dlep36.itg.ti.com (8.13.8/8.13.8) with ESMTP id o5GG93lI024232; Wed, 16 Jun 2010 11:09:03 -0500 (CDT) Received: from localhost (x0066660-laptop.am.dhcp.ti.com [128.247.115.249]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id o5GG93P25094; Wed, 16 Jun 2010 11:09:03 -0500 (CDT) From: Abraham Arce To: linux-input@vger.kernel.org, linux-omap@vger.kernel.org Cc: Abraham Arce Subject: [PATCH v4 2/4] OMAP4: Keyboard device registration Date: Wed, 16 Jun 2010 11:09:15 -0500 Message-Id: <1276704555-30625-1-git-send-email-x0066660@ti.com> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: References: Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Wed, 16 Jun 2010 16:09:17 +0000 (UTC) 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 #include #include +#include #include #include @@ -29,6 +30,9 @@ #include #include #include +#include +#include +#include #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