Thread (22 messages) 22 messages, 7 authors, 2011-02-23
STALE5581d
Revisions (8)
  1. v3 [diff vs current]
  2. v3 [diff vs current]
  3. v3 [diff vs current]
  4. v3 current
  5. v3 [diff vs current]
  6. v3 [diff vs current]
  7. v3 [diff vs current]
  8. v3 [diff vs current]

[PATCH 1/6] ARM: tegra: add tegra_gpio_table and tegra_gpio_config

From: Erik Gilling <hidden>
Date: 2011-02-22 19:18:08
Also in: linux-tegra

Can you split the boardfile changes into their own patch?  Also see
the below whitespace only change.  Other than that, looks good.

On Mon, Feb 21, 2011 at 9:55 PM, Olof Johansson [off-list ref] wrote:
snip
quoted hunk ↗ jump to hunk
diff --git a/arch/arm/mach-tegra/gpio.c b/arch/arm/mach-tegra/gpio.c
index 132dcd6..ffc146d 100644
--- a/arch/arm/mach-tegra/gpio.c
+++ b/arch/arm/mach-tegra/gpio.c
@@ -378,9 +378,22 @@ static int __init tegra_gpio_init(void)
? ? ? ?return 0;
?}
-
?postcore_initcall(tegra_gpio_init);
whitespace only change
quoted hunk ↗ jump to hunk
+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 <linux/debugfs.h>
diff --git a/arch/arm/mach-tegra/include/mach/gpio.h b/arch/arm/mach-tegra/include/mach/gpio.h
index e31f486..2369fba 100644
--- a/arch/arm/mach-tegra/include/mach/gpio.h
+++ b/arch/arm/mach-tegra/include/mach/gpio.h
@@ -20,6 +20,7 @@
?#ifndef __MACH_TEGRA_GPIO_H
?#define __MACH_TEGRA_GPIO_H

+#include <linux/init.h>
?#include <mach/irqs.h>

?#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 __init tegra_gpio_config(struct tegra_gpio_table *table, int num);
?void tegra_gpio_enable(int gpio);
?void tegra_gpio_disable(int gpio);

--
1.7.0.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help