From patchwork Sat Nov 24 08:25:30 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 1798101 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 653993FCA5 for ; Sat, 24 Nov 2012 08:28:04 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TcB3U-00078a-Pj; Sat, 24 Nov 2012 08:25:41 +0000 Received: from mail-pb0-f49.google.com ([209.85.160.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TcB3P-00078G-O2 for linux-arm-kernel@lists.infradead.org; Sat, 24 Nov 2012 08:25:38 +0000 Received: by mail-pb0-f49.google.com with SMTP id un15so6307608pbc.36 for ; Sat, 24 Nov 2012 00:25:33 -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:mime-version:content-type :content-disposition:user-agent; bh=HX3mOStzEREoQV+eTcBG5MIzfPOcBKL8JbiGmw5comY=; b=HRTjUk5/vNVvuKOO4YN7Vikgwg655DEfFzkC9ElxxySj3J2t5y7l5SIGsGgr4Ms/71 4LczbVeF5UQocbixNLIf0m+T7mH0AzLzqXA4y8ZE9h+RxWRJ5fUJOl9fjAwwTuKRYEfY 0CItOLZkF8HzpIFtYcwlq7xHmOq/aXfwY0QoV6b1jKnvHycveTLVABUqKvKSUv+QaYLt xCmAc4vl5TuAuDVqr3WExIbZwwvw1CG+dRQsIl7OMGDxwiqbjv/3DRvncHlrqFbcaayB XxU2X/UxcOWfYGUTJ7d3lCVYq35dyj7sfMKJmEdrfNs5dcffdns1kSTk6YRWBm52E/PD kENg== Received: by 10.66.73.227 with SMTP id o3mr16341900pav.78.1353745533672; Sat, 24 Nov 2012 00:25:33 -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 ju7sm5150730pbb.60.2012.11.24.00.25.31 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 24 Nov 2012 00:25:32 -0800 (PST) Date: Sat, 24 Nov 2012 00:25:30 -0800 From: Dmitry Torokhov To: Sascha Hauer Subject: [PATCH] ARM: eukrea_mbimx27-baseboard - use stock get_pendown_state() in ads7846 Message-ID: <20121124082529.GA7687@core.coreip.homeip.net> MIME-Version: 1.0 Content-Disposition: inline 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-20121124_032535_916777_5AA25B42 X-CRM114-Status: GOOD ( 15.99 ) 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.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.160.49 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (dmitry.torokhov[at]gmail.com) -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: Russell King , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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 --- Not tested - no hardware, but should be fine. 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..b20fc55 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 = (GPIO_PORTD | 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 */