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

Commit 3acd9d46 authored by Krzysztof Helt's avatar Krzysztof Helt Committed by Linus Torvalds
Browse files

tridentfb: register should be left in non-locked state



Remove locking registers after they are unlocked during switch to/from MMIO
mode.  This fixes regression on the Blade3D (Trident 9880) caused by the
previous patch (probe fixes).

Signed-off-by: default avatarKrzysztof Helt <krzysztof.h1@wp.pl>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent e84290dc
Loading
Loading
Loading
Loading
+0 −12
Original line number Original line Diff line number Diff line
@@ -566,44 +566,32 @@ static inline void write3CE(int reg, unsigned char val)


static void enable_mmio(void)
static void enable_mmio(void)
{
{
	unsigned char tmp;

	/* Goto New Mode */
	/* Goto New Mode */
	outb(0x0B, 0x3C4);
	outb(0x0B, 0x3C4);
	inb(0x3C5);
	inb(0x3C5);


	/* Unprotect registers */
	/* Unprotect registers */
	outb(NewMode1, 0x3C4);
	outb(NewMode1, 0x3C4);
	tmp = inb(0x3C5);
	outb(0x80, 0x3C5);
	outb(0x80, 0x3C5);


	/* Enable MMIO */
	/* Enable MMIO */
	outb(PCIReg, 0x3D4);
	outb(PCIReg, 0x3D4);
	outb(inb(0x3D5) | 0x01, 0x3D5);
	outb(inb(0x3D5) | 0x01, 0x3D5);

	t_outb(NewMode1, 0x3C4);
	t_outb(tmp, 0x3C5);
}
}


static void disable_mmio(void)
static void disable_mmio(void)
{
{
	unsigned char tmp;

	/* Goto New Mode */
	/* Goto New Mode */
	t_outb(0x0B, 0x3C4);
	t_outb(0x0B, 0x3C4);
	t_inb(0x3C5);
	t_inb(0x3C5);


	/* Unprotect registers */
	/* Unprotect registers */
	t_outb(NewMode1, 0x3C4);
	t_outb(NewMode1, 0x3C4);
	tmp = t_inb(0x3C5);
	t_outb(0x80, 0x3C5);
	t_outb(0x80, 0x3C5);


	/* Disable MMIO */
	/* Disable MMIO */
	t_outb(PCIReg, 0x3D4);
	t_outb(PCIReg, 0x3D4);
	t_outb(t_inb(0x3D5) & ~0x01, 0x3D5);
	t_outb(t_inb(0x3D5) & ~0x01, 0x3D5);

	outb(NewMode1, 0x3C4);
	outb(tmp, 0x3C5);
}
}


#define crtc_unlock()	write3X4(CRTVSyncEnd, read3X4(CRTVSyncEnd) & 0x7F)
#define crtc_unlock()	write3X4(CRTVSyncEnd, read3X4(CRTVSyncEnd) & 0x7F)