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

Commit 0bc777bc authored by Jason Wang's avatar Jason Wang Committed by David S. Miller
Browse files

8139cp/8139too: terminate the eeprom access with the right opmode



Currently, we terminate the eeprom access through clearing the CS by:

RTL_W8 (Cfg9346, ~EE_CS); or writeb (~EE_CS, ee_addr);

This would left the eeprom into "Config. Register Write Enable:"
state which is not expcted as the highest two bits were set to
0x11 ( expected is the "Normal" mode (0x00)). Solving this by write
0x0 instead of ~EE_CS when terminating the eeprom access.

Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b01af457
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -1636,7 +1636,7 @@ static void eeprom_cmd(void __iomem *ee_addr, int cmd, int cmd_len)


static void eeprom_cmd_end(void __iomem *ee_addr)
static void eeprom_cmd_end(void __iomem *ee_addr)
{
{
	writeb (~EE_CS, ee_addr);
	writeb(0, ee_addr);
	eeprom_delay ();
	eeprom_delay ();
}
}


+1 −1
Original line number Original line Diff line number Diff line
@@ -1173,7 +1173,7 @@ static int __devinit read_eeprom (void __iomem *ioaddr, int location, int addr_l
	}
	}


	/* Terminate the EEPROM access. */
	/* Terminate the EEPROM access. */
	RTL_W8 (Cfg9346, ~EE_CS);
	RTL_W8(Cfg9346, 0);
	eeprom_delay ();
	eeprom_delay ();


	return retval;
	return retval;