Skip to content

Commit

Permalink
drivers/video/ssd1307fb.c: fix bit order bug in the byte translation …
Browse files Browse the repository at this point in the history
…function

This was leading to a strange behaviour when using the fbcon driver on
top of this one: the letters were in the right order, but each letter
had a vertical symmetry.

This was because the addressing was right for the byte, but the
addressing of each individual bit was inverted.

Signed-off-by: Maxime Ripard <[email protected]>
Cc: Brian Lilly <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Florian Tobias Schandinat <[email protected]>
Cc: Thomas Petazzoni <[email protected]>
Cc: Tomi Valkeinen <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
mripard authored and torvalds committed Jan 11, 2013
1 parent 04fa5d6 commit 552f0cc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/video/ssd1307fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ static void ssd1307fb_update_display(struct ssd1307fb_par *par)
u32 page_length = SSD1307FB_WIDTH * i;
u32 index = page_length + (SSD1307FB_WIDTH * k + j) / 8;
u8 byte = *(vmem + index);
u8 bit = byte & (1 << (7 - (j % 8)));
bit = bit >> (7 - (j % 8));
u8 bit = byte & (1 << (j % 8));
bit = bit >> (j % 8);
buf |= bit << k;
}
ssd1307fb_write_data(par->client, buf);
Expand Down

0 comments on commit 552f0cc

Please sign in to comment.