gpio.c 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. #include <linux/kernel.h>
  16. #include <linux/init.h>
  17. #include <asm/coldfire.h>
  18. #include <asm/mcfsim.h>
  19. #include <asm/mcfgpio.h>
  20. static struct mcf_gpio_chip mcf_gpio_chips[] = {
  21. MCFGPS(PIRQ, 0, 8, MCFEPORT_EPDDR, MCFEPORT_EPDR, MCFEPORT_EPPDR),
  22. MCFGPF(FECH, 8, 8),
  23. MCFGPF(FECL, 16, 8),
  24. MCFGPF(SSI, 24, 5),
  25. MCFGPF(BUSCTL, 32, 4),
  26. MCFGPF(BE, 40, 4),
  27. MCFGPF(CS, 49, 5),
  28. MCFGPF(PWM, 58, 4),
  29. MCFGPF(FECI2C, 64, 4),
  30. MCFGPF(UART, 72, 8),
  31. MCFGPF(QSPI, 80, 6),
  32. MCFGPF(TIMER, 88, 4),
  33. MCFGPF(LCDDATAH, 96, 2),
  34. MCFGPF(LCDDATAM, 104, 8),
  35. MCFGPF(LCDDATAL, 112, 8),
  36. MCFGPF(LCDCTLH, 120, 1),
  37. MCFGPF(LCDCTLL, 128, 8),
  38. };
  39. static int __init mcf_gpio_init(void)
  40. {
  41. unsigned i = 0;
  42. while (i < ARRAY_SIZE(mcf_gpio_chips))
  43. (void)gpiochip_add((struct gpio_chip *)&mcf_gpio_chips[i++]);
  44. return 0;
  45. }
  46. core_initcall(mcf_gpio_init);