diff options
-rw-r--r-- | arch/arm/mach-tegra/gpio.c | 14 | ||||
-rw-r--r-- | arch/arm/mach-tegra/include/mach/gpio.h | 7 |
2 files changed, 21 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> |
diff --git a/arch/arm/mach-tegra/include/mach/gpio.h b/arch/arm/mach-tegra/include/mach/gpio.h index 12a7cf6874cd..196f114dc241 100644 --- a/arch/arm/mach-tegra/include/mach/gpio.h +++ b/arch/arm/mach-tegra/include/mach/gpio.h | |||
@@ -20,6 +20,7 @@ | |||
20 | #ifndef __MACH_TEGRA_GPIO_H | 20 | #ifndef __MACH_TEGRA_GPIO_H |
21 | #define __MACH_TEGRA_GPIO_H | 21 | #define __MACH_TEGRA_GPIO_H |
22 | 22 | ||
23 | #include <linux/init.h> | ||
23 | #include <mach/irqs.h> | 24 | #include <mach/irqs.h> |
24 | 25 | ||
25 | #define TEGRA_NR_GPIOS INT_GPIO_NR | 26 | #define TEGRA_NR_GPIOS INT_GPIO_NR |
@@ -47,6 +48,12 @@ static inline int irq_to_gpio(unsigned int irq) | |||
47 | return -EINVAL; | 48 | return -EINVAL; |
48 | } | 49 | } |
49 | 50 | ||
51 | struct tegra_gpio_table { | ||
52 | int gpio; /* GPIO number */ | ||
53 | bool enable; /* Enable for GPIO at init? */ | ||
54 | }; | ||
55 | |||
56 | void tegra_gpio_config(struct tegra_gpio_table *table, int num); | ||
50 | void tegra_gpio_enable(int gpio); | 57 | void tegra_gpio_enable(int gpio); |
51 | void tegra_gpio_disable(int gpio); | 58 | void tegra_gpio_disable(int gpio); |
52 | 59 | ||