blob: 6100a7d824dd0ad7e7881f921e44d5b5b5f0964f [file] [log] [blame]
Uwe Kleine-Königad851bf2010-11-04 17:07:48 +01001/*
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
Uwe Kleine-König194ee8e2010-11-11 15:32:21 +010012#define imx_imx_fb_data_entry_single(soc, _size) \
Uwe Kleine-Königad851bf2010-11-04 17:07:48 +010013 { \
14 .iobase = soc ## _LCDC_BASE_ADDR, \
Uwe Kleine-König194ee8e2010-11-11 15:32:21 +010015 .iosize = _size, \
Uwe Kleine-Königad851bf2010-11-04 17:07:48 +010016 .irq = soc ## _INT_LCDC, \
17 }
18
19#ifdef CONFIG_SOC_IMX21
20const struct imx_imx_fb_data imx21_imx_fb_data __initconst =
Uwe Kleine-König194ee8e2010-11-11 15:32:21 +010021 imx_imx_fb_data_entry_single(MX21, SZ_4K);
Uwe Kleine-Königad851bf2010-11-04 17:07:48 +010022#endif /* ifdef CONFIG_SOC_IMX21 */
23
Uwe Kleine-König972cc482010-11-11 18:35:01 +010024#ifdef CONFIG_SOC_IMX25
Uwe Kleine-König194ee8e2010-11-11 15:32:21 +010025const struct imx_imx_fb_data imx25_imx_fb_data __initconst =
26 imx_imx_fb_data_entry_single(MX25, SZ_16K);
Uwe Kleine-König972cc482010-11-11 18:35:01 +010027#endif /* ifdef CONFIG_SOC_IMX25 */
Uwe Kleine-König194ee8e2010-11-11 15:32:21 +010028
Uwe Kleine-Königad851bf2010-11-04 17:07:48 +010029#ifdef CONFIG_SOC_IMX27
30const struct imx_imx_fb_data imx27_imx_fb_data __initconst =
Uwe Kleine-König194ee8e2010-11-11 15:32:21 +010031 imx_imx_fb_data_entry_single(MX27, SZ_4K);
Uwe Kleine-Königad851bf2010-11-04 17:07:48 +010032#endif /* ifdef CONFIG_SOC_IMX27 */
33
34struct platform_device *__init imx_add_imx_fb(
35 const struct imx_imx_fb_data *data,
36 const struct imx_fb_platform_data *pdata)
37{
38 struct resource res[] = {
39 {
40 .start = data->iobase,
Uwe Kleine-König194ee8e2010-11-11 15:32:21 +010041 .end = data->iobase + data->iosize - 1,
Uwe Kleine-Königad851bf2010-11-04 17:07:48 +010042 .flags = IORESOURCE_MEM,
43 }, {
44 .start = data->irq,
45 .end = data->irq,
46 .flags = IORESOURCE_IRQ,
47 },
48 };
49 return imx_add_platform_device_dmamask("imx-fb", 0,
50 res, ARRAY_SIZE(res),
51 pdata, sizeof(*pdata), DMA_BIT_MASK(32));
52}