Skip to content

Commit 5a72477

Browse files
grembeterAndi Shyti
authored andcommitted
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: 18f98b1 ("[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>
1 parent 5c8cfd5 commit 5a72477

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/i2c/busses/i2c-ocores.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,8 +431,8 @@ static int ocores_init(struct device *dev, struct ocores_i2c *i2c)
431431
oc_setreg(i2c, OCI2C_PREHIGH, prescale >> 8);
432432

433433
/* Init the device */
434-
oc_setreg(i2c, OCI2C_CMD, OCI2C_CMD_IACK);
435434
oc_setreg(i2c, OCI2C_CONTROL, ctrl | OCI2C_CTRL_EN);
435+
oc_setreg(i2c, OCI2C_CMD, OCI2C_CMD_IACK);
436436

437437
return 0;
438438
}

0 commit comments

Comments
 (0)