[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191115223356.27675-1-mathieu.poirier@linaro.org>
Date: Fri, 15 Nov 2019 15:33:37 -0700
From: Mathieu Poirier <mathieu.poirier@...aro.org>
To: stable@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org
Subject: [stable 4.19+][PATCH 01/20] i2c: stm32f7: fix first byte to send in slave mode
From: Fabrice Gasnier <fabrice.gasnier@...com>
commit 915da2b794ce4fc98b1acf64d64354f22a5e4931 upstream
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: 60d609f30de2 ("i2c: i2c-stm32f7: Add slave support")
Signed-off-by: Fabrice Gasnier <fabrice.gasnier@...com>
Reviewed-by: Pierre-Yves MORDRET <pierre-yves.mordret@...com>
Signed-off-by: Wolfram Sang <wsa@...-dreams.de>
Cc: stable <stable@...r.kernel.org> # 4.19+
Signed-off-by: Mathieu Poirier <mathieu.poirier@...aro.org>
---
drivers/i2c/busses/i2c-stm32f7.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/i2c/busses/i2c-stm32f7.c b/drivers/i2c/busses/i2c-stm32f7.c
index ac9c9486b834..48521bc8a4d2 100644
--- a/drivers/i2c/busses/i2c-stm32f7.c
+++ b/drivers/i2c/busses/i2c-stm32f7.c
@@ -1177,6 +1177,8 @@ static void stm32f7_i2c_slave_start(struct stm32f7_i2c_dev *i2c_dev)
STM32F7_I2C_CR1_TXIE;
stm32f7_i2c_set_bits(base + STM32F7_I2C_CR1, mask);
+ /* Write 1st data byte */
+ writel_relaxed(value, base + STM32F7_I2C_TXDR);
} else {
/* Notify i2c slave that new write transfer is starting */
i2c_slave_event(slave, I2C_SLAVE_WRITE_REQUESTED, &value);
--
2.17.1
Powered by blists - more mailing lists