From patchwork Fri Dec 3 15:05:38 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sundar Iyer X-Patchwork-Id: 378101 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oB3F6eC6008909 for ; Fri, 3 Dec 2010 15:06:42 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751479Ab0LCPGl (ORCPT ); Fri, 3 Dec 2010 10:06:41 -0500 Received: from eu1sys200aog114.obsmtp.com ([207.126.144.137]:35016 "EHLO eu1sys200aog114.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750807Ab0LCPGk (ORCPT ); Fri, 3 Dec 2010 10:06:40 -0500 Received: from source ([164.129.1.35]) (using TLSv1) by eu1sys200aob114.postini.com ([207.126.147.11]) with SMTP ID DSNKTPkHeBNGvZsi0Mdoh3Sh8d6R9gKIzZ6m@postini.com; Fri, 03 Dec 2010 15:06:40 UTC Received: from zeta.dmz-eu.st.com (ns2.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 2B044A5; Fri, 3 Dec 2010 15:06:21 +0000 (GMT) Received: from relay1.stm.gmessaging.net (unknown [10.230.100.17]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 1E39125A1; Fri, 3 Dec 2010 15:06:21 +0000 (GMT) Received: from exdcvycastm022.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm022", Issuer "exdcvycastm022" (not verified)) by relay1.stm.gmessaging.net (Postfix) with ESMTPS id 77A7624C2C0; Fri, 3 Dec 2010 16:06:13 +0100 (CET) Received: from localhost (10.201.54.119) by exdcvycastm022.EQ1STM.local (10.230.100.30) with Microsoft SMTP Server (TLS) id 8.2.254.0; Fri, 3 Dec 2010 16:06:20 +0100 From: Sundar Iyer To: , , , Cc: , , Sundar Iyer Subject: [PATCH 05/20] mach-ux500: add STMPE1601 platform data Date: Fri, 3 Dec 2010 20:35:38 +0530 Message-ID: <1291388753-14662-6-git-send-email-sundar.iyer@stericsson.com> X-Mailer: git-send-email 1.7.2.dirty In-Reply-To: <1291388753-14662-1-git-send-email-sundar.iyer@stericsson.com> References: <1291388753-14662-1-git-send-email-sundar.iyer@stericsson.com> MIME-Version: 1.0 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Fri, 03 Dec 2010 15:06:42 +0000 (UTC) diff --git a/arch/arm/mach-ux500/board-mop500-keypads.c b/arch/arm/mach-ux500/board-mop500-keypads.c index c1218c5..4acc4f1 100644 --- a/arch/arm/mach-ux500/board-mop500-keypads.c +++ b/arch/arm/mach-ux500/board-mop500-keypads.c @@ -128,7 +128,39 @@ static struct ske_keypad_platform_data ske_keypad_board = { .debounce_ms = 40, /* in millsecs */ }; +/* + * STMPE1601 + */ +static struct stmpe_keypad_platform_data stmpe1601_keypad_data = { + .debounce_ms = 64, + .scan_count = 8, + .no_autorepeat = true, + .keymap_data = &mop500_keymap_data, +}; + +static struct stmpe_platform_data stmpe1601_data = { + .id = 1, + .blocks = STMPE_BLOCK_KEYPAD, + .irq_trigger = IRQF_TRIGGER_FALLING, + .irq_base = MOP500_STMPE1601_IRQ(0), + .keypad = &stmpe1601_keypad_data, + .autosleep = true, + .autosleep_timeout = 1024, +}; + +static struct i2c_board_info __initdata mop500_i2c0_devices_stuib[] = { + { + I2C_BOARD_INFO("stmpe1601", 0x40), + .irq = NOMADIK_GPIO_TO_IRQ(218), + .platform_data = &stmpe1601_data, + .flags = I2C_CLIENT_WAKE, + }, +}; + void mop500_keypad_init(void) { db8500_add_ske_keypad(&ske_keypad_board); + + i2c_register_board_info(0, mop500_i2c0_devices_stuib, + ARRAY_SIZE(mop500_i2c0_devices_stuib)); } diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c index 9b5e66e..8f4a955 100644 --- a/arch/arm/mach-ux500/board-mop500.c +++ b/arch/arm/mach-ux500/board-mop500.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -71,6 +72,8 @@ static pin_cfg_t mop500_pins[] = { GPIO168_KP_O0, GPIO217_GPIO, /* GPIO_EXP_INT */ + + GPIO218_GPIO | PIN_INPUT_PULLUP, /* STMPE1601 IRQ */ }; static struct ab8500_platform_data ab8500_platdata = { diff --git a/arch/arm/mach-ux500/include/mach/irqs-board-mop500.h b/arch/arm/mach-ux500/include/mach/irqs-board-mop500.h index 7ee8aaa..c89ae0d 100644 --- a/arch/arm/mach-ux500/include/mach/irqs-board-mop500.h +++ b/arch/arm/mach-ux500/include/mach/irqs-board-mop500.h @@ -14,6 +14,7 @@ #define MOP500_AB8500_IRQ_END (MOP500_AB8500_IRQ_BASE \ + AB8500_NR_IRQS) +/* TC35892 */ #define TC35892_NR_INTERNAL_IRQS 8 #define TC35892_INT_GPIO(x) (TC35892_NR_INTERNAL_IRQS + (x)) #define TC35892_NR_GPIOS 24 @@ -24,8 +25,18 @@ #define MOP500_EGPIO_IRQ_BASE MOP500_AB8500_IRQ_END #define MOP500_EGPIO_IRQ_END (MOP500_EGPIO_IRQ_BASE \ + MOP500_EGPIO_NR_IRQS) +/* STMPE1601 irqs */ +#define STMPE_NR_INTERNAL_IRQS 9 +#define STMPE_INT_GPIO(x) (STMPE_NR_INTERNAL_IRQS + (x)) +#define STMPE_NR_GPIOS 24 +#define STMPE_NR_IRQS STMPE_INT_GPIO(STMPE_NR_GPIOS) -#define MOP500_IRQ_END MOP500_EGPIO_IRQ_END +#define MOP500_STMPE1601_IRQBASE MOP500_EGPIO_IRQ_END +#define MOP500_STMPE1601_IRQ(x) (MOP500_STMPE1601_IRQBASE + (x)) + +#define MOP500_NR_IRQS MOP500_STMPE1601_IRQ(STMPE_NR_INTERNAL_IRQS) + +#define MOP500_IRQ_END MOP500_NR_IRQS #if MOP500_IRQ_END > IRQ_BOARD_END #undef IRQ_BOARD_END