forked from luck/tmp_suning_uos_patched
7444a72eff
This patch adds functionality to the gpio-lib subsystem to make it possible to enable the gpio-lib code even if the architecture code didn't request to get it built in. The archtitecture code does still need to implement the gpiolib accessor functions in its asm/gpio.h file. This patch adds the implementations for x86 and PPC. With these changes it is possible to run generic GPIO expansion cards on every architecture that implements the trivial wrapper functions. Support for more architectures can easily be added. Signed-off-by: Michael Buesch <mb@bu3sch.de> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Stephen Rothwell <sfr@canb.auug.org.au> Cc: David Brownell <david-b@pacbell.net> Cc: Russell King <rmk@arm.linux.org.uk> Cc: Haavard Skinnemoen <hskinnemoen@atmel.com> Cc: Jesper Nilsson <jesper.nilsson@axis.com> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Ingo Molnar <mingo@elte.hu> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Jean Delvare <khali@linux-fr.org> Cc: Samuel Ortiz <sameo@openedhand.com> Cc: Kumar Gala <galak@gate.crashing.org> Cc: Sam Ravnborg <sam@ravnborg.org> Cc: Adrian Bunk <bunk@stusta.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
22 lines
640 B
C
22 lines
640 B
C
#ifndef __ASM_MACH_GENERIC_GPIO_H
|
|
#define __ASM_MACH_GENERIC_GPIO_H
|
|
|
|
#ifdef CONFIG_GPIOLIB
|
|
#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);
|
|
|
|
#include <asm-generic/gpio.h> /* cansleep wrappers */
|
|
|
|
#endif /* __ASM_MACH_GENERIC_GPIO_H */
|