Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 23aa4db7 authored by Ondrej Zary's avatar Ondrej Zary Committed by Tomi Valkeinen
Browse files

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: default avatarOndrej Zary <linux@rainbow-software.org>
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent 7f2ea957
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -673,6 +673,12 @@ 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);
	/* 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));
}