From patchwork Thu Jun 30 17:41:46 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daiane Angolini X-Patchwork-Id: 102791 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:4978:20e::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 17F9FB6F00 for ; Fri, 1 Jul 2011 03:36:40 +1000 (EST) Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QcLAE-0000N3-12; Thu, 30 Jun 2011 17:36:30 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QcLAD-0005nZ-LC; Thu, 30 Jun 2011 17:36:29 +0000 Received: from ch1ehsobe003.messaging.microsoft.com ([216.32.181.183] helo=CH1EHSOBE008.bigfish.com) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QcLAA-0005nH-3l for linux-arm-kernel@lists.infradead.org; Thu, 30 Jun 2011 17:36:27 +0000 Received: from mail21-ch1-R.bigfish.com (216.32.181.168) by CH1EHSOBE008.bigfish.com (10.43.70.58) with Microsoft SMTP Server id 14.1.225.22; Thu, 30 Jun 2011 17:36:21 +0000 Received: from mail21-ch1 (localhost.localdomain [127.0.0.1]) by mail21-ch1-R.bigfish.com (Postfix) with ESMTP id 8E1DF16680A6; Thu, 30 Jun 2011 17:36:21 +0000 (UTC) X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzz8275bhz2dh2a8h668h839h61h) X-Spam-TCS-SCL: 0:0 X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPVD:NLI; H:mail.freescale.net; RD:none; EFVD:NLI Received: from mail21-ch1 (localhost.localdomain [127.0.0.1]) by mail21-ch1 (MessageSwitch) id 1309455381406638_20219; Thu, 30 Jun 2011 17:36:21 +0000 (UTC) Received: from CH1EHSMHS002.bigfish.com (snatpool1.int.messaging.microsoft.com [10.43.68.247]) by mail21-ch1.bigfish.com (Postfix) with ESMTP id 55A9422004E; Thu, 30 Jun 2011 17:36:21 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by CH1EHSMHS002.bigfish.com (10.43.70.2) with Microsoft SMTP Server (TLS) id 14.1.225.22; Thu, 30 Jun 2011 17:36:17 +0000 Received: from az33smr01.freescale.net (10.64.34.199) by 039-SN1MMR1-002.039d.mgd.msft.net (10.84.1.15) with Microsoft SMTP Server id 14.1.289.8; Thu, 30 Jun 2011 12:36:16 -0500 Received: from b19406.am.freescale.net ([10.29.244.35]) by az33smr01.freescale.net (8.13.1/8.13.0) with ESMTP id p5UHaEjp008233; Thu, 30 Jun 2011 12:36:14 -0500 (CDT) From: Daiane Angolini To: Subject: [PATCH] ARM: mach-mx5/mx53_ard: Add gpio_keys support Date: Thu, 30 Jun 2011 14:41:46 -0300 Message-ID: <1309455706-9509-1-git-send-email-daiane.angolini@freescale.com> X-Mailer: git-send-email 1.7.4.1 MIME-Version: 1.0 X-OriginatorOrg: freescale.com X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110630_133626_526951_617B1161 X-CRM114-Status: GOOD ( 15.26 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [216.32.181.183 listed in list.dnswl.org] Cc: kernel@pengutronix.de, Daiane Angolini X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org Signed-off-by: Daiane Angolini --- arch/arm/mach-mx5/Kconfig | 1 + arch/arm/mach-mx5/board-mx53_ard.c | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-mx5/Kconfig b/arch/arm/mach-mx5/Kconfig index 6a47d4c..b4e7c58 100644 --- a/arch/arm/mach-mx5/Kconfig +++ b/arch/arm/mach-mx5/Kconfig @@ -216,6 +216,7 @@ config MACH_MX53_ARD select IMX_HAVE_PLATFORM_IMX_I2C select IMX_HAVE_PLATFORM_IMX_UART select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX + select IMX_HAVE_PLATFORM_GPIO_KEYS help Include support for MX53 ARD platform. This includes specific configurations for the board and its peripherals. diff --git a/arch/arm/mach-mx5/board-mx53_ard.c b/arch/arm/mach-mx5/board-mx53_ard.c index 280cefc..e2b8b2f 100644 --- a/arch/arm/mach-mx5/board-mx53_ard.c +++ b/arch/arm/mach-mx5/board-mx53_ard.c @@ -39,6 +39,11 @@ #define ARD_SD1_CD IMX_GPIO_NR(1, 1) #define ARD_SD1_WP IMX_GPIO_NR(1, 9) #define ARD_I2CPORTEXP_B IMX_GPIO_NR(2, 3) +#define ARD_VOLUMEDOWN IMX_GPIO_NR(4, 0) +#define ARD_HOME IMX_GPIO_NR(5, 10) +#define ARD_BACK IMX_GPIO_NR(5, 11) +#define ARD_PROG IMX_GPIO_NR(5, 12) +#define ARD_VOLUMEUP IMX_GPIO_NR(5, 13) static iomux_v3_cfg_t mx53_ard_pads[] = { /* UART1 */ @@ -91,6 +96,35 @@ static iomux_v3_cfg_t mx53_ard_pads[] = { /* I2C3 */ MX53_PAD_GPIO_3__I2C3_SCL, MX53_PAD_GPIO_16__I2C3_SDA, + /* GPIO */ + MX53_PAD_DISP0_DAT16__GPIO5_10, /* home */ + MX53_PAD_DISP0_DAT17__GPIO5_11, /* back */ + MX53_PAD_DISP0_DAT18__GPIO5_12, /* prog */ + MX53_PAD_DISP0_DAT19__GPIO5_13, /* vol up */ + MX53_PAD_GPIO_10__GPIO4_0, /* vol down */ +}; + +#define GPIO_BUTTON(gpio_num, ev_code, act_low, descr, wake) \ +{ \ + .gpio = gpio_num, \ + .type = EV_KEY, \ + .code = ev_code, \ + .active_low = act_low, \ + .desc = "btn " descr, \ + .wakeup = wake, \ +} + +static struct gpio_keys_button ard_buttons[] = { + GPIO_BUTTON(ARD_HOME, KEY_HOME, 1, "home", 0), + GPIO_BUTTON(ARD_BACK, KEY_BACK, 1, "back", 0), + GPIO_BUTTON(ARD_PROG, KEY_PROGRAM, 1, "program", 0), + GPIO_BUTTON(ARD_VOLUMEUP, KEY_VOLUMEUP, 1, "volume-up", 0), + GPIO_BUTTON(ARD_VOLUMEDOWN, KEY_VOLUMEDOWN, 1, "volume-down", 0), +}; + +static const struct gpio_keys_platform_data ard_button_data __initconst = { + .buttons = ard_buttons, + .nbuttons = ARRAY_SIZE(ard_buttons), }; static struct resource ard_smsc911x_resources[] = { @@ -199,6 +233,7 @@ static void __init mx53_ard_board_init(void) imx53_add_imx2_wdt(0, NULL); imx53_add_imx_i2c(1, &mx53_ard_i2c2_data); imx53_add_imx_i2c(2, &mx53_ard_i2c3_data); + imx_add_gpio_keys(&ard_button_data); } static void __init mx53_ard_timer_init(void)