mcfgpio.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * Coldfire generic GPIO support.
  3. *
  4. * (C) Copyright 2009, Steven King <sfking@fdwdc.com>
  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 as published by
  8. * the Free Software Foundation; version 2 of the License.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. */
  15. #ifndef mcfgpio_h
  16. #define mcfgpio_h
  17. #include <linux/io.h>
  18. #include <asm-generic/gpio.h>
  19. struct mcf_gpio_chip {
  20. struct gpio_chip gpio_chip;
  21. void __iomem *pddr;
  22. void __iomem *podr;
  23. void __iomem *ppdr;
  24. void __iomem *setr;
  25. void __iomem *clrr;
  26. const u8 *gpio_to_pinmux;
  27. };
  28. int mcf_gpio_direction_input(struct gpio_chip *, unsigned);
  29. int mcf_gpio_get_value(struct gpio_chip *, unsigned);
  30. int mcf_gpio_direction_output(struct gpio_chip *, unsigned, int);
  31. void mcf_gpio_set_value(struct gpio_chip *, unsigned, int);
  32. void mcf_gpio_set_value_fast(struct gpio_chip *, unsigned, int);
  33. int mcf_gpio_request(struct gpio_chip *, unsigned);
  34. void mcf_gpio_free(struct gpio_chip *, unsigned);
  35. #endif