From patchwork Thu Mar 24 15:32:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tim Harvey X-Patchwork-Id: 1609109 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KPTjs2jX6z9sFh for ; Fri, 25 Mar 2022 02:32:17 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 12903840A9; Thu, 24 Mar 2022 16:32:12 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=gateworks.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 2721284000; Thu, 24 Mar 2022 16:32:10 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from finn.localdomain (finn.gateworks.com [108.161.129.64]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 5F31B84021 for ; Thu, 24 Mar 2022 16:32:07 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=gateworks.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=tharvey@gateworks.com Received: from 068-189-091-139.biz.spectrum.com ([68.189.91.139] helo=tharvey.pdc.gateworks.com) by finn.localdomain with esmtp (Exim 4.93) (envelope-from ) id 1nXPRS-00BuPZ-MO; Thu, 24 Mar 2022 15:32:02 +0000 From: Tim Harvey To: u-boot@lists.denx.de, Stefano Babic , Fabio Estevam , "NXP i . MX U-Boot Team" Cc: Simon Glass , Tim Harvey Subject: [PATCH] board: gw_ventana: gsc: fix GSC read/write functions Date: Thu, 24 Mar 2022 08:32:00 -0700 Message-Id: <20220324153200.8335-1-tharvey@gateworks.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean commit 7c84319af9c7 ("dm: gpio: Correct use of -ENODEV in drivers") changed the return code for an I2C NAK from -ENODEV to -EREMOTEIO. Update the gsc_i2c_read and gsc_i2c_write functions for this change to properly retry the transaction on a NAK meaning the GSC is busy. Fixes: 7c84319af9c7 ("dm: gpio: Correct use of -ENODEV in drivers") Signed-off-by: Tim Harvey Reviewed-by: Fabio Estevam --- board/gateworks/gw_ventana/gsc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/board/gateworks/gw_ventana/gsc.c b/board/gateworks/gw_ventana/gsc.c index 324e5dbed2c8..a5d6de7e0e8e 100644 --- a/board/gateworks/gw_ventana/gsc.c +++ b/board/gateworks/gw_ventana/gsc.c @@ -41,7 +41,7 @@ int gsc_i2c_read(uchar chip, uint addr, int alen, uchar *buf, int len) break; debug("%s: 0x%02x 0x%02x retry%d: %d\n", __func__, chip, addr, n, ret); - if (ret != -ENODEV) + if (ret != -EREMOTEIO) break; mdelay(10); } @@ -60,7 +60,7 @@ int gsc_i2c_write(uchar chip, uint addr, int alen, uchar *buf, int len) break; debug("%s: 0x%02x 0x%02x retry%d: %d\n", __func__, chip, addr, n, ret); - if (ret != -ENODEV) + if (ret != -EREMOTEIO) break; mdelay(10); }