aboutsummaryrefslogtreecommitdiffstats
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
parentfc40d0191943fa995f5359b5c23aa7c3dea69d7b (diff)
ARM: imx: dynamically register imx-fb devices
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
-rw-r--r--arch/arm/mach-imx/Kconfig9
-rw-r--r--arch/arm/mach-imx/devices-imx21.h4
-rw-r--r--arch/arm/mach-imx/devices-imx27.h4
-rw-r--r--arch/arm/mach-imx/devices.c29
-rw-r--r--arch/arm/mach-imx/devices.h1
-rw-r--r--arch/arm/mach-imx/eukrea_mbimx27-baseboard.c5
-rw-r--r--arch/arm/mach-imx/mach-mx21ads.c5
-rw-r--r--arch/arm/mach-imx/mach-mx27ads.c5
-rw-r--r--arch/arm/mach-imx/mach-mxt_td60.c5
-rw-r--r--arch/arm/mach-imx/mach-pca100.c5
-rw-r--r--arch/arm/mach-imx/pcm970-baseboard.c6
-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
-rw-r--r--arch/arm/plat-mxc/include/mach/devices-common.h9
-rw-r--r--arch/arm/plat-mxc/include/mach/imxfb.h3
16 files changed, 90 insertions, 50 deletions
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index 6b1662c55a5d..d3e983e57594 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -71,6 +71,7 @@ comment "MX21 platforms:"
71 71
72config MACH_MX21ADS 72config MACH_MX21ADS
73 bool "MX21ADS platform" 73 bool "MX21ADS platform"
74 select IMX_HAVE_PLATFORM_IMX_FB
74 select IMX_HAVE_PLATFORM_IMX_UART 75 select IMX_HAVE_PLATFORM_IMX_UART
75 select IMX_HAVE_PLATFORM_MXC_NAND 76 select IMX_HAVE_PLATFORM_MXC_NAND
76 help 77 help
@@ -85,6 +86,7 @@ comment "MX27 platforms:"
85 86
86config MACH_MX27ADS 87config MACH_MX27ADS
87 bool "MX27ADS platform" 88 bool "MX27ADS platform"
89 select IMX_HAVE_PLATFORM_IMX_FB
88 select IMX_HAVE_PLATFORM_IMX_I2C 90 select IMX_HAVE_PLATFORM_IMX_I2C
89 select IMX_HAVE_PLATFORM_IMX_UART 91 select IMX_HAVE_PLATFORM_IMX_UART
90 select IMX_HAVE_PLATFORM_MXC_NAND 92 select IMX_HAVE_PLATFORM_MXC_NAND
@@ -112,8 +114,8 @@ choice
112 default MACH_PCM970_BASEBOARD 114 default MACH_PCM970_BASEBOARD
113 115
114config MACH_PCM970_BASEBOARD 116config MACH_PCM970_BASEBOARD
115 prompt "PHYTEC PCM970 development board" 117 bool "PHYTEC PCM970 development board"
116 bool 118 select IMX_HAVE_PLATFORM_IMX_FB
117 help 119 help
118 This adds board specific devices that can be found on Phytec's 120 This adds board specific devices that can be found on Phytec's
119 PCM970 evaluation board. 121 PCM970 evaluation board.
@@ -153,6 +155,7 @@ choice
153 155
154config MACH_EUKREA_MBIMX27_BASEBOARD 156config MACH_EUKREA_MBIMX27_BASEBOARD
155 bool "Eukrea MBIMX27 development board" 157 bool "Eukrea MBIMX27 development board"
158 select IMX_HAVE_PLATFORM_IMX_FB
156 select IMX_HAVE_PLATFORM_IMX_SSI 159 select IMX_HAVE_PLATFORM_IMX_SSI
157 select IMX_HAVE_PLATFORM_IMX_UART 160 select IMX_HAVE_PLATFORM_IMX_UART
158 select IMX_HAVE_PLATFORM_SPI_IMX 161 select IMX_HAVE_PLATFORM_SPI_IMX
@@ -188,6 +191,7 @@ config MACH_IMX27LITE
188config MACH_PCA100 191config MACH_PCA100
189 bool "Phytec phyCARD-s (pca100)" 192 bool "Phytec phyCARD-s (pca100)"
190 select IMX_HAVE_PLATFORM_IMX2_WDT 193 select IMX_HAVE_PLATFORM_IMX2_WDT
194 select IMX_HAVE_PLATFORM_IMX_FB
191 select IMX_HAVE_PLATFORM_IMX_I2C 195 select IMX_HAVE_PLATFORM_IMX_I2C
192 select IMX_HAVE_PLATFORM_IMX_SSI 196 select IMX_HAVE_PLATFORM_IMX_SSI
193 select IMX_HAVE_PLATFORM_IMX_UART 197 select IMX_HAVE_PLATFORM_IMX_UART
@@ -201,6 +205,7 @@ config MACH_PCA100
201 205
202config MACH_MXT_TD60 206config MACH_MXT_TD60
203 bool "Maxtrack i-MXT TD60" 207 bool "Maxtrack i-MXT TD60"
208 select IMX_HAVE_PLATFORM_IMX_FB
204 select IMX_HAVE_PLATFORM_IMX_I2C 209 select IMX_HAVE_PLATFORM_IMX_I2C
205 select IMX_HAVE_PLATFORM_IMX_UART 210 select IMX_HAVE_PLATFORM_IMX_UART
206 select IMX_HAVE_PLATFORM_MXC_NAND 211 select IMX_HAVE_PLATFORM_MXC_NAND
diff --git a/arch/arm/mach-imx/devices-imx21.h b/arch/arm/mach-imx/devices-imx21.h
index 738dbba6032e..0f782b6fcf88 100644
--- a/arch/arm/mach-imx/devices-imx21.h
+++ b/arch/arm/mach-imx/devices-imx21.h
@@ -13,6 +13,10 @@ extern const struct imx_imx2_wdt_data imx21_imx2_wdt_data __initconst;
13#define imx21_add_imx2_wdt(pdata) \ 13#define imx21_add_imx2_wdt(pdata) \
14 imx_add_imx2_wdt(&imx21_imx2_wdt_data) 14 imx_add_imx2_wdt(&imx21_imx2_wdt_data)
15 15
16extern const struct imx_imx_fb_data imx21_imx_fb_data __initconst;
17#define imx21_add_imx_fb(pdata) \
18 imx_add_imx_fb(&imx21_imx_fb_data, pdata)
19
16extern const struct imx_imx_i2c_data imx21_imx_i2c_data __initconst; 20extern const struct imx_imx_i2c_data imx21_imx_i2c_data __initconst;
17#define imx21_add_imx_i2c(pdata) \ 21#define imx21_add_imx_i2c(pdata) \
18 imx_add_imx_i2c(&imx21_imx_i2c_data, pdata) 22 imx_add_imx_i2c(&imx21_imx_i2c_data, pdata)
diff --git a/arch/arm/mach-imx/devices-imx27.h b/arch/arm/mach-imx/devices-imx27.h
index b2d4c5136354..6e11bef297d0 100644
--- a/arch/arm/mach-imx/devices-imx27.h
+++ b/arch/arm/mach-imx/devices-imx27.h
@@ -17,6 +17,10 @@ extern const struct imx_imx2_wdt_data imx27_imx2_wdt_data __initconst;
17#define imx27_add_imx2_wdt(pdata) \ 17#define imx27_add_imx2_wdt(pdata) \
18 imx_add_imx2_wdt(&imx27_imx2_wdt_data) 18 imx_add_imx2_wdt(&imx27_imx2_wdt_data)
19 19
20extern const struct imx_imx_fb_data imx27_imx_fb_data __initconst;
21#define imx27_add_imx_fb(pdata) \
22 imx_add_imx_fb(&imx27_imx_fb_data, pdata)
23
20extern const struct imx_imx_i2c_data imx27_imx_i2c_data[] __initconst; 24extern const struct imx_imx_i2c_data imx27_imx_i2c_data[] __initconst;
21#define imx27_add_imx_i2c(id, pdata) \ 25#define imx27_add_imx_i2c(id, pdata) \
22 imx_add_imx_i2c(&imx27_imx_i2c_data[id], pdata) 26 imx_add_imx_i2c(&imx27_imx_i2c_data[id], pdata)
diff --git a/arch/arm/mach-imx/devices.c b/arch/arm/mach-imx/devices.c
index 20655fb10a57..d78456411f3f 100644
--- a/arch/arm/mach-imx/devices.c
+++ b/arch/arm/mach-imx/devices.c
@@ -77,35 +77,6 @@ int __init imx1_register_gpios(void)
77#endif 77#endif
78 78
79#if defined(CONFIG_MACH_MX21) || defined(CONFIG_MACH_MX27) 79#if defined(CONFIG_MACH_MX21) || defined(CONFIG_MACH_MX27)
80/*
81 * lcdc:
82 * - i.MX1: the basic controller
83 * - i.MX21: to be checked
84 * - i.MX27: like i.MX1, with slightly variations
85 */
86static struct resource mxc_fb[] = {
87 {
88 .start = MX2x_LCDC_BASE_ADDR,
89 .end = MX2x_LCDC_BASE_ADDR + SZ_4K - 1,
90 .flags = IORESOURCE_MEM,
91 }, {
92 .start = MX2x_INT_LCDC,
93 .end = MX2x_INT_LCDC,
94 .flags = IORESOURCE_IRQ,
95 }
96};
97
98/* mxc lcd driver */
99struct platform_device mxc_fb_device = {
100 .name = "imx-fb",
101 .id = 0,
102 .num_resources = ARRAY_SIZE(mxc_fb),
103 .resource = mxc_fb,
104 .dev = {
105 .coherent_dma_mask = DMA_BIT_MASK(32),
106 },
107};
108
109static struct resource mxc_pwm_resources[] = { 80static struct resource mxc_pwm_resources[] = {
110 { 81 {
111 .start = MX2x_PWM_BASE_ADDR, 82 .start = MX2x_PWM_BASE_ADDR,
diff --git a/arch/arm/mach-imx/devices.h b/arch/arm/mach-imx/devices.h
index f441b0256b93..407e90aa0bc4 100644
--- a/arch/arm/mach-imx/devices.h
+++ b/arch/arm/mach-imx/devices.h
@@ -1,5 +1,4 @@
1#if defined(CONFIG_MACH_MX21) || defined(CONFIG_MACH_MX27) 1#if defined(CONFIG_MACH_MX21) || defined(CONFIG_MACH_MX27)
2extern struct platform_device mxc_fb_device;
3extern struct platform_device mxc_pwm_device; 2extern struct platform_device mxc_pwm_device;
4extern struct platform_device mxc_sdhc_device0; 3extern struct platform_device mxc_sdhc_device0;
5extern struct platform_device mxc_sdhc_device1; 4extern struct platform_device mxc_sdhc_device1;
diff --git a/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c b/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c
index 026263c665ca..a226e2540ebd 100644
--- a/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c
+++ b/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c
@@ -32,7 +32,6 @@
32 32
33#include <mach/common.h> 33#include <mach/common.h>
34#include <mach/iomux-mx27.h> 34#include <mach/iomux-mx27.h>
35#include <mach/imxfb.h>
36#include <mach/hardware.h> 35#include <mach/hardware.h>
37#include <mach/mmc.h> 36#include <mach/mmc.h>
38#include <mach/spi.h> 37#include <mach/spi.h>
@@ -196,7 +195,7 @@ static struct imx_fb_videomode eukrea_mbimx27_modes[] = {
196 }, 195 },
197}; 196};
198 197
199static struct imx_fb_platform_data eukrea_mbimx27_fb_data = { 198static const struct imx_fb_platform_data eukrea_mbimx27_fb_data __initconst = {
200 .mode = eukrea_mbimx27_modes, 199 .mode = eukrea_mbimx27_modes,
201 .num_modes = ARRAY_SIZE(eukrea_mbimx27_modes), 200 .num_modes = ARRAY_SIZE(eukrea_mbimx27_modes),
202 201
@@ -351,7 +350,7 @@ void __init eukrea_mbimx27_baseboard_init(void)
351 imx27_add_imx_uart3(&uart_pdata); 350 imx27_add_imx_uart3(&uart_pdata);
352#endif 351#endif
353 352
354 mxc_register_device(&mxc_fb_device, &eukrea_mbimx27_fb_data); 353 imx27_add_imx_fb(&eukrea_mbimx27_fb_data);
355 mxc_register_device(&mxc_sdhc_device0, &sdhc_pdata); 354 mxc_register_device(&mxc_sdhc_device0, &sdhc_pdata);
356 355
357 i2c_register_board_info(0, eukrea_mbimx27_i2c_devices, 356 i2c_register_board_info(0, eukrea_mbimx27_i2c_devices,
diff --git a/arch/arm/mach-imx/mach-mx21ads.c b/arch/arm/mach-imx/mach-mx21ads.c
index e1282e9f50ff..4820a67b8abb 100644
--- a/arch/arm/mach-imx/mach-mx21ads.c
+++ b/arch/arm/mach-imx/mach-mx21ads.c
@@ -24,7 +24,6 @@
24#include <asm/mach/arch.h> 24#include <asm/mach/arch.h>
25#include <asm/mach/time.h> 25#include <asm/mach/time.h>
26#include <asm/mach/map.h> 26#include <asm/mach/map.h>
27#include <mach/imxfb.h>
28#include <mach/iomux-mx21.h> 27#include <mach/iomux-mx21.h>
29#include <mach/mxc_nand.h> 28#include <mach/mxc_nand.h>
30#include <mach/mmc.h> 29#include <mach/mmc.h>
@@ -213,7 +212,7 @@ static struct imx_fb_videomode mx21ads_modes[] = {
213 }, 212 },
214}; 213};
215 214
216static struct imx_fb_platform_data mx21ads_fb_data = { 215static const struct imx_fb_platform_data mx21ads_fb_data __initconst = {
217 .mode = mx21ads_modes, 216 .mode = mx21ads_modes,
218 .num_modes = ARRAY_SIZE(mx21ads_modes), 217 .num_modes = ARRAY_SIZE(mx21ads_modes),
219 218
@@ -296,7 +295,7 @@ static void __init mx21ads_board_init(void)
296 imx21_add_imx_uart0(&uart_pdata_rts); 295 imx21_add_imx_uart0(&uart_pdata_rts);
297 imx21_add_imx_uart2(&uart_pdata_norts); 296 imx21_add_imx_uart2(&uart_pdata_norts);
298 imx21_add_imx_uart3(&uart_pdata_rts); 297 imx21_add_imx_uart3(&uart_pdata_rts);
299 mxc_register_device(&mxc_fb_device, &mx21ads_fb_data); 298 imx21_add_imx_fb(&mx21ads_fb_data);
300 mxc_register_device(&mxc_sdhc_device0, &mx21ads_sdhc_pdata); 299 mxc_register_device(&mxc_sdhc_device0, &mx21ads_sdhc_pdata);
301 imx21_add_mxc_nand(&mx21ads_nand_board_info); 300 imx21_add_mxc_nand(&mx21ads_nand_board_info);
302 301
diff --git a/arch/arm/mach-imx/mach-mx27ads.c b/arch/arm/mach-imx/mach-mx27ads.c
index 219899a5c8ab..d97b25bffe7b 100644
--- a/arch/arm/mach-imx/mach-mx27ads.c
+++ b/arch/arm/mach-imx/mach-mx27ads.c
@@ -30,7 +30,6 @@
30#include <mach/gpio.h> 30#include <mach/gpio.h>
31#include <mach/iomux-mx27.h> 31#include <mach/iomux-mx27.h>
32#include <mach/mxc_nand.h> 32#include <mach/mxc_nand.h>
33#include <mach/imxfb.h>
34#include <mach/mmc.h> 33#include <mach/mmc.h>
35 34
36#include "devices-imx27.h" 35#include "devices-imx27.h"
@@ -228,7 +227,7 @@ static struct imx_fb_videomode mx27ads_modes[] = {
228 }, 227 },
229}; 228};
230 229
231static struct imx_fb_platform_data mx27ads_fb_data = { 230static const struct imx_fb_platform_data mx27ads_fb_data __initconst = {
232 .mode = mx27ads_modes, 231 .mode = mx27ads_modes,
233 .num_modes = ARRAY_SIZE(mx27ads_modes), 232 .num_modes = ARRAY_SIZE(mx27ads_modes),
234 233
@@ -307,7 +306,7 @@ static void __init mx27ads_board_init(void)
307 i2c_register_board_info(1, mx27ads_i2c_devices, 306 i2c_register_board_info(1, mx27ads_i2c_devices,
308 ARRAY_SIZE(mx27ads_i2c_devices)); 307 ARRAY_SIZE(mx27ads_i2c_devices));
309 imx27_add_imx_i2c(1, &mx27ads_i2c1_data); 308 imx27_add_imx_i2c(1, &mx27ads_i2c1_data);
310 mxc_register_device(&mxc_fb_device, &mx27ads_fb_data); 309 imx27_add_imx_fb(&mx27ads_fb_data);
311 mxc_register_device(&mxc_sdhc_device0, &sdhc1_pdata); 310 mxc_register_device(&mxc_sdhc_device0, &sdhc1_pdata);
312 mxc_register_device(&mxc_sdhc_device1, &sdhc2_pdata); 311 mxc_register_device(&mxc_sdhc_device1, &sdhc2_pdata);
313 312
diff --git a/arch/arm/mach-imx/mach-mxt_td60.c b/arch/arm/mach-imx/mach-mxt_td60.c
index 38d3a4ae17c7..0c944858e884 100644
--- a/arch/arm/mach-imx/mach-mxt_td60.c
+++ b/arch/arm/mach-imx/mach-mxt_td60.c
@@ -31,7 +31,6 @@
31#include <mach/iomux-mx27.h> 31#include <mach/iomux-mx27.h>
32#include <mach/mxc_nand.h> 32#include <mach/mxc_nand.h>
33#include <linux/i2c/pca953x.h> 33#include <linux/i2c/pca953x.h>
34#include <mach/imxfb.h>
35#include <mach/mmc.h> 34#include <mach/mmc.h>
36 35
37#include "devices-imx27.h" 36#include "devices-imx27.h"
@@ -196,7 +195,7 @@ static struct imx_fb_videomode mxt_td60_modes[] = {
196 }, 195 },
197}; 196};
198 197
199static struct imx_fb_platform_data mxt_td60_fb_data = { 198static const struct imx_fb_platform_data mxt_td60_fb_data __initconst = {
200 .mode = mxt_td60_modes, 199 .mode = mxt_td60_modes,
201 .num_modes = ARRAY_SIZE(mxt_td60_modes), 200 .num_modes = ARRAY_SIZE(mxt_td60_modes),
202 201
@@ -253,7 +252,7 @@ static void __init mxt_td60_board_init(void)
253 252
254 imx27_add_imx_i2c(0, &mxt_td60_i2c0_data); 253 imx27_add_imx_i2c(0, &mxt_td60_i2c0_data);
255 imx27_add_imx_i2c(1, &mxt_td60_i2c1_data); 254 imx27_add_imx_i2c(1, &mxt_td60_i2c1_data);
256 mxc_register_device(&mxc_fb_device, &mxt_td60_fb_data); 255 imx27_add_imx_fb(&mxt_td60_fb_data);
257 mxc_register_device(&mxc_sdhc_device0, &sdhc1_pdata); 256 mxc_register_device(&mxc_sdhc_device0, &sdhc1_pdata);
258 imx27_add_fec(NULL); 257 imx27_add_fec(NULL);
259} 258}
diff --git a/arch/arm/mach-imx/mach-pca100.c b/arch/arm/mach-imx/mach-pca100.c
index 11da9c226e90..30490c37190e 100644
--- a/arch/arm/mach-imx/mach-pca100.c
+++ b/arch/arm/mach-imx/mach-pca100.c
@@ -43,7 +43,6 @@
43#include <mach/mmc.h> 43#include <mach/mmc.h>
44#include <mach/mxc_ehci.h> 44#include <mach/mxc_ehci.h>
45#include <mach/ulpi.h> 45#include <mach/ulpi.h>
46#include <mach/imxfb.h>
47 46
48#include "devices-imx27.h" 47#include "devices-imx27.h"
49#include "devices.h" 48#include "devices.h"
@@ -350,7 +349,7 @@ static struct imx_fb_videomode pca100_fb_modes[] = {
350 }, 349 },
351}; 350};
352 351
353static struct imx_fb_platform_data pca100_fb_data = { 352static const struct imx_fb_platform_data pca100_fb_data __initconst = {
354 .mode = pca100_fb_modes, 353 .mode = pca100_fb_modes,
355 .num_modes = ARRAY_SIZE(pca100_fb_modes), 354 .num_modes = ARRAY_SIZE(pca100_fb_modes),
356 355
@@ -425,7 +424,7 @@ static void __init pca100_init(void)
425 mxc_register_device(&mxc_otg_udc_device, &otg_device_pdata); 424 mxc_register_device(&mxc_otg_udc_device, &otg_device_pdata);
426 } 425 }
427 426
428 mxc_register_device(&mxc_fb_device, &pca100_fb_data); 427 imx27_add_imx_fb(&pca100_fb_data);
429 428
430 imx27_add_fec(NULL); 429 imx27_add_fec(NULL);
431 imx27_add_imx2_wdt(NULL); 430 imx27_add_imx2_wdt(NULL);
diff --git a/arch/arm/mach-imx/pcm970-baseboard.c b/arch/arm/mach-imx/pcm970-baseboard.c
index 9110d9cca7a2..9cf94607034e 100644
--- a/arch/arm/mach-imx/pcm970-baseboard.c
+++ b/arch/arm/mach-imx/pcm970-baseboard.c
@@ -25,10 +25,10 @@
25 25
26#include <mach/common.h> 26#include <mach/common.h>
27#include <mach/iomux-mx27.h> 27#include <mach/iomux-mx27.h>
28#include <mach/imxfb.h>
29#include <mach/hardware.h> 28#include <mach/hardware.h>
30#include <mach/mmc.h> 29#include <mach/mmc.h>
31 30
31#include "devices-imx27.h"
32#include "devices.h" 32#include "devices.h"
33 33
34static const int pcm970_pins[] __initconst = { 34static const int pcm970_pins[] __initconst = {
@@ -179,7 +179,7 @@ static struct imx_fb_videomode pcm970_modes[] = {
179 }, 179 },
180}; 180};
181 181
182static struct imx_fb_platform_data pcm038_fb_data = { 182static const struct imx_fb_platform_data pcm038_fb_data __initconst = {
183 .mode = pcm970_modes, 183 .mode = pcm970_modes,
184 .num_modes = ARRAY_SIZE(pcm970_modes), 184 .num_modes = ARRAY_SIZE(pcm970_modes),
185 185
@@ -226,7 +226,7 @@ void __init pcm970_baseboard_init(void)
226 mxc_gpio_setup_multiple_pins(pcm970_pins, ARRAY_SIZE(pcm970_pins), 226 mxc_gpio_setup_multiple_pins(pcm970_pins, ARRAY_SIZE(pcm970_pins),
227 "PCM970"); 227 "PCM970");
228 228
229 mxc_register_device(&mxc_fb_device, &pcm038_fb_data); 229 imx27_add_imx_fb(&pcm038_fb_data);
230 mxc_gpio_mode(GPIO_PORTC | 28 | GPIO_GPIO | GPIO_IN); 230 mxc_gpio_mode(GPIO_PORTC | 28 | GPIO_GPIO | GPIO_IN);
231 mxc_register_device(&mxc_sdhc_device1, &sdhc_pdata); 231 mxc_register_device(&mxc_sdhc_device1, &sdhc_pdata);
232 platform_device_register(&pcm970_sja1000); 232 platform_device_register(&pcm970_sja1000);
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}
diff --git a/arch/arm/plat-mxc/include/mach/devices-common.h b/arch/arm/plat-mxc/include/mach/devices-common.h
index 830369ea80d0..b1d765634860 100644
--- a/arch/arm/plat-mxc/include/mach/devices-common.h
+++ b/arch/arm/plat-mxc/include/mach/devices-common.h
@@ -54,6 +54,15 @@ struct imx_imx2_wdt_data {
54struct platform_device *__init imx_add_imx2_wdt( 54struct platform_device *__init imx_add_imx2_wdt(
55 const struct imx_imx2_wdt_data *data); 55 const struct imx_imx2_wdt_data *data);
56 56
57#include <mach/imxfb.h>
58struct imx_imx_fb_data {
59 resource_size_t iobase;
60 resource_size_t irq;
61};
62struct platform_device *__init imx_add_imx_fb(
63 const struct imx_imx_fb_data *data,
64 const struct imx_fb_platform_data *pdata);
65
57#include <mach/i2c.h> 66#include <mach/i2c.h>
58struct imx_imx_i2c_data { 67struct imx_imx_i2c_data {
59 int id; 68 int id;
diff --git a/arch/arm/plat-mxc/include/mach/imxfb.h b/arch/arm/plat-mxc/include/mach/imxfb.h
index 5263506b7ddf..9de8f062ad5d 100644
--- a/arch/arm/plat-mxc/include/mach/imxfb.h
+++ b/arch/arm/plat-mxc/include/mach/imxfb.h
@@ -1,6 +1,8 @@
1/* 1/*
2 * This structure describes the machine which we are running on. 2 * This structure describes the machine which we are running on.
3 */ 3 */
4#ifndef __MACH_IMXFB_H__
5#define __MACH_IMXFB_H__
4 6
5#include <linux/fb.h> 7#include <linux/fb.h>
6 8
@@ -79,3 +81,4 @@ struct imx_fb_platform_data {
79}; 81};
80 82
81void set_imx_fb_info(struct imx_fb_platform_data *); 83void set_imx_fb_info(struct imx_fb_platform_data *);
84#endif /* ifndef __MACH_IMXFB_H__ */