diff options
author | Juha Tukkinen <jtukkinen@nvidia.com> | 2012-03-14 13:44:35 +0200 |
---|---|---|
committer | Rohan Somvanshi <rsomvanshi@nvidia.com> | 2012-03-30 09:12:22 -0700 |
commit | ff6eaed4ff8d732417e89eeb540a2f78fb54a6d3 (patch) | |
tree | 26e02f3b2ca293f22e0b90bfdb954fbb2879a956 /arch/arm/mach-tegra/board-touch-kai-synaptics-spi.c | |
parent | 536e91c520ea1c80209987d70bc29857f878cbeb (diff) |
ARM: tegra: Fix Synaptics setup compilation warning
Fix Synaptics touchpad GPIO setup compilation warning and add freeing of
resources when unconfiguring.
Change-Id: Idc98dd622cc969ac55f8c6a945317d657a6b7222
Signed-off-by: Juha Tukkinen <jtukkinen@nvidia.com>
Reviewed-on: http://git-master/r/90046
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'arch/arm/mach-tegra/board-touch-kai-synaptics-spi.c')
-rw-r--r-- | arch/arm/mach-tegra/board-touch-kai-synaptics-spi.c | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/arch/arm/mach-tegra/board-touch-kai-synaptics-spi.c b/arch/arm/mach-tegra/board-touch-kai-synaptics-spi.c index b4052c277c3a..989cf3339be4 100644 --- a/arch/arm/mach-tegra/board-touch-kai-synaptics-spi.c +++ b/arch/arm/mach-tegra/board-touch-kai-synaptics-spi.c @@ -1,7 +1,7 @@ /* * arch/arm/mach-tegra/board-touch-synaptics-spi.c * - * Copyright (C) 2010-2011 NVIDIA Corporation + * Copyright (C) 2010-2012 NVIDIA Corporation * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and @@ -35,20 +35,26 @@ static struct rmi_f19_button_map synaptics_button_map = { .map = synaptics_button_codes, }; -static int synaptics_touchpad_gpio_setup(void) +static int synaptics_touchpad_gpio_setup(void *gpio_data, bool configure) { - tegra_gpio_enable(SYNAPTICS_ATTN_GPIO); - gpio_request(SYNAPTICS_ATTN_GPIO, "synaptics-irq"); - gpio_direction_input(SYNAPTICS_ATTN_GPIO); + if (configure) { + tegra_gpio_enable(SYNAPTICS_ATTN_GPIO); + gpio_request(SYNAPTICS_ATTN_GPIO, "synaptics-irq"); + gpio_direction_input(SYNAPTICS_ATTN_GPIO); - tegra_gpio_enable(SYNAPTICS_RESET_GPIO); - gpio_request(SYNAPTICS_RESET_GPIO, "synaptics-reset"); - gpio_direction_output(SYNAPTICS_RESET_GPIO, 0); - - msleep(1); - gpio_set_value(SYNAPTICS_RESET_GPIO, 1); - msleep(100); + tegra_gpio_enable(SYNAPTICS_RESET_GPIO); + gpio_request(SYNAPTICS_RESET_GPIO, "synaptics-reset"); + gpio_direction_output(SYNAPTICS_RESET_GPIO, 0); + msleep(1); + gpio_set_value(SYNAPTICS_RESET_GPIO, 1); + msleep(100); + } else { + gpio_free(SYNAPTICS_ATTN_GPIO); + gpio_free(SYNAPTICS_RESET_GPIO); + tegra_gpio_disable(SYNAPTICS_ATTN_GPIO); + tegra_gpio_disable(SYNAPTICS_RESET_GPIO); + } return 0; } |