]> git.baikalelectronics.ru Git - uboot.git/commitdiff
misc: atsha204a: add delay after sending the message
authorAdrian Fiergolski <adrian.fiergolski@fastree3d.com>
Tue, 11 Jan 2022 18:05:30 +0000 (19:05 +0100)
committerHeiko Schocher <hs@denx.de>
Wed, 23 Mar 2022 06:27:37 +0000 (07:27 +0100)
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 <adrian.fiergolski@fastree3d.com>
Reviewed-by: Marek BehĂșn <marek.behun@nic.cz>
drivers/misc/atsha204a-i2c.c

index 9d069fb33c92a803ae21b2148d686473b20384e4..d264477927d5a6151b8d9fb1cceedc836d9edda5 100644 (file)
@@ -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);