aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Abraham <thomas.abraham@linaro.org>2012-03-24 12:28:47 -0400
committerFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>2012-04-09 12:11:23 -0400
commit884924be2a3368a3ac96587f347f9973c80140f6 (patch)
tree85dd0615fd118e271a1591d22bcefb1e3e5883e2
parent3c582647a9f84affd5c86e89d548157c62f8d9ca (diff)
ARM: s3c64xx: Decouple lcd type from display controller window data
The display controller window data should contain window configuration data for only one type of lcd panel. So, for real6410 and mini6410 boards, split the existing display controller window data, which contains window configuration data for two different types of lcd panels, into two seperate instances and register one of them depending on the type of the lcd panel detected at runtime. This is a prerequisite change for a subsequent commit that reorders the platform data of display controller by moving video interface timing out of window setup data. Cc: Darius Augulis <augulis.darius@gmail.com> Acked-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org> Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
-rw-r--r--arch/arm/mach-s3c64xx/mach-mini6410.c82
-rw-r--r--arch/arm/mach-s3c64xx/mach-real6410.c82
2 files changed, 88 insertions, 76 deletions
diff --git a/arch/arm/mach-s3c64xx/mach-mini6410.c b/arch/arm/mach-s3c64xx/mach-mini6410.c
index c34c2ab22ead..34f51950b46e 100644
--- a/arch/arm/mach-s3c64xx/mach-mini6410.c
+++ b/arch/arm/mach-s3c64xx/mach-mini6410.c
@@ -151,41 +151,49 @@ static struct s3c2410_platform_nand mini6410_nand_info = {
151 .sets = mini6410_nand_sets, 151 .sets = mini6410_nand_sets,
152}; 152};
153 153
154static struct s3c_fb_pd_win mini6410_fb_win[] = { 154static struct s3c_fb_pd_win mini6410_lcd_type0_fb_win = {
155 { 155 .win_mode = { /* 4.3" 480x272 */
156 .win_mode = { /* 4.3" 480x272 */ 156 .left_margin = 3,
157 .left_margin = 3, 157 .right_margin = 2,
158 .right_margin = 2, 158 .upper_margin = 1,
159 .upper_margin = 1, 159 .lower_margin = 1,
160 .lower_margin = 1, 160 .hsync_len = 40,
161 .hsync_len = 40, 161 .vsync_len = 1,
162 .vsync_len = 1, 162 .xres = 480,
163 .xres = 480, 163 .yres = 272,
164 .yres = 272,
165 },
166 .max_bpp = 32,
167 .default_bpp = 16,
168 }, {
169 .win_mode = { /* 7.0" 800x480 */
170 .left_margin = 8,
171 .right_margin = 13,
172 .upper_margin = 7,
173 .lower_margin = 5,
174 .hsync_len = 3,
175 .vsync_len = 1,
176 .xres = 800,
177 .yres = 480,
178 },
179 .max_bpp = 32,
180 .default_bpp = 16,
181 }, 164 },
165 .max_bpp = 32,
166 .default_bpp = 16,
182}; 167};
183 168
184static struct s3c_fb_platdata mini6410_lcd_pdata __initdata = { 169static struct s3c_fb_pd_win mini6410_lcd_type1_fb_win = {
185 .setup_gpio = s3c64xx_fb_gpio_setup_24bpp, 170 .win_mode = { /* 7.0" 800x480 */
186 .win[0] = &mini6410_fb_win[0], 171 .left_margin = 8,
187 .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB, 172 .right_margin = 13,
188 .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC, 173 .upper_margin = 7,
174 .lower_margin = 5,
175 .hsync_len = 3,
176 .vsync_len = 1,
177 .xres = 800,
178 .yres = 480,
179 },
180 .max_bpp = 32,
181 .default_bpp = 16,
182};
183
184static struct s3c_fb_platdata mini6410_lcd_pdata[] __initdata = {
185 {
186 .setup_gpio = s3c64xx_fb_gpio_setup_24bpp,
187 .win[0] = &mini6410_lcd_type0_fb_win,
188 .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB,
189 .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
190 }, {
191 .setup_gpio = s3c64xx_fb_gpio_setup_24bpp,
192 .win[0] = &mini6410_lcd_type1_fb_win,
193 .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB,
194 .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
195 },
196 { },
189}; 197};
190 198
191static void mini6410_lcd_power_set(struct plat_lcd_data *pd, 199static void mini6410_lcd_power_set(struct plat_lcd_data *pd,
@@ -283,7 +291,7 @@ static void mini6410_parse_features(
283 "screen type already set\n", f); 291 "screen type already set\n", f);
284 } else { 292 } else {
285 int li = f - '0'; 293 int li = f - '0';
286 if (li >= ARRAY_SIZE(mini6410_fb_win)) 294 if (li >= ARRAY_SIZE(mini6410_lcd_pdata))
287 printk(KERN_INFO "MINI6410: '%c' out " 295 printk(KERN_INFO "MINI6410: '%c' out "
288 "of range LCD mode\n", f); 296 "of range LCD mode\n", f);
289 else { 297 else {
@@ -307,14 +315,12 @@ static void __init mini6410_machine_init(void)
307 /* Parse the feature string */ 315 /* Parse the feature string */
308 mini6410_parse_features(&features, mini6410_features_str); 316 mini6410_parse_features(&features, mini6410_features_str);
309 317
310 mini6410_lcd_pdata.win[0] = &mini6410_fb_win[features.lcd_index];
311
312 printk(KERN_INFO "MINI6410: selected LCD display is %dx%d\n", 318 printk(KERN_INFO "MINI6410: selected LCD display is %dx%d\n",
313 mini6410_lcd_pdata.win[0]->win_mode.xres, 319 mini6410_lcd_pdata[features.lcd_index].win[0]->win_mode.xres,
314 mini6410_lcd_pdata.win[0]->win_mode.yres); 320 mini6410_lcd_pdata[features.lcd_index].win[0]->win_mode.yres);
315 321
316 s3c_nand_set_platdata(&mini6410_nand_info); 322 s3c_nand_set_platdata(&mini6410_nand_info);
317 s3c_fb_set_platdata(&mini6410_lcd_pdata); 323 s3c_fb_set_platdata(&mini6410_lcd_pdata[features.lcd_index]);
318 s3c24xx_ts_set_platdata(NULL); 324 s3c24xx_ts_set_platdata(NULL);
319 325
320 /* configure nCS1 width to 16 bits */ 326 /* configure nCS1 width to 16 bits */
diff --git a/arch/arm/mach-s3c64xx/mach-real6410.c b/arch/arm/mach-s3c64xx/mach-real6410.c
index be2a9a22ab74..21f91e5b093d 100644
--- a/arch/arm/mach-s3c64xx/mach-real6410.c
+++ b/arch/arm/mach-s3c64xx/mach-real6410.c
@@ -117,41 +117,49 @@ static struct platform_device real6410_device_eth = {
117 }, 117 },
118}; 118};
119 119
120static struct s3c_fb_pd_win real6410_fb_win[] = { 120static struct s3c_fb_pd_win real6410_lcd_type0_fb_win = {
121 { 121 .win_mode = { /* 4.3" 480x272 */
122 .win_mode = { /* 4.3" 480x272 */ 122 .left_margin = 3,
123 .left_margin = 3, 123 .right_margin = 2,
124 .right_margin = 2, 124 .upper_margin = 1,
125 .upper_margin = 1, 125 .lower_margin = 1,
126 .lower_margin = 1, 126 .hsync_len = 40,
127 .hsync_len = 40, 127 .vsync_len = 1,
128 .vsync_len = 1, 128 .xres = 480,
129 .xres = 480, 129 .yres = 272,
130 .yres = 272,
131 },
132 .max_bpp = 32,
133 .default_bpp = 16,
134 }, {
135 .win_mode = { /* 7.0" 800x480 */
136 .left_margin = 8,
137 .right_margin = 13,
138 .upper_margin = 7,
139 .lower_margin = 5,
140 .hsync_len = 3,
141 .vsync_len = 1,
142 .xres = 800,
143 .yres = 480,
144 },
145 .max_bpp = 32,
146 .default_bpp = 16,
147 }, 130 },
131 .max_bpp = 32,
132 .default_bpp = 16,
148}; 133};
149 134
150static struct s3c_fb_platdata real6410_lcd_pdata __initdata = { 135static struct s3c_fb_pd_win real6410_lcd_type1_fb_win = {
151 .setup_gpio = s3c64xx_fb_gpio_setup_24bpp, 136 .win_mode = { /* 7.0" 800x480 */
152 .win[0] = &real6410_fb_win[0], 137 .left_margin = 8,
153 .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB, 138 .right_margin = 13,
154 .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC, 139 .upper_margin = 7,
140 .lower_margin = 5,
141 .hsync_len = 3,
142 .vsync_len = 1,
143 .xres = 800,
144 .yres = 480,
145 },
146 .max_bpp = 32,
147 .default_bpp = 16,
148};
149
150static struct s3c_fb_platdata real6410_lcd_pdata[] __initdata = {
151 {
152 .setup_gpio = s3c64xx_fb_gpio_setup_24bpp,
153 .win[0] = &real6410_lcd_type0_fb_win,
154 .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB,
155 .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
156 }, {
157 .setup_gpio = s3c64xx_fb_gpio_setup_24bpp,
158 .win[0] = &real6410_lcd_type1_fb_win,
159 .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB,
160 .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
161 },
162 { },
155}; 163};
156 164
157static struct mtd_partition real6410_nand_part[] = { 165static struct mtd_partition real6410_nand_part[] = {
@@ -264,7 +272,7 @@ static void real6410_parse_features(
264 "screen type already set\n", f); 272 "screen type already set\n", f);
265 } else { 273 } else {
266 int li = f - '0'; 274 int li = f - '0';
267 if (li >= ARRAY_SIZE(real6410_fb_win)) 275 if (li >= ARRAY_SIZE(real6410_lcd_pdata))
268 printk(KERN_INFO "REAL6410: '%c' out " 276 printk(KERN_INFO "REAL6410: '%c' out "
269 "of range LCD mode\n", f); 277 "of range LCD mode\n", f);
270 else { 278 else {
@@ -288,13 +296,11 @@ static void __init real6410_machine_init(void)
288 /* Parse the feature string */ 296 /* Parse the feature string */
289 real6410_parse_features(&features, real6410_features_str); 297 real6410_parse_features(&features, real6410_features_str);
290 298
291 real6410_lcd_pdata.win[0] = &real6410_fb_win[features.lcd_index];
292
293 printk(KERN_INFO "REAL6410: selected LCD display is %dx%d\n", 299 printk(KERN_INFO "REAL6410: selected LCD display is %dx%d\n",
294 real6410_lcd_pdata.win[0]->win_mode.xres, 300 real6410_lcd_pdata[features.lcd_index].win[0]->win_mode.xres,
295 real6410_lcd_pdata.win[0]->win_mode.yres); 301 real6410_lcd_pdata[features.lcd_index].win[0]->win_mode.yres);
296 302
297 s3c_fb_set_platdata(&real6410_lcd_pdata); 303 s3c_fb_set_platdata(&real6410_lcd_pdata[features.lcd_index]);
298 s3c_nand_set_platdata(&real6410_nand_info); 304 s3c_nand_set_platdata(&real6410_nand_info);
299 s3c24xx_ts_set_platdata(NULL); 305 s3c24xx_ts_set_platdata(NULL);
300 306