From patchwork Wed Nov 24 21:59:32 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Gardiner X-Patchwork-Id: 354592 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 oAOM2LnC013351 for ; Wed, 24 Nov 2010 22:12:45 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756164Ab0KXV7q (ORCPT ); Wed, 24 Nov 2010 16:59:46 -0500 Received: from na3sys009aog102.obsmtp.com ([74.125.149.69]:59374 "HELO na3sys009aog102.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1756155Ab0KXV7o (ORCPT ); Wed, 24 Nov 2010 16:59:44 -0500 Received: from source ([209.85.213.175]) by na3sys009aob102.postini.com ([74.125.148.12]) with SMTP ID DSNKTO2K0GFjXlGm/malSZHiMtWznCkQfWN6@postini.com; Wed, 24 Nov 2010 13:59:44 PST Received: by mail-yx0-f175.google.com with SMTP id 5so154462yxd.20 for ; Wed, 24 Nov 2010 13:59:44 -0800 (PST) Received: by 10.150.225.9 with SMTP id x9mr1889651ybg.30.1290635983930; Wed, 24 Nov 2010 13:59:43 -0800 (PST) Received: from localhost.localdomain ([206.191.47.130]) by mx.google.com with ESMTPS id m65sm5072712yha.23.2010.11.24.13.59.41 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 24 Nov 2010 13:59:42 -0800 (PST) From: Ben Gardiner To: Kevin Hilman , davinci-linux-open-source@linux.davincidsp.com, linux-input@vger.kernel.org, Dmitry Torokhov Cc: linux-kernel@vger.kernel.org, Chris Cordahi , Paul Mundt , Sekhar Nori , Gabor Juhos , Victor Rodriguez Subject: [PATCH v5 3/5] da850-evm: extract defines for SEL{A, B, C} pins in UI expander Date: Wed, 24 Nov 2010 16:59:32 -0500 Message-Id: X-Mailer: git-send-email 1.7.0.4 In-Reply-To: References: 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]); Wed, 24 Nov 2010 22:12:50 +0000 (UTC) diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c index f6490f8..8f7a605 100644 --- a/arch/arm/mach-davinci/board-da850-evm.c +++ b/arch/arm/mach-davinci/board-da850-evm.c @@ -360,23 +360,23 @@ static int da850_evm_ui_expander_setup(struct i2c_client *client, unsigned gpio, { int sel_a, sel_b, sel_c, ret; - sel_a = gpio + 7; - sel_b = gpio + 6; - sel_c = gpio + 5; + sel_a = gpio + DA850_EVM_UI_EXP_SEL_A; + sel_b = gpio + DA850_EVM_UI_EXP_SEL_B; + sel_c = gpio + DA850_EVM_UI_EXP_SEL_C; - ret = gpio_request(sel_a, "sel_a"); + ret = gpio_request(sel_a, da850_evm_ui_exp[DA850_EVM_UI_EXP_SEL_A]); if (ret) { pr_warning("Cannot open UI expander pin %d\n", sel_a); goto exp_setup_sela_fail; } - ret = gpio_request(sel_b, "sel_b"); + ret = gpio_request(sel_b, da850_evm_ui_exp[DA850_EVM_UI_EXP_SEL_B]); if (ret) { pr_warning("Cannot open UI expander pin %d\n", sel_b); goto exp_setup_selb_fail; } - ret = gpio_request(sel_c, "sel_c"); + ret = gpio_request(sel_c, da850_evm_ui_exp[DA850_EVM_UI_EXP_SEL_C]); if (ret) { pr_warning("Cannot open UI expander pin %d\n", sel_c); goto exp_setup_selc_fail; @@ -419,13 +419,13 @@ static int da850_evm_ui_expander_teardown(struct i2c_client *client, platform_device_unregister(&da850_evm_ui_keys_device); /* deselect all functionalities */ - gpio_set_value_cansleep(gpio + 5, 1); - gpio_set_value_cansleep(gpio + 6, 1); - gpio_set_value_cansleep(gpio + 7, 1); + gpio_set_value_cansleep(gpio + DA850_EVM_UI_EXP_SEL_C, 1); + gpio_set_value_cansleep(gpio + DA850_EVM_UI_EXP_SEL_B, 1); + gpio_set_value_cansleep(gpio + DA850_EVM_UI_EXP_SEL_A, 1); - gpio_free(gpio + 5); - gpio_free(gpio + 6); - gpio_free(gpio + 7); + gpio_free(gpio + DA850_EVM_UI_EXP_SEL_C); + gpio_free(gpio + DA850_EVM_UI_EXP_SEL_B); + gpio_free(gpio + DA850_EVM_UI_EXP_SEL_A); return 0; }