gpio.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * include/asm-mips/pmc-sierra/msp71xx/gpio.h
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 as
  6. * published by the Free Software Foundation.
  7. *
  8. * @author Patrick Glass <patrickglass@gmail.com>
  9. */
  10. #ifndef __PMC_MSP71XX_GPIO_H
  11. #define __PMC_MSP71XX_GPIO_H
  12. /* Max number of gpio's is 28 on chip plus 3 banks of I2C IO Expanders */
  13. #define ARCH_NR_GPIOS (28 + (3 * 8))
  14. /* new generic GPIO API - see Documentation/gpio.txt */
  15. #include <asm-generic/gpio.h>
  16. #define gpio_get_value __gpio_get_value
  17. #define gpio_set_value __gpio_set_value
  18. #define gpio_cansleep __gpio_cansleep
  19. /* Setup calls for the gpio and gpio extended */
  20. extern void msp71xx_init_gpio(void);
  21. extern void msp71xx_init_gpio_extended(void);
  22. extern int msp71xx_set_output_drive(unsigned gpio, int value);
  23. /* Custom output drive functionss */
  24. static inline int gpio_set_output_drive(unsigned gpio, int value)
  25. {
  26. return msp71xx_set_output_drive(gpio, value);
  27. }
  28. /* IRQ's are not supported for gpio lines */
  29. static inline int gpio_to_irq(unsigned gpio)
  30. {
  31. return -EINVAL;
  32. }
  33. static inline int irq_to_gpio(unsigned irq)
  34. {
  35. return -EINVAL;
  36. }
  37. #endif /* __PMC_MSP71XX_GPIO_H */