platform-imx21-hcd.c 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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 "../hardware.h"
  10. #include "devices-common.h"
  11. #define imx_imx21_hcd_data_entry_single(soc) \
  12. { \
  13. .iobase = soc ## _USBOTG_BASE_ADDR, \
  14. .irq = soc ## _INT_USBHOST, \
  15. }
  16. #ifdef CONFIG_SOC_IMX21
  17. const struct imx_imx21_hcd_data imx21_imx21_hcd_data __initconst =
  18. imx_imx21_hcd_data_entry_single(MX21);
  19. #endif /* ifdef CONFIG_SOC_IMX21 */
  20. struct platform_device *__init imx_add_imx21_hcd(
  21. const struct imx_imx21_hcd_data *data,
  22. const struct mx21_usbh_platform_data *pdata)
  23. {
  24. struct resource res[] = {
  25. {
  26. .start = data->iobase,
  27. .end = data->iobase + SZ_8K - 1,
  28. .flags = IORESOURCE_MEM,
  29. }, {
  30. .start = data->irq,
  31. .end = data->irq,
  32. .flags = IORESOURCE_IRQ,
  33. },
  34. };
  35. return imx_add_platform_device_dmamask("imx21-hcd", 0,
  36. res, ARRAY_SIZE(res),
  37. pdata, sizeof(*pdata), DMA_BIT_MASK(32));
  38. }