mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-06-09 23:36:03 +09:00
c854933f50
This is an old driver that supports both device mapped and non-mapped
mode, and covers a wide range of hardware. It's hard to change without
risking breaking something. I have to tried to be exceedingly detailed
in this patch, so please excuse the length of the commit essay that
follows.
In device mapped mode the I2C xfer function does not handle plain read,
and some other, transfers correctly.
What it can't handle are transactions that:
Start with a read, or,
Have a write followed by a read, or,
Have more than one read in a row.
The common I2C/SMBUS read register and write register transactions
always start with a write, followed by a write or a read, and then end.
These work, so the bug is not apparent for most I2C slaves that only use
these common xfer forms.
The existing xfer loop initializes by sending the chip address in write
mode after it deals with bus arbitration and master setup. When
processing each message, if the next message will be a read, it sends a
repeated start followed by the chip address in read mode after the
current message.
Obviously, this does not work if the first message is a read, as the
chip is always addressed in write mode initially by i2c_init_transfer().
A write following a read does not work because the repeated start is
only sent when the next message is a read. There is no logic to send it
when the current message is a read and next is write. It should be sent
every time the bus changes direction.
The ability to use a plain read was added to this driver in
commit
|
||
---|---|---|
.. | ||
muxes | ||
ast_i2c.c | ||
ast_i2c.h | ||
at91_i2c.c | ||
at91_i2c.h | ||
cros_ec_ldo.c | ||
cros_ec_tunnel.c | ||
davinci_i2c.c | ||
davinci_i2c.h | ||
designware_i2c.c | ||
designware_i2c.h | ||
exynos_hs_i2c.c | ||
fsl_i2c.c | ||
i2c_core.c | ||
i2c-cdns.c | ||
i2c-emul-uclass.c | ||
i2c-gpio.c | ||
i2c-uclass-compat.c | ||
i2c-uclass.c | ||
i2c-uniphier-f.c | ||
i2c-uniphier.c | ||
i2c-versatile.c | ||
ihs_i2c.c | ||
imx_lpi2c.c | ||
intel_i2c.c | ||
Kconfig | ||
kona_i2c.c | ||
lpc32xx_i2c.c | ||
Makefile | ||
meson_i2c.c | ||
mv_i2c.c | ||
mv_i2c.h | ||
mvtwsi.c | ||
mxc_i2c.c | ||
omap24xx_i2c.c | ||
omap24xx_i2c.h | ||
rcar_i2c.c | ||
rcar_iic.c | ||
rk_i2c.c | ||
s3c24x0_i2c.c | ||
s3c24x0_i2c.h | ||
sandbox_i2c.c | ||
sh_i2c.c | ||
soft_i2c.c | ||
stm32f7_i2c.c | ||
tegra_i2c.c | ||
tegra186_bpmp_i2c.c | ||
xilinx_xiic.c |