platform-pata_imx.c 948 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * This program is free software; you can redistribute it and/or modify it under
  3. * the terms of the GNU General Public License version 2 as published by the
  4. * Free Software Foundation.
  5. */
  6. #include <mach/hardware.h>
  7. #include <mach/devices-common.h>
  8. #define imx_pata_imx_data_entry_single(soc) \
  9. { \
  10. .iobase = soc ## _ATA_BASE_ADDR, \
  11. .irq = soc ## _MXC_INT_ATA, \
  12. }
  13. #ifdef CONFIG_SOC_IMX51
  14. const struct imx_pata_imx_data imx51_pata_imx_data __initconst =
  15. imx_pata_imx_data_entry_single(MX51);
  16. #endif /* ifdef CONFIG_SOC_IMX51 */
  17. struct platform_device *__init imx_add_pata_imx(
  18. const struct imx_pata_imx_data *data)
  19. {
  20. struct resource res[] = {
  21. {
  22. .start = data->iobase,
  23. .end = data->iobase + SZ_16K - 1,
  24. .flags = IORESOURCE_MEM,
  25. },
  26. {
  27. .start = data->irq,
  28. .end = data->irq,
  29. .flags = IORESOURCE_IRQ,
  30. },
  31. };
  32. return imx_add_platform_device("pata_imx", -1,
  33. res, ARRAY_SIZE(res), NULL, 0);
  34. }