Skip to content

Commit 391251d

Browse files
grembetergregkh
authored andcommitted
i2c: ocores: set IACK bit after core is enabled
commit 5a72477 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 84d3549 commit 391251d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/i2c/busses/i2c-ocores.c

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

444444
/* Init the device */
445-
oc_setreg(i2c, OCI2C_CMD, OCI2C_CMD_IACK);
446445
oc_setreg(i2c, OCI2C_CONTROL, ctrl | OCI2C_CTRL_EN);
446+
oc_setreg(i2c, OCI2C_CMD, OCI2C_CMD_IACK);
447447

448448
return 0;
449449
}

0 commit comments

Comments
 (0)