platform-mx1-camera.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 <mach/hardware.h>
  10. #include <mach/devices-common.h>
  11. #define imx_mx1_camera_data_entry_single(soc, _size) \
  12. { \
  13. .iobase = soc ## _CSI ## _BASE_ADDR, \
  14. .iosize = _size, \
  15. .irq = soc ## _INT_CSI, \
  16. }
  17. #ifdef CONFIG_SOC_IMX1
  18. const struct imx_mx1_camera_data imx1_mx1_camera_data __initconst =
  19. imx_mx1_camera_data_entry_single(MX1, 10);
  20. #endif /* ifdef CONFIG_SOC_IMX1 */
  21. struct platform_device *__init imx_add_mx1_camera(
  22. const struct imx_mx1_camera_data *data,
  23. const struct mx1_camera_pdata *pdata)
  24. {
  25. struct resource res[] = {
  26. {
  27. .start = data->iobase,
  28. .end = data->iobase + data->iosize - 1,
  29. .flags = IORESOURCE_MEM,
  30. }, {
  31. .start = data->irq,
  32. .end = data->irq,
  33. .flags = IORESOURCE_IRQ,
  34. },
  35. };
  36. return imx_add_platform_device_dmamask("mx1-camera", 0,
  37. res, ARRAY_SIZE(res),
  38. pdata, sizeof(*pdata), DMA_BIT_MASK(32));
  39. }