mediatek: Add support for Xiaomi Redmi Router AX6S
[openwrt/staging/chunkeey.git] / target / linux / generic / backport-5.4 / 820-v5.8-i2c-pxa-use-master-abort-for-device-probes.patch
1 From: Russell King <rmk+kernel@armlinux.org.uk>
2 Bcc: linux@mail.armlinux.org.uk
3 Subject: [PATCH 6/7] i2c: pxa: use master-abort for device probes
4 MIME-Version: 1.0
5 Content-Disposition: inline
6 Content-Transfer-Encoding: 8bit
7 Content-Type: text/plain; charset="utf-8"
8
9 Use master-abort to send the stop condition after an address cycle
10 rather than resetting the controller.
11
12 Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
13 ---
14 drivers/i2c/busses/i2c-pxa.c | 10 ++--------
15 1 file changed, 2 insertions(+), 8 deletions(-)
16
17 --- a/drivers/i2c/busses/i2c-pxa.c
18 +++ b/drivers/i2c/busses/i2c-pxa.c
19 @@ -899,14 +899,8 @@ static void i2c_pxa_irq_txempty(struct p
20 icr &= ~ICR_ALDIE;
21 icr |= ICR_START | ICR_TB;
22 } else {
23 - if (i2c->msg->len == 0) {
24 - /*
25 - * Device probes have a message length of zero
26 - * and need the bus to be reset before it can
27 - * be used again.
28 - */
29 - i2c_pxa_reset(i2c);
30 - }
31 + if (i2c->msg->len == 0)
32 + icr |= ICR_MA;
33 i2c_pxa_master_complete(i2c, 0);
34 }
35