diff options
author | Olof Johansson <olof@lixom.net> | 2011-02-13 22:12:27 -0500 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2011-02-22 20:27:11 -0500 |
commit | 632095ea15db51d73d3d084ee18620d3ac1cb040 (patch) | |
tree | f3cf8e089309abce2843e4eeab5e125a56a99752 /arch/arm/mach-tegra/gpio.c | |
parent | 38376866a1fe5b1e6d9510ec4913c2b461f456f3 (diff) |
ARM: tegra: add tegra_gpio_table and tegra_gpio_config
To give one place to setup the pins that are used as GPIOs instead
of as their pinmuxed functions. Specifying enabled as false explicitly
disables the gpio mode of that pin (if left on by firmware).
This should remove the need for calling these from specific drivers and
thus reduce tegra-specific code from them.
Signed-off-by: Olof Johansson <olof@lixom.net>
Acked-by: Erik Gilling <konkers@android.com>
Diffstat (limited to 'arch/arm/mach-tegra/gpio.c')
-rw-r--r-- | arch/arm/mach-tegra/gpio.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/gpio.c b/arch/arm/mach-tegra/gpio.c index 132dcd6833a2..12090a2cf3e0 100644 --- a/arch/arm/mach-tegra/gpio.c +++ b/arch/arm/mach-tegra/gpio.c | |||
@@ -381,6 +381,20 @@ static int __init tegra_gpio_init(void) | |||
381 | 381 | ||
382 | postcore_initcall(tegra_gpio_init); | 382 | postcore_initcall(tegra_gpio_init); |
383 | 383 | ||
384 | void __init tegra_gpio_config(struct tegra_gpio_table *table, int num) | ||
385 | { | ||
386 | int i; | ||
387 | |||
388 | for (i = 0; i < num; i++) { | ||
389 | int gpio = table[i].gpio; | ||
390 | |||
391 | if (table[i].enable) | ||
392 | tegra_gpio_enable(gpio); | ||
393 | else | ||
394 | tegra_gpio_disable(gpio); | ||
395 | } | ||
396 | } | ||
397 | |||
384 | #ifdef CONFIG_DEBUG_FS | 398 | #ifdef CONFIG_DEBUG_FS |
385 | 399 | ||
386 | #include <linux/debugfs.h> | 400 | #include <linux/debugfs.h> |