summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrygorii Tertychnyi <grembeter@gmail.com>2024-05-20 17:39:32 +0200
committerAndi Shyti <andi.shyti@kernel.org>2024-06-21 01:17:43 +0200
commit5a72477273066b5b357801ab2d315ef14949d402 (patch)
tree5adabda6c2c74b628596cfc40ddcd8948519c1ba
parent5c8cfd592bb7632200b4edac8f2c7ec892ed9d81 (diff)
downloadlinux-stable-5a72477273066b5b357801ab2d315ef14949d402.tar.gz
linux-stable-5a72477273066b5b357801ab2d315ef14949d402.tar.bz2
linux-stable-5a72477273066b5b357801ab2d315ef14949d402.zip
i2c: ocores: set IACK bit after core is enabled
Setting IACK bit when core is disabled does not clear the "Interrupt Flag" bit in the status register, and the interrupt remains pending. Sometimes it causes failure for the very first message transfer, that is usually a device probe. Hence, set IACK bit after core is enabled to clear pending interrupt. Fixes: 18f98b1e3147 ("[PATCH] i2c: New bus driver for the OpenCores I2C controller") Signed-off-by: Grygorii Tertychnyi <grygorii.tertychnyi@leica-geosystems.com> Acked-by: Peter Korsgaard <peter@korsgaard.com> Cc: stable@vger.kernel.org Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
-rw-r--r--drivers/i2c/busses/i2c-ocores.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-ocores.c b/drivers/i2c/busses/i2c-ocores.c
index 56a4dabf5a38..4ad670a80a63 100644
--- a/drivers/i2c/busses/i2c-ocores.c
+++ b/drivers/i2c/busses/i2c-ocores.c
@@ -431,8 +431,8 @@ static int ocores_init(struct device *dev, struct ocores_i2c *i2c)
oc_setreg(i2c, OCI2C_PREHIGH, prescale >> 8);
/* Init the device */
- oc_setreg(i2c, OCI2C_CMD, OCI2C_CMD_IACK);
oc_setreg(i2c, OCI2C_CONTROL, ctrl | OCI2C_CTRL_EN);
+ oc_setreg(i2c, OCI2C_CMD, OCI2C_CMD_IACK);
return 0;
}