platform-imx-fb.c 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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_imx_fb_data_entry_single(soc) \
  12. { \
  13. .iobase = soc ## _LCDC_BASE_ADDR, \
  14. .irq = soc ## _INT_LCDC, \
  15. }
  16. #ifdef CONFIG_SOC_IMX21
  17. const struct imx_imx_fb_data imx21_imx_fb_data __initconst =
  18. imx_imx_fb_data_entry_single(MX21);
  19. #endif /* ifdef CONFIG_SOC_IMX21 */
  20. #ifdef CONFIG_SOC_IMX27
  21. const struct imx_imx_fb_data imx27_imx_fb_data __initconst =
  22. imx_imx_fb_data_entry_single(MX27);
  23. #endif /* ifdef CONFIG_SOC_IMX27 */
  24. struct platform_device *__init imx_add_imx_fb(
  25. const struct imx_imx_fb_data *data,
  26. const struct imx_fb_platform_data *pdata)
  27. {
  28. struct resource res[] = {
  29. {
  30. .start = data->iobase,
  31. .end = data->iobase + SZ_4K - 1,
  32. .flags = IORESOURCE_MEM,
  33. }, {
  34. .start = data->irq,
  35. .end = data->irq,
  36. .flags = IORESOURCE_IRQ,
  37. },
  38. };
  39. return imx_add_platform_device_dmamask("imx-fb", 0,
  40. res, ARRAY_SIZE(res),
  41. pdata, sizeof(*pdata), DMA_BIT_MASK(32));
  42. }