diff options
author | Lennert Buytenhek <buytenh@wantstofly.org> | 2006-06-29 11:06:30 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2006-06-29 11:06:30 -0400 |
commit | 656602978e43a4e5d929423d766be0448bdacc1e (patch) | |
tree | 4267cdee31182359cfff905efbf38c9c484da224 /arch/arm/mach-pxa/lpd270.c | |
parent | 264edb35ce5c85749bfdd2942c74b786ea1cde41 (diff) |
[ARM] 3673/1: lpd270: parse lcd= command line parameter
Patch from Lennert Buytenhek
The bootloader on the LogicPD PXA270 platform informs the kernel of
which type of TFT screen is connected via an lcd=$FOO kernel command
line parameter.
Before this patch, we ignored this parameter and just hardcoded the use
of the Sharp lq64d343 display kit. This patch implement parsing of the
command line option, and chooses the right pxafb_mach_info to use (six
choices) based on this command line option.
Also fix the fb settings to correspond with those of the bootloader.
Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-pxa/lpd270.c')
-rw-r--r-- | arch/arm/mach-pxa/lpd270.c | 126 |
1 files changed, 102 insertions, 24 deletions
diff --git a/arch/arm/mach-pxa/lpd270.c b/arch/arm/mach-pxa/lpd270.c index ec0f43a102c7..1a5f5c21481e 100644 --- a/arch/arm/mach-pxa/lpd270.c +++ b/arch/arm/mach-pxa/lpd270.c | |||
@@ -248,58 +248,137 @@ static void lpd270_backlight_power(int on) | |||
248 | 248 | ||
249 | /* 5.7" TFT QVGA (LoLo display number 1) */ | 249 | /* 5.7" TFT QVGA (LoLo display number 1) */ |
250 | static struct pxafb_mach_info sharp_lq057q3dc02 __initdata = { | 250 | static struct pxafb_mach_info sharp_lq057q3dc02 __initdata = { |
251 | .pixclock = 100000, | 251 | .pixclock = 150000, |
252 | .xres = 240, | 252 | .xres = 320, |
253 | .yres = 320, | 253 | .yres = 240, |
254 | .bpp = 16, | 254 | .bpp = 16, |
255 | .hsync_len = 64, | 255 | .hsync_len = 0x14, |
256 | .left_margin = 0x27, | 256 | .left_margin = 0x28, |
257 | .right_margin = 0x09, | 257 | .right_margin = 0x0a, |
258 | .vsync_len = 0x04, | 258 | .vsync_len = 0x02, |
259 | .upper_margin = 0x08, | 259 | .upper_margin = 0x08, |
260 | .lower_margin = 0x14, | 260 | .lower_margin = 0x14, |
261 | .sync = 0, | 261 | .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, |
262 | .lccr0 = 0x07800080, | 262 | .lccr0 = 0x07800080, |
263 | .lccr3 = 0x04400007, | 263 | .lccr3 = 0x00400000, |
264 | .pxafb_backlight_power = lpd270_backlight_power, | ||
265 | }; | ||
266 | |||
267 | /* 12.1" TFT SVGA (LoLo display number 2) */ | ||
268 | static struct pxafb_mach_info sharp_lq121s1dg31 __initdata = { | ||
269 | .pixclock = 50000, | ||
270 | .xres = 800, | ||
271 | .yres = 600, | ||
272 | .bpp = 16, | ||
273 | .hsync_len = 0x05, | ||
274 | .left_margin = 0x52, | ||
275 | .right_margin = 0x05, | ||
276 | .vsync_len = 0x04, | ||
277 | .upper_margin = 0x14, | ||
278 | .lower_margin = 0x0a, | ||
279 | .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, | ||
280 | .lccr0 = 0x07800080, | ||
281 | .lccr3 = 0x00400000, | ||
282 | .pxafb_backlight_power = lpd270_backlight_power, | ||
283 | }; | ||
284 | |||
285 | /* 3.6" TFT QVGA (LoLo display number 3) */ | ||
286 | static struct pxafb_mach_info sharp_lq036q1da01 __initdata = { | ||
287 | .pixclock = 150000, | ||
288 | .xres = 320, | ||
289 | .yres = 240, | ||
290 | .bpp = 16, | ||
291 | .hsync_len = 0x0e, | ||
292 | .left_margin = 0x04, | ||
293 | .right_margin = 0x0a, | ||
294 | .vsync_len = 0x03, | ||
295 | .upper_margin = 0x03, | ||
296 | .lower_margin = 0x03, | ||
297 | .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, | ||
298 | .lccr0 = 0x07800080, | ||
299 | .lccr3 = 0x00400000, | ||
264 | .pxafb_backlight_power = lpd270_backlight_power, | 300 | .pxafb_backlight_power = lpd270_backlight_power, |
265 | }; | 301 | }; |
266 | 302 | ||
267 | /* 6.4" TFT VGA (LoLo display number 5) */ | 303 | /* 6.4" TFT VGA (LoLo display number 5) */ |
268 | static struct pxafb_mach_info sharp_lq64d343 __initdata = { | 304 | static struct pxafb_mach_info sharp_lq64d343 __initdata = { |
269 | .pixclock = 20000, | 305 | .pixclock = 25000, |
270 | .xres = 640, | 306 | .xres = 640, |
271 | .yres = 480, | 307 | .yres = 480, |
272 | .bpp = 16, | 308 | .bpp = 16, |
273 | .hsync_len = 49, | 309 | .hsync_len = 0x31, |
274 | .left_margin = 0x89, | 310 | .left_margin = 0x89, |
275 | .right_margin = 0x19, | 311 | .right_margin = 0x19, |
276 | .vsync_len = 18, | 312 | .vsync_len = 0x12, |
277 | .upper_margin = 0x22, | 313 | .upper_margin = 0x22, |
278 | .lower_margin = 0, | 314 | .lower_margin = 0x00, |
279 | .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, | 315 | .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, |
280 | .lccr0 = 0x07800080, | 316 | .lccr0 = 0x07800080, |
281 | .lccr3 = 0x04400001, | 317 | .lccr3 = 0x00400000, |
318 | .pxafb_backlight_power = lpd270_backlight_power, | ||
319 | }; | ||
320 | |||
321 | /* 10.4" TFT VGA (LoLo display number 7) */ | ||
322 | static struct pxafb_mach_info sharp_lq10d368 __initdata = { | ||
323 | .pixclock = 25000, | ||
324 | .xres = 640, | ||
325 | .yres = 480, | ||
326 | .bpp = 16, | ||
327 | .hsync_len = 0x31, | ||
328 | .left_margin = 0x89, | ||
329 | .right_margin = 0x19, | ||
330 | .vsync_len = 0x12, | ||
331 | .upper_margin = 0x22, | ||
332 | .lower_margin = 0x00, | ||
333 | .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, | ||
334 | .lccr0 = 0x07800080, | ||
335 | .lccr3 = 0x00400000, | ||
282 | .pxafb_backlight_power = lpd270_backlight_power, | 336 | .pxafb_backlight_power = lpd270_backlight_power, |
283 | }; | 337 | }; |
284 | 338 | ||
285 | /* 3.5" TFT QVGA (LoLo display number 8) */ | 339 | /* 3.5" TFT QVGA (LoLo display number 8) */ |
286 | static struct pxafb_mach_info sharp_lq035q7db02_20 __initdata = { | 340 | static struct pxafb_mach_info sharp_lq035q7db02_20 __initdata = { |
287 | .pixclock = 100000, | 341 | .pixclock = 150000, |
288 | .xres = 240, | 342 | .xres = 240, |
289 | .yres = 320, | 343 | .yres = 320, |
290 | .bpp = 16, | 344 | .bpp = 16, |
291 | .hsync_len = 0x34, | 345 | .hsync_len = 0x0e, |
292 | .left_margin = 0x09, | 346 | .left_margin = 0x0a, |
293 | .right_margin = 0x09, | 347 | .right_margin = 0x0a, |
294 | .vsync_len = 0x08, | 348 | .vsync_len = 0x03, |
295 | .upper_margin = 0x05, | 349 | .upper_margin = 0x05, |
296 | .lower_margin = 0x14, | 350 | .lower_margin = 0x14, |
297 | .sync = 0, | 351 | .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, |
298 | .lccr0 = 0x07800080, | 352 | .lccr0 = 0x07800080, |
299 | .lccr3 = 0x04400007, | 353 | .lccr3 = 0x00400000, |
300 | .pxafb_backlight_power = lpd270_backlight_power, | 354 | .pxafb_backlight_power = lpd270_backlight_power, |
301 | }; | 355 | }; |
302 | 356 | ||
357 | static struct pxafb_mach_info *lpd270_lcd_to_use; | ||
358 | |||
359 | static int __init lpd270_set_lcd(char *str) | ||
360 | { | ||
361 | if (!strnicmp(str, "lq057q3dc02", 11)) { | ||
362 | lpd270_lcd_to_use = &sharp_lq057q3dc02; | ||
363 | } else if (!strnicmp(str, "lq121s1dg31", 11)) { | ||
364 | lpd270_lcd_to_use = &sharp_lq121s1dg31; | ||
365 | } else if (!strnicmp(str, "lq036q1da01", 11)) { | ||
366 | lpd270_lcd_to_use = &sharp_lq036q1da01; | ||
367 | } else if (!strnicmp(str, "lq64d343", 8)) { | ||
368 | lpd270_lcd_to_use = &sharp_lq64d343; | ||
369 | } else if (!strnicmp(str, "lq10d368", 8)) { | ||
370 | lpd270_lcd_to_use = &sharp_lq10d368; | ||
371 | } else if (!strnicmp(str, "lq035q7db02-20", 14)) { | ||
372 | lpd270_lcd_to_use = &sharp_lq035q7db02_20; | ||
373 | } else { | ||
374 | printk(KERN_INFO "lpd270: unknown lcd panel [%s]\n", str); | ||
375 | } | ||
376 | |||
377 | return 1; | ||
378 | } | ||
379 | |||
380 | __setup("lcd=", lpd270_set_lcd); | ||
381 | |||
303 | static struct platform_device *platform_devices[] __initdata = { | 382 | static struct platform_device *platform_devices[] __initdata = { |
304 | &smc91x_device, | 383 | &smc91x_device, |
305 | &lpd270_audio_device, | 384 | &lpd270_audio_device, |
@@ -345,9 +424,8 @@ static void __init lpd270_init(void) | |||
345 | 424 | ||
346 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); | 425 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); |
347 | 426 | ||
348 | // set_pxa_fb_info(&sharp_lq057q3dc02); | 427 | if (lpd270_lcd_to_use != NULL) |
349 | set_pxa_fb_info(&sharp_lq64d343); | 428 | set_pxa_fb_info(lpd270_lcd_to_use); |
350 | // set_pxa_fb_info(&sharp_lq035q7db02_20); | ||
351 | 429 | ||
352 | pxa_set_ohci_info(&lpd270_ohci_platform_data); | 430 | pxa_set_ohci_info(&lpd270_ohci_platform_data); |
353 | } | 431 | } |