From e4662716fbbe4ce717cbf9f193564943ffe355f8 Mon Sep 17 00:00:00 2001 From: Adrian Fiergolski Date: Tue, 11 Jan 2022 19:05:30 +0100 Subject: [PATCH] misc: atsha204a: add delay after sending the message MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- drivers/misc/atsha204a-i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/misc/atsha204a-i2c.c b/drivers/misc/atsha204a-i2c.c index 9d069fb33c..d264477927 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); -- 2.39.5