gpio.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*
  2. * arch/arm/mach-ks8695/include/mach/gpio.h
  3. *
  4. * Copyright (C) 2006 Andrew Victor
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. */
  10. #ifndef __ASM_ARCH_GPIO_H_
  11. #define __ASM_ARCH_GPIO_H_
  12. #define KS8695_GPIO_0 0
  13. #define KS8695_GPIO_1 1
  14. #define KS8695_GPIO_2 2
  15. #define KS8695_GPIO_3 3
  16. #define KS8695_GPIO_4 4
  17. #define KS8695_GPIO_5 5
  18. #define KS8695_GPIO_6 6
  19. #define KS8695_GPIO_7 7
  20. #define KS8695_GPIO_8 8
  21. #define KS8695_GPIO_9 9
  22. #define KS8695_GPIO_10 10
  23. #define KS8695_GPIO_11 11
  24. #define KS8695_GPIO_12 12
  25. #define KS8695_GPIO_13 13
  26. #define KS8695_GPIO_14 14
  27. #define KS8695_GPIO_15 15
  28. /*
  29. * Configure GPIO pin as external interrupt source.
  30. */
  31. int __init_or_module ks8695_gpio_interrupt(unsigned int pin, unsigned int type);
  32. /*
  33. * Configure the GPIO line as an input.
  34. */
  35. int __init_or_module gpio_direction_input(unsigned int pin);
  36. /*
  37. * Configure the GPIO line as an output, with default state.
  38. */
  39. int __init_or_module gpio_direction_output(unsigned int pin, unsigned int state);
  40. /*
  41. * Set the state of an output GPIO line.
  42. */
  43. void gpio_set_value(unsigned int pin, unsigned int state);
  44. /*
  45. * Read the state of a GPIO line.
  46. */
  47. int gpio_get_value(unsigned int pin);
  48. /*
  49. * Map GPIO line to IRQ number.
  50. */
  51. int gpio_to_irq(unsigned int pin);
  52. /*
  53. * Map IRQ number to GPIO line.
  54. */
  55. int irq_to_gpio(unsigned int irq);
  56. #include <asm-generic/gpio.h>
  57. static inline int gpio_request(unsigned int pin, const char *label)
  58. {
  59. return 0;
  60. }
  61. static inline void gpio_free(unsigned int pin)
  62. {
  63. }
  64. #endif