mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-29 10:08:59 +00:00
afd4bf08bc
Manually merged: layerscape/808-i2c-0011-i2c-imx-support-slave-mode-for-imx-I2C-driver.patch layerscape/808-i2c-0012-i2c-imx-correct-code-of-errata-A-010650-for-layersca.patch Remaining modifications made by update_kernel.sh Build system: x86_64 Build-tested: ipq806x/R7800, ath79/generic, bcm27xx/bcm2711, x86/64 [*], ramips/mt7621 [*], ath79/tiny [*], ipq40xx [*], octeon [*], realtek [*] Run-tested: ipq806x/R7800, ramips/mt7621 [*], octeon [*], realtek [*] No dmesg regressions, everything functional Signed-off-by: John Audia <graysky@archlinux.us> Tested-by: Stijn Segers <foss@volatilesystems.org> [*]
47 lines
1.5 KiB
Diff
47 lines
1.5 KiB
Diff
From 85048a8a0df324df94f9585c1e01d0a4419de4dc Mon Sep 17 00:00:00 2001
|
|
From: Clark Wang <xiaoning.wang@nxp.com>
|
|
Date: Wed, 27 Nov 2019 14:23:55 +0800
|
|
Subject: [PATCH] LF-98 i2c: imx: fix the judgement of slave mode in isr
|
|
|
|
The I2CR[MSTA] will be modified by software or hardware even in master
|
|
mode. The judgment of slave mode by reading CR register is unreliable.
|
|
Change to use i2c_imx->slave registered status to judge i2c mode.
|
|
|
|
Acked-by: Fugang Duan <fugang.duan@nxp.com>
|
|
Signed-off-by: Clark Wang <xiaoning.wang@nxp.com>
|
|
---
|
|
drivers/i2c/busses/i2c-imx.c | 13 +++++--------
|
|
1 file changed, 5 insertions(+), 8 deletions(-)
|
|
|
|
--- a/drivers/i2c/busses/i2c-imx.c
|
|
+++ b/drivers/i2c/busses/i2c-imx.c
|
|
@@ -1482,23 +1482,20 @@ static const struct i2c_algorithm i2c_im
|
|
static irqreturn_t i2c_imx_isr(int irq, void *dev_id)
|
|
{
|
|
struct imx_i2c_struct *i2c_imx = dev_id;
|
|
- unsigned int status, ctl;
|
|
- irqreturn_t irq_status = IRQ_NONE;
|
|
+ unsigned int status;
|
|
|
|
status = imx_i2c_read_reg(i2c_imx, IMX_I2C_I2SR);
|
|
- ctl = imx_i2c_read_reg(i2c_imx, IMX_I2C_I2CR);
|
|
|
|
if (status & I2SR_IIF) {
|
|
i2c_imx_clr_if_bit(status, i2c_imx);
|
|
- if (ctl & I2CR_MSTA)
|
|
- irq_status = i2c_imx_master_isr(i2c_imx);
|
|
#if IS_ENABLED(CONFIG_I2C_SLAVE)
|
|
- else
|
|
- irq_status = i2c_imx_slave_isr(i2c_imx);
|
|
+ if (i2c_imx->slave)
|
|
+ return i2c_imx_slave_isr(i2c_imx);
|
|
#endif
|
|
+ return i2c_imx_master_isr(i2c_imx);
|
|
}
|
|
|
|
- return irq_status;
|
|
+ return IRQ_NONE;
|
|
}
|
|
|
|
static int i2c_imx_probe(struct platform_device *pdev)
|