Skip to content

Commit 552f0cc

Browse files
mripardtorvalds
authored andcommitted
drivers/video/ssd1307fb.c: fix bit order bug in the byte translation 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]>
1 parent 04fa5d6 commit 552f0cc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/video/ssd1307fb.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ static void ssd1307fb_update_display(struct ssd1307fb_par *par)
145145
u32 page_length = SSD1307FB_WIDTH * i;
146146
u32 index = page_length + (SSD1307FB_WIDTH * k + j) / 8;
147147
u8 byte = *(vmem + index);
148-
u8 bit = byte & (1 << (7 - (j % 8)));
149-
bit = bit >> (7 - (j % 8));
148+
u8 bit = byte & (1 << (j % 8));
149+
bit = bit >> (j % 8);
150150
buf |= bit << k;
151151
}
152152
ssd1307fb_write_data(par->client, buf);

0 commit comments

Comments
 (0)