From patchwork Tue Dec 15 14:42:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 344010 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp3974436jai; Tue, 15 Dec 2020 06:43:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJwJleOR+j7aulx/DpvE5AtjFCmKqge0Ny+cZVQWMGDbXnLG40xuLcngnQqEPnEV272gdLaE X-Received: by 2002:a17:906:1510:: with SMTP id b16mr15793814ejd.5.1608043399167; Tue, 15 Dec 2020 06:43:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608043399; cv=none; d=google.com; s=arc-20160816; b=MXcUdlo+yrNu1pSPqoBJrAmTBYGMfcG9QyphSqcZDPcPWC2Y6ftRrI/D6LpGU21zYn MraFC2lzVFIfJJzQA5LJN0V6tMOpIPCn2eFRdQgbn4G4K779K2G02NLvJji/DdN/N/+R YRGghDciiu+ItPAY5k/oX47pGNzSb7Bvo1+PPDFtwTxyfrcPg79Q0JCBneOqNIZmF1sc SJ/q0BWzG5Q4T8QBY51l4YKha4V6PWe9JyI+Oro/p6gW8Gd2a29TZP+bb5jZNB09CzEm 4Y9T+2m8+UEZ3Sf2HPKUjSZF7M7zqndI+m4HwWn+500b5nxK36Gg0VjcGb7ErgOUEiUi ZL6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:references:cms-type:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:dkim-filter; bh=JjCbe7dJUMYOKHef9/EJ+A4k4tBdZY2KTbt99YPqGHM=; b=WXkznCzjJUvIz5dRjJy4OYYpTf6YJK+7YbiBIUNT7cbp19QcXZbDccqcIL7wzYmaRC D9VCZ3u7B2DAn7dN6Y3a+dCWr3DcwBuq/YED5sGW0XtlTZpXhu7j2MZ4CnWiFPwGyi/O 9rSZyLZp9y6zqa1aMgZZfGPwHLbh6Sy/l1t8Jd3R0F0pxW8zf/3R2E/NZuunNVGuJ4pu 4+G3+hE+GnxGfaDIl4ttSU+FvRsRxPR0rX616t+PKRBRM9/HVdf4fwZlfswknk7UjA+o qn1/AoaurA/u+AsVwk0FdYjTL3zbh4utx/9o6HmyRxBeQwG2UAkHZp9U1eP6ZJpKWops Z05g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=IF+9CJTO; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id q4si920582eds.576.2020.12.15.06.43.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Dec 2020 06:43:19 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=IF+9CJTO; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 303A8829A4; Tue, 15 Dec 2020 15:43:05 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=samsung.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=samsung.com header.i=@samsung.com header.b="IF+9CJTO"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 956F3829B0; Tue, 15 Dec 2020 15:42:59 +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=-7.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id AABF182980 for ; Tue, 15 Dec 2020 15:42:56 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=m.szyprowski@samsung.com Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20201215144245euoutp029c0b5e994fd1025c3a5efeef8ec62095~Q6uvp0rKs1508115081euoutp02g for ; Tue, 15 Dec 2020 14:42:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20201215144245euoutp029c0b5e994fd1025c3a5efeef8ec62095~Q6uvp0rKs1508115081euoutp02g DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1608043365; bh=JjCbe7dJUMYOKHef9/EJ+A4k4tBdZY2KTbt99YPqGHM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IF+9CJTOjwC6kRypu4JJTUKIfBpiri3Wuc3xrPMio6RzwoPcIQcUjPom2F/GwdoOl 8LbS/uL/cc3Blm75GT3rZWPyBwhnMfo6yXTfSK7c07H0VJ6dLWuBk1wrMXJSSKu/E/ ykQwJLbKqKUiIr7WiVDX0bpWn5uP8wwp8vN9A16g= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20201215144245eucas1p14e88f9e5eb55176e4e85821e9c648d0c~Q6uvUT64P0481904819eucas1p1d; Tue, 15 Dec 2020 14:42:45 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id C4.36.27958.56BC8DF5; Tue, 15 Dec 2020 14:42:45 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20201215144245eucas1p174ae2f6945b84f7f67528f76d0ff5939~Q6uu1DmFG0484804848eucas1p1Y; Tue, 15 Dec 2020 14:42:45 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20201215144244eusmtrp2deeb7c128087876b04dfe51737d2c2e3~Q6uuuwUAY2505225052eusmtrp21; Tue, 15 Dec 2020 14:42:44 +0000 (GMT) X-AuditID: cbfec7f2-f15ff70000006d36-94-5fd8cb65cf86 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 59.DD.16282.46BC8DF5; Tue, 15 Dec 2020 14:42:44 +0000 (GMT) Received: from AMDC2765.digital.local (unknown [106.120.51.73]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20201215144244eusmtip2e6a5f6540ee10d3f079fde8c1c9a1f0e~Q6uuNCoSs0557505575eusmtip2N; Tue, 15 Dec 2020 14:42:44 +0000 (GMT) From: Marek Szyprowski To: u-boot@lists.denx.de, u-boot-amlogic@groups.io Cc: Marek Szyprowski , Neil Armstrong , Lukasz Majewski , Philippe Reynes , Simon Glass , Heinrich Schuchardt , Jaehoon Chung , Bartlomiej Zolnierkiewicz Subject: [PATCH v2 6/7] cmd: button: store button state in the 'button' env Date: Tue, 15 Dec 2020 15:42:29 +0100 Message-Id: <20201215144230.9235-7-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201215144230.9235-1-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuplleLIzCtJLcpLzFFi42LZduzned3U0zfiDbYtlLXYOGM9q8WNX22s Fs/fXWayWHvkLrvFob5oi47DyhbftmxjtJg04Rebxdu9newWh6d+YHTg8nh/o5XdY3bDRRaP ebNOsHh8+BjnMb/zO5PH2Ts7GD36tqxi9Ni47ABzAEcUl01Kak5mWWqRvl0CV8b+mauYCm6z Vrxa+oOtgfESSxcjJ4eEgInE4ytnWLsYuTiEBFYwSmxbfI4FwvnCKHFxx1+ozGdGic/9z5lg WtbOfMQMkVjOKPFj4RY2uJa2ec/YQKrYBAwlut52gdkiAkYSl5p2gM1lFrjDJNE1uQFsu7CA t8S2vzeZQWwWAVWJxobLYDavgI1E1/Y7UOvkJVZvOAAW5xSwlfgzcRU7yCAJgQMcEl1/5kC9 4SJx4uAXdghbWOLV8S1QtozE/53zmSAamhklHp5bC9XdwyhxuWkGI0SVtcSdc7+AbuUAuk9T Yv0ufYiwo8SRuW9YQMISAnwSN94KgoSZgcxJ26YzQ4R5JTrahCCq1SRmHV8Ht/bghUvMELaH xKrWB9DgmsAosfnaAbYJjPKzEJYtYGRcxSieWlqcm55abJiXWq5XnJhbXJqXrpecn7uJEZhi Tv87/mkH49xXH/UOMTJxMB5ilOBgVhLh7S29Hi/Em5JYWZValB9fVJqTWnyIUZqDRUmcd9Xs NfFCAumJJanZqakFqUUwWSYOTqkGJh9xGdXLaU+MLvzak3PRzfTlsadOGn6nXqe/eXdP41qu AI/6m80qtnFsb9d//V6htVM6bEVQxFcuDYb/HSl7Iz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/+EsQQc2Vy3NZzArEmQSlGgoUahpZL qjfNaZKVWj5TKep2f4pbseev9R4h5isnKVb2XtwYa73c/ui/Nz/j1p4zW3bLnFfpWQfHpwOe 5sfKzT2b/y5J038cm7PnWHWkz9f2pMliQrJ2bSt0O7XCN/FJdTm8Zei3XDO9ereL1uP+zVd/ dF17p3d0y5/MxZeaFszuubn0p8n0JL01i2vYqhhyDGTqGPsTtlrdrvvesF+JpTgj0VCLuag4 EQA6xsYa/wIAAA== X-CMS-MailID: 20201215144245eucas1p174ae2f6945b84f7f67528f76d0ff5939 X-Msg-Generator: CA X-RootMTR: 20201215144245eucas1p174ae2f6945b84f7f67528f76d0ff5939 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20201215144245eucas1p174ae2f6945b84f7f67528f76d0ff5939 References: <20201215144230.9235-1-m.szyprowski@samsung.com> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.102.3 at phobos.denx.de X-Virus-Status: Clean Save examined button state in 'button' environment variable to enable checking button state in the scripts. Signed-off-by: Marek Szyprowski Change-Id: I78b539e1516573fcfea4401f75469291844daae4 --- cmd/button.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/cmd/button.c b/cmd/button.c index 64c5a8fa04..8da911068a 100644 --- a/cmd/button.c +++ b/cmd/button.c @@ -23,8 +23,10 @@ static int show_button_state(struct udevice *dev) ret = button_get_state(dev); if (ret >= BUTTON_COUNT) ret = -EINVAL; - if (ret >= 0) + if (ret >= 0) { printf("%s\n", state_label[ret]); + env_set("button", state_label[ret]); + } return ret; }