diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/atmel_lcdfb.c | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c index 6fcf76c12910..5a31a7a40cd4 100644 --- a/drivers/video/atmel_lcdfb.c +++ b/drivers/video/atmel_lcdfb.c | |||
@@ -338,19 +338,35 @@ static int atmel_lcdfb_check_var(struct fb_var_screeninfo *var, | |||
338 | break; | 338 | break; |
339 | case 15: | 339 | case 15: |
340 | case 16: | 340 | case 16: |
341 | var->red.offset = 0; | 341 | if (sinfo->lcd_wiring_mode == ATMEL_LCDC_WIRING_RGB) { |
342 | /* RGB:565 mode */ | ||
343 | var->red.offset = 11; | ||
344 | var->blue.offset = 0; | ||
345 | var->green.length = 6; | ||
346 | } else { | ||
347 | /* BGR:555 mode */ | ||
348 | var->red.offset = 0; | ||
349 | var->blue.offset = 10; | ||
350 | var->green.length = 5; | ||
351 | } | ||
342 | var->green.offset = 5; | 352 | var->green.offset = 5; |
343 | var->blue.offset = 10; | 353 | var->red.length = var->blue.length = 5; |
344 | var->red.length = var->green.length = var->blue.length = 5; | ||
345 | break; | 354 | break; |
346 | case 32: | 355 | case 32: |
347 | var->transp.offset = 24; | 356 | var->transp.offset = 24; |
348 | var->transp.length = 8; | 357 | var->transp.length = 8; |
349 | /* fall through */ | 358 | /* fall through */ |
350 | case 24: | 359 | case 24: |
351 | var->red.offset = 0; | 360 | if (sinfo->lcd_wiring_mode == ATMEL_LCDC_WIRING_RGB) { |
361 | /* RGB:888 mode */ | ||
362 | var->red.offset = 16; | ||
363 | var->blue.offset = 0; | ||
364 | } else { | ||
365 | /* BGR:888 mode */ | ||
366 | var->red.offset = 0; | ||
367 | var->blue.offset = 16; | ||
368 | } | ||
352 | var->green.offset = 8; | 369 | var->green.offset = 8; |
353 | var->blue.offset = 16; | ||
354 | var->red.length = var->green.length = var->blue.length = 8; | 370 | var->red.length = var->green.length = var->blue.length = 8; |
355 | break; | 371 | break; |
356 | default: | 372 | default: |
@@ -697,6 +713,7 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev) | |||
697 | sinfo->atmel_lcdfb_power_control = pdata_sinfo->atmel_lcdfb_power_control; | 713 | sinfo->atmel_lcdfb_power_control = pdata_sinfo->atmel_lcdfb_power_control; |
698 | sinfo->guard_time = pdata_sinfo->guard_time; | 714 | sinfo->guard_time = pdata_sinfo->guard_time; |
699 | sinfo->lcdcon_is_backlight = pdata_sinfo->lcdcon_is_backlight; | 715 | sinfo->lcdcon_is_backlight = pdata_sinfo->lcdcon_is_backlight; |
716 | sinfo->lcd_wiring_mode = pdata_sinfo->lcd_wiring_mode; | ||
700 | } else { | 717 | } else { |
701 | dev_err(dev, "cannot get default configuration\n"); | 718 | dev_err(dev, "cannot get default configuration\n"); |
702 | goto free_info; | 719 | goto free_info; |