From patchwork Tue Nov 20 08:30:53 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 1771811 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 493923FCA5 for ; Tue, 20 Nov 2012 08:31:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752891Ab2KTIa6 (ORCPT ); Tue, 20 Nov 2012 03:30:58 -0500 Received: from mail-pb0-f46.google.com ([209.85.160.46]:37316 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752883Ab2KTIa5 (ORCPT ); Tue, 20 Nov 2012 03:30:57 -0500 Received: by mail-pb0-f46.google.com with SMTP id wy7so4111589pbc.19 for ; Tue, 20 Nov 2012 00:30:57 -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=FRo81DTF31IFpym8jeeb/aC8zsCe9++cIWCOPDVyvHo=; b=LXZTcauJUfhezryqahwIMmyWvmF/Ad+fAKAAIv/QvOSCwbfiABpOdxDjYvP6mlT+n4 qubIUIittwOFUeDRXBWYjRwVNlDODgG1Oobez0vnxo5Y4ik29WovwTuPLF5eLzZqrgvP 4PmsRuAgVmsiuo9kRirk3IOJSig5P2qf40Dkzi9TEbArb2D7pHbDzah2YVg/nXI55U0u x18feN3nYblYqs8P3u1lRf/P+C4rXFrdPhyZZ11ErP/t86hz8zSeEREJlGnR9hFYU/VT sCmNFETDnmkXD7ojvHDRYF4obfX6aiVxaEO3xkBrhi6Z9YbiCwjoSkG9JRIFxk7x8HI7 GDtw== Received: by 10.66.78.4 with SMTP id x4mr6007253paw.60.1353400257136; Tue, 20 Nov 2012 00:30:57 -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 kb3sm7708607pbc.27.2012.11.20.00.30.55 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 20 Nov 2012 00:30:56 -0800 (PST) Date: Tue, 20 Nov 2012 00:30:53 -0800 From: Dmitry Torokhov To: Tony Lindgren Cc: Tomi Valkeinen , Felipe Balbi , linux-omap@vger.kernel.org Subject: [RFC/RFT] OMAP: N770: remove custom implementation of ads7846_get_pendown_state Message-ID: <20121120083052.GA29020@core.coreip.homeip.net> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.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 Tested-by: Aaro Koskinen Acked-by: Tony Lindgren --- No hardware so not tested... Thanks! arch/arm/mach-omap1/board-nokia770.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c index 7d5c06d..be6490b 100644 --- a/arch/arm/mach-omap1/board-nokia770.c +++ b/arch/arm/mach-omap1/board-nokia770.c @@ -112,17 +112,6 @@ static void __init mipid_dev_init(void) omapfb_set_lcd_config(&nokia770_lcd_config); } -static void __init ads7846_dev_init(void) -{ - if (gpio_request(ADS7846_PENDOWN_GPIO, "ADS7846 pendown") < 0) - printk(KERN_ERR "can't get ads7846 pen down GPIO\n"); -} - -static int ads7846_get_pendown_state(void) -{ - return !gpio_get_value(ADS7846_PENDOWN_GPIO); -} - static struct ads7846_platform_data nokia770_ads7846_platform_data __initdata = { .x_max = 0x0fff, .y_max = 0x0fff, @@ -131,7 +120,7 @@ static struct ads7846_platform_data nokia770_ads7846_platform_data __initdata = .debounce_max = 10, .debounce_tol = 3, .debounce_rep = 1, - .get_pendown_state = ads7846_get_pendown_state, + .gpio_pendown = ADS7846_PENDOWN_GPIO, }; static struct spi_board_info nokia770_spi_board_info[] __initdata = { @@ -241,7 +230,6 @@ static void __init omap_nokia770_init(void) omap_serial_init(); omap_register_i2c_bus(1, 100, NULL, 0); hwa742_dev_init(); - ads7846_dev_init(); mipid_dev_init(); omap1_usb_init(&nokia770_usb_config); nokia770_mmc_init();