From: Adrian Fiergolski Date: Tue, 11 Jan 2022 18:05:30 +0000 (+0100) Subject: misc: atsha204a: add delay after sending the message X-Git-Tag: v2022.07~140^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e4662716fbbe4ce717cbf9f193564943ffe355f8;p=platform%2Fkernel%2Fu-boot.git misc: atsha204a: add delay after sending the message Once request is sent, and before receiving a response, the delay is required. This patch fixes missing delay for before first response try. Signed-off-by: Adrian Fiergolski Reviewed-by: Marek BehĂșn --- diff --git a/drivers/misc/atsha204a-i2c.c b/drivers/misc/atsha204a-i2c.c index 9d069fb..d264477 100644 --- a/drivers/misc/atsha204a-i2c.c +++ b/drivers/misc/atsha204a-i2c.c @@ -280,6 +280,7 @@ static int atsha204a_transaction(struct udevice *dev, struct atsha204a_req *req, } do { + udelay(ATSHA204A_EXECTIME); res = atsha204a_recv_resp(dev, resp); if (!res || res == -EMSGSIZE || res == -EBADMSG) break; @@ -287,7 +288,6 @@ static int atsha204a_transaction(struct udevice *dev, struct atsha204a_req *req, debug("ATSHA204A transaction polling for response " "(timeout = %d)\n", timeout); - udelay(ATSHA204A_EXECTIME); timeout -= ATSHA204A_EXECTIME; } while (timeout > 0);