mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-30 08:02:30 +00:00
i2c: stm32f7: fix first byte to send in slave mode
The slave-interface documentation [1] states "the bus driver should
transmit the first byte" upon I2C_SLAVE_READ_REQUESTED slave event:
- 'val': backend returns first byte to be sent
The driver currently ignores the 1st byte to send on this event.
[1] https://www.kernel.org/doc/Documentation/i2c/slave-interface
Fixes: 60d609f30d
("i2c: i2c-stm32f7: Add slave support")
Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Reviewed-by: Pierre-Yves MORDRET <pierre-yves.mordret@st.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
This commit is contained in:
parent
62931ac2f9
commit
02e64276c6
1 changed files with 2 additions and 0 deletions
|
@ -1192,6 +1192,8 @@ static void stm32f7_i2c_slave_start(struct stm32f7_i2c_dev *i2c_dev)
|
||||||
STM32F7_I2C_CR1_TXIE;
|
STM32F7_I2C_CR1_TXIE;
|
||||||
stm32f7_i2c_set_bits(base + STM32F7_I2C_CR1, mask);
|
stm32f7_i2c_set_bits(base + STM32F7_I2C_CR1, mask);
|
||||||
|
|
||||||
|
/* Write 1st data byte */
|
||||||
|
writel_relaxed(value, base + STM32F7_I2C_TXDR);
|
||||||
} else {
|
} else {
|
||||||
/* Notify i2c slave that new write transfer is starting */
|
/* Notify i2c slave that new write transfer is starting */
|
||||||
i2c_slave_event(slave, I2C_SLAVE_WRITE_REQUESTED, &value);
|
i2c_slave_event(slave, I2C_SLAVE_WRITE_REQUESTED, &value);
|
||||||
|
|
Loading…
Reference in a new issue