From patchwork Tue Dec 18 13:49:29 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 1892061 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id EE9393FCD4 for ; Tue, 18 Dec 2012 13:58:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754869Ab2LRN64 (ORCPT ); Tue, 18 Dec 2012 08:58:56 -0500 Received: from mail.free-electrons.com ([94.23.32.191]:38749 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754411Ab2LRN6z (ORCPT ); Tue, 18 Dec 2012 08:58:55 -0500 X-Greylist: delayed 544 seconds by postgrey-1.27 at vger.kernel.org; Tue, 18 Dec 2012 08:58:55 EST Received: by mail.free-electrons.com (Postfix, from userid 106) id C8524175; Tue, 18 Dec 2012 14:49:49 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 shortcircuit=no autolearn=ham version=3.3.1 Received: from localhost (col31-4-88-188-83-94.fbx.proxad.net [88.188.83.94]) by mail.free-electrons.com (Postfix) with ESMTPSA id 194A6116; Tue, 18 Dec 2012 14:49:42 +0100 (CET) From: Maxime Ripard To: linux-fbdev@vger.kernel.org Cc: Brian Lilly , Greg Kroah-Hartman , Florian Tobias Schandinat , Thomas Petazzoni , Tomi Valkeinen , Andrew Morton Subject: [PATCH] video: ssd1307fb: Fix bit order bug in the byte translation function Date: Tue, 18 Dec 2012 14:49:29 +0100 Message-Id: <1355838569-30225-1-git-send-email-maxime.ripard@free-electrons.com> X-Mailer: git-send-email 1.7.9.5 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org This was leading to a strange behaviour when using the fbcon driver on top of this one: the letter were in the right order, but each letter was having 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 Cc: Brian Lilly Cc: Greg Kroah-Hartman Cc: Florian Tobias Schandinat Cc: Thomas Petazzoni Cc: Tomi Valkeinen Cc: Andrew Morton --- drivers/video/ssd1307fb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/video/ssd1307fb.c b/drivers/video/ssd1307fb.c index 9e46633..7f5f824 100644 --- a/drivers/video/ssd1307fb.c +++ b/drivers/video/ssd1307fb.c @@ -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);