Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tridentfb: Fix set_lwidth on TGUI9440 and CYBER9320

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 <linux@rainbow-software.org>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>

authored by

Ondrej Zary and committed by
Tomi Valkeinen
23aa4db7 7f2ea957

+8 -2
+8 -2
drivers/video/fbdev/tridentfb.c
··· 673 673 static inline void set_lwidth(struct tridentfb_par *par, int width) 674 674 { 675 675 write3X4(par, VGA_CRTC_OFFSET, width & 0xFF); 676 - write3X4(par, AddColReg, 677 - (read3X4(par, AddColReg) & 0xCF) | ((width & 0x300) >> 4)); 676 + /* chips older than TGUI9660 have only 1 width bit in AddColReg */ 677 + /* touching the other one breaks I2C/DDC */ 678 + if (par->chip_id == TGUI9440 || par->chip_id == CYBER9320) 679 + write3X4(par, AddColReg, 680 + (read3X4(par, AddColReg) & 0xEF) | ((width & 0x100) >> 4)); 681 + else 682 + write3X4(par, AddColReg, 683 + (read3X4(par, AddColReg) & 0xCF) | ((width & 0x300) >> 4)); 678 684 } 679 685 680 686 /* For resolutions smaller than FP resolution stretch */