platform-spi_imx.c 786 B

123456789101112131415161718192021222324252627282930
  1. /*
  2. * Copyright (C) 2009-2010 Pengutronix
  3. * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
  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 <asm/sizes.h>
  10. #include <mach/devices-common.h>
  11. struct platform_device *__init imx_add_spi_imx(int id,
  12. resource_size_t iobase, resource_size_t iosize, int irq,
  13. const struct spi_imx_master *pdata)
  14. {
  15. struct resource res[] = {
  16. {
  17. .start = iobase,
  18. .end = iobase + iosize - 1,
  19. .flags = IORESOURCE_MEM,
  20. }, {
  21. .start = irq,
  22. .end = irq,
  23. .flags = IORESOURCE_IRQ,
  24. },
  25. };
  26. return imx_add_platform_device("spi_imx", id, res, ARRAY_SIZE(res),
  27. pdata, sizeof(*pdata));
  28. }