Merge branches 'fixes' and 'mmci' into for-linus
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / arch / arm / mach-imx / devices / platform-imx-fb.c
CommitLineData
ad851bff
UKK
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 */
b7f080cf 9#include <linux/dma-mapping.h>
50f2de61
SG
10
11#include "../hardware.h"
e0557c0d 12#include "devices-common.h"
ad851bff 13
e69dc9a9 14#define imx_imx_fb_data_entry_single(soc, _devid, _size) \
ad851bff 15 { \
e69dc9a9 16 .devid = _devid, \
ad851bff 17 .iobase = soc ## _LCDC_BASE_ADDR, \
194ee8e8 18 .iosize = _size, \
ad851bff
UKK
19 .irq = soc ## _INT_LCDC, \
20 }
21
9685a360
GGM
22#ifdef CONFIG_SOC_IMX1
23const struct imx_imx_fb_data imx1_imx_fb_data __initconst =
e69dc9a9 24 imx_imx_fb_data_entry_single(MX1, "imx1-fb", SZ_4K);
9685a360
GGM
25#endif /* ifdef CONFIG_SOC_IMX1 */
26
ad851bff
UKK
27#ifdef CONFIG_SOC_IMX21
28const struct imx_imx_fb_data imx21_imx_fb_data __initconst =
e69dc9a9 29 imx_imx_fb_data_entry_single(MX21, "imx21-fb", SZ_4K);
ad851bff
UKK
30#endif /* ifdef CONFIG_SOC_IMX21 */
31
972cc482 32#ifdef CONFIG_SOC_IMX25
194ee8e8 33const struct imx_imx_fb_data imx25_imx_fb_data __initconst =
e69dc9a9 34 imx_imx_fb_data_entry_single(MX25, "imx21-fb", SZ_16K);
972cc482 35#endif /* ifdef CONFIG_SOC_IMX25 */
194ee8e8 36
ad851bff
UKK
37#ifdef CONFIG_SOC_IMX27
38const struct imx_imx_fb_data imx27_imx_fb_data __initconst =
e69dc9a9 39 imx_imx_fb_data_entry_single(MX27, "imx21-fb", SZ_4K);
ad851bff
UKK
40#endif /* ifdef CONFIG_SOC_IMX27 */
41
42struct platform_device *__init imx_add_imx_fb(
43 const struct imx_imx_fb_data *data,
44 const struct imx_fb_platform_data *pdata)
45{
46 struct resource res[] = {
47 {
48 .start = data->iobase,
194ee8e8 49 .end = data->iobase + data->iosize - 1,
ad851bff
UKK
50 .flags = IORESOURCE_MEM,
51 }, {
52 .start = data->irq,
53 .end = data->irq,
54 .flags = IORESOURCE_IRQ,
55 },
56 };
006e792b 57 return imx_add_platform_device_dmamask(data->devid, 0,
ad851bff
UKK
58 res, ARRAY_SIZE(res),
59 pdata, sizeof(*pdata), DMA_BIT_MASK(32));
60}