platform-imx-dma.c 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * Copyright (C) 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 "devices-common.h"
  10. struct platform_device __init __maybe_unused *imx_add_imx_dma(char *name,
  11. resource_size_t iobase, int irq, int irq_err)
  12. {
  13. struct resource res[] = {
  14. {
  15. .start = iobase,
  16. .end = iobase + SZ_4K - 1,
  17. .flags = IORESOURCE_MEM,
  18. }, {
  19. .start = irq,
  20. .end = irq,
  21. .flags = IORESOURCE_IRQ,
  22. }, {
  23. .start = irq_err,
  24. .end = irq_err,
  25. .flags = IORESOURCE_IRQ,
  26. },
  27. };
  28. return platform_device_register_resndata(&mxc_ahb_bus,
  29. name, -1, res, ARRAY_SIZE(res), NULL, 0);
  30. }
  31. struct platform_device __init __maybe_unused *imx_add_imx_sdma(char *name,
  32. resource_size_t iobase, int irq, struct sdma_platform_data *pdata)
  33. {
  34. struct resource res[] = {
  35. {
  36. .start = iobase,
  37. .end = iobase + SZ_16K - 1,
  38. .flags = IORESOURCE_MEM,
  39. }, {
  40. .start = irq,
  41. .end = irq,
  42. .flags = IORESOURCE_IRQ,
  43. },
  44. };
  45. return platform_device_register_resndata(&mxc_ahb_bus, name,
  46. -1, res, ARRAY_SIZE(res), pdata, sizeof(*pdata));
  47. }