3648d31fa8
I think when Klaus ported his slave mode changes from the original patch
series to the rewritten I2C module, he changed the behavior of the first
byte that is received by the slave device.
What's supposed to happen is that the AspeedI2CBus's slave device's
i2c_event callback should run, and if the event is "send_async", then it
should populate the byte buffer with the 8-bit I2C address that is being
sent to. Since we only support "send_async", the lowest bit should
always be 0 (indicating that the master is requesting to send data).
This is the code Klaus had previously, for reference. [1]
switch (event) {
case I2C_START_SEND:
bus->buf = bus->dev_addr << 1;
bus->buf &= I2CD_BYTE_BUF_RX_MASK;
bus->buf <<= I2CD_BYTE_BUF_RX_SHIFT;
bus->intr_status |= (I2CD_INTR_SLAVE_ADDR_RX_MATCH | I2CD_INTR_RX_DONE);
aspeed_i2c_set_state(bus, I2CD_STXD);
break;
[1]: https://lore.kernel.org/qemu-devel/20220331165737.1073520-4-its@irrelevant.dk/
Fixes:
|
||
---|---|---|
.. | ||
arm_sbcon_i2c.h | ||
aspeed_i2c.h | ||
bitbang_i2c.h | ||
i2c_mux_pca954x.h | ||
i2c.h | ||
imx_i2c.h | ||
microbit_i2c.h | ||
npcm7xx_smbus.h | ||
pm_smbus.h | ||
pmbus_device.h | ||
ppc4xx_i2c.h | ||
smbus_eeprom.h | ||
smbus_master.h | ||
smbus_slave.h |