From patchwork Tue Nov 27 09:03:56 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 202129 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 8E6872C0081 for ; Tue, 27 Nov 2012 20:07:39 +1100 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TdH5V-0001Of-DR; Tue, 27 Nov 2012 09:04:17 +0000 Received: from mail-pa0-f49.google.com ([209.85.220.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TdH5H-0001N3-1Y for linux-arm-kernel@lists.infradead.org; Tue, 27 Nov 2012 09:04:04 +0000 Received: by mail-pa0-f49.google.com with SMTP id bi1so5214220pad.36 for ; Tue, 27 Nov 2012 01:04:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=qZ/iggDa1RXflhV59IbR+CuqZznB0EbIgO0+PzVmK8A=; b=mdX8TzZI6Nqxic1nHj8ZroMdaH23nF6guiF8Bwsl1DAYDfDn0R9Xx1/DFFkRdPF+vl +OE2+t6iTneOCdvgrA4wBNTxTbuvNRGJ+ohyjJPer8KmM4IvicY+VsyBiMhwb1kU79S5 yhYwHI7/j5k2Ie8j3/hRR8Tkq+WPhKvxFY0Jg5JGlgFKPtQ/6YMFjAt2A/tBahxHaBMK T7asEh+LB4VKNLdKmIqxWZj1fYEEXQ3QOjICKxxqnvuWdT68QNrhvsgqcLUy/OPCpOpZ Az9QPJqIZmPIMFAZCIJeRsi7YfHgndvfhu0GksYPE92gCe/hvLzby64jCJBqey2/qpSe brGA== Received: by 10.68.241.232 with SMTP id wl8mr45978295pbc.144.1354007041388; Tue, 27 Nov 2012 01:04:01 -0800 (PST) Received: from mailhub.coreip.homeip.net (c-67-188-112-76.hsd1.ca.comcast.net. [67.188.112.76]) by mx.google.com with ESMTPS id nm9sm10313954pbc.46.2012.11.27.01.03.58 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 27 Nov 2012 01:03:59 -0800 (PST) Date: Tue, 27 Nov 2012 01:03:56 -0800 From: Dmitry Torokhov To: Sascha Hauer Subject: [PATCH v2] ARM: eukrea_mbimx27-baseboard - use stock get_pendown_state() in ads7846 Message-ID: <20121127090356.GA25658@core.coreip.homeip.net> References: <20121124082529.GA7687@core.coreip.homeip.net> <20121127074209.GL10369@pengutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20121127074209.GL10369@pengutronix.de> User-Agent: Mutt/1.5.21 (2010-09-15) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121127_040403_975822_9CD1226B X-CRM114-Status: GOOD ( 16.45 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (dmitry.torokhov[at]gmail.com) -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.220.49 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Eric =?iso-8859-1?Q?B=E9nard?= , Russell King , linux-arm-kernel@lists.infradead.org, Sascha Hauer , linux-kernel@vger.kernel.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 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 The default implementation matches exactly our custom one so we can switch to using the default one. As a bonus the driver will take care of setting GPIO line for us. Signed-off-by: Dmitry Torokhov Acked-by: Eric BĂ©nard --- Adjusted to use IMX_GPIO_NR() macro. arch/arm/mach-imx/eukrea_mbimx27-baseboard.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c b/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c index 98aef57..f361143 100644 --- a/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c +++ b/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c @@ -238,24 +238,8 @@ static const struct imxuart_platform_data uart_pdata __initconst = { .flags = IMXUART_HAVE_RTSCTS, }; -#define ADS7846_PENDOWN (GPIO_PORTD | 25) - -static void __maybe_unused ads7846_dev_init(void) -{ - if (gpio_request(ADS7846_PENDOWN, "ADS7846 pendown") < 0) { - printk(KERN_ERR "can't get ads7846 pen down GPIO\n"); - return; - } - gpio_direction_input(ADS7846_PENDOWN); -} - -static int ads7846_get_pendown_state(void) -{ - return !gpio_get_value(ADS7846_PENDOWN); -} - static struct ads7846_platform_data ads7846_config __initdata = { - .get_pendown_state = ads7846_get_pendown_state, + .gpio_pendown = IMX_GPIO_NR(4, 25), .keep_vref_on = 1, }; @@ -323,7 +307,6 @@ void __init eukrea_mbimx27_baseboard_init(void) || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE) /* ADS7846 Touchscreen controller init */ mxc_gpio_mode(GPIO_PORTD | 25 | GPIO_GPIO | GPIO_IN); - ads7846_dev_init(); #endif /* SPI_CS0 init */