From patchwork Mon Dec 14 11:24:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 343487 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp2911466jai; Mon, 14 Dec 2020 03:25:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJxNof5mj82jJ++HNXa2b57dJcO5N+kuXBQELF6AeZwJ4D9eGApAHK7QOciGuzVD6V1En4EL X-Received: by 2002:a17:907:2108:: with SMTP id qn8mr21825106ejb.127.1607945125662; Mon, 14 Dec 2020 03:25:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607945125; cv=none; d=google.com; s=arc-20160816; b=qVVrqqUvd+US/bongQEngyouK2aDkOG02lE1OG9hpgLL4CoiciVYCXsdQz0RBces9H LBlrvlKXurXhKXmfbeYuwQTXZkduU7OuIUp63IyVF1tcEuS4NXhhKF9KizPz6PcyjSQl IdEo5wOQ+yMZOnAnHL1CIHTIyGmJ93NQJS4xDgoieXVoez2l2fky2WXHI9oNAxAR0iHo y2xNrxR49Pd3waJy45wZoJL9lzGjLCYckVecs88UdfH5kzT8lf8bIKvsXH2MPB+AvI2G YEgmQNkISQ6URGQUkzUc/C2g5Wc1VxqPDmJPqoJQryVzshKlTtETHnn+NFGsEymrgbQO LBow== 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=R7mNm5ML53RHW9zx3apeGR+lOQFHGzETqEb+IveRrCE=; b=Oim+1w+6BPNv48zyi0kXggY1Kq/YyXea6VPtX6SoId8xvlAC209NPz3/XXlvVgJ/cd PBxR3FSLAMEgdleg3JxHPVWn5/UgRflTSfNRPzyXzWzZdjtxgqyy/a35kL8Hxtn5KUMh NbkYTKdgBTm7wx7ZXPUR6OysZIt3gWT/zLPT5daVYPO/561yHs2sXK5USKAamtp1dwy5 L5epAgLYmCGkDhgj8xzkqORFtMuqUQ5nSZgiLAzOD03BpTKdvgSVNN6xdCEkNmyN0npG x9HtRYygupGMXIo+owQ8jthxI3c4oEcTR0mMShsawMU44y12sISe+HccCkCIERQh1RKC nECw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=ApqfuTFR; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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. [85.214.62.61]) by mx.google.com with ESMTPS id u2si8868125ejo.423.2020.12.14.03.25.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Dec 2020 03:25:25 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=ApqfuTFR; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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 84E408282B; Mon, 14 Dec 2020 12:25:12 +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="ApqfuTFR"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BA92882816; Mon, 14 Dec 2020 12:25:07 +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 D9BE58280D for ; Mon, 14 Dec 2020 12:25:02 +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 20201214112452euoutp02af925c7fce52442ba0bfd04f2e0df293~QkYrYeWIn2120021200euoutp02b for ; Mon, 14 Dec 2020 11:24:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20201214112452euoutp02af925c7fce52442ba0bfd04f2e0df293~QkYrYeWIn2120021200euoutp02b DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1607945092; bh=R7mNm5ML53RHW9zx3apeGR+lOQFHGzETqEb+IveRrCE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ApqfuTFR1PaQmppypk8eD63YqcGAlU3tpRCoDPESQU0zsjxoLf/8+qbqma+TES84U aBmq47Ik80/Qj7cuiTlwWIoldUFkiZs284Tvld3m9oBBJZxoLYQVmLiwuA99xMoHCR JqagSMRz/5g3leQS/Q8kNTe7tQbdef2+FMkMHnos= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20201214112452eucas1p1ba1547665e1d3dea4982b35ea4b3d87a~QkYq9qNja3050430504eucas1p1p; Mon, 14 Dec 2020 11:24:52 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id A2.82.44805.38B47DF5; Mon, 14 Dec 2020 11:24:51 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20201214112451eucas1p2ace7794301c6791761fd130c158f3d08~QkYqnmX4e1087810878eucas1p2V; Mon, 14 Dec 2020 11:24:51 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20201214112451eusmtrp2def4372ad2ef1e2b919c6782b4769024~QkYqm9gA30874808748eusmtrp26; Mon, 14 Dec 2020 11:24:51 +0000 (GMT) X-AuditID: cbfec7f4-b4fff7000000af05-c5-5fd74b83efa7 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 11.F8.16282.38B47DF5; Mon, 14 Dec 2020 11:24:51 +0000 (GMT) Received: from AMDC2765.digital.local (unknown [106.120.51.73]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20201214112450eusmtip1639af7dc990c4e3e89249ac13ec2d32c~QkYp2oFQz2707027070eusmtip1S; Mon, 14 Dec 2020 11:24:50 +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 5/6] cmd: button: store button state in the 'button' env Date: Mon, 14 Dec 2020 12:24:36 +0100 Message-Id: <20201214112437.18757-6-m.szyprowski@samsung.com> X-M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4GAYv/RkpearF6KweouF3fJ uy2rObd7Spjp5gP9nvLsnYXvHnh9OBBw5QA3+54Va1vS1b85WGUxT/Aqv+PC/7JNiaU4I9FQ i7moOBEAcuvPQwADAAA= X-CMS-MailID: 20201214112451eucas1p2ace7794301c6791761fd130c158f3d08 X-Msg-Generator: CA X-RootMTR: 20201214112451eucas1p2ace7794301c6791761fd130c158f3d08 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20201214112451eucas1p2ace7794301c6791761fd130c158f3d08 References: <20201214112437.18757-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 64c5a8fa046..8da911068a4 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; }