mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-25 06:00:43 +00:00
mxs-i2c: Fix internal address byte order
Large EEPROMs, e.g. 24lc32, need 2 byte to address the internal memory. These devices require that the high byte of the internal address has to be written first. The mxs_i2c driver currently writes the address' low byte first. The following patch fixes the byte order of the internal address that should be written to the I2C device. Signed-off-by: Torsten Fleischer <to-fleischer@t-online.de> CC: Marek Vasut <marex@denx.de> CC: Stefano Babic <sbabic@denx.de> CC: Fabio Estevam <fabio.estevam@freescale.com> Acked-by: Marek Vasut <marex@denx.de> Acked-by: Stefano Babic <sbabic@denx.de>
This commit is contained in:
parent
9ca37d78a3
commit
fa86d1c0bf
1 changed files with 1 additions and 1 deletions
|
@ -97,7 +97,7 @@ void mxs_i2c_write(uchar chip, uint addr, int alen,
|
|||
|
||||
for (i = 0; i < alen; i++) {
|
||||
data >>= 8;
|
||||
data |= ((char *)&addr)[i] << 24;
|
||||
data |= ((char *)&addr)[alen - i - 1] << 24;
|
||||
if ((i & 3) == 2)
|
||||
writel(data, &i2c_regs->hw_i2c_data);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue