aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-msm/gpio.c
diff options
context:
space:
mode:
authorGregory Bean <gbean@codeaurora.org>2010-09-10 18:03:37 -0400
committerDaniel Walker <dwalker@codeaurora.org>2010-10-06 12:01:19 -0400
commit26cc66607189ac544edad04927f506599d990f0f (patch)
tree28c61ee7dd6837015883eec80e852014aec9d5bd /arch/arm/mach-msm/gpio.c
parent2783cc265cc57c4bbf788b75fa8c3f06259dffd1 (diff)
msm: gpio: Add gpiomux calls to request and free.
Add gpiomux get and put calls to msmgpio request and free, in order to allow gpio lines to be properly reference-counted and power-managed. Signed-off-by: Gregory Bean <gbean@codeaurora.org> Signed-off-by: Daniel Walker <dwalker@codeaurora.org>
Diffstat (limited to 'arch/arm/mach-msm/gpio.c')
-rw-r--r--arch/arm/mach-msm/gpio.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/arm/mach-msm/gpio.c b/arch/arm/mach-msm/gpio.c
index 5040f1cb64f9..33051b509e88 100644
--- a/arch/arm/mach-msm/gpio.c
+++ b/arch/arm/mach-msm/gpio.c
@@ -21,6 +21,7 @@
21#include <linux/irq.h> 21#include <linux/irq.h>
22#include <linux/module.h> 22#include <linux/module.h>
23#include "gpio_hw.h" 23#include "gpio_hw.h"
24#include "gpiomux.h"
24 25
25#define FIRST_GPIO_IRQ MSM_GPIO_TO_INT(0) 26#define FIRST_GPIO_IRQ MSM_GPIO_TO_INT(0)
26 27
@@ -44,6 +45,8 @@
44 .direction_input = msm_gpio_direction_input, \ 45 .direction_input = msm_gpio_direction_input, \
45 .direction_output = msm_gpio_direction_output, \ 46 .direction_output = msm_gpio_direction_output, \
46 .to_irq = msm_gpio_to_irq, \ 47 .to_irq = msm_gpio_to_irq, \
48 .request = msm_gpio_request, \
49 .free = msm_gpio_free, \
47 } \ 50 } \
48 } 51 }
49 52
@@ -171,6 +174,21 @@ static int msm_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
171 return MSM_GPIO_TO_INT(chip->base + offset); 174 return MSM_GPIO_TO_INT(chip->base + offset);
172} 175}
173 176
177#ifdef CONFIG_MSM_GPIOMUX
178static int msm_gpio_request(struct gpio_chip *chip, unsigned offset)
179{
180 return msm_gpiomux_get(chip->base + offset);
181}
182
183static void msm_gpio_free(struct gpio_chip *chip, unsigned offset)
184{
185 msm_gpiomux_put(chip->base + offset);
186}
187#else
188#define msm_gpio_request NULL
189#define msm_gpio_free NULL
190#endif
191
174struct msm_gpio_chip msm_gpio_chips[] = { 192struct msm_gpio_chip msm_gpio_chips[] = {
175#if defined(CONFIG_ARCH_MSM7X00A) 193#if defined(CONFIG_ARCH_MSM7X00A)
176 MSM_GPIO_BANK(0, 0, 15), 194 MSM_GPIO_BANK(0, 0, 15),