Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 284817
b: refs/heads/master
c: 5d67b89
h: refs/heads/master
i:
  284815: b6bb205
v: v3
  • Loading branch information
Peter Korsgaard authored and Florian Tobias Schandinat committed Nov 11, 2011
1 parent c33826a commit df440a7
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 9 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: acfdc2e1bdb4b148e7546fe8948d8f75bd2f9377
refs/heads/master: 5d67b89ce88f2db60573de859649b1b5a8c830d6
32 changes: 24 additions & 8 deletions trunk/drivers/video/atmel_lcdfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -684,14 +684,30 @@ static int atmel_lcdfb_setcolreg(unsigned int regno, unsigned int red,

case FB_VISUAL_PSEUDOCOLOR:
if (regno < 256) {
val = ((red >> 11) & 0x001f);
val |= ((green >> 6) & 0x03e0);
val |= ((blue >> 1) & 0x7c00);

/*
* TODO: intensity bit. Maybe something like
* ~(red[10] ^ green[10] ^ blue[10]) & 1
*/
if (cpu_is_at91sam9261() || cpu_is_at91sam9263()
|| cpu_is_at91sam9rl()) {
/* old style I+BGR:555 */
val = ((red >> 11) & 0x001f);
val |= ((green >> 6) & 0x03e0);
val |= ((blue >> 1) & 0x7c00);

/*
* TODO: intensity bit. Maybe something like
* ~(red[10] ^ green[10] ^ blue[10]) & 1
*/
} else {
/* new style BGR:565 / RGB:565 */
if (sinfo->lcd_wiring_mode ==
ATMEL_LCDC_WIRING_RGB) {
val = ((blue >> 11) & 0x001f);
val |= ((red >> 0) & 0xf800);
} else {
val = ((red >> 11) & 0x001f);
val |= ((blue >> 0) & 0xf800);
}

val |= ((green >> 5) & 0x07e0);
}

lcdc_writel(sinfo, ATMEL_LCDC_LUT(regno), val);
ret = 0;
Expand Down

0 comments on commit df440a7

Please sign in to comment.