From f96dca20659310e029400b59cd67ce396c7fd1f0 Mon Sep 17 00:00:00 2001 From: Olof Johansson Date: Sun, 13 Feb 2011 19:12:27 -0800 Subject: [PATCH] --- yaml --- r: 235261 b: refs/heads/master c: 632095ea15db51d73d3d084ee18620d3ac1cb040 h: refs/heads/master i: 235259: 0e600bea54dbdb668a1774ad3eedd998275d5f18 v: v3 --- [refs] | 2 +- trunk/arch/arm/mach-tegra/gpio.c | 14 ++++++++++++++ trunk/arch/arm/mach-tegra/include/mach/gpio.h | 7 +++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 0bf712144e42..2bce55725af4 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 38376866a1fe5b1e6d9510ec4913c2b461f456f3 +refs/heads/master: 632095ea15db51d73d3d084ee18620d3ac1cb040 diff --git a/trunk/arch/arm/mach-tegra/gpio.c b/trunk/arch/arm/mach-tegra/gpio.c index 132dcd6833a2..12090a2cf3e0 100644 --- a/trunk/arch/arm/mach-tegra/gpio.c +++ b/trunk/arch/arm/mach-tegra/gpio.c @@ -381,6 +381,20 @@ static int __init tegra_gpio_init(void) postcore_initcall(tegra_gpio_init); +void __init tegra_gpio_config(struct tegra_gpio_table *table, int num) +{ + int i; + + for (i = 0; i < num; i++) { + int gpio = table[i].gpio; + + if (table[i].enable) + tegra_gpio_enable(gpio); + else + tegra_gpio_disable(gpio); + } +} + #ifdef CONFIG_DEBUG_FS #include diff --git a/trunk/arch/arm/mach-tegra/include/mach/gpio.h b/trunk/arch/arm/mach-tegra/include/mach/gpio.h index 12a7cf6874cd..196f114dc241 100644 --- a/trunk/arch/arm/mach-tegra/include/mach/gpio.h +++ b/trunk/arch/arm/mach-tegra/include/mach/gpio.h @@ -20,6 +20,7 @@ #ifndef __MACH_TEGRA_GPIO_H #define __MACH_TEGRA_GPIO_H +#include #include #define TEGRA_NR_GPIOS INT_GPIO_NR @@ -47,6 +48,12 @@ static inline int irq_to_gpio(unsigned int irq) return -EINVAL; } +struct tegra_gpio_table { + int gpio; /* GPIO number */ + bool enable; /* Enable for GPIO at init? */ +}; + +void tegra_gpio_config(struct tegra_gpio_table *table, int num); void tegra_gpio_enable(int gpio); void tegra_gpio_disable(int gpio);