kernel: backport v5.8 i2c-pxa updates
[openwrt/staging/stintel.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 diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c
18 index a72d07bdb793..0e194d6cd1b5 100644
19 --- a/drivers/i2c/busses/i2c-pxa.c
20 +++ b/drivers/i2c/busses/i2c-pxa.c
21 @@ -940,14 +940,8 @@ static void i2c_pxa_irq_txempty(struct pxa_i2c *i2c, u32 isr)
22 icr &= ~ICR_ALDIE;
23 icr |= ICR_START | ICR_TB;
24 } else {
25 - if (i2c->msg->len == 0) {
26 - /*
27 - * Device probes have a message length of zero
28 - * and need the bus to be reset before it can
29 - * be used again.
30 - */
31 - i2c_pxa_reset(i2c);
32 - }
33 + if (i2c->msg->len == 0)
34 + icr |= ICR_MA;
35 i2c_pxa_master_complete(i2c, 0);
36 }
37
38 --
39 2.20.1
40