From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9F015C433F5 for ; Fri, 8 Apr 2022 23:44:12 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id F003483B29; Sat, 9 Apr 2022 01:44:09 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="KzbogSiw"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 882E383B49; Sat, 9 Apr 2022 01:44:07 +0200 (CEST) Received: from mail-qt1-x834.google.com (mail-qt1-x834.google.com [IPv6:2607:f8b0:4864:20::834]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 3586B83AFF for ; Sat, 9 Apr 2022 01:44:04 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qt1-x834.google.com with SMTP id j21so12037474qta.0 for ; Fri, 08 Apr 2022 16:44:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=NpkvFuQy5VdK0eowJCDJ1Z5+1vzQcBAuLqSDk2eMhkE=; b=KzbogSiwVJOz3vHRuyAA97qV2GXPyJxS40+kZaFlkldHc4sBKKm1I8qentaL65o/hB QEAA24lU0nsypN35lWV/jLTHEQ+cEmpl/ohfZetcn8tmdsYT93J2/UwMv6OFwlcGb1u1 ehwpzMrh75PmqBY2Q7m5frzerxXEngQxngzGg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=NpkvFuQy5VdK0eowJCDJ1Z5+1vzQcBAuLqSDk2eMhkE=; b=MWgbfwyRc/9B8CKrAvbiTQkpSUdlh3BYoU3jyW5r8UlBWHCt+zFv/4tAqJmDPhsH0F GwHPev3JQuuKi1z99DI7crWnBI53Ry5YSJpgfKwooOBz6Kf87NjC+d8qezgh3BKnvllM hwyVc3RQS6hB28OmHr13ehhAAsz4cqLWXmMMSjyin5DpvRLmvXolDvIz2JaAlzSaGqhC zMnHY1OqsufPATLQhezN3nrNQBD3+vTk80W4IKYo6hg4fo/TWZ17DuR3Z6aV/WczMQ0v X9Ed4ZCheukJ28y9f3FCboU7zHfebbMPx7DLLm3O6iSLAFZnRXbpBu8Tfk9bNwk844RP ZJkA== X-Gm-Message-State: AOAM531mzRwr75HGWLORglrQzdbwBpy/EZVNm2QIOa8VR/59j42Zrfae 23zQ0XOmg48DK044Tbq700nOjymY1ZqjgA== X-Google-Smtp-Source: ABdhPJwSlPK/aormApfcJ6849eQ7P+KIsUPWxP7kcfN53ApPPzyEOO8qbubOZ1gSLZ39K+oHn7jnUQ== X-Received: by 2002:ac8:5cc1:0:b0:2e1:bd05:1371 with SMTP id s1-20020ac85cc1000000b002e1bd051371mr17752229qta.573.1649461443010; Fri, 08 Apr 2022 16:44:03 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b01-cbda-2ef0-5dff-fedb-a8ba.res6.spectrum.com. [2603:6081:7b01:cbda:2ef0:5dff:fedb:a8ba]) by smtp.gmail.com with ESMTPSA id 2-20020a05620a078200b0069bf545076bsm524414qka.13.2022.04.08.16.44.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Apr 2022 16:44:02 -0700 (PDT) Date: Fri, 8 Apr 2022 19:43:59 -0400 From: Tom Rini To: Diego Rondini Cc: u-boot@lists.denx.de Subject: Re: [PATCH] cmd: gpio: Add `gpio read` subcommand Message-ID: <20220408234359.GA467796@bill-the-cat> References: <20220322171435.3558515-1-diego.rondini@kynetics.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Dxnq1zWXvFF0Q93v" Content-Disposition: inline In-Reply-To: <20220322171435.3558515-1-diego.rondini@kynetics.com> X-Clacks-Overhead: GNU Terry Pratchett 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 --Dxnq1zWXvFF0Q93v Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Mar 22, 2022 at 06:14:35PM +0100, Diego Rondini wrote: > As explained in commit 4af2a33ee5b9 ("cmd: gpio: Make `gpio input` > return pin value again") the `gpio input` is used in scripts to obtain > the value of a pin, despite the fact that CMD_RET_FAILURE is > indistinguishable from a valid pin value. > To be able to detect failures and properly use the value of a GPIO in > scripts we introduce the `gpio read` command that sets the variable > `name` to the value of the pin. Return code of the `gpio read` command > can be used to check for CMD_RET_SUCCESS or CMD_RET_FAILURE. >=20 > Signed-off-by: Diego Rondini > --- > cmd/gpio.c | 24 ++++++++++++++++++++---- > test/py/tests/test_gpio.py | 15 +++++++++++++++ > 2 files changed, 35 insertions(+), 4 deletions(-) Please rework this to add CONFIG_CMD_GPIO_READ, and enable it on sandbox as it causes a good bit of growth on a large number of platforms, thanks. --=20 Tom --Dxnq1zWXvFF0Q93v Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmJQyLUACgkQFHw5/5Y0 tyz1lQv9GTO7B/R2Hb6gs2wXhFHLY2FLsQpbl9GEiJJxgcxqQer/l9pYgZZyZ48i MNaNfzpIms9RsYVjie0iQPTIyEp8XsQai27J4W3tUe9s6wS3msMma1t4ak4a095u W9Tln6a2nzkknXNbBQObdWkrqYZvk5wnkhbyRKNv2COhKmzQsesHAs4Juf6JAEcg ouqEwBRXjig1ykb/PX/AU2k/id3tdBzQVSdD4DG3zChPQiOV019yyy+eBmTyGZ6C vmsRs/t5Vt2FacBplEzbxyiPKTg6owQIomziRk0GNKvxPhU0UlkNfrRXu54GnKfw oDnfLVv/Fhhey+mj/yUcXbzFstr+jIgD5jqHw1zjjHJXKDRSHjon8Q9r32NyU1IJ El9UQShEs4npMZ4GVLZIUSjjrYAaPVxYy0psPMYOwwV4fFXgSMZ2nbz4TvYzJm20 MfQWXBCjJFVpCTn3ICmkEZGuFT75ygj5efpF10ZQ++fwnyNhnxoRJAvowEpWTB63 +Y2tVsM4 =uXhq -----END PGP SIGNATURE----- --Dxnq1zWXvFF0Q93v--