platform-gpio-mxs.c 813 B

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