diff options
author | Kyungmin Park <kyungmin.park@samsung.com> | 2009-11-17 02:41:20 -0500 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2009-11-30 20:33:16 -0500 |
commit | 079b03241765f0a31c4bfdefd277452399dbafc9 (patch) | |
tree | 0a1b2c8f1be6e50834195acd6c6a5881347ef4f1 /arch/arm/mach-s5pc100 | |
parent | edd6e3f89d7fe245149669400bd213140c16d6e4 (diff) |
SMDKC100: enable S3C FrameBuffer
Add required machine definitions for s3c-fb device.
A 800x480 lcd device (simmilar to the one known from SMDK6410 boards) has
been defined. The lcd controller is attached to GPIO lines and can be
enabled/disabled with platform-lcd driver.
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'arch/arm/mach-s5pc100')
-rw-r--r-- | arch/arm/mach-s5pc100/Kconfig | 2 | ||||
-rw-r--r-- | arch/arm/mach-s5pc100/mach-smdkc100.c | 67 |
2 files changed, 69 insertions, 0 deletions
diff --git a/arch/arm/mach-s5pc100/Kconfig b/arch/arm/mach-s5pc100/Kconfig index b1a4ba504416..5e6b9a32bd90 100644 --- a/arch/arm/mach-s5pc100/Kconfig +++ b/arch/arm/mach-s5pc100/Kconfig | |||
@@ -17,6 +17,8 @@ config CPU_S5PC100 | |||
17 | config MACH_SMDKC100 | 17 | config MACH_SMDKC100 |
18 | bool "SMDKC100" | 18 | bool "SMDKC100" |
19 | select CPU_S5PC100 | 19 | select CPU_S5PC100 |
20 | select S3C_DEV_FB | ||
20 | select S5PC1XX_SETUP_I2C1 | 21 | select S5PC1XX_SETUP_I2C1 |
22 | select S5PC1XX_SETUP_FB_24BPP | ||
21 | help | 23 | help |
22 | Machine support for the Samsung SMDKC100 | 24 | Machine support for the Samsung SMDKC100 |
diff --git a/arch/arm/mach-s5pc100/mach-smdkc100.c b/arch/arm/mach-s5pc100/mach-smdkc100.c index daf6a2bc6b61..e8f45535f035 100644 --- a/arch/arm/mach-s5pc100/mach-smdkc100.c +++ b/arch/arm/mach-s5pc100/mach-smdkc100.c | |||
@@ -27,16 +27,21 @@ | |||
27 | #include <asm/mach/map.h> | 27 | #include <asm/mach/map.h> |
28 | 28 | ||
29 | #include <mach/map.h> | 29 | #include <mach/map.h> |
30 | #include <mach/regs-fb.h> | ||
31 | #include <video/platform_lcd.h> | ||
30 | 32 | ||
31 | #include <asm/irq.h> | 33 | #include <asm/irq.h> |
32 | #include <asm/mach-types.h> | 34 | #include <asm/mach-types.h> |
33 | 35 | ||
34 | #include <plat/regs-serial.h> | 36 | #include <plat/regs-serial.h> |
37 | #include <plat/gpio-cfg.h> | ||
38 | #include <plat/regs-gpio.h> | ||
35 | 39 | ||
36 | #include <plat/clock.h> | 40 | #include <plat/clock.h> |
37 | #include <plat/devs.h> | 41 | #include <plat/devs.h> |
38 | #include <plat/cpu.h> | 42 | #include <plat/cpu.h> |
39 | #include <plat/s5pc100.h> | 43 | #include <plat/s5pc100.h> |
44 | #include <plat/fb.h> | ||
40 | 45 | ||
41 | #define UCON (S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK) | 46 | #define UCON (S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK) |
42 | #define ULCON (S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB) | 47 | #define ULCON (S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB) |
@@ -73,9 +78,65 @@ static struct s3c2410_uartcfg smdkc100_uartcfgs[] __initdata = { | |||
73 | }, | 78 | }, |
74 | }; | 79 | }; |
75 | 80 | ||
81 | /* LCD power controller */ | ||
82 | static void smdkc100_lcd_power_set(struct plat_lcd_data *pd, | ||
83 | unsigned int power) | ||
84 | { | ||
85 | /* backlight */ | ||
86 | gpio_direction_output(S5PC100_GPD(0), power); | ||
87 | |||
88 | if (power) { | ||
89 | /* module reset */ | ||
90 | gpio_direction_output(S5PC100_GPH0(6), 1); | ||
91 | mdelay(100); | ||
92 | gpio_direction_output(S5PC100_GPH0(6), 0); | ||
93 | mdelay(10); | ||
94 | gpio_direction_output(S5PC100_GPH0(6), 1); | ||
95 | mdelay(10); | ||
96 | } | ||
97 | } | ||
98 | |||
99 | static struct plat_lcd_data smdkc100_lcd_power_data = { | ||
100 | .set_power = smdkc100_lcd_power_set, | ||
101 | }; | ||
102 | |||
103 | static struct platform_device smdkc100_lcd_powerdev = { | ||
104 | .name = "platform-lcd", | ||
105 | .dev.parent = &s3c_device_fb.dev, | ||
106 | .dev.platform_data = &smdkc100_lcd_power_data, | ||
107 | }; | ||
108 | |||
109 | /* Frame Buffer */ | ||
110 | static struct s3c_fb_pd_win smdkc100_fb_win0 = { | ||
111 | /* this is to ensure we use win0 */ | ||
112 | .win_mode = { | ||
113 | .refresh = 70, | ||
114 | .pixclock = (8+13+3+800)*(7+5+1+480), | ||
115 | .left_margin = 8, | ||
116 | .right_margin = 13, | ||
117 | .upper_margin = 7, | ||
118 | .lower_margin = 5, | ||
119 | .hsync_len = 3, | ||
120 | .vsync_len = 1, | ||
121 | .xres = 800, | ||
122 | .yres = 480, | ||
123 | }, | ||
124 | .max_bpp = 32, | ||
125 | .default_bpp = 16, | ||
126 | }; | ||
127 | |||
128 | static struct s3c_fb_platdata smdkc100_lcd_pdata __initdata = { | ||
129 | .win[0] = &smdkc100_fb_win0, | ||
130 | .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB, | ||
131 | .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC, | ||
132 | .setup_gpio = s5pc100_fb_gpio_setup_24bpp, | ||
133 | }; | ||
134 | |||
76 | static struct map_desc smdkc100_iodesc[] = {}; | 135 | static struct map_desc smdkc100_iodesc[] = {}; |
77 | 136 | ||
78 | static struct platform_device *smdkc100_devices[] __initdata = { | 137 | static struct platform_device *smdkc100_devices[] __initdata = { |
138 | &s3c_device_fb, | ||
139 | &smdkc100_lcd_powerdev, | ||
79 | }; | 140 | }; |
80 | 141 | ||
81 | static void __init smdkc100_map_io(void) | 142 | static void __init smdkc100_map_io(void) |
@@ -87,6 +148,12 @@ static void __init smdkc100_map_io(void) | |||
87 | 148 | ||
88 | static void __init smdkc100_machine_init(void) | 149 | static void __init smdkc100_machine_init(void) |
89 | { | 150 | { |
151 | s3c_fb_set_platdata(&smdkc100_lcd_pdata); | ||
152 | |||
153 | /* LCD init */ | ||
154 | gpio_request(S5PC100_GPD(0), "GPD"); | ||
155 | gpio_request(S5PC100_GPH0(6), "GPH0"); | ||
156 | smdkc100_lcd_power_set(&smdkc100_lcd_power_data, 0); | ||
90 | platform_add_devices(smdkc100_devices, ARRAY_SIZE(smdkc100_devices)); | 157 | platform_add_devices(smdkc100_devices, ARRAY_SIZE(smdkc100_devices)); |
91 | } | 158 | } |
92 | 159 | ||