aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-mxc/devices
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2010-11-04 12:07:48 -0400
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>2010-11-17 04:01:27 -0500
commitad851bffba6afd6468f96a6180cc4a14e9ebee38 (patch)
treebb42d6c8e6493cb29690f1f44abc224b338a163f /arch/arm/plat-mxc/devices
parentfc40d0191943fa995f5359b5c23aa7c3dea69d7b (diff)
ARM: imx: dynamically register imx-fb devices
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Diffstat (limited to 'arch/arm/plat-mxc/devices')
-rw-r--r--arch/arm/plat-mxc/devices/Kconfig3
-rw-r--r--arch/arm/plat-mxc/devices/Makefile1
-rw-r--r--arch/arm/plat-mxc/devices/platform-imx-fb.c46
3 files changed, 50 insertions, 0 deletions
diff --git a/arch/arm/plat-mxc/devices/Kconfig b/arch/arm/plat-mxc/devices/Kconfig
index 01b0d0cdf866..25423713b498 100644
--- a/arch/arm/plat-mxc/devices/Kconfig
+++ b/arch/arm/plat-mxc/devices/Kconfig
@@ -16,6 +16,9 @@ config IMX_HAVE_PLATFORM_GPIO_KEYS
16config IMX_HAVE_PLATFORM_IMX2_WDT 16config IMX_HAVE_PLATFORM_IMX2_WDT
17 bool 17 bool
18 18
19config IMX_HAVE_PLATFORM_IMX_FB
20 bool
21
19config IMX_HAVE_PLATFORM_IMX_I2C 22config IMX_HAVE_PLATFORM_IMX_I2C
20 bool 23 bool
21 24
diff --git a/arch/arm/plat-mxc/devices/Makefile b/arch/arm/plat-mxc/devices/Makefile
index 224f6655c75f..d3f845eea1ca 100644
--- a/arch/arm/plat-mxc/devices/Makefile
+++ b/arch/arm/plat-mxc/devices/Makefile
@@ -4,6 +4,7 @@ obj-$(CONFIG_IMX_HAVE_PLATFORM_FLEXCAN) += platform-flexcan.o
4obj-$(CONFIG_IMX_HAVE_PLATFORM_GPIO_KEYS) += platform-gpio_keys.o 4obj-$(CONFIG_IMX_HAVE_PLATFORM_GPIO_KEYS) += platform-gpio_keys.o
5obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX2_WDT) += platform-imx2-wdt.o 5obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX2_WDT) += platform-imx2-wdt.o
6obj-y += platform-imx-dma.o 6obj-y += platform-imx-dma.o
7obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_FB) += platform-imx-fb.o
7obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_I2C) += platform-imx-i2c.o 8obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_I2C) += platform-imx-i2c.o
8obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_SSI) += platform-imx-ssi.o 9obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_SSI) += platform-imx-ssi.o
9obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_UART) += platform-imx-uart.o 10obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_UART) += platform-imx-uart.o
diff --git a/arch/arm/plat-mxc/devices/platform-imx-fb.c b/arch/arm/plat-mxc/devices/platform-imx-fb.c
new file mode 100644
index 000000000000..42ed3bea0fd1
--- /dev/null
+++ b/arch/arm/plat-mxc/devices/platform-imx-fb.c
@@ -0,0 +1,46 @@
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
12#define imx_imx_fb_data_entry_single(soc) \
13 { \
14 .iobase = soc ## _LCDC_BASE_ADDR, \
15 .irq = soc ## _INT_LCDC, \
16 }
17
18#ifdef CONFIG_SOC_IMX21
19const struct imx_imx_fb_data imx21_imx_fb_data __initconst =
20 imx_imx_fb_data_entry_single(MX21);
21#endif /* ifdef CONFIG_SOC_IMX21 */
22
23#ifdef CONFIG_SOC_IMX27
24const struct imx_imx_fb_data imx27_imx_fb_data __initconst =
25 imx_imx_fb_data_entry_single(MX27);
26#endif /* ifdef CONFIG_SOC_IMX27 */
27
28struct platform_device *__init imx_add_imx_fb(
29 const struct imx_imx_fb_data *data,
30 const struct imx_fb_platform_data *pdata)
31{
32 struct resource res[] = {
33 {
34 .start = data->iobase,
35 .end = data->iobase + SZ_4K - 1,
36 .flags = IORESOURCE_MEM,
37 }, {
38 .start = data->irq,
39 .end = data->irq,
40 .flags = IORESOURCE_IRQ,
41 },
42 };
43 return imx_add_platform_device_dmamask("imx-fb", 0,
44 res, ARRAY_SIZE(res),
45 pdata, sizeof(*pdata), DMA_BIT_MASK(32));
46}