platform-imx-fb.c 1.6 KB

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