Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755358AbbHXTh6 (ORCPT ); Mon, 24 Aug 2015 15:37:58 -0400 Received: from ns.gsystem.sk ([62.176.172.50]:60902 "EHLO gsystem.sk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751179AbbHXThz (ORCPT ); Mon, 24 Aug 2015 15:37:55 -0400 From: Ondrej Zary To: Krzysztof Helt Cc: Tomi Valkeinen , linux-fbdev@vger.kernel.org, Kernel development list Subject: [PATCH 2/4] [resend #2] tridentfb: Fix set_lwidth on TGUI9440 and CYBER9320 Date: Mon, 24 Aug 2015 21:37:26 +0200 Message-Id: <1440445048-24694-2-git-send-email-linux@rainbow-software.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1440445048-24694-1-git-send-email-linux@rainbow-software.org> References: <1440445048-24694-1-git-send-email-linux@rainbow-software.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1540 Lines: 39 According to X.Org driver, chips older than TGUI9660 have only 1 width bit in AddColReg. Touching the 2nd one causes I2C/DDC to fail on TGUI9440. Set only 1 bit of width in AddColReg on TGUI9440 and CYBER9320. Signed-off-by: Ondrej Zary --- drivers/video/fbdev/tridentfb.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/video/fbdev/tridentfb.c b/drivers/video/fbdev/tridentfb.c index 7429713..01b43e9 100644 --- a/drivers/video/fbdev/tridentfb.c +++ b/drivers/video/fbdev/tridentfb.c @@ -673,8 +673,14 @@ static int get_nativex(struct tridentfb_par *par) static inline void set_lwidth(struct tridentfb_par *par, int width) { write3X4(par, VGA_CRTC_OFFSET, width & 0xFF); - write3X4(par, AddColReg, - (read3X4(par, AddColReg) & 0xCF) | ((width & 0x300) >> 4)); + /* chips older than TGUI9660 have only 1 width bit in AddColReg */ + /* touching the other one breaks I2C/DDC */ + if (par->chip_id == TGUI9440 || par->chip_id == CYBER9320) + write3X4(par, AddColReg, + (read3X4(par, AddColReg) & 0xEF) | ((width & 0x100) >> 4)); + else + write3X4(par, AddColReg, + (read3X4(par, AddColReg) & 0xCF) | ((width & 0x300) >> 4)); } /* For resolutions smaller than FP resolution stretch */ -- Ondrej Zary -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/