Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sparc: Add GPIO layer support.

Signed-off-by: David S. Miller <davem@davemloft.net>

+48
+6
arch/sparc/Kconfig
··· 20 20 bool 21 21 default y 22 22 23 + config GENERIC_GPIO 24 + bool 25 + help 26 + Generic GPIO API support 27 + 23 28 config ARCH_NO_VIRT_TO_BUS 24 29 def_bool y 25 30 ··· 74 69 select HAVE_OPROFILE 75 70 select HAVE_ARCH_KGDB if !SMP 76 71 select HAVE_ARCH_TRACEHOOK 72 + select ARCH_WANT_OPTIONAL_GPIOLIB 77 73 78 74 # Identify this as a Sparc32 build 79 75 config SPARC32
+36
arch/sparc/include/asm/gpio.h
··· 1 + #ifndef __ASM_SPARC_GPIO_H 2 + #define __ASM_SPARC_GPIO_H 3 + 4 + #include <linux/errno.h> 5 + #include <asm-generic/gpio.h> 6 + 7 + #ifdef CONFIG_GPIOLIB 8 + 9 + static inline int gpio_get_value(unsigned int gpio) 10 + { 11 + return __gpio_get_value(gpio); 12 + } 13 + 14 + static inline void gpio_set_value(unsigned int gpio, int value) 15 + { 16 + __gpio_set_value(gpio, value); 17 + } 18 + 19 + static inline int gpio_cansleep(unsigned int gpio) 20 + { 21 + return __gpio_cansleep(gpio); 22 + } 23 + 24 + static inline int gpio_to_irq(unsigned int gpio) 25 + { 26 + return -ENOSYS; 27 + } 28 + 29 + static inline int irq_to_gpio(unsigned int irq) 30 + { 31 + return -EINVAL; 32 + } 33 + 34 + #endif /* CONFIG_GPIOLIB */ 35 + 36 + #endif /* __ASM_SPARC_GPIO_H */
+6
arch/sparc64/Kconfig
··· 18 18 select HAVE_ARCH_KGDB 19 19 select USE_GENERIC_SMP_HELPERS if SMP 20 20 select HAVE_ARCH_TRACEHOOK 21 + select ARCH_WANT_OPTIONAL_GPIOLIB 21 22 22 23 config GENERIC_TIME 23 24 bool ··· 31 30 config GENERIC_CLOCKEVENTS 32 31 bool 33 32 default y 33 + 34 + config GENERIC_GPIO 35 + bool 36 + help 37 + Generic GPIO API support 34 38 35 39 config 64BIT 36 40 def_bool y