diff options
author | Gregory Bean <gbean@codeaurora.org> | 2010-09-11 00:03:37 +0200 |
---|---|---|
committer | Daniel Walker <dwalker@codeaurora.org> | 2010-10-06 18:01:19 +0200 |
commit | 26cc66607189ac544edad04927f506599d990f0f (patch) | |
tree | 28c61ee7dd6837015883eec80e852014aec9d5bd /arch/arm/mach-msm | |
parent | msm: add gpio driver for single-core SoCs. (diff) | |
download | linux-26cc66607189ac544edad04927f506599d990f0f.tar.xz linux-26cc66607189ac544edad04927f506599d990f0f.zip |
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')
-rw-r--r-- | arch/arm/mach-msm/gpio.c | 18 |
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 @@ #include <linux/irq.h> #include <linux/module.h> #include "gpio_hw.h" +#include "gpiomux.h" #define FIRST_GPIO_IRQ MSM_GPIO_TO_INT(0) @@ -44,6 +45,8 @@ .direction_input = msm_gpio_direction_input, \ .direction_output = msm_gpio_direction_output, \ .to_irq = msm_gpio_to_irq, \ + .request = msm_gpio_request, \ + .free = msm_gpio_free, \ } \ } @@ -171,6 +174,21 @@ static int msm_gpio_to_irq(struct gpio_chip *chip, unsigned offset) return MSM_GPIO_TO_INT(chip->base + offset); } +#ifdef CONFIG_MSM_GPIOMUX +static int msm_gpio_request(struct gpio_chip *chip, unsigned offset) +{ + return msm_gpiomux_get(chip->base + offset); +} + +static void msm_gpio_free(struct gpio_chip *chip, unsigned offset) +{ + msm_gpiomux_put(chip->base + offset); +} +#else +#define msm_gpio_request NULL +#define msm_gpio_free NULL +#endif + struct msm_gpio_chip msm_gpio_chips[] = { #if defined(CONFIG_ARCH_MSM7X00A) MSM_GPIO_BANK(0, 0, 15), |