Path: blob/master/arch/avr32/mach-at32ap/include/mach/gpio.h
10820 views
#ifndef __ASM_AVR32_ARCH_GPIO_H1#define __ASM_AVR32_ARCH_GPIO_H23#include <linux/compiler.h>4#include <asm/irq.h>567/* Some GPIO chips can manage IRQs; some can't. The exact numbers can8* be changed if needed, but for the moment they're not configurable.9*/10#define ARCH_NR_GPIOS (NR_GPIO_IRQS + 2 * 32)111213/* Arch-neutral GPIO API, supporting both "native" and external GPIOs. */14#include <asm-generic/gpio.h>1516static inline int gpio_get_value(unsigned int gpio)17{18return __gpio_get_value(gpio);19}2021static inline void gpio_set_value(unsigned int gpio, int value)22{23__gpio_set_value(gpio, value);24}2526static inline int gpio_cansleep(unsigned int gpio)27{28return __gpio_cansleep(gpio);29}303132static inline int gpio_to_irq(unsigned int gpio)33{34if (gpio < NR_GPIO_IRQS)35return gpio + GPIO_IRQ_BASE;36return -EINVAL;37}3839static inline int irq_to_gpio(unsigned int irq)40{41return irq - GPIO_IRQ_BASE;42}4344#endif /* __ASM_AVR32_ARCH_GPIO_H */454647