From patchwork Tue Sep 11 05:30:59 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Lindgren X-Patchwork-Id: 1435081 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id D2E9B4025E for ; Tue, 11 Sep 2012 05:31:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753977Ab2IKFbD (ORCPT ); Tue, 11 Sep 2012 01:31:03 -0400 Received: from mho-04-ewr.mailhop.org ([204.13.248.74]:13785 "EHLO mho-02-ewr.mailhop.org" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753657Ab2IKFbA (ORCPT ); Tue, 11 Sep 2012 01:31:00 -0400 Received: from c-98-234-237-12.hsd1.ca.comcast.net ([98.234.237.12] helo=muffinssi.local) by mho-02-ewr.mailhop.org with esmtpa (Exim 4.72) (envelope-from ) id 1TBJ3s-0000wm-BF; Tue, 11 Sep 2012 05:31:00 +0000 X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 98.234.237.12 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1/weTWlbCMRut7HRFhR7F9c Subject: [PATCH 07/17] Input: omap-keypad: Remove dependencies to mach includes To: linux-arm-kernel@lists.infradead.org From: Tony Lindgren Cc: linux-omap@vger.kernel.org, Dmitry Torokhov , linux-input@vger.kernel.org Date: Mon, 10 Sep 2012 22:30:59 -0700 Message-ID: <20120911053059.29637.22108.stgit@muffinssi.local> In-Reply-To: <20120911052934.29637.9190.stgit@muffinssi.local> References: <20120911052934.29637.9190.stgit@muffinssi.local> User-Agent: StGit/0.16-2-g0d85 MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org We can't build CONFIG_ARCH_OMAP1 set with ARCH_OMAP2PLUS because of different compiler flags needed, so we can define omap_kp_24xx() instead of using cpu_is_omap24xx(). This way we can remove depency to plat and mach headers which is needed for ARM common zImage support. Also remove INT_KEYBOARD by using omap_kp->irq. Note that this patch depends on an earlier patch "ARM: OMAP: Move gpio.h to include/linux/platform_data". Cc: Dmitry Torokhov Cc: linux-input@vger.kernel.org Signed-off-by: Tony Lindgren --- drivers/input/keyboard/omap-keypad.c | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/input/keyboard/omap-keypad.c b/drivers/input/keyboard/omap-keypad.c index a0222db..171d739 100644 --- a/drivers/input/keyboard/omap-keypad.c +++ b/drivers/input/keyboard/omap-keypad.c @@ -35,16 +35,19 @@ #include #include #include -#include +#include +#include #include -#include -#include -#include -#include -#include #undef NEW_BOARD_LEARNING_MODE +#ifdef CONFIG_ARCH_OMAP1 +#define omap_kp_24xx() 0 +#else +#define omap_kp_24xx() 1 +#endif + +static struct omap_kp *omap_kp; static void omap_kp_tasklet(unsigned long); static void omap_kp_timer(unsigned long); @@ -99,7 +102,7 @@ static irqreturn_t omap_kp_interrupt(int irq, void *dev_id) struct omap_kp *omap_kp = dev_id; /* disable keyboard interrupt and schedule for handling */ - if (cpu_is_omap24xx()) { + if (omap_kp_24xx()) { int i; for (i = 0; i < omap_kp->rows; i++) { @@ -134,7 +137,7 @@ static void omap_kp_scan_keypad(struct omap_kp *omap_kp, unsigned char *state) int col = 0; /* read the keypad status */ - if (cpu_is_omap24xx()) { + if (omap_kp_24xx()) { /* read the keypad status */ for (col = 0; col < omap_kp->cols; col++) { set_col_gpio_val(omap_kp, ~(1 << col)); @@ -222,7 +225,7 @@ static void omap_kp_tasklet(unsigned long data) mod_timer(&omap_kp_data->timer, jiffies + delay); } else { /* enable interrupts */ - if (cpu_is_omap24xx()) { + if (omap_kp_24xx()) { int i; for (i = 0; i < omap_kp_data->rows; i++) enable_irq(gpio_to_irq(row_gpios[i])); @@ -253,9 +256,9 @@ static ssize_t omap_kp_enable_store(struct device *dev, struct device_attribute mutex_lock(&kp_enable_mutex); if (state != kp_enable) { if (state) - enable_irq(INT_KEYBOARD); + enable_irq(omap_kp->irq); else - disable_irq(INT_KEYBOARD); + disable_irq(omap_kp->irq); kp_enable = state; } mutex_unlock(&kp_enable_mutex); @@ -286,7 +289,6 @@ static int omap_kp_resume(struct platform_device *dev) static int __devinit omap_kp_probe(struct platform_device *pdev) { - struct omap_kp *omap_kp; struct input_dev *input_dev; struct omap_kp_platform_data *pdata = pdev->dev.platform_data; int i, col_idx, row_idx, irq_idx, ret; @@ -314,7 +316,7 @@ static int __devinit omap_kp_probe(struct platform_device *pdev) omap_kp->input = input_dev; /* Disable the interrupt for the MPUIO keyboard */ - if (!cpu_is_omap24xx()) + if (!omap_kp_24xx()) omap_writew(1, OMAP1_MPUIO_BASE + OMAP_MPUIO_KBD_MASKIT); if (pdata->delay) @@ -328,7 +330,7 @@ static int __devinit omap_kp_probe(struct platform_device *pdev) omap_kp->rows = pdata->rows; omap_kp->cols = pdata->cols; - if (cpu_is_omap24xx()) { + if (omap_kp_24xx()) { /* Cols: outputs */ for (col_idx = 0; col_idx < omap_kp->cols; col_idx++) { if (gpio_request(col_gpios[col_idx], "omap_kp_col") < 0) { @@ -394,7 +396,7 @@ static int __devinit omap_kp_probe(struct platform_device *pdev) /* scan current status and enable interrupt */ omap_kp_scan_keypad(omap_kp, keypad_state); - if (!cpu_is_omap24xx()) { + if (!omap_kp_24xx()) { omap_kp->irq = platform_get_irq(pdev, 0); if (omap_kp->irq >= 0) { if (request_irq(omap_kp->irq, omap_kp_interrupt, 0, @@ -439,7 +441,7 @@ static int __devexit omap_kp_remove(struct platform_device *pdev) /* disable keypad interrupt handling */ tasklet_disable(&kp_tasklet); - if (cpu_is_omap24xx()) { + if (omap_kp_24xx()) { int i; for (i = 0; i < omap_kp->cols; i++) gpio_free(col_gpios[i]);