gpio.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * arch/arm/plat-orion/include/plat/gpio.h
  3. *
  4. * Marvell Orion SoC GPIO handling.
  5. *
  6. * This file is licensed under the terms of the GNU General Public
  7. * License version 2. This program is licensed "as is" without any
  8. * warranty of any kind, whether express or implied.
  9. */
  10. #ifndef __PLAT_GPIO_H
  11. #define __PLAT_GPIO_H
  12. /*
  13. * GENERIC_GPIO primitives.
  14. */
  15. int gpio_request(unsigned pin, const char *label);
  16. void gpio_free(unsigned pin);
  17. int gpio_direction_input(unsigned pin);
  18. int gpio_direction_output(unsigned pin, int value);
  19. int gpio_get_value(unsigned pin);
  20. void gpio_set_value(unsigned pin, int value);
  21. /*
  22. * Orion-specific GPIO API extensions.
  23. */
  24. void orion_gpio_set_unused(unsigned pin);
  25. void orion_gpio_set_blink(unsigned pin, int blink);
  26. #define GPIO_BIDI_OK (1 << 0)
  27. #define GPIO_INPUT_OK (1 << 1)
  28. #define GPIO_OUTPUT_OK (1 << 2)
  29. void orion_gpio_set_valid(unsigned pin, int mode);
  30. /*
  31. * GPIO interrupt handling.
  32. */
  33. extern struct irq_chip orion_gpio_irq_chip;
  34. void orion_gpio_irq_handler(int irqoff);
  35. #endif