Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 94175
b: refs/heads/master
c: fd08580
h: refs/heads/master
i:
  94173: 6345097
  94171: 00f4dce
  94167: d4b8382
  94159: 30f2223
  94143: 6eaed97
v: v3
  • Loading branch information
Nicolas Ferre authored and Linus Torvalds committed Apr 28, 2008
1 parent 8ff24c8 commit 0dd4ee0
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cf19a37e0641d975d271a5a30f097dd6b96d232f
refs/heads/master: fd0858017eb67aa0d41dd4e8499ca6a7bfb63941
27 changes: 22 additions & 5 deletions trunk/drivers/video/atmel_lcdfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,19 +338,35 @@ static int atmel_lcdfb_check_var(struct fb_var_screeninfo *var,
break;
case 15:
case 16:
var->red.offset = 0;
if (sinfo->lcd_wiring_mode == ATMEL_LCDC_WIRING_RGB) {
/* RGB:565 mode */
var->red.offset = 11;
var->blue.offset = 0;
var->green.length = 6;
} else {
/* BGR:555 mode */
var->red.offset = 0;
var->blue.offset = 10;
var->green.length = 5;
}
var->green.offset = 5;
var->blue.offset = 10;
var->red.length = var->green.length = var->blue.length = 5;
var->red.length = var->blue.length = 5;
break;
case 32:
var->transp.offset = 24;
var->transp.length = 8;
/* fall through */
case 24:
var->red.offset = 0;
if (sinfo->lcd_wiring_mode == ATMEL_LCDC_WIRING_RGB) {
/* RGB:888 mode */
var->red.offset = 16;
var->blue.offset = 0;
} else {
/* BGR:888 mode */
var->red.offset = 0;
var->blue.offset = 16;
}
var->green.offset = 8;
var->blue.offset = 16;
var->red.length = var->green.length = var->blue.length = 8;
break;
default:
Expand Down Expand Up @@ -697,6 +713,7 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev)
sinfo->atmel_lcdfb_power_control = pdata_sinfo->atmel_lcdfb_power_control;
sinfo->guard_time = pdata_sinfo->guard_time;
sinfo->lcdcon_is_backlight = pdata_sinfo->lcdcon_is_backlight;
sinfo->lcd_wiring_mode = pdata_sinfo->lcd_wiring_mode;
} else {
dev_err(dev, "cannot get default configuration\n");
goto free_info;
Expand Down
10 changes: 10 additions & 0 deletions trunk/include/video/atmel_lcdc.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@
#ifndef __ATMEL_LCDC_H__
#define __ATMEL_LCDC_H__


/* Way LCD wires are connected to the chip:
* Some Atmel chips use BGR color mode (instead of standard RGB)
* A swapped wiring onboard can bring to RGB mode.
*/
#define ATMEL_LCDC_WIRING_BGR 0
#define ATMEL_LCDC_WIRING_RGB 1


/* LCD Controller info data structure, stored in device platform_data */
struct atmel_lcdfb_info {
spinlock_t lock;
Expand All @@ -42,6 +51,7 @@ struct atmel_lcdfb_info {
u8 saved_lcdcon;

u8 default_bpp;
u8 lcd_wiring_mode;
unsigned int default_lcdcon2;
unsigned int default_dmacon;
void (*atmel_lcdfb_power_control)(int on);
Expand Down

0 comments on commit 0dd4ee0

Please sign in to comment.