platform-imx-dma.c 929 B

12345678910111213141516171819202122232425262728293031323334
  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(void)
  11. {
  12. return platform_device_register_resndata(&mxc_ahb_bus,
  13. "imx-dma", -1, NULL, 0, NULL, 0);
  14. }
  15. struct platform_device __init __maybe_unused *imx_add_imx_sdma(char *name,
  16. resource_size_t iobase, int irq, struct sdma_platform_data *pdata)
  17. {
  18. struct resource res[] = {
  19. {
  20. .start = iobase,
  21. .end = iobase + SZ_16K - 1,
  22. .flags = IORESOURCE_MEM,
  23. }, {
  24. .start = irq,
  25. .end = irq,
  26. .flags = IORESOURCE_IRQ,
  27. },
  28. };
  29. return platform_device_register_resndata(&mxc_ahb_bus, name,
  30. -1, res, ARRAY_SIZE(res), pdata, sizeof(*pdata));
  31. }