platform-gpio-mxc.c 844 B

1234567891011121314151617181920212223242526272829303132
  1. /*
  2. * Copyright 2011 Freescale Semiconductor, Inc. All Rights Reserved.
  3. * Copyright 2011 Linaro Limited
  4. *
  5. * This program is free software; you can redistribute it and/or modify it under
  6. * the terms of the GNU General Public License version 2 as published by the
  7. * Free Software Foundation.
  8. */
  9. #include <mach/devices-common.h>
  10. struct platform_device *__init mxc_register_gpio(char *name, int id,
  11. resource_size_t iobase, resource_size_t iosize, int irq, int irq_high)
  12. {
  13. struct resource res[] = {
  14. {
  15. .start = iobase,
  16. .end = iobase + iosize - 1,
  17. .flags = IORESOURCE_MEM,
  18. }, {
  19. .start = irq,
  20. .end = irq,
  21. .flags = IORESOURCE_IRQ,
  22. }, {
  23. .start = irq_high,
  24. .end = irq_high,
  25. .flags = IORESOURCE_IRQ,
  26. },
  27. };
  28. return platform_device_register_resndata(&mxc_aips_bus,
  29. name, id, res, ARRAY_SIZE(res), NULL, 0);
  30. }