* - omap-gpio-wrappers.patch removed from -mm tree
@ 2007-02-12 22:45 akpm
0 siblings, 0 replies; only message in thread
From: akpm @ 2007-02-12 22:45 UTC (permalink / raw)
To: david-b, dbrownell, mm-commits
The patch titled
OMAP GPIO wrappers
has been removed from the -mm tree. Its filename was
omap-gpio-wrappers.patch
This patch was dropped because it was merged into mainline or a subsystem tree
------------------------------------------------------
Subject: OMAP GPIO wrappers
From: David Brownell <david-b@pacbell.net>
This teaches OMAP how to implement the cross-platform GPIO interfaces.
[akpm@osdl.org: cleanups]
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
include/asm-arm/arch-omap/gpio.h | 66 +++++++++++++++++++++++++++++
1 file changed, 66 insertions(+)
diff -puN include/asm-arm/arch-omap/gpio.h~omap-gpio-wrappers include/asm-arm/arch-omap/gpio.h
--- a/include/asm-arm/arch-omap/gpio.h~omap-gpio-wrappers
+++ a/include/asm-arm/arch-omap/gpio.h
@@ -76,4 +76,70 @@ extern void omap_set_gpio_direction(int
extern void omap_set_gpio_dataout(int gpio, int enable);
extern int omap_get_gpio_datain(int gpio);
+/*-------------------------------------------------------------------------*/
+
+/* wrappers for "new style" GPIO calls. the old OMAP-specfic ones should
+ * eventually be removed (along with this errno.h inclusion), and maybe
+ * gpios should put MPUIOs last too.
+ */
+
+#include <asm/errno.h>
+
+static inline int gpio_request(unsigned gpio, const char *label)
+{
+ return omap_request_gpio(gpio);
+}
+
+static inline void gpio_free(unsigned gpio)
+{
+ omap_free_gpio(gpio);
+}
+
+static inline int __gpio_set_direction(unsigned gpio, int is_input)
+{
+ if (cpu_class_is_omap2()) {
+ if (gpio > OMAP_MAX_GPIO_LINES)
+ return -EINVAL;
+ } else {
+ if (gpio > (OMAP_MAX_GPIO_LINES + 16 /* MPUIO */))
+ return -EINVAL;
+ }
+ omap_set_gpio_direction(gpio, is_input);
+ return 0;
+}
+
+static inline int gpio_direction_input(unsigned gpio)
+{
+ return __gpio_set_direction(gpio, 1);
+}
+
+static inline int gpio_direction_output(unsigned gpio)
+{
+ return __gpio_set_direction(gpio, 0);
+}
+
+static inline int gpio_get_value(unsigned gpio)
+{
+ return omap_get_gpio_datain(gpio);
+}
+
+static inline void gpio_set_value(unsigned gpio, int value)
+{
+ omap_set_gpio_dataout(gpio, value);
+}
+
+#include <asm-generic/gpio.h> /* cansleep wrappers */
+
+static inline int gpio_to_irq(unsigned gpio)
+{
+ return OMAP_GPIO_IRQ(gpio);
+}
+
+static inline int irq_to_gpio(unsigned irq)
+{
+ if (cpu_class_is_omap1() && (irq < (IH_MPUIO_BASE + 16)))
+ return (irq - IH_MPUIO_BASE) + OMAP_MAX_GPIO_LINES;
+ return irq - IH_GPIO_BASE;
+}
+
#endif
_
Patches currently in -mm which might be from david-b@pacbell.net are
origin.patch
git-acpi.patch
git-avr32.patch
git-md-accel.patch
8250-make-probing-for-txen-bug-a-config-option.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-02-12 22:46 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-12 22:45 - omap-gpio-wrappers.patch removed from -mm tree akpm
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.