Linux MIPS Architecture development
 help / color / mirror / Atom feed
* [PATCH 1/4] make fallback gpio.h gpiolib-friendly
@ 2008-04-04 15:55 Atsushi Nemoto
  2008-04-04 17:44 ` Ralf Baechle
  0 siblings, 1 reply; 2+ messages in thread
From: Atsushi Nemoto @ 2008-04-04 15:55 UTC (permalink / raw)
  To: linux-mips; +Cc: ralf

If gpiolib was selected, asm-generic/gpio.h provides some prototypes
for gpio API and implementation helpers.  With this patch, platform
code can implement its GPIO API using gpiolib without custom gpio.h
file.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
---
diff --git a/include/asm-mips/mach-generic/gpio.h b/include/asm-mips/mach-generic/gpio.h
index 6eaf5ef..e6b376b 100644
--- a/include/asm-mips/mach-generic/gpio.h
+++ b/include/asm-mips/mach-generic/gpio.h
@@ -1,12 +1,18 @@
 #ifndef __ASM_MACH_GENERIC_GPIO_H
 #define __ASM_MACH_GENERIC_GPIO_H
 
+#ifdef CONFIG_HAVE_GPIO_LIB
+#define gpio_get_value	__gpio_get_value
+#define gpio_set_value	__gpio_set_value
+#define gpio_cansleep	__gpio_cansleep
+#else
 int gpio_request(unsigned gpio, const char *label);
 void gpio_free(unsigned gpio);
 int gpio_direction_input(unsigned gpio);
 int gpio_direction_output(unsigned gpio, int value);
 int gpio_get_value(unsigned gpio);
 void gpio_set_value(unsigned gpio, int value);
+#endif
 int gpio_to_irq(unsigned gpio);
 int irq_to_gpio(unsigned irq);
 

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/4] make fallback gpio.h gpiolib-friendly
  2008-04-04 15:55 [PATCH 1/4] make fallback gpio.h gpiolib-friendly Atsushi Nemoto
@ 2008-04-04 17:44 ` Ralf Baechle
  0 siblings, 0 replies; 2+ messages in thread
From: Ralf Baechle @ 2008-04-04 17:44 UTC (permalink / raw)
  To: Atsushi Nemoto; +Cc: linux-mips

On Sat, Apr 05, 2008 at 12:55:24AM +0900, Atsushi Nemoto wrote:

> If gpiolib was selected, asm-generic/gpio.h provides some prototypes
> for gpio API and implementation helpers.  With this patch, platform
> code can implement its GPIO API using gpiolib without custom gpio.h
> file.
> 
> Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>

Thanks, queued for 2.6.26,

  Ralf

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-04-04 17:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-04 15:55 [PATCH 1/4] make fallback gpio.h gpiolib-friendly Atsushi Nemoto
2008-04-04 17:44 ` Ralf Baechle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox