aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-03-22 23:43:40 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-03-22 23:43:40 -0400
commit437538267b672f9320833907f1b5acbb2605f4be (patch)
treed10173b35a5b86bc037bb2ece1b406d5575a2094 /arch
parent9586c959bfc917695893bef0102433a7d0675691 (diff)
parent6bff98b455cf3e666fd0e3d0d908eba874de0eee (diff)
Merge tag 'fbdev-updates-for-3.4' of git://github.com/schandinat/linux-2.6
Pull fbdev updates for 3.4 from Florian Tobias Schandinat: - drivers for Samsung Exynos MIPI DSI and display port - i740fb to support those old Intel chips - large updates to OMAP, viafb and sh_mobile_lcdcfb - some updates to s3c-fb and udlfb, few patches to others Fix up conflicts in drivers/video/udlfb.c due to Key Sievers' fix making it in twice. * tag 'fbdev-updates-for-3.4' of git://github.com/schandinat/linux-2.6: (156 commits) Revert "video:uvesafb: Fix oops that uvesafb try to execute NX-protected page" OMAPDSS: register dss drivers in module init video: pxafb: add clk_prepare/clk_unprepare calls fbdev: bfin_adv7393fb: Drop needless include fbdev: sh_mipi_dsi: add extra phyctrl for sh_mipi_dsi_info fbdev: remove dependency of FB_SH_MOBILE_MERAM from FB_SH_MOBILE_LCDC Revert "MAINTAINERS: add entry for exynos mipi display drivers" fbdev: da8xx: add support for SP10Q010 display fbdev: da8xx:: fix reporting of the display timing info drivers/video/pvr2fb.c: ensure arguments to request_irq and free_irq are compatible OMAPDSS: APPLY: fix clearing shadow dirty flag with manual update fbdev: sh_mobile_meram: Implement system suspend/resume fbdev: sh_mobile_meram: Remove unneeded sanity checks fbdev: sh_mobile_meram: Don't perform update in register operation arm: mach-shmobile: Constify sh_mobile_meram_cfg structures fbdev: sh_mobile_lcdc: Don't store copy of platform data fbdev: sh_mobile_meram: Remove unused sh_mobile_meram_icb_cfg fields arm: mach-shmobile: Don't set MERAM ICB numbers in platform data fbdev: sh_mobile_meram: Allocate ICBs automatically fbdev: sh_mobile_meram: Use genalloc to manage MERAM allocation ...
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-omap1/board-ams-delta.c9
-rw-r--r--arch/arm/mach-omap1/board-fsample.c15
-rw-r--r--arch/arm/mach-omap1/board-h2.c15
-rw-r--r--arch/arm/mach-omap1/board-h3.c9
-rw-r--r--arch/arm/mach-omap1/board-htcherald.c9
-rw-r--r--arch/arm/mach-omap1/board-innovator.c11
-rw-r--r--arch/arm/mach-omap1/board-nokia770.c19
-rw-r--r--arch/arm/mach-omap1/board-osk.c14
-rw-r--r--arch/arm/mach-omap1/board-palmte.c10
-rw-r--r--arch/arm/mach-omap1/board-palmtt.c10
-rw-r--r--arch/arm/mach-omap1/board-palmz71.c10
-rw-r--r--arch/arm/mach-omap1/board-perseus2.c15
-rw-r--r--arch/arm/mach-omap1/board-sx1.c16
-rw-r--r--arch/arm/mach-omap2/io.c1
-rw-r--r--arch/arm/mach-shmobile/board-ag5evm.c24
-rw-r--r--arch/arm/mach-shmobile/board-ap4evb.c302
-rw-r--r--arch/arm/mach-shmobile/board-bonito.c6
-rw-r--r--arch/arm/mach-shmobile/board-mackerel.c106
-rw-r--r--arch/arm/plat-omap/common.c2
-rw-r--r--arch/arm/plat-omap/fb.c334
-rw-r--r--arch/arm/plat-omap/fb.h10
-rw-r--r--arch/arm/plat-omap/include/plat/blizzard.h12
-rw-r--r--arch/arm/plat-omap/include/plat/board.h2
-rw-r--r--arch/arm/plat-omap/include/plat/hwa742.h8
-rw-r--r--arch/arm/plat-omap/include/plat/vram.h21
-rw-r--r--arch/arm/plat-samsung/include/plat/regs-fb.h33
-rw-r--r--arch/sh/boards/mach-ap325rxa/setup.c22
-rw-r--r--arch/sh/boards/mach-ecovec24/setup.c20
-rw-r--r--arch/sh/boards/mach-kfr2r09/lcd_wqvga.c10
-rw-r--r--arch/sh/boards/mach-kfr2r09/setup.c8
-rw-r--r--arch/sh/boards/mach-migor/lcd_qvga.c3
-rw-r--r--arch/sh/boards/mach-migor/setup.c16
-rw-r--r--arch/sh/boards/mach-se/7724/setup.c12
-rw-r--r--arch/sh/include/mach-kfr2r09/mach/kfr2r09.h16
-rw-r--r--arch/sh/include/mach-migor/mach/migor.h2
35 files changed, 343 insertions, 789 deletions
diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c
index 88909cc0b254..e0e8245f3c9f 100644
--- a/arch/arm/mach-omap1/board-ams-delta.c
+++ b/arch/arm/mach-omap1/board-ams-delta.c
@@ -20,6 +20,7 @@
20#include <linux/platform_device.h> 20#include <linux/platform_device.h>
21#include <linux/serial_8250.h> 21#include <linux/serial_8250.h>
22#include <linux/export.h> 22#include <linux/export.h>
23#include <linux/omapfb.h>
23 24
24#include <media/soc_camera.h> 25#include <media/soc_camera.h>
25 26
@@ -169,10 +170,6 @@ static struct omap_usb_config ams_delta_usb_config __initdata = {
169 .pins[0] = 2, 170 .pins[0] = 2,
170}; 171};
171 172
172static struct omap_board_config_kernel ams_delta_config[] __initdata = {
173 { OMAP_TAG_LCD, &ams_delta_lcd_config },
174};
175
176static struct resource ams_delta_nand_resources[] = { 173static struct resource ams_delta_nand_resources[] = {
177 [0] = { 174 [0] = {
178 .start = OMAP1_MPUIO_BASE, 175 .start = OMAP1_MPUIO_BASE,
@@ -302,8 +299,6 @@ static void __init ams_delta_init(void)
302 omap_cfg_reg(J19_1610_CAM_D6); 299 omap_cfg_reg(J19_1610_CAM_D6);
303 omap_cfg_reg(J18_1610_CAM_D7); 300 omap_cfg_reg(J18_1610_CAM_D7);
304 301
305 omap_board_config = ams_delta_config;
306 omap_board_config_size = ARRAY_SIZE(ams_delta_config);
307 omap_serial_init(); 302 omap_serial_init();
308 omap_register_i2c_bus(1, 100, NULL, 0); 303 omap_register_i2c_bus(1, 100, NULL, 0);
309 304
@@ -321,6 +316,8 @@ static void __init ams_delta_init(void)
321 ams_delta_init_fiq(); 316 ams_delta_init_fiq();
322 317
323 omap_writew(omap_readw(ARM_RSTCT1) | 0x0004, ARM_RSTCT1); 318 omap_writew(omap_readw(ARM_RSTCT1) | 0x0004, ARM_RSTCT1);
319
320 omapfb_set_lcd_config(&ams_delta_lcd_config);
324} 321}
325 322
326static struct plat_serial8250_port ams_delta_modem_ports[] = { 323static struct plat_serial8250_port ams_delta_modem_ports[] = {
diff --git a/arch/arm/mach-omap1/board-fsample.c b/arch/arm/mach-omap1/board-fsample.c
index 0b9464b41212..7afaf3c5bdc6 100644
--- a/arch/arm/mach-omap1/board-fsample.c
+++ b/arch/arm/mach-omap1/board-fsample.c
@@ -21,6 +21,7 @@
21#include <linux/mtd/physmap.h> 21#include <linux/mtd/physmap.h>
22#include <linux/input.h> 22#include <linux/input.h>
23#include <linux/smc91x.h> 23#include <linux/smc91x.h>
24#include <linux/omapfb.h>
24 25
25#include <mach/hardware.h> 26#include <mach/hardware.h>
26#include <asm/mach-types.h> 27#include <asm/mach-types.h>
@@ -273,27 +274,17 @@ static struct platform_device kp_device = {
273 .resource = kp_resources, 274 .resource = kp_resources,
274}; 275};
275 276
276static struct platform_device lcd_device = {
277 .name = "lcd_p2",
278 .id = -1,
279};
280
281static struct platform_device *devices[] __initdata = { 277static struct platform_device *devices[] __initdata = {
282 &nor_device, 278 &nor_device,
283 &nand_device, 279 &nand_device,
284 &smc91x_device, 280 &smc91x_device,
285 &kp_device, 281 &kp_device,
286 &lcd_device,
287}; 282};
288 283
289static struct omap_lcd_config fsample_lcd_config = { 284static struct omap_lcd_config fsample_lcd_config = {
290 .ctrl_name = "internal", 285 .ctrl_name = "internal",
291}; 286};
292 287
293static struct omap_board_config_kernel fsample_config[] __initdata = {
294 { OMAP_TAG_LCD, &fsample_lcd_config },
295};
296
297static void __init omap_fsample_init(void) 288static void __init omap_fsample_init(void)
298{ 289{
299 /* Early, board-dependent init */ 290 /* Early, board-dependent init */
@@ -352,10 +343,10 @@ static void __init omap_fsample_init(void)
352 343
353 platform_add_devices(devices, ARRAY_SIZE(devices)); 344 platform_add_devices(devices, ARRAY_SIZE(devices));
354 345
355 omap_board_config = fsample_config;
356 omap_board_config_size = ARRAY_SIZE(fsample_config);
357 omap_serial_init(); 346 omap_serial_init();
358 omap_register_i2c_bus(1, 100, NULL, 0); 347 omap_register_i2c_bus(1, 100, NULL, 0);
348
349 omapfb_set_lcd_config(&fsample_lcd_config);
359} 350}
360 351
361/* Only FPGA needs to be mapped here. All others are done with ioremap */ 352/* Only FPGA needs to be mapped here. All others are done with ioremap */
diff --git a/arch/arm/mach-omap1/board-h2.c b/arch/arm/mach-omap1/board-h2.c
index 00ad6b22d60a..af2be8c12c07 100644
--- a/arch/arm/mach-omap1/board-h2.c
+++ b/arch/arm/mach-omap1/board-h2.c
@@ -30,6 +30,7 @@
30#include <linux/input.h> 30#include <linux/input.h>
31#include <linux/i2c/tps65010.h> 31#include <linux/i2c/tps65010.h>
32#include <linux/smc91x.h> 32#include <linux/smc91x.h>
33#include <linux/omapfb.h>
33 34
34#include <mach/hardware.h> 35#include <mach/hardware.h>
35 36
@@ -325,18 +326,12 @@ static struct platform_device h2_irda_device = {
325 .resource = h2_irda_resources, 326 .resource = h2_irda_resources,
326}; 327};
327 328
328static struct platform_device h2_lcd_device = {
329 .name = "lcd_h2",
330 .id = -1,
331};
332
333static struct platform_device *h2_devices[] __initdata = { 329static struct platform_device *h2_devices[] __initdata = {
334 &h2_nor_device, 330 &h2_nor_device,
335 &h2_nand_device, 331 &h2_nand_device,
336 &h2_smc91x_device, 332 &h2_smc91x_device,
337 &h2_irda_device, 333 &h2_irda_device,
338 &h2_kp_device, 334 &h2_kp_device,
339 &h2_lcd_device,
340}; 335};
341 336
342static void __init h2_init_smc91x(void) 337static void __init h2_init_smc91x(void)
@@ -391,10 +386,6 @@ static struct omap_lcd_config h2_lcd_config __initdata = {
391 .ctrl_name = "internal", 386 .ctrl_name = "internal",
392}; 387};
393 388
394static struct omap_board_config_kernel h2_config[] __initdata = {
395 { OMAP_TAG_LCD, &h2_lcd_config },
396};
397
398static void __init h2_init(void) 389static void __init h2_init(void)
399{ 390{
400 h2_init_smc91x(); 391 h2_init_smc91x();
@@ -438,13 +429,13 @@ static void __init h2_init(void)
438 omap_cfg_reg(N19_1610_KBR5); 429 omap_cfg_reg(N19_1610_KBR5);
439 430
440 platform_add_devices(h2_devices, ARRAY_SIZE(h2_devices)); 431 platform_add_devices(h2_devices, ARRAY_SIZE(h2_devices));
441 omap_board_config = h2_config;
442 omap_board_config_size = ARRAY_SIZE(h2_config);
443 omap_serial_init(); 432 omap_serial_init();
444 omap_register_i2c_bus(1, 100, h2_i2c_board_info, 433 omap_register_i2c_bus(1, 100, h2_i2c_board_info,
445 ARRAY_SIZE(h2_i2c_board_info)); 434 ARRAY_SIZE(h2_i2c_board_info));
446 omap1_usb_init(&h2_usb_config); 435 omap1_usb_init(&h2_usb_config);
447 h2_mmc_init(); 436 h2_mmc_init();
437
438 omapfb_set_lcd_config(&h2_lcd_config);
448} 439}
449 440
450MACHINE_START(OMAP_H2, "TI-H2") 441MACHINE_START(OMAP_H2, "TI-H2")
diff --git a/arch/arm/mach-omap1/board-h3.c b/arch/arm/mach-omap1/board-h3.c
index 4a7f25149703..7cfd25b90735 100644
--- a/arch/arm/mach-omap1/board-h3.c
+++ b/arch/arm/mach-omap1/board-h3.c
@@ -30,6 +30,7 @@
30#include <linux/spi/spi.h> 30#include <linux/spi/spi.h>
31#include <linux/i2c/tps65010.h> 31#include <linux/i2c/tps65010.h>
32#include <linux/smc91x.h> 32#include <linux/smc91x.h>
33#include <linux/omapfb.h>
33 34
34#include <asm/setup.h> 35#include <asm/setup.h>
35#include <asm/page.h> 36#include <asm/page.h>
@@ -370,10 +371,6 @@ static struct omap_lcd_config h3_lcd_config __initdata = {
370 .ctrl_name = "internal", 371 .ctrl_name = "internal",
371}; 372};
372 373
373static struct omap_board_config_kernel h3_config[] __initdata = {
374 { OMAP_TAG_LCD, &h3_lcd_config },
375};
376
377static struct i2c_board_info __initdata h3_i2c_board_info[] = { 374static struct i2c_board_info __initdata h3_i2c_board_info[] = {
378 { 375 {
379 I2C_BOARD_INFO("tps65013", 0x48), 376 I2C_BOARD_INFO("tps65013", 0x48),
@@ -426,13 +423,13 @@ static void __init h3_init(void)
426 platform_add_devices(devices, ARRAY_SIZE(devices)); 423 platform_add_devices(devices, ARRAY_SIZE(devices));
427 spi_register_board_info(h3_spi_board_info, 424 spi_register_board_info(h3_spi_board_info,
428 ARRAY_SIZE(h3_spi_board_info)); 425 ARRAY_SIZE(h3_spi_board_info));
429 omap_board_config = h3_config;
430 omap_board_config_size = ARRAY_SIZE(h3_config);
431 omap_serial_init(); 426 omap_serial_init();
432 omap_register_i2c_bus(1, 100, h3_i2c_board_info, 427 omap_register_i2c_bus(1, 100, h3_i2c_board_info,
433 ARRAY_SIZE(h3_i2c_board_info)); 428 ARRAY_SIZE(h3_i2c_board_info));
434 omap1_usb_init(&h3_usb_config); 429 omap1_usb_init(&h3_usb_config);
435 h3_mmc_init(); 430 h3_mmc_init();
431
432 omapfb_set_lcd_config(&h3_lcd_config);
436} 433}
437 434
438MACHINE_START(OMAP_H3, "TI OMAP1710 H3 board") 435MACHINE_START(OMAP_H3, "TI OMAP1710 H3 board")
diff --git a/arch/arm/mach-omap1/board-htcherald.c b/arch/arm/mach-omap1/board-htcherald.c
index 731cc3db7ab3..af2afcf24f75 100644
--- a/arch/arm/mach-omap1/board-htcherald.c
+++ b/arch/arm/mach-omap1/board-htcherald.c
@@ -36,6 +36,7 @@
36#include <linux/leds.h> 36#include <linux/leds.h>
37#include <linux/spi/spi.h> 37#include <linux/spi/spi.h>
38#include <linux/spi/ads7846.h> 38#include <linux/spi/ads7846.h>
39#include <linux/omapfb.h>
39 40
40#include <asm/mach-types.h> 41#include <asm/mach-types.h>
41#include <asm/mach/arch.h> 42#include <asm/mach/arch.h>
@@ -398,10 +399,6 @@ static struct omap_lcd_config htcherald_lcd_config __initdata = {
398 .ctrl_name = "internal", 399 .ctrl_name = "internal",
399}; 400};
400 401
401static struct omap_board_config_kernel htcherald_config[] __initdata = {
402 { OMAP_TAG_LCD, &htcherald_lcd_config },
403};
404
405static struct platform_device lcd_device = { 402static struct platform_device lcd_device = {
406 .name = "lcd_htcherald", 403 .name = "lcd_htcherald",
407 .id = -1, 404 .id = -1,
@@ -580,8 +577,6 @@ static void __init htcherald_init(void)
580 printk(KERN_INFO "HTC Herald init.\n"); 577 printk(KERN_INFO "HTC Herald init.\n");
581 578
582 /* Do board initialization before we register all the devices */ 579 /* Do board initialization before we register all the devices */
583 omap_board_config = htcherald_config;
584 omap_board_config_size = ARRAY_SIZE(htcherald_config);
585 platform_add_devices(devices, ARRAY_SIZE(devices)); 580 platform_add_devices(devices, ARRAY_SIZE(devices));
586 581
587 htcherald_disable_watchdog(); 582 htcherald_disable_watchdog();
@@ -598,6 +593,8 @@ static void __init htcherald_init(void)
598 htc_mmc_data[0] = &htc_mmc1_data; 593 htc_mmc_data[0] = &htc_mmc1_data;
599 omap1_init_mmc(htc_mmc_data, 1); 594 omap1_init_mmc(htc_mmc_data, 1);
600#endif 595#endif
596
597 omapfb_set_lcd_config(&htcherald_lcd_config);
601} 598}
602 599
603MACHINE_START(HERALD, "HTC Herald") 600MACHINE_START(HERALD, "HTC Herald")
diff --git a/arch/arm/mach-omap1/board-innovator.c b/arch/arm/mach-omap1/board-innovator.c
index be2002f42dea..1d5ab6606b9f 100644
--- a/arch/arm/mach-omap1/board-innovator.c
+++ b/arch/arm/mach-omap1/board-innovator.c
@@ -25,6 +25,7 @@
25#include <linux/mtd/physmap.h> 25#include <linux/mtd/physmap.h>
26#include <linux/input.h> 26#include <linux/input.h>
27#include <linux/smc91x.h> 27#include <linux/smc91x.h>
28#include <linux/omapfb.h>
28 29
29#include <mach/hardware.h> 30#include <mach/hardware.h>
30#include <asm/mach-types.h> 31#include <asm/mach-types.h>
@@ -370,10 +371,6 @@ static inline void innovator_mmc_init(void)
370} 371}
371#endif 372#endif
372 373
373static struct omap_board_config_kernel innovator_config[] = {
374 { OMAP_TAG_LCD, NULL },
375};
376
377static void __init innovator_init(void) 374static void __init innovator_init(void)
378{ 375{
379 if (cpu_is_omap1510()) 376 if (cpu_is_omap1510())
@@ -416,17 +413,15 @@ static void __init innovator_init(void)
416#ifdef CONFIG_ARCH_OMAP15XX 413#ifdef CONFIG_ARCH_OMAP15XX
417 if (cpu_is_omap1510()) { 414 if (cpu_is_omap1510()) {
418 omap1_usb_init(&innovator1510_usb_config); 415 omap1_usb_init(&innovator1510_usb_config);
419 innovator_config[0].data = &innovator1510_lcd_config; 416 omapfb_set_lcd_config(&innovator1510_lcd_config);
420 } 417 }
421#endif 418#endif
422#ifdef CONFIG_ARCH_OMAP16XX 419#ifdef CONFIG_ARCH_OMAP16XX
423 if (cpu_is_omap1610()) { 420 if (cpu_is_omap1610()) {
424 omap1_usb_init(&h2_usb_config); 421 omap1_usb_init(&h2_usb_config);
425 innovator_config[0].data = &innovator1610_lcd_config; 422 omapfb_set_lcd_config(&innovator1610_lcd_config);
426 } 423 }
427#endif 424#endif
428 omap_board_config = innovator_config;
429 omap_board_config_size = ARRAY_SIZE(innovator_config);
430 omap_serial_init(); 425 omap_serial_init();
431 omap_register_i2c_bus(1, 100, NULL, 0); 426 omap_register_i2c_bus(1, 100, NULL, 0);
432 innovator_mmc_init(); 427 innovator_mmc_init();
diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c
index f9efc036ba96..9b6332a31fb6 100644
--- a/arch/arm/mach-omap1/board-nokia770.c
+++ b/arch/arm/mach-omap1/board-nokia770.c
@@ -31,7 +31,6 @@
31#include <plat/board.h> 31#include <plat/board.h>
32#include <plat/keypad.h> 32#include <plat/keypad.h>
33#include "common.h" 33#include "common.h"
34#include <plat/hwa742.h>
35#include <plat/lcd_mipid.h> 34#include <plat/lcd_mipid.h>
36#include <plat/mmc.h> 35#include <plat/mmc.h>
37#include <plat/clock.h> 36#include <plat/clock.h>
@@ -99,15 +98,16 @@ static struct mipid_platform_data nokia770_mipid_platform_data = {
99 .shutdown = mipid_shutdown, 98 .shutdown = mipid_shutdown,
100}; 99};
101 100
101static struct omap_lcd_config nokia770_lcd_config __initdata = {
102 .ctrl_name = "hwa742",
103};
104
102static void __init mipid_dev_init(void) 105static void __init mipid_dev_init(void)
103{ 106{
104 const struct omap_lcd_config *conf; 107 nokia770_mipid_platform_data.nreset_gpio = 13;
108 nokia770_mipid_platform_data.data_lines = 16;
105 109
106 conf = omap_get_config(OMAP_TAG_LCD, struct omap_lcd_config); 110 omapfb_set_lcd_config(&nokia770_lcd_config);
107 if (conf != NULL) {
108 nokia770_mipid_platform_data.nreset_gpio = conf->nreset_gpio;
109 nokia770_mipid_platform_data.data_lines = conf->data_lines;
110 }
111} 111}
112 112
113static void __init ads7846_dev_init(void) 113static void __init ads7846_dev_init(void)
@@ -150,14 +150,9 @@ static struct spi_board_info nokia770_spi_board_info[] __initdata = {
150 }, 150 },
151}; 151};
152 152
153static struct hwa742_platform_data nokia770_hwa742_platform_data = {
154 .te_connected = 1,
155};
156
157static void __init hwa742_dev_init(void) 153static void __init hwa742_dev_init(void)
158{ 154{
159 clk_add_alias("hwa_sys_ck", NULL, "bclk", NULL); 155 clk_add_alias("hwa_sys_ck", NULL, "bclk", NULL);
160 omapfb_set_ctrl_platform_data(&nokia770_hwa742_platform_data);
161} 156}
162 157
163/* assume no Mini-AB port */ 158/* assume no Mini-AB port */
diff --git a/arch/arm/mach-omap1/board-osk.c b/arch/arm/mach-omap1/board-osk.c
index 675de06557aa..ef874655fbd3 100644
--- a/arch/arm/mach-omap1/board-osk.c
+++ b/arch/arm/mach-omap1/board-osk.c
@@ -34,6 +34,7 @@
34#include <linux/i2c.h> 34#include <linux/i2c.h>
35#include <linux/leds.h> 35#include <linux/leds.h>
36#include <linux/smc91x.h> 36#include <linux/smc91x.h>
37#include <linux/omapfb.h>
37 38
38#include <linux/mtd/mtd.h> 39#include <linux/mtd/mtd.h>
39#include <linux/mtd/partitions.h> 40#include <linux/mtd/partitions.h>
@@ -300,12 +301,6 @@ static struct omap_lcd_config osk_lcd_config __initdata = {
300}; 301};
301#endif 302#endif
302 303
303static struct omap_board_config_kernel osk_config[] __initdata = {
304#ifdef CONFIG_OMAP_OSK_MISTRAL
305 { OMAP_TAG_LCD, &osk_lcd_config },
306#endif
307};
308
309#ifdef CONFIG_OMAP_OSK_MISTRAL 304#ifdef CONFIG_OMAP_OSK_MISTRAL
310 305
311#include <linux/input.h> 306#include <linux/input.h>
@@ -549,8 +544,6 @@ static void __init osk_init(void)
549 osk_flash_resource.end = osk_flash_resource.start = omap_cs3_phys(); 544 osk_flash_resource.end = osk_flash_resource.start = omap_cs3_phys();
550 osk_flash_resource.end += SZ_32M - 1; 545 osk_flash_resource.end += SZ_32M - 1;
551 platform_add_devices(osk5912_devices, ARRAY_SIZE(osk5912_devices)); 546 platform_add_devices(osk5912_devices, ARRAY_SIZE(osk5912_devices));
552 omap_board_config = osk_config;
553 omap_board_config_size = ARRAY_SIZE(osk_config);
554 547
555 l = omap_readl(USB_TRANSCEIVER_CTRL); 548 l = omap_readl(USB_TRANSCEIVER_CTRL);
556 l |= (3 << 1); 549 l |= (3 << 1);
@@ -567,6 +560,11 @@ static void __init osk_init(void)
567 omap_register_i2c_bus(1, 400, osk_i2c_board_info, 560 omap_register_i2c_bus(1, 400, osk_i2c_board_info,
568 ARRAY_SIZE(osk_i2c_board_info)); 561 ARRAY_SIZE(osk_i2c_board_info));
569 osk_mistral_init(); 562 osk_mistral_init();
563
564#ifdef CONFIG_OMAP_OSK_MISTRAL
565 omapfb_set_lcd_config(&osk_lcd_config);
566#endif
567
570} 568}
571 569
572MACHINE_START(OMAP_OSK, "TI-OSK") 570MACHINE_START(OMAP_OSK, "TI-OSK")
diff --git a/arch/arm/mach-omap1/board-palmte.c b/arch/arm/mach-omap1/board-palmte.c
index 81fa27f88369..612342cb2a2d 100644
--- a/arch/arm/mach-omap1/board-palmte.c
+++ b/arch/arm/mach-omap1/board-palmte.c
@@ -27,6 +27,7 @@
27#include <linux/spi/spi.h> 27#include <linux/spi/spi.h>
28#include <linux/interrupt.h> 28#include <linux/interrupt.h>
29#include <linux/apm-emulation.h> 29#include <linux/apm-emulation.h>
30#include <linux/omapfb.h>
30 31
31#include <mach/hardware.h> 32#include <mach/hardware.h>
32#include <asm/mach-types.h> 33#include <asm/mach-types.h>
@@ -209,10 +210,6 @@ static struct omap_lcd_config palmte_lcd_config __initdata = {
209 .ctrl_name = "internal", 210 .ctrl_name = "internal",
210}; 211};
211 212
212static struct omap_board_config_kernel palmte_config[] __initdata = {
213 { OMAP_TAG_LCD, &palmte_lcd_config },
214};
215
216static struct spi_board_info palmte_spi_info[] __initdata = { 213static struct spi_board_info palmte_spi_info[] __initdata = {
217 { 214 {
218 .modalias = "tsc2102", 215 .modalias = "tsc2102",
@@ -250,9 +247,6 @@ static void __init omap_palmte_init(void)
250 omap_cfg_reg(UART3_TX); 247 omap_cfg_reg(UART3_TX);
251 omap_cfg_reg(UART3_RX); 248 omap_cfg_reg(UART3_RX);
252 249
253 omap_board_config = palmte_config;
254 omap_board_config_size = ARRAY_SIZE(palmte_config);
255
256 platform_add_devices(palmte_devices, ARRAY_SIZE(palmte_devices)); 250 platform_add_devices(palmte_devices, ARRAY_SIZE(palmte_devices));
257 251
258 spi_register_board_info(palmte_spi_info, ARRAY_SIZE(palmte_spi_info)); 252 spi_register_board_info(palmte_spi_info, ARRAY_SIZE(palmte_spi_info));
@@ -260,6 +254,8 @@ static void __init omap_palmte_init(void)
260 omap_serial_init(); 254 omap_serial_init();
261 omap1_usb_init(&palmte_usb_config); 255 omap1_usb_init(&palmte_usb_config);
262 omap_register_i2c_bus(1, 100, NULL, 0); 256 omap_register_i2c_bus(1, 100, NULL, 0);
257
258 omapfb_set_lcd_config(&palmte_lcd_config);
263} 259}
264 260
265MACHINE_START(OMAP_PALMTE, "OMAP310 based Palm Tungsten E") 261MACHINE_START(OMAP_PALMTE, "OMAP310 based Palm Tungsten E")
diff --git a/arch/arm/mach-omap1/board-palmtt.c b/arch/arm/mach-omap1/board-palmtt.c
index 81cb82178388..b63350bc88fd 100644
--- a/arch/arm/mach-omap1/board-palmtt.c
+++ b/arch/arm/mach-omap1/board-palmtt.c
@@ -24,6 +24,7 @@
24#include <linux/mtd/partitions.h> 24#include <linux/mtd/partitions.h>
25#include <linux/mtd/physmap.h> 25#include <linux/mtd/physmap.h>
26#include <linux/leds.h> 26#include <linux/leds.h>
27#include <linux/omapfb.h>
27 28
28#include <mach/hardware.h> 29#include <mach/hardware.h>
29#include <asm/mach-types.h> 30#include <asm/mach-types.h>
@@ -273,10 +274,6 @@ static struct omap_lcd_config palmtt_lcd_config __initdata = {
273 .ctrl_name = "internal", 274 .ctrl_name = "internal",
274}; 275};
275 276
276static struct omap_board_config_kernel palmtt_config[] __initdata = {
277 { OMAP_TAG_LCD, &palmtt_lcd_config },
278};
279
280static void __init omap_mpu_wdt_mode(int mode) { 277static void __init omap_mpu_wdt_mode(int mode) {
281 if (mode) 278 if (mode)
282 omap_writew(0x8000, OMAP_WDT_TIMER_MODE); 279 omap_writew(0x8000, OMAP_WDT_TIMER_MODE);
@@ -298,15 +295,14 @@ static void __init omap_palmtt_init(void)
298 295
299 omap_mpu_wdt_mode(0); 296 omap_mpu_wdt_mode(0);
300 297
301 omap_board_config = palmtt_config;
302 omap_board_config_size = ARRAY_SIZE(palmtt_config);
303
304 platform_add_devices(palmtt_devices, ARRAY_SIZE(palmtt_devices)); 298 platform_add_devices(palmtt_devices, ARRAY_SIZE(palmtt_devices));
305 299
306 spi_register_board_info(palmtt_boardinfo,ARRAY_SIZE(palmtt_boardinfo)); 300 spi_register_board_info(palmtt_boardinfo,ARRAY_SIZE(palmtt_boardinfo));
307 omap_serial_init(); 301 omap_serial_init();
308 omap1_usb_init(&palmtt_usb_config); 302 omap1_usb_init(&palmtt_usb_config);
309 omap_register_i2c_bus(1, 100, NULL, 0); 303 omap_register_i2c_bus(1, 100, NULL, 0);
304
305 omapfb_set_lcd_config(&palmtt_lcd_config);
310} 306}
311 307
312MACHINE_START(OMAP_PALMTT, "OMAP1510 based Palm Tungsten|T") 308MACHINE_START(OMAP_PALMTT, "OMAP1510 based Palm Tungsten|T")
diff --git a/arch/arm/mach-omap1/board-palmz71.c b/arch/arm/mach-omap1/board-palmz71.c
index e881945ce8ec..9924c70af09f 100644
--- a/arch/arm/mach-omap1/board-palmz71.c
+++ b/arch/arm/mach-omap1/board-palmz71.c
@@ -27,6 +27,7 @@
27#include <linux/mtd/mtd.h> 27#include <linux/mtd/mtd.h>
28#include <linux/mtd/partitions.h> 28#include <linux/mtd/partitions.h>
29#include <linux/mtd/physmap.h> 29#include <linux/mtd/physmap.h>
30#include <linux/omapfb.h>
30 31
31#include <mach/hardware.h> 32#include <mach/hardware.h>
32#include <asm/mach-types.h> 33#include <asm/mach-types.h>
@@ -239,10 +240,6 @@ static struct omap_lcd_config palmz71_lcd_config __initdata = {
239 .ctrl_name = "internal", 240 .ctrl_name = "internal",
240}; 241};
241 242
242static struct omap_board_config_kernel palmz71_config[] __initdata = {
243 {OMAP_TAG_LCD, &palmz71_lcd_config},
244};
245
246static irqreturn_t 243static irqreturn_t
247palmz71_powercable(int irq, void *dev_id) 244palmz71_powercable(int irq, void *dev_id)
248{ 245{
@@ -313,9 +310,6 @@ omap_palmz71_init(void)
313 palmz71_gpio_setup(1); 310 palmz71_gpio_setup(1);
314 omap_mpu_wdt_mode(0); 311 omap_mpu_wdt_mode(0);
315 312
316 omap_board_config = palmz71_config;
317 omap_board_config_size = ARRAY_SIZE(palmz71_config);
318
319 platform_add_devices(devices, ARRAY_SIZE(devices)); 313 platform_add_devices(devices, ARRAY_SIZE(devices));
320 314
321 spi_register_board_info(palmz71_boardinfo, 315 spi_register_board_info(palmz71_boardinfo,
@@ -324,6 +318,8 @@ omap_palmz71_init(void)
324 omap_serial_init(); 318 omap_serial_init();
325 omap_register_i2c_bus(1, 100, NULL, 0); 319 omap_register_i2c_bus(1, 100, NULL, 0);
326 palmz71_gpio_setup(0); 320 palmz71_gpio_setup(0);
321
322 omapfb_set_lcd_config(&palmz71_lcd_config);
327} 323}
328 324
329MACHINE_START(OMAP_PALMZ71, "OMAP310 based Palm Zire71") 325MACHINE_START(OMAP_PALMZ71, "OMAP310 based Palm Zire71")
diff --git a/arch/arm/mach-omap1/board-perseus2.c b/arch/arm/mach-omap1/board-perseus2.c
index c000bed76276..8e0153447c6d 100644
--- a/arch/arm/mach-omap1/board-perseus2.c
+++ b/arch/arm/mach-omap1/board-perseus2.c
@@ -21,6 +21,7 @@
21#include <linux/mtd/physmap.h> 21#include <linux/mtd/physmap.h>
22#include <linux/input.h> 22#include <linux/input.h>
23#include <linux/smc91x.h> 23#include <linux/smc91x.h>
24#include <linux/omapfb.h>
24 25
25#include <mach/hardware.h> 26#include <mach/hardware.h>
26#include <asm/mach-types.h> 27#include <asm/mach-types.h>
@@ -232,27 +233,17 @@ static struct platform_device kp_device = {
232 .resource = kp_resources, 233 .resource = kp_resources,
233}; 234};
234 235
235static struct platform_device lcd_device = {
236 .name = "lcd_p2",
237 .id = -1,
238};
239
240static struct platform_device *devices[] __initdata = { 236static struct platform_device *devices[] __initdata = {
241 &nor_device, 237 &nor_device,
242 &nand_device, 238 &nand_device,
243 &smc91x_device, 239 &smc91x_device,
244 &kp_device, 240 &kp_device,
245 &lcd_device,
246}; 241};
247 242
248static struct omap_lcd_config perseus2_lcd_config __initdata = { 243static struct omap_lcd_config perseus2_lcd_config __initdata = {
249 .ctrl_name = "internal", 244 .ctrl_name = "internal",
250}; 245};
251 246
252static struct omap_board_config_kernel perseus2_config[] __initdata = {
253 { OMAP_TAG_LCD, &perseus2_lcd_config },
254};
255
256static void __init perseus2_init_smc91x(void) 247static void __init perseus2_init_smc91x(void)
257{ 248{
258 fpga_write(1, H2P2_DBG_FPGA_LAN_RESET); 249 fpga_write(1, H2P2_DBG_FPGA_LAN_RESET);
@@ -320,10 +311,10 @@ static void __init omap_perseus2_init(void)
320 311
321 platform_add_devices(devices, ARRAY_SIZE(devices)); 312 platform_add_devices(devices, ARRAY_SIZE(devices));
322 313
323 omap_board_config = perseus2_config;
324 omap_board_config_size = ARRAY_SIZE(perseus2_config);
325 omap_serial_init(); 314 omap_serial_init();
326 omap_register_i2c_bus(1, 100, NULL, 0); 315 omap_register_i2c_bus(1, 100, NULL, 0);
316
317 omapfb_set_lcd_config(&perseus2_lcd_config);
327} 318}
328 319
329/* Only FPGA needs to be mapped here. All others are done with ioremap */ 320/* Only FPGA needs to be mapped here. All others are done with ioremap */
diff --git a/arch/arm/mach-omap1/board-sx1.c b/arch/arm/mach-omap1/board-sx1.c
index 7bcd82ab0fd0..0c76e12337d9 100644
--- a/arch/arm/mach-omap1/board-sx1.c
+++ b/arch/arm/mach-omap1/board-sx1.c
@@ -27,6 +27,7 @@
27#include <linux/i2c.h> 27#include <linux/i2c.h>
28#include <linux/errno.h> 28#include <linux/errno.h>
29#include <linux/export.h> 29#include <linux/export.h>
30#include <linux/omapfb.h>
30 31
31#include <mach/hardware.h> 32#include <mach/hardware.h>
32#include <asm/mach-types.h> 33#include <asm/mach-types.h>
@@ -355,11 +356,6 @@ static struct omap_usb_config sx1_usb_config __initdata = {
355 356
356/*----------- LCD -------------------------*/ 357/*----------- LCD -------------------------*/
357 358
358static struct platform_device sx1_lcd_device = {
359 .name = "lcd_sx1",
360 .id = -1,
361};
362
363static struct omap_lcd_config sx1_lcd_config __initdata = { 359static struct omap_lcd_config sx1_lcd_config __initdata = {
364 .ctrl_name = "internal", 360 .ctrl_name = "internal",
365}; 361};
@@ -368,14 +364,8 @@ static struct omap_lcd_config sx1_lcd_config __initdata = {
368static struct platform_device *sx1_devices[] __initdata = { 364static struct platform_device *sx1_devices[] __initdata = {
369 &sx1_flash_device, 365 &sx1_flash_device,
370 &sx1_kp_device, 366 &sx1_kp_device,
371 &sx1_lcd_device,
372 &sx1_irda_device, 367 &sx1_irda_device,
373}; 368};
374/*-----------------------------------------*/
375
376static struct omap_board_config_kernel sx1_config[] __initdata = {
377 { OMAP_TAG_LCD, &sx1_lcd_config },
378};
379 369
380/*-----------------------------------------*/ 370/*-----------------------------------------*/
381 371
@@ -391,8 +381,6 @@ static void __init omap_sx1_init(void)
391 381
392 platform_add_devices(sx1_devices, ARRAY_SIZE(sx1_devices)); 382 platform_add_devices(sx1_devices, ARRAY_SIZE(sx1_devices));
393 383
394 omap_board_config = sx1_config;
395 omap_board_config_size = ARRAY_SIZE(sx1_config);
396 omap_serial_init(); 384 omap_serial_init();
397 omap_register_i2c_bus(1, 100, NULL, 0); 385 omap_register_i2c_bus(1, 100, NULL, 0);
398 omap1_usb_init(&sx1_usb_config); 386 omap1_usb_init(&sx1_usb_config);
@@ -406,6 +394,8 @@ static void __init omap_sx1_init(void)
406 gpio_direction_output(1, 1); /*A_IRDA_OFF = 1 */ 394 gpio_direction_output(1, 1); /*A_IRDA_OFF = 1 */
407 gpio_direction_output(11, 0); /*A_SWITCH = 0 */ 395 gpio_direction_output(11, 0); /*A_SWITCH = 0 */
408 gpio_direction_output(15, 0); /*A_USB_ON = 0 */ 396 gpio_direction_output(15, 0); /*A_USB_ON = 0 */
397
398 omapfb_set_lcd_config(&sx1_lcd_config);
409} 399}
410 400
411MACHINE_START(SX1, "OMAP310 based Siemens SX1") 401MACHINE_START(SX1, "OMAP310 based Siemens SX1")
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index fb11b44fbdec..e501b4972a64 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -21,7 +21,6 @@
21#include <linux/init.h> 21#include <linux/init.h>
22#include <linux/io.h> 22#include <linux/io.h>
23#include <linux/clk.h> 23#include <linux/clk.h>
24#include <linux/omapfb.h>
25 24
26#include <asm/tlb.h> 25#include <asm/tlb.h>
27 26
diff --git a/arch/arm/mach-shmobile/board-ag5evm.c b/arch/arm/mach-shmobile/board-ag5evm.c
index 8aea3a2dd889..12c431f3443f 100644
--- a/arch/arm/mach-shmobile/board-ag5evm.c
+++ b/arch/arm/mach-shmobile/board-ag5evm.c
@@ -230,16 +230,6 @@ static void lcd_backlight_reset(void)
230 gpio_set_value(GPIO_PORT235, 1); 230 gpio_set_value(GPIO_PORT235, 1);
231} 231}
232 232
233static void lcd_on(void *board_data, struct fb_info *info)
234{
235 lcd_backlight_on();
236}
237
238static void lcd_off(void *board_data)
239{
240 lcd_backlight_reset();
241}
242
243/* LCDC0 */ 233/* LCDC0 */
244static const struct fb_videomode lcdc0_modes[] = { 234static const struct fb_videomode lcdc0_modes[] = {
245 { 235 {
@@ -263,14 +253,14 @@ static struct sh_mobile_lcdc_info lcdc0_info = {
263 .interface_type = RGB24, 253 .interface_type = RGB24,
264 .clock_divider = 1, 254 .clock_divider = 1,
265 .flags = LCDC_FLAGS_DWPOL, 255 .flags = LCDC_FLAGS_DWPOL,
266 .lcd_size_cfg.width = 44,
267 .lcd_size_cfg.height = 79,
268 .fourcc = V4L2_PIX_FMT_RGB565, 256 .fourcc = V4L2_PIX_FMT_RGB565,
269 .lcd_cfg = lcdc0_modes, 257 .lcd_modes = lcdc0_modes,
270 .num_cfg = ARRAY_SIZE(lcdc0_modes), 258 .num_modes = ARRAY_SIZE(lcdc0_modes),
271 .board_cfg = { 259 .panel_cfg = {
272 .display_on = lcd_on, 260 .width = 44,
273 .display_off = lcd_off, 261 .height = 79,
262 .display_on = lcd_backlight_on,
263 .display_off = lcd_backlight_reset,
274 }, 264 },
275 } 265 }
276}; 266};
diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
index 8f6da7f134b3..f90ba5b850a3 100644
--- a/arch/arm/mach-shmobile/board-ap4evb.c
+++ b/arch/arm/mach-shmobile/board-ap4evb.c
@@ -258,10 +258,16 @@ static struct sh_mobile_meram_info meram_info = {
258 258
259static struct resource meram_resources[] = { 259static struct resource meram_resources[] = {
260 [0] = { 260 [0] = {
261 .name = "MERAM", 261 .name = "regs",
262 .start = 0xe8000000, 262 .start = 0xe8000000,
263 .end = 0xe81fffff, 263 .end = 0xe807ffff,
264 .flags = IORESOURCE_MEM, 264 .flags = IORESOURCE_MEM,
265 },
266 [1] = {
267 .name = "meram",
268 .start = 0xe8080000,
269 .end = 0xe81fffff,
270 .flags = IORESOURCE_MEM,
265 }, 271 },
266}; 272};
267 273
@@ -437,82 +443,6 @@ static struct platform_device usb1_host_device = {
437 .resource = usb1_host_resources, 443 .resource = usb1_host_resources,
438}; 444};
439 445
440static const struct fb_videomode ap4evb_lcdc_modes[] = {
441 {
442#ifdef CONFIG_AP4EVB_QHD
443 .name = "R63302(QHD)",
444 .xres = 544,
445 .yres = 961,
446 .left_margin = 72,
447 .right_margin = 600,
448 .hsync_len = 16,
449 .upper_margin = 8,
450 .lower_margin = 8,
451 .vsync_len = 2,
452 .sync = FB_SYNC_VERT_HIGH_ACT | FB_SYNC_HOR_HIGH_ACT,
453#else
454 .name = "WVGA Panel",
455 .xres = 800,
456 .yres = 480,
457 .left_margin = 220,
458 .right_margin = 110,
459 .hsync_len = 70,
460 .upper_margin = 20,
461 .lower_margin = 5,
462 .vsync_len = 5,
463 .sync = 0,
464#endif
465 },
466};
467static struct sh_mobile_meram_cfg lcd_meram_cfg = {
468 .icb[0] = {
469 .marker_icb = 28,
470 .cache_icb = 24,
471 .meram_offset = 0x0,
472 .meram_size = 0x40,
473 },
474 .icb[1] = {
475 .marker_icb = 29,
476 .cache_icb = 25,
477 .meram_offset = 0x40,
478 .meram_size = 0x40,
479 },
480};
481
482static struct sh_mobile_lcdc_info lcdc_info = {
483 .meram_dev = &meram_info,
484 .ch[0] = {
485 .chan = LCDC_CHAN_MAINLCD,
486 .fourcc = V4L2_PIX_FMT_RGB565,
487 .lcd_cfg = ap4evb_lcdc_modes,
488 .num_cfg = ARRAY_SIZE(ap4evb_lcdc_modes),
489 .meram_cfg = &lcd_meram_cfg,
490 }
491};
492
493static struct resource lcdc_resources[] = {
494 [0] = {
495 .name = "LCDC",
496 .start = 0xfe940000, /* P4-only space */
497 .end = 0xfe943fff,
498 .flags = IORESOURCE_MEM,
499 },
500 [1] = {
501 .start = intcs_evt2irq(0x580),
502 .flags = IORESOURCE_IRQ,
503 },
504};
505
506static struct platform_device lcdc_device = {
507 .name = "sh_mobile_lcdc_fb",
508 .num_resources = ARRAY_SIZE(lcdc_resources),
509 .resource = lcdc_resources,
510 .dev = {
511 .platform_data = &lcdc_info,
512 .coherent_dma_mask = ~0,
513 },
514};
515
516/* 446/*
517 * QHD display 447 * QHD display
518 */ 448 */
@@ -556,20 +486,25 @@ static struct platform_device keysc_device = {
556}; 486};
557 487
558/* MIPI-DSI */ 488/* MIPI-DSI */
559#define PHYCTRL 0x0070
560static int sh_mipi_set_dot_clock(struct platform_device *pdev, 489static int sh_mipi_set_dot_clock(struct platform_device *pdev,
561 void __iomem *base, 490 void __iomem *base,
562 int enable) 491 int enable)
563{ 492{
564 struct clk *pck = clk_get(&pdev->dev, "dsip_clk"); 493 struct clk *pck = clk_get(&pdev->dev, "dsip_clk");
565 void __iomem *phy = base + PHYCTRL;
566 494
567 if (IS_ERR(pck)) 495 if (IS_ERR(pck))
568 return PTR_ERR(pck); 496 return PTR_ERR(pck);
569 497
570 if (enable) { 498 if (enable) {
499 /*
500 * DSIPCLK = 24MHz
501 * D-PHY = DSIPCLK * ((0x6*2)+1) = 312MHz (see .phyctrl)
502 * HsByteCLK = D-PHY/8 = 39MHz
503 *
504 * X * Y * FPS =
505 * (544+72+600+16) * (961+8+8+2) * 30 = 36.1MHz
506 */
571 clk_set_rate(pck, clk_round_rate(pck, 24000000)); 507 clk_set_rate(pck, clk_round_rate(pck, 24000000));
572 iowrite32(ioread32(phy) | (0xb << 8), phy);
573 clk_enable(pck); 508 clk_enable(pck);
574 } else { 509 } else {
575 clk_disable(pck); 510 clk_disable(pck);
@@ -593,11 +528,14 @@ static struct resource mipidsi0_resources[] = {
593 }, 528 },
594}; 529};
595 530
531static struct sh_mobile_lcdc_info lcdc_info;
532
596static struct sh_mipi_dsi_info mipidsi0_info = { 533static struct sh_mipi_dsi_info mipidsi0_info = {
597 .data_format = MIPI_RGB888, 534 .data_format = MIPI_RGB888,
598 .lcd_chan = &lcdc_info.ch[0], 535 .lcd_chan = &lcdc_info.ch[0],
599 .lane = 2, 536 .lane = 2,
600 .vsynw_offset = 17, 537 .vsynw_offset = 17,
538 .phyctrl = 0x6 << 8,
601 .flags = SH_MIPI_DSI_SYNC_PULSES_MODE | 539 .flags = SH_MIPI_DSI_SYNC_PULSES_MODE |
602 SH_MIPI_DSI_HSbyteCLK, 540 SH_MIPI_DSI_HSbyteCLK,
603 .set_dot_clock = sh_mipi_set_dot_clock, 541 .set_dot_clock = sh_mipi_set_dot_clock,
@@ -619,6 +557,81 @@ static struct platform_device *qhd_devices[] __initdata = {
619}; 557};
620#endif /* CONFIG_AP4EVB_QHD */ 558#endif /* CONFIG_AP4EVB_QHD */
621 559
560/* LCDC0 */
561static const struct fb_videomode ap4evb_lcdc_modes[] = {
562 {
563#ifdef CONFIG_AP4EVB_QHD
564 .name = "R63302(QHD)",
565 .xres = 544,
566 .yres = 961,
567 .left_margin = 72,
568 .right_margin = 600,
569 .hsync_len = 16,
570 .upper_margin = 8,
571 .lower_margin = 8,
572 .vsync_len = 2,
573 .sync = FB_SYNC_VERT_HIGH_ACT | FB_SYNC_HOR_HIGH_ACT,
574#else
575 .name = "WVGA Panel",
576 .xres = 800,
577 .yres = 480,
578 .left_margin = 220,
579 .right_margin = 110,
580 .hsync_len = 70,
581 .upper_margin = 20,
582 .lower_margin = 5,
583 .vsync_len = 5,
584 .sync = 0,
585#endif
586 },
587};
588
589static const struct sh_mobile_meram_cfg lcd_meram_cfg = {
590 .icb[0] = {
591 .meram_size = 0x40,
592 },
593 .icb[1] = {
594 .meram_size = 0x40,
595 },
596};
597
598static struct sh_mobile_lcdc_info lcdc_info = {
599 .meram_dev = &meram_info,
600 .ch[0] = {
601 .chan = LCDC_CHAN_MAINLCD,
602 .fourcc = V4L2_PIX_FMT_RGB565,
603 .lcd_modes = ap4evb_lcdc_modes,
604 .num_modes = ARRAY_SIZE(ap4evb_lcdc_modes),
605 .meram_cfg = &lcd_meram_cfg,
606#ifdef CONFIG_AP4EVB_QHD
607 .tx_dev = &mipidsi0_device,
608#endif
609 }
610};
611
612static struct resource lcdc_resources[] = {
613 [0] = {
614 .name = "LCDC",
615 .start = 0xfe940000, /* P4-only space */
616 .end = 0xfe943fff,
617 .flags = IORESOURCE_MEM,
618 },
619 [1] = {
620 .start = intcs_evt2irq(0x580),
621 .flags = IORESOURCE_IRQ,
622 },
623};
624
625static struct platform_device lcdc_device = {
626 .name = "sh_mobile_lcdc_fb",
627 .num_resources = ARRAY_SIZE(lcdc_resources),
628 .resource = lcdc_resources,
629 .dev = {
630 .platform_data = &lcdc_info,
631 .coherent_dma_mask = ~0,
632 },
633};
634
622/* FSI */ 635/* FSI */
623#define IRQ_FSI evt2irq(0x1840) 636#define IRQ_FSI evt2irq(0x1840)
624static int __fsi_set_rate(struct clk *clk, long rate, int enable) 637static int __fsi_set_rate(struct clk *clk, long rate, int enable)
@@ -790,65 +803,11 @@ static struct platform_device fsi_ak4643_device = {
790 }, 803 },
791}; 804};
792 805
793static struct sh_mobile_meram_cfg hdmi_meram_cfg = { 806/* LCDC1 */
794 .icb[0] = {
795 .marker_icb = 30,
796 .cache_icb = 26,
797 .meram_offset = 0x80,
798 .meram_size = 0x100,
799 },
800 .icb[1] = {
801 .marker_icb = 31,
802 .cache_icb = 27,
803 .meram_offset = 0x180,
804 .meram_size = 0x100,
805 },
806};
807
808static struct sh_mobile_lcdc_info sh_mobile_lcdc1_info = {
809 .clock_source = LCDC_CLK_EXTERNAL,
810 .meram_dev = &meram_info,
811 .ch[0] = {
812 .chan = LCDC_CHAN_MAINLCD,
813 .fourcc = V4L2_PIX_FMT_RGB565,
814 .interface_type = RGB24,
815 .clock_divider = 1,
816 .flags = LCDC_FLAGS_DWPOL,
817 .meram_cfg = &hdmi_meram_cfg,
818 }
819};
820
821static struct resource lcdc1_resources[] = {
822 [0] = {
823 .name = "LCDC1",
824 .start = 0xfe944000,
825 .end = 0xfe947fff,
826 .flags = IORESOURCE_MEM,
827 },
828 [1] = {
829 .start = intcs_evt2irq(0x1780),
830 .flags = IORESOURCE_IRQ,
831 },
832};
833
834static struct platform_device lcdc1_device = {
835 .name = "sh_mobile_lcdc_fb",
836 .num_resources = ARRAY_SIZE(lcdc1_resources),
837 .resource = lcdc1_resources,
838 .id = 1,
839 .dev = {
840 .platform_data = &sh_mobile_lcdc1_info,
841 .coherent_dma_mask = ~0,
842 },
843};
844
845static long ap4evb_clk_optimize(unsigned long target, unsigned long *best_freq, 807static long ap4evb_clk_optimize(unsigned long target, unsigned long *best_freq,
846 unsigned long *parent_freq); 808 unsigned long *parent_freq);
847 809
848
849static struct sh_mobile_hdmi_info hdmi_info = { 810static struct sh_mobile_hdmi_info hdmi_info = {
850 .lcd_chan = &sh_mobile_lcdc1_info.ch[0],
851 .lcd_dev = &lcdc1_device.dev,
852 .flags = HDMI_SND_SRC_SPDIF, 811 .flags = HDMI_SND_SRC_SPDIF,
853 .clk_optimize_parent = ap4evb_clk_optimize, 812 .clk_optimize_parent = ap4evb_clk_optimize,
854}; 813};
@@ -877,10 +836,6 @@ static struct platform_device hdmi_device = {
877 }, 836 },
878}; 837};
879 838
880static struct platform_device fsi_hdmi_device = {
881 .name = "sh_fsi2_b_hdmi",
882};
883
884static long ap4evb_clk_optimize(unsigned long target, unsigned long *best_freq, 839static long ap4evb_clk_optimize(unsigned long target, unsigned long *best_freq,
885 unsigned long *parent_freq) 840 unsigned long *parent_freq)
886{ 841{
@@ -900,6 +855,57 @@ static long ap4evb_clk_optimize(unsigned long target, unsigned long *best_freq,
900 return error; 855 return error;
901} 856}
902 857
858static const struct sh_mobile_meram_cfg hdmi_meram_cfg = {
859 .icb[0] = {
860 .meram_size = 0x100,
861 },
862 .icb[1] = {
863 .meram_size = 0x100,
864 },
865};
866
867static struct sh_mobile_lcdc_info sh_mobile_lcdc1_info = {
868 .clock_source = LCDC_CLK_EXTERNAL,
869 .meram_dev = &meram_info,
870 .ch[0] = {
871 .chan = LCDC_CHAN_MAINLCD,
872 .fourcc = V4L2_PIX_FMT_RGB565,
873 .interface_type = RGB24,
874 .clock_divider = 1,
875 .flags = LCDC_FLAGS_DWPOL,
876 .meram_cfg = &hdmi_meram_cfg,
877 .tx_dev = &hdmi_device,
878 }
879};
880
881static struct resource lcdc1_resources[] = {
882 [0] = {
883 .name = "LCDC1",
884 .start = 0xfe944000,
885 .end = 0xfe947fff,
886 .flags = IORESOURCE_MEM,
887 },
888 [1] = {
889 .start = intcs_evt2irq(0x1780),
890 .flags = IORESOURCE_IRQ,
891 },
892};
893
894static struct platform_device lcdc1_device = {
895 .name = "sh_mobile_lcdc_fb",
896 .num_resources = ARRAY_SIZE(lcdc1_resources),
897 .resource = lcdc1_resources,
898 .id = 1,
899 .dev = {
900 .platform_data = &sh_mobile_lcdc1_info,
901 .coherent_dma_mask = ~0,
902 },
903};
904
905static struct platform_device fsi_hdmi_device = {
906 .name = "sh_fsi2_b_hdmi",
907};
908
903static struct gpio_led ap4evb_leds[] = { 909static struct gpio_led ap4evb_leds[] = {
904 { 910 {
905 .name = "led4", 911 .name = "led4",
@@ -1034,9 +1040,9 @@ static struct platform_device *ap4evb_devices[] __initdata = {
1034 &fsi_ak4643_device, 1040 &fsi_ak4643_device,
1035 &fsi_hdmi_device, 1041 &fsi_hdmi_device,
1036 &sh_mmcif_device, 1042 &sh_mmcif_device,
1037 &lcdc1_device,
1038 &lcdc_device,
1039 &hdmi_device, 1043 &hdmi_device,
1044 &lcdc_device,
1045 &lcdc1_device,
1040 &ceu_device, 1046 &ceu_device,
1041 &ap4evb_camera, 1047 &ap4evb_camera,
1042 &meram_device, 1048 &meram_device,
@@ -1347,8 +1353,8 @@ static void __init ap4evb_init(void)
1347 lcdc_info.ch[0].interface_type = RGB24; 1353 lcdc_info.ch[0].interface_type = RGB24;
1348 lcdc_info.ch[0].clock_divider = 1; 1354 lcdc_info.ch[0].clock_divider = 1;
1349 lcdc_info.ch[0].flags = LCDC_FLAGS_DWPOL; 1355 lcdc_info.ch[0].flags = LCDC_FLAGS_DWPOL;
1350 lcdc_info.ch[0].lcd_size_cfg.width = 44; 1356 lcdc_info.ch[0].panel_cfg.width = 44;
1351 lcdc_info.ch[0].lcd_size_cfg.height = 79; 1357 lcdc_info.ch[0].panel_cfg.height = 79;
1352 1358
1353 platform_add_devices(qhd_devices, ARRAY_SIZE(qhd_devices)); 1359 platform_add_devices(qhd_devices, ARRAY_SIZE(qhd_devices));
1354 1360
@@ -1389,8 +1395,8 @@ static void __init ap4evb_init(void)
1389 lcdc_info.ch[0].interface_type = RGB18; 1395 lcdc_info.ch[0].interface_type = RGB18;
1390 lcdc_info.ch[0].clock_divider = 3; 1396 lcdc_info.ch[0].clock_divider = 3;
1391 lcdc_info.ch[0].flags = 0; 1397 lcdc_info.ch[0].flags = 0;
1392 lcdc_info.ch[0].lcd_size_cfg.width = 152; 1398 lcdc_info.ch[0].panel_cfg.width = 152;
1393 lcdc_info.ch[0].lcd_size_cfg.height = 91; 1399 lcdc_info.ch[0].panel_cfg.height = 91;
1394 1400
1395 /* enable TouchScreen */ 1401 /* enable TouchScreen */
1396 irq_set_irq_type(IRQ7, IRQ_TYPE_LEVEL_LOW); 1402 irq_set_irq_type(IRQ7, IRQ_TYPE_LEVEL_LOW);
diff --git a/arch/arm/mach-shmobile/board-bonito.c b/arch/arm/mach-shmobile/board-bonito.c
index 4bd1162ce0df..c79baa9ef61b 100644
--- a/arch/arm/mach-shmobile/board-bonito.c
+++ b/arch/arm/mach-shmobile/board-bonito.c
@@ -246,9 +246,9 @@ static struct sh_mobile_lcdc_info lcdc0_info = {
246 .interface_type = RGB24, 246 .interface_type = RGB24,
247 .clock_divider = 5, 247 .clock_divider = 5,
248 .flags = 0, 248 .flags = 0,
249 .lcd_cfg = &lcdc0_mode, 249 .lcd_modes = &lcdc0_mode,
250 .num_cfg = 1, 250 .num_modes = 1,
251 .lcd_size_cfg = { 251 .panel_cfg = {
252 .width = 152, 252 .width = 152,
253 .height = 91, 253 .height = 91,
254 }, 254 },
diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
index d99e780dffca..865d56d96299 100644
--- a/arch/arm/mach-shmobile/board-mackerel.c
+++ b/arch/arm/mach-shmobile/board-mackerel.c
@@ -318,8 +318,14 @@ static struct sh_mobile_meram_info mackerel_meram_info = {
318 318
319static struct resource meram_resources[] = { 319static struct resource meram_resources[] = {
320 [0] = { 320 [0] = {
321 .name = "MERAM", 321 .name = "regs",
322 .start = 0xe8000000, 322 .start = 0xe8000000,
323 .end = 0xe807ffff,
324 .flags = IORESOURCE_MEM,
325 },
326 [1] = {
327 .name = "meram",
328 .start = 0xe8080000,
323 .end = 0xe81fffff, 329 .end = 0xe81fffff,
324 .flags = IORESOURCE_MEM, 330 .flags = IORESOURCE_MEM,
325 }, 331 },
@@ -351,29 +357,23 @@ static struct fb_videomode mackerel_lcdc_modes[] = {
351 }, 357 },
352}; 358};
353 359
354static int mackerel_set_brightness(void *board_data, int brightness) 360static int mackerel_set_brightness(int brightness)
355{ 361{
356 gpio_set_value(GPIO_PORT31, brightness); 362 gpio_set_value(GPIO_PORT31, brightness);
357 363
358 return 0; 364 return 0;
359} 365}
360 366
361static int mackerel_get_brightness(void *board_data) 367static int mackerel_get_brightness(void)
362{ 368{
363 return gpio_get_value(GPIO_PORT31); 369 return gpio_get_value(GPIO_PORT31);
364} 370}
365 371
366static struct sh_mobile_meram_cfg lcd_meram_cfg = { 372static const struct sh_mobile_meram_cfg lcd_meram_cfg = {
367 .icb[0] = { 373 .icb[0] = {
368 .marker_icb = 28,
369 .cache_icb = 24,
370 .meram_offset = 0x0,
371 .meram_size = 0x40, 374 .meram_size = 0x40,
372 }, 375 },
373 .icb[1] = { 376 .icb[1] = {
374 .marker_icb = 29,
375 .cache_icb = 25,
376 .meram_offset = 0x40,
377 .meram_size = 0x40, 377 .meram_size = 0x40,
378 }, 378 },
379}; 379};
@@ -384,20 +384,20 @@ static struct sh_mobile_lcdc_info lcdc_info = {
384 .ch[0] = { 384 .ch[0] = {
385 .chan = LCDC_CHAN_MAINLCD, 385 .chan = LCDC_CHAN_MAINLCD,
386 .fourcc = V4L2_PIX_FMT_RGB565, 386 .fourcc = V4L2_PIX_FMT_RGB565,
387 .lcd_cfg = mackerel_lcdc_modes, 387 .lcd_modes = mackerel_lcdc_modes,
388 .num_cfg = ARRAY_SIZE(mackerel_lcdc_modes), 388 .num_modes = ARRAY_SIZE(mackerel_lcdc_modes),
389 .interface_type = RGB24, 389 .interface_type = RGB24,
390 .clock_divider = 3, 390 .clock_divider = 3,
391 .flags = 0, 391 .flags = 0,
392 .lcd_size_cfg.width = 152, 392 .panel_cfg = {
393 .lcd_size_cfg.height = 91, 393 .width = 152,
394 .board_cfg = { 394 .height = 91,
395 .set_brightness = mackerel_set_brightness,
396 .get_brightness = mackerel_get_brightness,
397 }, 395 },
398 .bl_info = { 396 .bl_info = {
399 .name = "sh_mobile_lcdc_bl", 397 .name = "sh_mobile_lcdc_bl",
400 .max_brightness = 1, 398 .max_brightness = 1,
399 .set_brightness = mackerel_set_brightness,
400 .get_brightness = mackerel_get_brightness,
401 }, 401 },
402 .meram_cfg = &lcd_meram_cfg, 402 .meram_cfg = &lcd_meram_cfg,
403 } 403 }
@@ -426,21 +426,44 @@ static struct platform_device lcdc_device = {
426 }, 426 },
427}; 427};
428 428
429static struct sh_mobile_meram_cfg hdmi_meram_cfg = { 429/* HDMI */
430static struct sh_mobile_hdmi_info hdmi_info = {
431 .flags = HDMI_SND_SRC_SPDIF,
432};
433
434static struct resource hdmi_resources[] = {
435 [0] = {
436 .name = "HDMI",
437 .start = 0xe6be0000,
438 .end = 0xe6be00ff,
439 .flags = IORESOURCE_MEM,
440 },
441 [1] = {
442 /* There's also an HDMI interrupt on INTCS @ 0x18e0 */
443 .start = evt2irq(0x17e0),
444 .flags = IORESOURCE_IRQ,
445 },
446};
447
448static struct platform_device hdmi_device = {
449 .name = "sh-mobile-hdmi",
450 .num_resources = ARRAY_SIZE(hdmi_resources),
451 .resource = hdmi_resources,
452 .id = -1,
453 .dev = {
454 .platform_data = &hdmi_info,
455 },
456};
457
458static const struct sh_mobile_meram_cfg hdmi_meram_cfg = {
430 .icb[0] = { 459 .icb[0] = {
431 .marker_icb = 30,
432 .cache_icb = 26,
433 .meram_offset = 0x80,
434 .meram_size = 0x100, 460 .meram_size = 0x100,
435 }, 461 },
436 .icb[1] = { 462 .icb[1] = {
437 .marker_icb = 31,
438 .cache_icb = 27,
439 .meram_offset = 0x180,
440 .meram_size = 0x100, 463 .meram_size = 0x100,
441 }, 464 },
442}; 465};
443/* HDMI */ 466
444static struct sh_mobile_lcdc_info hdmi_lcdc_info = { 467static struct sh_mobile_lcdc_info hdmi_lcdc_info = {
445 .meram_dev = &mackerel_meram_info, 468 .meram_dev = &mackerel_meram_info,
446 .clock_source = LCDC_CLK_EXTERNAL, 469 .clock_source = LCDC_CLK_EXTERNAL,
@@ -451,6 +474,7 @@ static struct sh_mobile_lcdc_info hdmi_lcdc_info = {
451 .clock_divider = 1, 474 .clock_divider = 1,
452 .flags = LCDC_FLAGS_DWPOL, 475 .flags = LCDC_FLAGS_DWPOL,
453 .meram_cfg = &hdmi_meram_cfg, 476 .meram_cfg = &hdmi_meram_cfg,
477 .tx_dev = &hdmi_device,
454 } 478 }
455}; 479};
456 480
@@ -478,36 +502,6 @@ static struct platform_device hdmi_lcdc_device = {
478 }, 502 },
479}; 503};
480 504
481static struct sh_mobile_hdmi_info hdmi_info = {
482 .lcd_chan = &hdmi_lcdc_info.ch[0],
483 .lcd_dev = &hdmi_lcdc_device.dev,
484 .flags = HDMI_SND_SRC_SPDIF,
485};
486
487static struct resource hdmi_resources[] = {
488 [0] = {
489 .name = "HDMI",
490 .start = 0xe6be0000,
491 .end = 0xe6be00ff,
492 .flags = IORESOURCE_MEM,
493 },
494 [1] = {
495 /* There's also an HDMI interrupt on INTCS @ 0x18e0 */
496 .start = evt2irq(0x17e0),
497 .flags = IORESOURCE_IRQ,
498 },
499};
500
501static struct platform_device hdmi_device = {
502 .name = "sh-mobile-hdmi",
503 .num_resources = ARRAY_SIZE(hdmi_resources),
504 .resource = hdmi_resources,
505 .id = -1,
506 .dev = {
507 .platform_data = &hdmi_info,
508 },
509};
510
511static struct platform_device fsi_hdmi_device = { 505static struct platform_device fsi_hdmi_device = {
512 .name = "sh_fsi2_b_hdmi", 506 .name = "sh_fsi2_b_hdmi",
513}; 507};
@@ -1274,8 +1268,8 @@ static struct platform_device *mackerel_devices[] __initdata = {
1274 &sh_mmcif_device, 1268 &sh_mmcif_device,
1275 &ceu_device, 1269 &ceu_device,
1276 &mackerel_camera, 1270 &mackerel_camera,
1277 &hdmi_lcdc_device,
1278 &hdmi_device, 1271 &hdmi_device,
1272 &hdmi_lcdc_device,
1279 &meram_device, 1273 &meram_device,
1280}; 1274};
1281 1275
diff --git a/arch/arm/plat-omap/common.c b/arch/arm/plat-omap/common.c
index 4de7d1e79e73..f1e46ea6b81d 100644
--- a/arch/arm/plat-omap/common.c
+++ b/arch/arm/plat-omap/common.c
@@ -15,7 +15,6 @@
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/io.h> 16#include <linux/io.h>
17#include <linux/dma-mapping.h> 17#include <linux/dma-mapping.h>
18#include <linux/omapfb.h>
19 18
20#include <plat/common.h> 19#include <plat/common.h>
21#include <plat/board.h> 20#include <plat/board.h>
@@ -65,7 +64,6 @@ const void *__init omap_get_var_config(u16 tag, size_t *len)
65 64
66void __init omap_reserve(void) 65void __init omap_reserve(void)
67{ 66{
68 omapfb_reserve_sdram_memblock();
69 omap_vram_reserve_sdram_memblock(); 67 omap_vram_reserve_sdram_memblock();
70 omap_dsp_reserve_sdram_memblock(); 68 omap_dsp_reserve_sdram_memblock();
71 omap_secure_ram_reserve_memblock(); 69 omap_secure_ram_reserve_memblock();
diff --git a/arch/arm/plat-omap/fb.c b/arch/arm/plat-omap/fb.c
index c9e5d7298c40..dd6f92c99e56 100644
--- a/arch/arm/plat-omap/fb.c
+++ b/arch/arm/plat-omap/fb.c
@@ -34,15 +34,11 @@
34#include <asm/mach/map.h> 34#include <asm/mach/map.h>
35 35
36#include <plat/board.h> 36#include <plat/board.h>
37#include <plat/sram.h>
38
39#include "fb.h"
40 37
41#if defined(CONFIG_FB_OMAP) || defined(CONFIG_FB_OMAP_MODULE) 38#if defined(CONFIG_FB_OMAP) || defined(CONFIG_FB_OMAP_MODULE)
42 39
40static bool omapfb_lcd_configured;
43static struct omapfb_platform_data omapfb_config; 41static struct omapfb_platform_data omapfb_config;
44static int config_invalid;
45static int configured_regions;
46 42
47static u64 omap_fb_dma_mask = ~(u32)0; 43static u64 omap_fb_dma_mask = ~(u32)0;
48 44
@@ -57,302 +53,21 @@ static struct platform_device omap_fb_device = {
57 .num_resources = 0, 53 .num_resources = 0,
58}; 54};
59 55
60void omapfb_set_platform_data(struct omapfb_platform_data *data) 56void __init omapfb_set_lcd_config(const struct omap_lcd_config *config)
61{
62}
63
64static inline int ranges_overlap(unsigned long start1, unsigned long size1,
65 unsigned long start2, unsigned long size2)
66{
67 return (start1 >= start2 && start1 < start2 + size2) ||
68 (start2 >= start1 && start2 < start1 + size1);
69}
70
71static inline int range_included(unsigned long start1, unsigned long size1,
72 unsigned long start2, unsigned long size2)
73{
74 return start1 >= start2 && start1 + size1 <= start2 + size2;
75}
76
77
78/* Check if there is an overlapping region. */
79static int fbmem_region_reserved(unsigned long start, size_t size)
80{
81 struct omapfb_mem_region *rg;
82 int i;
83
84 rg = &omapfb_config.mem_desc.region[0];
85 for (i = 0; i < OMAPFB_PLANE_NUM; i++, rg++) {
86 if (!rg->paddr)
87 /* Empty slot. */
88 continue;
89 if (ranges_overlap(start, size, rg->paddr, rg->size))
90 return 1;
91 }
92 return 0;
93}
94
95/*
96 * Get the region_idx`th region from board config/ATAG and convert it to
97 * our internal format.
98 */
99static int __init get_fbmem_region(int region_idx, struct omapfb_mem_region *rg)
100{ 57{
101 const struct omap_fbmem_config *conf; 58 omapfb_config.lcd = *config;
102 u32 paddr; 59 omapfb_lcd_configured = true;
103
104 conf = omap_get_nr_config(OMAP_TAG_FBMEM,
105 struct omap_fbmem_config, region_idx);
106 if (conf == NULL)
107 return -ENOENT;
108
109 paddr = conf->start;
110 /*
111 * Low bits encode the page allocation mode, if high bits
112 * are zero. Otherwise we need a page aligned fixed
113 * address.
114 */
115 memset(rg, 0, sizeof(*rg));
116 rg->type = paddr & ~PAGE_MASK;
117 rg->paddr = paddr & PAGE_MASK;
118 rg->size = PAGE_ALIGN(conf->size);
119 return 0;
120} 60}
121 61
122static int set_fbmem_region_type(struct omapfb_mem_region *rg, int mem_type, 62static int __init omap_init_fb(void)
123 unsigned long mem_start,
124 unsigned long mem_size)
125{
126 /*
127 * Check if the configuration specifies the type explicitly.
128 * type = 0 && paddr = 0, a default don't care case maps to
129 * the SDRAM type.
130 */
131 if (rg->type || !rg->paddr)
132 return 0;
133 if (ranges_overlap(rg->paddr, rg->size, mem_start, mem_size)) {
134 rg->type = mem_type;
135 return 0;
136 }
137 /* Can't determine it. */
138 return -1;
139}
140
141static int check_fbmem_region(int region_idx, struct omapfb_mem_region *rg,
142 unsigned long start_avail, unsigned size_avail)
143{ 63{
144 unsigned long paddr = rg->paddr;
145 size_t size = rg->size;
146
147 if (rg->type > OMAPFB_MEMTYPE_MAX) {
148 printk(KERN_ERR
149 "Invalid start address for FB region %d\n", region_idx);
150 return -EINVAL;
151 }
152
153 if (!rg->size) {
154 printk(KERN_ERR "Zero size for FB region %d\n", region_idx);
155 return -EINVAL;
156 }
157
158 if (!paddr)
159 /* Allocate this dynamically, leave paddr 0 for now. */
160 return 0;
161
162 /* 64 /*
163 * Fixed region for the given RAM range. Check if it's already 65 * If the board file has not set the lcd config with
164 * reserved by the FB code or someone else. 66 * omapfb_set_lcd_config(), don't bother registering the omapfb device
165 */ 67 */
166 if (fbmem_region_reserved(paddr, size) || 68 if (!omapfb_lcd_configured)
167 !range_included(paddr, size, start_avail, size_avail)) {
168 printk(KERN_ERR "Trying to use reserved memory "
169 "for FB region %d\n", region_idx);
170 return -EINVAL;
171 }
172
173 return 0;
174}
175
176static int valid_sdram(unsigned long addr, unsigned long size)
177{
178 return memblock_is_region_memory(addr, size);
179}
180
181static int reserve_sdram(unsigned long addr, unsigned long size)
182{
183 if (memblock_is_region_reserved(addr, size))
184 return -EBUSY;
185 if (memblock_reserve(addr, size))
186 return -ENOMEM;
187 return 0;
188}
189
190/*
191 * Called from map_io. We need to call to this early enough so that we
192 * can reserve the fixed SDRAM regions before VM could get hold of them.
193 */
194void __init omapfb_reserve_sdram_memblock(void)
195{
196 unsigned long reserved = 0;
197 int i;
198
199 if (config_invalid)
200 return;
201
202 for (i = 0; ; i++) {
203 struct omapfb_mem_region rg;
204
205 if (get_fbmem_region(i, &rg) < 0)
206 break;
207
208 if (i == OMAPFB_PLANE_NUM) {
209 pr_err("Extraneous FB mem configuration entries\n");
210 config_invalid = 1;
211 return;
212 }
213
214 /* Check if it's our memory type. */
215 if (rg.type != OMAPFB_MEMTYPE_SDRAM)
216 continue;
217
218 /* Check if the region falls within SDRAM */
219 if (rg.paddr && !valid_sdram(rg.paddr, rg.size))
220 continue;
221
222 if (rg.size == 0) {
223 pr_err("Zero size for FB region %d\n", i);
224 config_invalid = 1;
225 return;
226 }
227
228 if (rg.paddr) {
229 if (reserve_sdram(rg.paddr, rg.size)) {
230 pr_err("Trying to use reserved memory for FB region %d\n",
231 i);
232 config_invalid = 1;
233 return;
234 }
235 reserved += rg.size;
236 }
237
238 if (omapfb_config.mem_desc.region[i].size) {
239 pr_err("FB region %d already set\n", i);
240 config_invalid = 1;
241 return;
242 }
243
244 omapfb_config.mem_desc.region[i] = rg;
245 configured_regions++;
246 }
247 omapfb_config.mem_desc.region_cnt = i;
248 if (reserved)
249 pr_info("Reserving %lu bytes SDRAM for frame buffer\n",
250 reserved);
251}
252
253/*
254 * Called at sram init time, before anything is pushed to the SRAM stack.
255 * Because of the stack scheme, we will allocate everything from the
256 * start of the lowest address region to the end of SRAM. This will also
257 * include padding for page alignment and possible holes between regions.
258 *
259 * As opposed to the SDRAM case, we'll also do any dynamic allocations at
260 * this point, since the driver built as a module would have problem with
261 * freeing / reallocating the regions.
262 */
263unsigned long __init omapfb_reserve_sram(unsigned long sram_pstart,
264 unsigned long sram_vstart,
265 unsigned long sram_size,
266 unsigned long pstart_avail,
267 unsigned long size_avail)
268{
269 struct omapfb_mem_region rg;
270 unsigned long pend_avail;
271 unsigned long reserved;
272 int i;
273
274 if (config_invalid)
275 return 0; 69 return 0;
276 70
277 reserved = 0;
278 pend_avail = pstart_avail + size_avail;
279 for (i = 0; ; i++) {
280 if (get_fbmem_region(i, &rg) < 0)
281 break;
282 if (i == OMAPFB_PLANE_NUM) {
283 printk(KERN_ERR
284 "Extraneous FB mem configuration entries\n");
285 config_invalid = 1;
286 return 0;
287 }
288
289 /* Check if it's our memory type. */
290 if (set_fbmem_region_type(&rg, OMAPFB_MEMTYPE_SRAM,
291 sram_pstart, sram_size) < 0 ||
292 (rg.type != OMAPFB_MEMTYPE_SRAM))
293 continue;
294 BUG_ON(omapfb_config.mem_desc.region[i].size);
295
296 if (check_fbmem_region(i, &rg, pstart_avail, size_avail) < 0) {
297 config_invalid = 1;
298 return 0;
299 }
300
301 if (!rg.paddr) {
302 /* Dynamic allocation */
303 if ((size_avail & PAGE_MASK) < rg.size) {
304 printk("Not enough SRAM for FB region %d\n",
305 i);
306 config_invalid = 1;
307 return 0;
308 }
309 size_avail = (size_avail - rg.size) & PAGE_MASK;
310 rg.paddr = pstart_avail + size_avail;
311 }
312 /* Reserve everything above the start of the region. */
313 if (pend_avail - rg.paddr > reserved)
314 reserved = pend_avail - rg.paddr;
315 size_avail = pend_avail - reserved - pstart_avail;
316
317 /*
318 * We have a kernel mapping for this already, so the
319 * driver won't have to make one.
320 */
321 rg.vaddr = (void *)(sram_vstart + rg.paddr - sram_pstart);
322 omapfb_config.mem_desc.region[i] = rg;
323 configured_regions++;
324 }
325 omapfb_config.mem_desc.region_cnt = i;
326 if (reserved)
327 pr_info("Reserving %lu bytes SRAM for frame buffer\n",
328 reserved);
329 return reserved;
330}
331
332void omapfb_set_ctrl_platform_data(void *data)
333{
334 omapfb_config.ctrl_platform_data = data;
335}
336
337static int __init omap_init_fb(void)
338{
339 const struct omap_lcd_config *conf;
340
341 if (config_invalid)
342 return 0;
343 if (configured_regions != omapfb_config.mem_desc.region_cnt) {
344 printk(KERN_ERR "Invalid FB mem configuration entries\n");
345 return 0;
346 }
347 conf = omap_get_config(OMAP_TAG_LCD, struct omap_lcd_config);
348 if (conf == NULL) {
349 if (configured_regions)
350 /* FB mem config, but no LCD config? */
351 printk(KERN_ERR "Missing LCD configuration\n");
352 return 0;
353 }
354 omapfb_config.lcd = *conf;
355
356 return platform_device_register(&omap_fb_device); 71 return platform_device_register(&omap_fb_device);
357} 72}
358 73
@@ -374,11 +89,6 @@ static struct platform_device omap_fb_device = {
374 .num_resources = 0, 89 .num_resources = 0,
375}; 90};
376 91
377void omapfb_set_platform_data(struct omapfb_platform_data *data)
378{
379 omapfb_config = *data;
380}
381
382static int __init omap_init_fb(void) 92static int __init omap_init_fb(void)
383{ 93{
384 return platform_device_register(&omap_fb_device); 94 return platform_device_register(&omap_fb_device);
@@ -386,36 +96,10 @@ static int __init omap_init_fb(void)
386 96
387arch_initcall(omap_init_fb); 97arch_initcall(omap_init_fb);
388 98
389void omapfb_reserve_sdram_memblock(void)
390{
391}
392
393unsigned long __init omapfb_reserve_sram(unsigned long sram_pstart,
394 unsigned long sram_vstart,
395 unsigned long sram_size,
396 unsigned long start_avail,
397 unsigned long size_avail)
398{
399 return 0;
400}
401
402#else 99#else
403 100
404void omapfb_set_platform_data(struct omapfb_platform_data *data) 101void __init omapfb_set_lcd_config(const struct omap_lcd_config *config)
405{
406}
407
408void omapfb_reserve_sdram_memblock(void)
409{
410}
411
412unsigned long __init omapfb_reserve_sram(unsigned long sram_pstart,
413 unsigned long sram_vstart,
414 unsigned long sram_size,
415 unsigned long start_avail,
416 unsigned long size_avail)
417{ 102{
418 return 0;
419} 103}
420 104
421#endif 105#endif
diff --git a/arch/arm/plat-omap/fb.h b/arch/arm/plat-omap/fb.h
deleted file mode 100644
index d765d0bd8520..000000000000
--- a/arch/arm/plat-omap/fb.h
+++ /dev/null
@@ -1,10 +0,0 @@
1#ifndef __PLAT_OMAP_FB_H__
2#define __PLAT_OMAP_FB_H__
3
4extern unsigned long omapfb_reserve_sram(unsigned long sram_pstart,
5 unsigned long sram_vstart,
6 unsigned long sram_size,
7 unsigned long pstart_avail,
8 unsigned long size_avail);
9
10#endif /* __PLAT_OMAP_FB_H__ */
diff --git a/arch/arm/plat-omap/include/plat/blizzard.h b/arch/arm/plat-omap/include/plat/blizzard.h
deleted file mode 100644
index 56e7f2e7d12f..000000000000
--- a/arch/arm/plat-omap/include/plat/blizzard.h
+++ /dev/null
@@ -1,12 +0,0 @@
1#ifndef _BLIZZARD_H
2#define _BLIZZARD_H
3
4struct blizzard_platform_data {
5 void (*power_up)(struct device *dev);
6 void (*power_down)(struct device *dev);
7 unsigned long (*get_clock_rate)(struct device *dev);
8
9 unsigned te_connected:1;
10};
11
12#endif
diff --git a/arch/arm/plat-omap/include/plat/board.h b/arch/arm/plat-omap/include/plat/board.h
index 97126dfd2888..d5eb4c87db9d 100644
--- a/arch/arm/plat-omap/include/plat/board.h
+++ b/arch/arm/plat-omap/include/plat/board.h
@@ -28,9 +28,7 @@ enum {
28 28
29/* Different peripheral ids */ 29/* Different peripheral ids */
30#define OMAP_TAG_CLOCK 0x4f01 30#define OMAP_TAG_CLOCK 0x4f01
31#define OMAP_TAG_LCD 0x4f05
32#define OMAP_TAG_GPIO_SWITCH 0x4f06 31#define OMAP_TAG_GPIO_SWITCH 0x4f06
33#define OMAP_TAG_FBMEM 0x4f08
34#define OMAP_TAG_STI_CONSOLE 0x4f09 32#define OMAP_TAG_STI_CONSOLE 0x4f09
35#define OMAP_TAG_CAMERA_SENSOR 0x4f0a 33#define OMAP_TAG_CAMERA_SENSOR 0x4f0a
36 34
diff --git a/arch/arm/plat-omap/include/plat/hwa742.h b/arch/arm/plat-omap/include/plat/hwa742.h
deleted file mode 100644
index 886248d32b49..000000000000
--- a/arch/arm/plat-omap/include/plat/hwa742.h
+++ /dev/null
@@ -1,8 +0,0 @@
1#ifndef _HWA742_H
2#define _HWA742_H
3
4struct hwa742_platform_data {
5 unsigned te_connected:1;
6};
7
8#endif
diff --git a/arch/arm/plat-omap/include/plat/vram.h b/arch/arm/plat-omap/include/plat/vram.h
index 0aa4ecd12c7d..4d65b7d06e6c 100644
--- a/arch/arm/plat-omap/include/plat/vram.h
+++ b/arch/arm/plat-omap/include/plat/vram.h
@@ -23,40 +23,21 @@
23 23
24#include <linux/types.h> 24#include <linux/types.h>
25 25
26#define OMAP_VRAM_MEMTYPE_SDRAM 0
27#define OMAP_VRAM_MEMTYPE_SRAM 1
28#define OMAP_VRAM_MEMTYPE_MAX 1
29
30extern int omap_vram_add_region(unsigned long paddr, size_t size); 26extern int omap_vram_add_region(unsigned long paddr, size_t size);
31extern int omap_vram_free(unsigned long paddr, size_t size); 27extern int omap_vram_free(unsigned long paddr, size_t size);
32extern int omap_vram_alloc(int mtype, size_t size, unsigned long *paddr); 28extern int omap_vram_alloc(size_t size, unsigned long *paddr);
33extern int omap_vram_reserve(unsigned long paddr, size_t size); 29extern int omap_vram_reserve(unsigned long paddr, size_t size);
34extern void omap_vram_get_info(unsigned long *vram, unsigned long *free_vram, 30extern void omap_vram_get_info(unsigned long *vram, unsigned long *free_vram,
35 unsigned long *largest_free_block); 31 unsigned long *largest_free_block);
36 32
37#ifdef CONFIG_OMAP2_VRAM 33#ifdef CONFIG_OMAP2_VRAM
38extern void omap_vram_set_sdram_vram(u32 size, u32 start); 34extern void omap_vram_set_sdram_vram(u32 size, u32 start);
39extern void omap_vram_set_sram_vram(u32 size, u32 start);
40 35
41extern void omap_vram_reserve_sdram_memblock(void); 36extern void omap_vram_reserve_sdram_memblock(void);
42extern unsigned long omap_vram_reserve_sram(unsigned long sram_pstart,
43 unsigned long sram_vstart,
44 unsigned long sram_size,
45 unsigned long pstart_avail,
46 unsigned long size_avail);
47#else 37#else
48static inline void omap_vram_set_sdram_vram(u32 size, u32 start) { } 38static inline void omap_vram_set_sdram_vram(u32 size, u32 start) { }
49static inline void omap_vram_set_sram_vram(u32 size, u32 start) { }
50 39
51static inline void omap_vram_reserve_sdram_memblock(void) { } 40static inline void omap_vram_reserve_sdram_memblock(void) { }
52static inline unsigned long omap_vram_reserve_sram(unsigned long sram_pstart,
53 unsigned long sram_vstart,
54 unsigned long sram_size,
55 unsigned long pstart_avail,
56 unsigned long size_avail)
57{
58 return 0;
59}
60#endif 41#endif
61 42
62#endif 43#endif
diff --git a/arch/arm/plat-samsung/include/plat/regs-fb.h b/arch/arm/plat-samsung/include/plat/regs-fb.h
index 8f39aa5b26ea..9a78012d6f43 100644
--- a/arch/arm/plat-samsung/include/plat/regs-fb.h
+++ b/arch/arm/plat-samsung/include/plat/regs-fb.h
@@ -91,6 +91,9 @@
91#define VIDCON1_VSTATUS_BACKPORCH (0x1 << 13) 91#define VIDCON1_VSTATUS_BACKPORCH (0x1 << 13)
92#define VIDCON1_VSTATUS_ACTIVE (0x2 << 13) 92#define VIDCON1_VSTATUS_ACTIVE (0x2 << 13)
93#define VIDCON1_VSTATUS_FRONTPORCH (0x0 << 13) 93#define VIDCON1_VSTATUS_FRONTPORCH (0x0 << 13)
94#define VIDCON1_VCLK_MASK (0x3 << 9)
95#define VIDCON1_VCLK_HOLD (0x0 << 9)
96#define VIDCON1_VCLK_RUN (0x1 << 9)
94 97
95#define VIDCON1_INV_VCLK (1 << 7) 98#define VIDCON1_INV_VCLK (1 << 7)
96#define VIDCON1_INV_HSYNC (1 << 6) 99#define VIDCON1_INV_HSYNC (1 << 6)
@@ -164,15 +167,17 @@
164#define VIDTCON1_HSPW(_x) ((_x) << 0) 167#define VIDTCON1_HSPW(_x) ((_x) << 0)
165 168
166#define VIDTCON2 (0x18) 169#define VIDTCON2 (0x18)
170#define VIDTCON2_LINEVAL_E(_x) ((((_x) & 0x800) >> 11) << 23)
167#define VIDTCON2_LINEVAL_MASK (0x7ff << 11) 171#define VIDTCON2_LINEVAL_MASK (0x7ff << 11)
168#define VIDTCON2_LINEVAL_SHIFT (11) 172#define VIDTCON2_LINEVAL_SHIFT (11)
169#define VIDTCON2_LINEVAL_LIMIT (0x7ff) 173#define VIDTCON2_LINEVAL_LIMIT (0x7ff)
170#define VIDTCON2_LINEVAL(_x) ((_x) << 11) 174#define VIDTCON2_LINEVAL(_x) (((_x) & 0x7ff) << 11)
171 175
176#define VIDTCON2_HOZVAL_E(_x) ((((_x) & 0x800) >> 11) << 22)
172#define VIDTCON2_HOZVAL_MASK (0x7ff << 0) 177#define VIDTCON2_HOZVAL_MASK (0x7ff << 0)
173#define VIDTCON2_HOZVAL_SHIFT (0) 178#define VIDTCON2_HOZVAL_SHIFT (0)
174#define VIDTCON2_HOZVAL_LIMIT (0x7ff) 179#define VIDTCON2_HOZVAL_LIMIT (0x7ff)
175#define VIDTCON2_HOZVAL(_x) ((_x) << 0) 180#define VIDTCON2_HOZVAL(_x) (((_x) & 0x7ff) << 0)
176 181
177/* WINCONx */ 182/* WINCONx */
178 183
@@ -228,25 +233,29 @@
228/* Local input channels (windows 0-2) */ 233/* Local input channels (windows 0-2) */
229#define SHADOWCON_CHx_LOCAL_ENABLE(_win) (1 << (5 + (_win))) 234#define SHADOWCON_CHx_LOCAL_ENABLE(_win) (1 << (5 + (_win)))
230 235
236#define VIDOSDxA_TOPLEFT_X_E(_x) ((((_x) & 0x800) >> 11) << 23)
231#define VIDOSDxA_TOPLEFT_X_MASK (0x7ff << 11) 237#define VIDOSDxA_TOPLEFT_X_MASK (0x7ff << 11)
232#define VIDOSDxA_TOPLEFT_X_SHIFT (11) 238#define VIDOSDxA_TOPLEFT_X_SHIFT (11)
233#define VIDOSDxA_TOPLEFT_X_LIMIT (0x7ff) 239#define VIDOSDxA_TOPLEFT_X_LIMIT (0x7ff)
234#define VIDOSDxA_TOPLEFT_X(_x) ((_x) << 11) 240#define VIDOSDxA_TOPLEFT_X(_x) (((_x) & 0x7ff) << 11)
235 241
242#define VIDOSDxA_TOPLEFT_Y_E(_x) ((((_x) & 0x800) >> 11) << 22)
236#define VIDOSDxA_TOPLEFT_Y_MASK (0x7ff << 0) 243#define VIDOSDxA_TOPLEFT_Y_MASK (0x7ff << 0)
237#define VIDOSDxA_TOPLEFT_Y_SHIFT (0) 244#define VIDOSDxA_TOPLEFT_Y_SHIFT (0)
238#define VIDOSDxA_TOPLEFT_Y_LIMIT (0x7ff) 245#define VIDOSDxA_TOPLEFT_Y_LIMIT (0x7ff)
239#define VIDOSDxA_TOPLEFT_Y(_x) ((_x) << 0) 246#define VIDOSDxA_TOPLEFT_Y(_x) (((_x) & 0x7ff) << 0)
240 247
248#define VIDOSDxB_BOTRIGHT_X_E(_x) ((((_x) & 0x800) >> 11) << 23)
241#define VIDOSDxB_BOTRIGHT_X_MASK (0x7ff << 11) 249#define VIDOSDxB_BOTRIGHT_X_MASK (0x7ff << 11)
242#define VIDOSDxB_BOTRIGHT_X_SHIFT (11) 250#define VIDOSDxB_BOTRIGHT_X_SHIFT (11)
243#define VIDOSDxB_BOTRIGHT_X_LIMIT (0x7ff) 251#define VIDOSDxB_BOTRIGHT_X_LIMIT (0x7ff)
244#define VIDOSDxB_BOTRIGHT_X(_x) ((_x) << 11) 252#define VIDOSDxB_BOTRIGHT_X(_x) (((_x) & 0x7ff) << 11)
245 253
254#define VIDOSDxB_BOTRIGHT_Y_E(_x) ((((_x) & 0x800) >> 11) << 22)
246#define VIDOSDxB_BOTRIGHT_Y_MASK (0x7ff << 0) 255#define VIDOSDxB_BOTRIGHT_Y_MASK (0x7ff << 0)
247#define VIDOSDxB_BOTRIGHT_Y_SHIFT (0) 256#define VIDOSDxB_BOTRIGHT_Y_SHIFT (0)
248#define VIDOSDxB_BOTRIGHT_Y_LIMIT (0x7ff) 257#define VIDOSDxB_BOTRIGHT_Y_LIMIT (0x7ff)
249#define VIDOSDxB_BOTRIGHT_Y(_x) ((_x) << 0) 258#define VIDOSDxB_BOTRIGHT_Y(_x) (((_x) & 0x7ff) << 0)
250 259
251/* For VIDOSD[1..4]C */ 260/* For VIDOSD[1..4]C */
252#define VIDISD14C_ALPHA0_R(_x) ((_x) << 20) 261#define VIDISD14C_ALPHA0_R(_x) ((_x) << 20)
@@ -278,15 +287,17 @@
278#define VIDW_BUF_END1(_buff) (0xD4 + ((_buff) * 8)) 287#define VIDW_BUF_END1(_buff) (0xD4 + ((_buff) * 8))
279#define VIDW_BUF_SIZE(_buff) (0x100 + ((_buff) * 4)) 288#define VIDW_BUF_SIZE(_buff) (0x100 + ((_buff) * 4))
280 289
290#define VIDW_BUF_SIZE_OFFSET_E(_x) ((((_x) & 0x2000) >> 13) << 27)
281#define VIDW_BUF_SIZE_OFFSET_MASK (0x1fff << 13) 291#define VIDW_BUF_SIZE_OFFSET_MASK (0x1fff << 13)
282#define VIDW_BUF_SIZE_OFFSET_SHIFT (13) 292#define VIDW_BUF_SIZE_OFFSET_SHIFT (13)
283#define VIDW_BUF_SIZE_OFFSET_LIMIT (0x1fff) 293#define VIDW_BUF_SIZE_OFFSET_LIMIT (0x1fff)
284#define VIDW_BUF_SIZE_OFFSET(_x) ((_x) << 13) 294#define VIDW_BUF_SIZE_OFFSET(_x) (((_x) & 0x1fff) << 13)
285 295
296#define VIDW_BUF_SIZE_PAGEWIDTH_E(_x) ((((_x) & 0x2000) >> 13) << 26)
286#define VIDW_BUF_SIZE_PAGEWIDTH_MASK (0x1fff << 0) 297#define VIDW_BUF_SIZE_PAGEWIDTH_MASK (0x1fff << 0)
287#define VIDW_BUF_SIZE_PAGEWIDTH_SHIFT (0) 298#define VIDW_BUF_SIZE_PAGEWIDTH_SHIFT (0)
288#define VIDW_BUF_SIZE_PAGEWIDTH_LIMIT (0x1fff) 299#define VIDW_BUF_SIZE_PAGEWIDTH_LIMIT (0x1fff)
289#define VIDW_BUF_SIZE_PAGEWIDTH(_x) ((_x) << 0) 300#define VIDW_BUF_SIZE_PAGEWIDTH(_x) (((_x) & 0x1fff) << 0)
290 301
291/* Interrupt controls and status */ 302/* Interrupt controls and status */
292 303
@@ -384,3 +395,9 @@
384#define WPALCON_W0PAL_16BPP_A555 (0x5 << 0) 395#define WPALCON_W0PAL_16BPP_A555 (0x5 << 0)
385#define WPALCON_W0PAL_16BPP_565 (0x6 << 0) 396#define WPALCON_W0PAL_16BPP_565 (0x6 << 0)
386 397
398/* Blending equation control */
399#define BLENDCON (0x260)
400#define BLENDCON_NEW_MASK (1 << 0)
401#define BLENDCON_NEW_8BIT_ALPHA_VALUE (1 << 0)
402#define BLENDCON_NEW_4BIT_ALPHA_VALUE (0 << 0)
403
diff --git a/arch/sh/boards/mach-ap325rxa/setup.c b/arch/sh/boards/mach-ap325rxa/setup.c
index ebd0f818a25f..8cf02e343333 100644
--- a/arch/sh/boards/mach-ap325rxa/setup.c
+++ b/arch/sh/boards/mach-ap325rxa/setup.c
@@ -157,7 +157,7 @@ static struct platform_device nand_flash_device = {
157#define PORT_DRVCRA 0xA405018A 157#define PORT_DRVCRA 0xA405018A
158#define PORT_DRVCRB 0xA405018C 158#define PORT_DRVCRB 0xA405018C
159 159
160static int ap320_wvga_set_brightness(void *board_data, int brightness) 160static int ap320_wvga_set_brightness(int brightness)
161{ 161{
162 if (brightness) { 162 if (brightness) {
163 gpio_set_value(GPIO_PTS3, 0); 163 gpio_set_value(GPIO_PTS3, 0);
@@ -170,12 +170,12 @@ static int ap320_wvga_set_brightness(void *board_data, int brightness)
170 return 0; 170 return 0;
171} 171}
172 172
173static int ap320_wvga_get_brightness(void *board_data) 173static int ap320_wvga_get_brightness(void)
174{ 174{
175 return gpio_get_value(GPIO_PTS3); 175 return gpio_get_value(GPIO_PTS3);
176} 176}
177 177
178static void ap320_wvga_power_on(void *board_data, struct fb_info *info) 178static void ap320_wvga_power_on(void)
179{ 179{
180 msleep(100); 180 msleep(100);
181 181
@@ -183,7 +183,7 @@ static void ap320_wvga_power_on(void *board_data, struct fb_info *info)
183 __raw_writew(FPGA_LCDREG_VAL, FPGA_LCDREG); 183 __raw_writew(FPGA_LCDREG_VAL, FPGA_LCDREG);
184} 184}
185 185
186static void ap320_wvga_power_off(void *board_data) 186static void ap320_wvga_power_off(void)
187{ 187{
188 /* ASD AP-320/325 LCD OFF */ 188 /* ASD AP-320/325 LCD OFF */
189 __raw_writew(0, FPGA_LCDREG); 189 __raw_writew(0, FPGA_LCDREG);
@@ -211,21 +211,19 @@ static struct sh_mobile_lcdc_info lcdc_info = {
211 .fourcc = V4L2_PIX_FMT_RGB565, 211 .fourcc = V4L2_PIX_FMT_RGB565,
212 .interface_type = RGB18, 212 .interface_type = RGB18,
213 .clock_divider = 1, 213 .clock_divider = 1,
214 .lcd_cfg = ap325rxa_lcdc_modes, 214 .lcd_modes = ap325rxa_lcdc_modes,
215 .num_cfg = ARRAY_SIZE(ap325rxa_lcdc_modes), 215 .num_modes = ARRAY_SIZE(ap325rxa_lcdc_modes),
216 .lcd_size_cfg = { /* 7.0 inch */ 216 .panel_cfg = {
217 .width = 152, 217 .width = 152, /* 7.0 inch */
218 .height = 91, 218 .height = 91,
219 },
220 .board_cfg = {
221 .display_on = ap320_wvga_power_on, 219 .display_on = ap320_wvga_power_on,
222 .display_off = ap320_wvga_power_off, 220 .display_off = ap320_wvga_power_off,
223 .set_brightness = ap320_wvga_set_brightness,
224 .get_brightness = ap320_wvga_get_brightness,
225 }, 221 },
226 .bl_info = { 222 .bl_info = {
227 .name = "sh_mobile_lcdc_bl", 223 .name = "sh_mobile_lcdc_bl",
228 .max_brightness = 1, 224 .max_brightness = 1,
225 .set_brightness = ap320_wvga_set_brightness,
226 .get_brightness = ap320_wvga_get_brightness,
229 }, 227 },
230 } 228 }
231}; 229};
diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c
index 59daae2f29db..e5ac12b2ce65 100644
--- a/arch/sh/boards/mach-ecovec24/setup.c
+++ b/arch/sh/boards/mach-ecovec24/setup.c
@@ -310,14 +310,14 @@ static const struct fb_videomode ecovec_dvi_modes[] = {
310 }, 310 },
311}; 311};
312 312
313static int ecovec24_set_brightness(void *board_data, int brightness) 313static int ecovec24_set_brightness(int brightness)
314{ 314{
315 gpio_set_value(GPIO_PTR1, brightness); 315 gpio_set_value(GPIO_PTR1, brightness);
316 316
317 return 0; 317 return 0;
318} 318}
319 319
320static int ecovec24_get_brightness(void *board_data) 320static int ecovec24_get_brightness(void)
321{ 321{
322 return gpio_get_value(GPIO_PTR1); 322 return gpio_get_value(GPIO_PTR1);
323} 323}
@@ -327,17 +327,15 @@ static struct sh_mobile_lcdc_info lcdc_info = {
327 .interface_type = RGB18, 327 .interface_type = RGB18,
328 .chan = LCDC_CHAN_MAINLCD, 328 .chan = LCDC_CHAN_MAINLCD,
329 .fourcc = V4L2_PIX_FMT_RGB565, 329 .fourcc = V4L2_PIX_FMT_RGB565,
330 .lcd_size_cfg = { /* 7.0 inch */ 330 .panel_cfg = { /* 7.0 inch */
331 .width = 152, 331 .width = 152,
332 .height = 91, 332 .height = 91,
333 }, 333 },
334 .board_cfg = {
335 .set_brightness = ecovec24_set_brightness,
336 .get_brightness = ecovec24_get_brightness,
337 },
338 .bl_info = { 334 .bl_info = {
339 .name = "sh_mobile_lcdc_bl", 335 .name = "sh_mobile_lcdc_bl",
340 .max_brightness = 1, 336 .max_brightness = 1,
337 .set_brightness = ecovec24_set_brightness,
338 .get_brightness = ecovec24_get_brightness,
341 }, 339 },
342 } 340 }
343}; 341};
@@ -1118,8 +1116,8 @@ static int __init arch_setup(void)
1118 /* DVI */ 1116 /* DVI */
1119 lcdc_info.clock_source = LCDC_CLK_EXTERNAL; 1117 lcdc_info.clock_source = LCDC_CLK_EXTERNAL;
1120 lcdc_info.ch[0].clock_divider = 1; 1118 lcdc_info.ch[0].clock_divider = 1;
1121 lcdc_info.ch[0].lcd_cfg = ecovec_dvi_modes; 1119 lcdc_info.ch[0].lcd_modes = ecovec_dvi_modes;
1122 lcdc_info.ch[0].num_cfg = ARRAY_SIZE(ecovec_dvi_modes); 1120 lcdc_info.ch[0].num_modes = ARRAY_SIZE(ecovec_dvi_modes);
1123 1121
1124 gpio_set_value(GPIO_PTA2, 1); 1122 gpio_set_value(GPIO_PTA2, 1);
1125 gpio_set_value(GPIO_PTU1, 1); 1123 gpio_set_value(GPIO_PTU1, 1);
@@ -1127,8 +1125,8 @@ static int __init arch_setup(void)
1127 /* Panel */ 1125 /* Panel */
1128 lcdc_info.clock_source = LCDC_CLK_PERIPHERAL; 1126 lcdc_info.clock_source = LCDC_CLK_PERIPHERAL;
1129 lcdc_info.ch[0].clock_divider = 2; 1127 lcdc_info.ch[0].clock_divider = 2;
1130 lcdc_info.ch[0].lcd_cfg = ecovec_lcd_modes; 1128 lcdc_info.ch[0].lcd_modes = ecovec_lcd_modes;
1131 lcdc_info.ch[0].num_cfg = ARRAY_SIZE(ecovec_lcd_modes); 1129 lcdc_info.ch[0].num_modes = ARRAY_SIZE(ecovec_lcd_modes);
1132 1130
1133 gpio_set_value(GPIO_PTR1, 1); 1131 gpio_set_value(GPIO_PTR1, 1);
1134 1132
diff --git a/arch/sh/boards/mach-kfr2r09/lcd_wqvga.c b/arch/sh/boards/mach-kfr2r09/lcd_wqvga.c
index 25e145fb7087..c148b36ecb65 100644
--- a/arch/sh/boards/mach-kfr2r09/lcd_wqvga.c
+++ b/arch/sh/boards/mach-kfr2r09/lcd_wqvga.c
@@ -251,8 +251,7 @@ static void display_on(void *sohandle,
251 write_memory_start(sohandle, so); 251 write_memory_start(sohandle, so);
252} 252}
253 253
254int kfr2r09_lcd_setup(void *board_data, void *sohandle, 254int kfr2r09_lcd_setup(void *sohandle, struct sh_mobile_lcdc_sys_bus_ops *so)
255 struct sh_mobile_lcdc_sys_bus_ops *so)
256{ 255{
257 /* power on */ 256 /* power on */
258 gpio_set_value(GPIO_PTF4, 0); /* PROTECT/ -> L */ 257 gpio_set_value(GPIO_PTF4, 0); /* PROTECT/ -> L */
@@ -273,8 +272,7 @@ int kfr2r09_lcd_setup(void *board_data, void *sohandle,
273 return 0; 272 return 0;
274} 273}
275 274
276void kfr2r09_lcd_start(void *board_data, void *sohandle, 275void kfr2r09_lcd_start(void *sohandle, struct sh_mobile_lcdc_sys_bus_ops *so)
277 struct sh_mobile_lcdc_sys_bus_ops *so)
278{ 276{
279 write_memory_start(sohandle, so); 277 write_memory_start(sohandle, so);
280} 278}
@@ -327,12 +325,12 @@ static int kfr2r09_lcd_backlight(int on)
327 return 0; 325 return 0;
328} 326}
329 327
330void kfr2r09_lcd_on(void *board_data, struct fb_info *info) 328void kfr2r09_lcd_on(void)
331{ 329{
332 kfr2r09_lcd_backlight(1); 330 kfr2r09_lcd_backlight(1);
333} 331}
334 332
335void kfr2r09_lcd_off(void *board_data) 333void kfr2r09_lcd_off(void)
336{ 334{
337 kfr2r09_lcd_backlight(0); 335 kfr2r09_lcd_backlight(0);
338} 336}
diff --git a/arch/sh/boards/mach-kfr2r09/setup.c b/arch/sh/boards/mach-kfr2r09/setup.c
index 5b382e1afaea..d04a55d3b877 100644
--- a/arch/sh/boards/mach-kfr2r09/setup.c
+++ b/arch/sh/boards/mach-kfr2r09/setup.c
@@ -148,13 +148,11 @@ static struct sh_mobile_lcdc_info kfr2r09_sh_lcdc_info = {
148 .interface_type = SYS18, 148 .interface_type = SYS18,
149 .clock_divider = 6, 149 .clock_divider = 6,
150 .flags = LCDC_FLAGS_DWPOL, 150 .flags = LCDC_FLAGS_DWPOL,
151 .lcd_cfg = kfr2r09_lcdc_modes, 151 .lcd_modes = kfr2r09_lcdc_modes,
152 .num_cfg = ARRAY_SIZE(kfr2r09_lcdc_modes), 152 .num_modes = ARRAY_SIZE(kfr2r09_lcdc_modes),
153 .lcd_size_cfg = { 153 .panel_cfg = {
154 .width = 35, 154 .width = 35,
155 .height = 58, 155 .height = 58,
156 },
157 .board_cfg = {
158 .setup_sys = kfr2r09_lcd_setup, 156 .setup_sys = kfr2r09_lcd_setup,
159 .start_transfer = kfr2r09_lcd_start, 157 .start_transfer = kfr2r09_lcd_start,
160 .display_on = kfr2r09_lcd_on, 158 .display_on = kfr2r09_lcd_on,
diff --git a/arch/sh/boards/mach-migor/lcd_qvga.c b/arch/sh/boards/mach-migor/lcd_qvga.c
index de9014a8a93e..8bccd345b69c 100644
--- a/arch/sh/boards/mach-migor/lcd_qvga.c
+++ b/arch/sh/boards/mach-migor/lcd_qvga.c
@@ -113,8 +113,7 @@ static const unsigned short magic3_data[] = {
113 0x0010, 0x16B0, 0x0011, 0x0111, 0x0007, 0x0061, 113 0x0010, 0x16B0, 0x0011, 0x0111, 0x0007, 0x0061,
114}; 114};
115 115
116int migor_lcd_qvga_setup(void *board_data, void *sohandle, 116int migor_lcd_qvga_setup(void *sohandle, struct sh_mobile_lcdc_sys_bus_ops *so)
117 struct sh_mobile_lcdc_sys_bus_ops *so)
118{ 117{
119 unsigned long xres = 320; 118 unsigned long xres = 320;
120 unsigned long yres = 240; 119 unsigned long yres = 240;
diff --git a/arch/sh/boards/mach-migor/setup.c b/arch/sh/boards/mach-migor/setup.c
index d37ba2720527..ff6f69c6906e 100644
--- a/arch/sh/boards/mach-migor/setup.c
+++ b/arch/sh/boards/mach-migor/setup.c
@@ -246,9 +246,9 @@ static struct sh_mobile_lcdc_info sh_mobile_lcdc_info = {
246 .fourcc = V4L2_PIX_FMT_RGB565, 246 .fourcc = V4L2_PIX_FMT_RGB565,
247 .interface_type = RGB16, 247 .interface_type = RGB16,
248 .clock_divider = 2, 248 .clock_divider = 2,
249 .lcd_cfg = migor_lcd_modes, 249 .lcd_modes = migor_lcd_modes,
250 .num_cfg = ARRAY_SIZE(migor_lcd_modes), 250 .num_modes = ARRAY_SIZE(migor_lcd_modes),
251 .lcd_size_cfg = { /* 7.0 inch */ 251 .panel_cfg = { /* 7.0 inch */
252 .width = 152, 252 .width = 152,
253 .height = 91, 253 .height = 91,
254 }, 254 },
@@ -260,13 +260,11 @@ static struct sh_mobile_lcdc_info sh_mobile_lcdc_info = {
260 .fourcc = V4L2_PIX_FMT_RGB565, 260 .fourcc = V4L2_PIX_FMT_RGB565,
261 .interface_type = SYS16A, 261 .interface_type = SYS16A,
262 .clock_divider = 10, 262 .clock_divider = 10,
263 .lcd_cfg = migor_lcd_modes, 263 .lcd_modes = migor_lcd_modes,
264 .num_cfg = ARRAY_SIZE(migor_lcd_modes), 264 .num_modes = ARRAY_SIZE(migor_lcd_modes),
265 .lcd_size_cfg = { /* 2.4 inch */ 265 .panel_cfg = {
266 .width = 49, 266 .width = 49, /* 2.4 inch */
267 .height = 37, 267 .height = 37,
268 },
269 .board_cfg = {
270 .setup_sys = migor_lcd_qvga_setup, 268 .setup_sys = migor_lcd_qvga_setup,
271 }, 269 },
272 .sys_bus_cfg = { 270 .sys_bus_cfg = {
diff --git a/arch/sh/boards/mach-se/7724/setup.c b/arch/sh/boards/mach-se/7724/setup.c
index 59f4db829e91..c540b16547c3 100644
--- a/arch/sh/boards/mach-se/7724/setup.c
+++ b/arch/sh/boards/mach-se/7724/setup.c
@@ -182,12 +182,10 @@ static struct sh_mobile_lcdc_info lcdc_info = {
182 .chan = LCDC_CHAN_MAINLCD, 182 .chan = LCDC_CHAN_MAINLCD,
183 .fourcc = V4L2_PIX_FMT_RGB565, 183 .fourcc = V4L2_PIX_FMT_RGB565,
184 .clock_divider = 1, 184 .clock_divider = 1,
185 .lcd_size_cfg = { /* 7.0 inch */ 185 .panel_cfg = { /* 7.0 inch */
186 .width = 152, 186 .width = 152,
187 .height = 91, 187 .height = 91,
188 }, 188 },
189 .board_cfg = {
190 },
191 } 189 }
192}; 190};
193 191
@@ -890,12 +888,12 @@ static int __init devices_setup(void)
890 888
891 if (sw & SW41_B) { 889 if (sw & SW41_B) {
892 /* 720p */ 890 /* 720p */
893 lcdc_info.ch[0].lcd_cfg = lcdc_720p_modes; 891 lcdc_info.ch[0].lcd_modes = lcdc_720p_modes;
894 lcdc_info.ch[0].num_cfg = ARRAY_SIZE(lcdc_720p_modes); 892 lcdc_info.ch[0].num_modes = ARRAY_SIZE(lcdc_720p_modes);
895 } else { 893 } else {
896 /* VGA */ 894 /* VGA */
897 lcdc_info.ch[0].lcd_cfg = lcdc_vga_modes; 895 lcdc_info.ch[0].lcd_modes = lcdc_vga_modes;
898 lcdc_info.ch[0].num_cfg = ARRAY_SIZE(lcdc_vga_modes); 896 lcdc_info.ch[0].num_modes = ARRAY_SIZE(lcdc_vga_modes);
899 } 897 }
900 898
901 if (sw & SW41_A) { 899 if (sw & SW41_A) {
diff --git a/arch/sh/include/mach-kfr2r09/mach/kfr2r09.h b/arch/sh/include/mach-kfr2r09/mach/kfr2r09.h
index 07e635b0e04c..ba3d93d333f8 100644
--- a/arch/sh/include/mach-kfr2r09/mach/kfr2r09.h
+++ b/arch/sh/include/mach-kfr2r09/mach/kfr2r09.h
@@ -4,21 +4,21 @@
4#include <video/sh_mobile_lcdc.h> 4#include <video/sh_mobile_lcdc.h>
5 5
6#if defined(CONFIG_FB_SH_MOBILE_LCDC) || defined(CONFIG_FB_SH_MOBILE_LCDC_MODULE) 6#if defined(CONFIG_FB_SH_MOBILE_LCDC) || defined(CONFIG_FB_SH_MOBILE_LCDC_MODULE)
7void kfr2r09_lcd_on(void *board_data, struct fb_info *info); 7void kfr2r09_lcd_on(void);
8void kfr2r09_lcd_off(void *board_data); 8void kfr2r09_lcd_off(void);
9int kfr2r09_lcd_setup(void *board_data, void *sys_ops_handle, 9int kfr2r09_lcd_setup(void *sys_ops_handle,
10 struct sh_mobile_lcdc_sys_bus_ops *sys_ops); 10 struct sh_mobile_lcdc_sys_bus_ops *sys_ops);
11void kfr2r09_lcd_start(void *board_data, void *sys_ops_handle, 11void kfr2r09_lcd_start(void *sys_ops_handle,
12 struct sh_mobile_lcdc_sys_bus_ops *sys_ops); 12 struct sh_mobile_lcdc_sys_bus_ops *sys_ops);
13#else 13#else
14static void kfr2r09_lcd_on(void *board_data) {} 14static void kfr2r09_lcd_on(void) {}
15static void kfr2r09_lcd_off(void *board_data) {} 15static void kfr2r09_lcd_off(void) {}
16static int kfr2r09_lcd_setup(void *board_data, void *sys_ops_handle, 16static int kfr2r09_lcd_setup(void *sys_ops_handle,
17 struct sh_mobile_lcdc_sys_bus_ops *sys_ops) 17 struct sh_mobile_lcdc_sys_bus_ops *sys_ops)
18{ 18{
19 return -ENODEV; 19 return -ENODEV;
20} 20}
21static void kfr2r09_lcd_start(void *board_data, void *sys_ops_handle, 21static void kfr2r09_lcd_start(void *sys_ops_handle,
22 struct sh_mobile_lcdc_sys_bus_ops *sys_ops) 22 struct sh_mobile_lcdc_sys_bus_ops *sys_ops)
23{ 23{
24} 24}
diff --git a/arch/sh/include/mach-migor/mach/migor.h b/arch/sh/include/mach-migor/mach/migor.h
index 42fccf93412e..7de7bb74c290 100644
--- a/arch/sh/include/mach-migor/mach/migor.h
+++ b/arch/sh/include/mach-migor/mach/migor.h
@@ -9,7 +9,7 @@
9 9
10#include <video/sh_mobile_lcdc.h> 10#include <video/sh_mobile_lcdc.h>
11 11
12int migor_lcd_qvga_setup(void *board_data, void *sys_ops_handle, 12int migor_lcd_qvga_setup(void *sys_ops_handle,
13 struct sh_mobile_lcdc_sys_bus_ops *sys_ops); 13 struct sh_mobile_lcdc_sys_bus_ops *sys_ops);
14 14
15#endif /* __ASM_SH_MIGOR_H */ 15#endif /* __ASM_SH_MIGOR_H */