diff options
author | wanzongshun <mcuos.com@gmail.com> | 2010-07-18 10:15:11 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-07-22 04:20:16 -0400 |
commit | 6a446b906d58420f9282d74d42e28ff7e3b50b5c (patch) | |
tree | fd9209b499bdc476ef4e3c422c2ca6a4eea211de | |
parent | cd5b8f8755a89a57fc8c408d284b8b613f090345 (diff) |
ARM: 6231/1: re-organize the nuc900 lcd arch platform data setting
The patch re-organizes the nuc900 lcd arch platform data,
remove the lcd platform data setting from nuc950.c to dev.c
It can maximize the share codes between nuc900 series MCUs.
Signed-off-by: Wan ZongShun <mcuos.com@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r-- | arch/arm/mach-w90x900/dev.c | 55 | ||||
-rw-r--r-- | arch/arm/mach-w90x900/mach-nuc950evb.c | 44 | ||||
-rw-r--r-- | arch/arm/mach-w90x900/nuc910.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-w90x900/nuc950.c | 2 |
4 files changed, 41 insertions, 61 deletions
diff --git a/arch/arm/mach-w90x900/dev.c b/arch/arm/mach-w90x900/dev.c index b2eda4dc1c34..73b3ecaf81c1 100644 --- a/arch/arm/mach-w90x900/dev.c +++ b/arch/arm/mach-w90x900/dev.c | |||
@@ -36,6 +36,7 @@ | |||
36 | #include <mach/nuc900_spi.h> | 36 | #include <mach/nuc900_spi.h> |
37 | #include <mach/map.h> | 37 | #include <mach/map.h> |
38 | #include <mach/fb.h> | 38 | #include <mach/fb.h> |
39 | #include <mach/regs-ldm.h> | ||
39 | 40 | ||
40 | #include "cpu.h" | 41 | #include "cpu.h" |
41 | 42 | ||
@@ -382,7 +383,44 @@ struct platform_device nuc900_device_kpi = { | |||
382 | .resource = nuc900_kpi_resource, | 383 | .resource = nuc900_kpi_resource, |
383 | }; | 384 | }; |
384 | 385 | ||
385 | #ifdef CONFIG_FB_NUC900 | 386 | /* LCD controller*/ |
387 | |||
388 | static struct nuc900fb_display __initdata nuc900_lcd_info[] = { | ||
389 | /* Giantplus Technology GPM1040A0 320x240 Color TFT LCD */ | ||
390 | [0] = { | ||
391 | .type = LCM_DCCS_VA_SRC_RGB565, | ||
392 | .width = 320, | ||
393 | .height = 240, | ||
394 | .xres = 320, | ||
395 | .yres = 240, | ||
396 | .bpp = 16, | ||
397 | .pixclock = 200000, | ||
398 | .left_margin = 34, | ||
399 | .right_margin = 54, | ||
400 | .hsync_len = 10, | ||
401 | .upper_margin = 18, | ||
402 | .lower_margin = 4, | ||
403 | .vsync_len = 1, | ||
404 | .dccs = 0x8e00041a, | ||
405 | .devctl = 0x060800c0, | ||
406 | .fbctrl = 0x00a000a0, | ||
407 | .scale = 0x04000400, | ||
408 | }, | ||
409 | }; | ||
410 | |||
411 | static struct nuc900fb_mach_info nuc900_fb_info __initdata = { | ||
412 | #if defined(CONFIG_GPM1040A0_320X240) | ||
413 | .displays = &nuc900_lcd_info[0], | ||
414 | #else | ||
415 | .displays = nuc900_lcd_info, | ||
416 | #endif | ||
417 | .num_displays = ARRAY_SIZE(nuc900_lcd_info), | ||
418 | .default_display = 0, | ||
419 | .gpio_dir = 0x00000004, | ||
420 | .gpio_dir_mask = 0xFFFFFFFD, | ||
421 | .gpio_data = 0x00000004, | ||
422 | .gpio_data_mask = 0xFFFFFFFD, | ||
423 | }; | ||
386 | 424 | ||
387 | static struct resource nuc900_lcd_resource[] = { | 425 | static struct resource nuc900_lcd_resource[] = { |
388 | [0] = { | 426 | [0] = { |
@@ -406,23 +444,10 @@ struct platform_device nuc900_device_lcd = { | |||
406 | .dev = { | 444 | .dev = { |
407 | .dma_mask = &nuc900_device_lcd_dmamask, | 445 | .dma_mask = &nuc900_device_lcd_dmamask, |
408 | .coherent_dma_mask = -1, | 446 | .coherent_dma_mask = -1, |
447 | .platform_data = &nuc900_fb_info, | ||
409 | } | 448 | } |
410 | }; | 449 | }; |
411 | 450 | ||
412 | void nuc900_fb_set_platdata(struct nuc900fb_mach_info *pd) | ||
413 | { | ||
414 | struct nuc900fb_mach_info *npd; | ||
415 | |||
416 | npd = kmalloc(sizeof(*npd), GFP_KERNEL); | ||
417 | if (npd) { | ||
418 | memcpy(npd, pd, sizeof(*npd)); | ||
419 | nuc900_device_lcd.dev.platform_data = npd; | ||
420 | } else { | ||
421 | printk(KERN_ERR "no memory for LCD platform data\n"); | ||
422 | } | ||
423 | } | ||
424 | #endif | ||
425 | |||
426 | /* AUDIO controller*/ | 451 | /* AUDIO controller*/ |
427 | static u64 nuc900_device_audio_dmamask = -1; | 452 | static u64 nuc900_device_audio_dmamask = -1; |
428 | static struct resource nuc900_ac97_resource[] = { | 453 | static struct resource nuc900_ac97_resource[] = { |
diff --git a/arch/arm/mach-w90x900/mach-nuc950evb.c b/arch/arm/mach-w90x900/mach-nuc950evb.c index b3edc3cccf52..04d295f89eb0 100644 --- a/arch/arm/mach-w90x900/mach-nuc950evb.c +++ b/arch/arm/mach-w90x900/mach-nuc950evb.c | |||
@@ -20,51 +20,10 @@ | |||
20 | #include <asm/mach/map.h> | 20 | #include <asm/mach/map.h> |
21 | #include <asm/mach-types.h> | 21 | #include <asm/mach-types.h> |
22 | #include <mach/map.h> | 22 | #include <mach/map.h> |
23 | #include <mach/regs-ldm.h> | ||
24 | #include <mach/fb.h> | 23 | #include <mach/fb.h> |
25 | 24 | ||
26 | #include "nuc950.h" | 25 | #include "nuc950.h" |
27 | 26 | ||
28 | #ifdef CONFIG_FB_NUC900 | ||
29 | /* LCD Controller */ | ||
30 | static struct nuc900fb_display __initdata nuc950_lcd_info[] = { | ||
31 | /* Giantplus Technology GPM1040A0 320x240 Color TFT LCD */ | ||
32 | [0] = { | ||
33 | .type = LCM_DCCS_VA_SRC_RGB565, | ||
34 | .width = 320, | ||
35 | .height = 240, | ||
36 | .xres = 320, | ||
37 | .yres = 240, | ||
38 | .bpp = 16, | ||
39 | .pixclock = 200000, | ||
40 | .left_margin = 34, | ||
41 | .right_margin = 54, | ||
42 | .hsync_len = 10, | ||
43 | .upper_margin = 18, | ||
44 | .lower_margin = 4, | ||
45 | .vsync_len = 1, | ||
46 | .dccs = 0x8e00041a, | ||
47 | .devctl = 0x060800c0, | ||
48 | .fbctrl = 0x00a000a0, | ||
49 | .scale = 0x04000400, | ||
50 | }, | ||
51 | }; | ||
52 | |||
53 | static struct nuc900fb_mach_info nuc950_fb_info __initdata = { | ||
54 | #if defined(CONFIG_GPM1040A0_320X240) | ||
55 | .displays = &nuc950_lcd_info[0], | ||
56 | #else | ||
57 | .displays = nuc950_lcd_info, | ||
58 | #endif | ||
59 | .num_displays = ARRAY_SIZE(nuc950_lcd_info), | ||
60 | .default_display = 0, | ||
61 | .gpio_dir = 0x00000004, | ||
62 | .gpio_dir_mask = 0xFFFFFFFD, | ||
63 | .gpio_data = 0x00000004, | ||
64 | .gpio_data_mask = 0xFFFFFFFD, | ||
65 | }; | ||
66 | #endif | ||
67 | |||
68 | static void __init nuc950evb_map_io(void) | 27 | static void __init nuc950evb_map_io(void) |
69 | { | 28 | { |
70 | nuc950_map_io(); | 29 | nuc950_map_io(); |
@@ -74,9 +33,6 @@ static void __init nuc950evb_map_io(void) | |||
74 | static void __init nuc950evb_init(void) | 33 | static void __init nuc950evb_init(void) |
75 | { | 34 | { |
76 | nuc950_board_init(); | 35 | nuc950_board_init(); |
77 | #ifdef CONFIG_FB_NUC900 | ||
78 | nuc900_fb_set_platdata(&nuc950_fb_info); | ||
79 | #endif | ||
80 | } | 36 | } |
81 | 37 | ||
82 | MACHINE_START(W90P950EVB, "W90P950EVB") | 38 | MACHINE_START(W90P950EVB, "W90P950EVB") |
diff --git a/arch/arm/mach-w90x900/nuc910.c b/arch/arm/mach-w90x900/nuc910.c index 656f03b3b629..cd4977678b85 100644 --- a/arch/arm/mach-w90x900/nuc910.c +++ b/arch/arm/mach-w90x900/nuc910.c | |||
@@ -26,6 +26,7 @@ | |||
26 | static struct platform_device *nuc910_dev[] __initdata = { | 26 | static struct platform_device *nuc910_dev[] __initdata = { |
27 | &nuc900_device_ts, | 27 | &nuc900_device_ts, |
28 | &nuc900_device_rtc, | 28 | &nuc900_device_rtc, |
29 | &nuc900_device_lcd, | ||
29 | }; | 30 | }; |
30 | 31 | ||
31 | /* define specific CPU platform io map */ | 32 | /* define specific CPU platform io map */ |
diff --git a/arch/arm/mach-w90x900/nuc950.c b/arch/arm/mach-w90x900/nuc950.c index 4d1f1ab044c4..5704f74a50ee 100644 --- a/arch/arm/mach-w90x900/nuc950.c +++ b/arch/arm/mach-w90x900/nuc950.c | |||
@@ -26,9 +26,7 @@ | |||
26 | static struct platform_device *nuc950_dev[] __initdata = { | 26 | static struct platform_device *nuc950_dev[] __initdata = { |
27 | &nuc900_device_kpi, | 27 | &nuc900_device_kpi, |
28 | &nuc900_device_fmi, | 28 | &nuc900_device_fmi, |
29 | #ifdef CONFIG_FB_NUC900 | ||
30 | &nuc900_device_lcd, | 29 | &nuc900_device_lcd, |
31 | #endif | ||
32 | }; | 30 | }; |
33 | 31 | ||
34 | /* define specific CPU platform io map */ | 32 | /* define specific CPU platform io map */ |