From patchwork Tue Dec 15 16:54:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 344028 Delivered-To: patch@linaro.org Received: by 2002:a17:906:4755:0:0:0:0 with SMTP id j21csp4129958ejs; Tue, 15 Dec 2020 08:55:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJx07wMUa0l6URUtrL2bUh8xTQURFRYeP+f1RwH+pAxsqg7lnp9DJgI1Pr7o4fR3rUnlHfZI X-Received: by 2002:a17:906:3a55:: with SMTP id a21mr28013051ejf.516.1608051312627; Tue, 15 Dec 2020 08:55:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608051312; cv=none; d=google.com; s=arc-20160816; b=Nl/ZTWP6by3ahdH++pl7qbZQvPLQ8S4jiRUr/5sYgGiBawpQCMlmXr3PoM+0s7GDOl VFi+mPNQYCYO+qYg22cS/N9C0gB8XyE2K1s9iONHyEpU1ywg5mr3RXesMuq0xLuFf6pN 17q80ME2ugoCvrSSptVvGIMmCTAKACNkZOHb/2Td/KaqiIG2ab75sxoJ51/UlcpaJpcv +YqSF9cfH/eIcFtyhA6GKQYEQFfxfMoD3KzateczDG+cL9mAqjd2B4gm3HUXFP9670Us sagZmu1VXHwc45LRZmGFNuAFykHLpB3SiT9cIJNDsBtxxERKg3H3YvRwqhYXnvbLEM5L Edzg== 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=25f9K14ba99a3g1qYAViGnEi+v2MiDNaZ0KcW6aa4SE=; b=dB5MjzluKo7cO0RUBBDBQu4w+EASRBSQSzgY/1fQAxg18/f8k/nvAUk0GIAA3Un1qF 1r9WwoJtPcJ3J5CSiPBuOHTonlRLQjhUpR72HJeYd7IcXcoWteB36fQRSJw626nv8sUQ 5Y0eD4z2hNfcN7hoxErqafUbEAhEgnjQXiRyyy6mamDQHPCsiY7hxVAXD2PpeNf3MfBW fpwxQx/wuvPgIDHycHuI4rw92GbCO5oJL97LKiZd+pqfflE8UShchgiqpXLdO0vO/EB6 WDc2rHDXoB2kaOoii0QivzF3Ii7ZXf3LsMsz5NYjmPrJP64uxTOA+PE4+kGWFQFfPs8E OjzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=FAxB39Uw; 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 92si1129012edm.533.2020.12.15.08.55.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Dec 2020 08:55:12 -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=FAxB39Uw; 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 EAC2D829D2; Tue, 15 Dec 2020 17:55:08 +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="FAxB39Uw"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7EF19829E6; Tue, 15 Dec 2020 17:55: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 mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2194482867 for ; Tue, 15 Dec 2020 17:55:04 +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 eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20201215165452euoutp01ebb989a042c55f4872b9106774a14030~Q8iGH41Uw1853418534euoutp01B for ; Tue, 15 Dec 2020 16:54:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20201215165452euoutp01ebb989a042c55f4872b9106774a14030~Q8iGH41Uw1853418534euoutp01B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1608051292; bh=25f9K14ba99a3g1qYAViGnEi+v2MiDNaZ0KcW6aa4SE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FAxB39Uw+UAMqq+/3Yp3A3C6OeI23TQsS7n7mo1Wwant2EI2lGL/aS4aPESSp3JmM g4/9E5LB+0N673x8Xt7HMygNk4Vdl7C4GhcvG0FfCWbeyDMLD9Z6z5YVkRZmcU14xJ mGTFAkeKGBipMI+0QpX1eSd7U9QpemdymDlGqxTI= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20201215165447eucas1p14d53759a96b416af684f324f864c69fb~Q8iBOqBHO1694216942eucas1p15; Tue, 15 Dec 2020 16:54:47 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id AF.15.45488.75AE8DF5; Tue, 15 Dec 2020 16:54:47 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20201215165446eucas1p1c627adde04ee9da682e665756c5e934c~Q8iAtvVuS2578925789eucas1p1V; Tue, 15 Dec 2020 16:54:46 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20201215165446eusmtrp2e5e0c27aec7d170b31762782a014a734~Q8iAtB31t3213632136eusmtrp2N; Tue, 15 Dec 2020 16:54:46 +0000 (GMT) X-AuditID: cbfec7f5-c77ff7000000b1b0-eb-5fd8ea574117 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id CA.62.21957.65AE8DF5; Tue, 15 Dec 2020 16:54:46 +0000 (GMT) Received: from AMDC2765.digital.local (unknown [106.120.51.73]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20201215165446eusmtip23e2d780d2ad73baf5e67a00703803af3~Q8iAJcTsu1282212822eusmtip20; Tue, 15 Dec 2020 16:54:46 +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 RESEND] cmd: button: store button state in the 'button' env Date: Tue, 15 Dec 2020 17:54:39 +0100 Message-Id: <20201215165439.13165-1-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201215144230.9235-7-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuphleLIzCtJLcpLzFFi42LZduznOd3wVzfiDR6tlbTYOGM9q8WNX22s Fs/fXWayWHvkLrvFob5oi47DyhbftmxjtJg04Rebxdu9newWh6d+YHTg8nh/o5XdY3bDRRaP ebNOsHh8+BjnMb/zO5PH2Ts7GD36tqxi9Ni47ABzAEcUl01Kak5mWWqRvl0CV8aRow9ZCt6x VvxoP87YwHiDpYuRk0NCwETi6+IfQDYXh5DACkaJr13LWCGcL4wSDbdPMEI4nxkl3p8/yQ7T cnPvLqjEckaJRwdPMMO1rPn8hxGkik3AUKLrbRcbiC0iYCRxqWkH2BJmgTtMEl2TG8C2CwuE SOyavA+siEVAVWLKzKesIDavgK3EsnXtUOvkJVZvOMAMYnMCxe++fgR2oITAAQ6JlU8XADkc QI6LxNvt/hD1whKvjm+B6pWR+L9zPhNEfTOjxMNza9khnB5GictNMxghqqwl7pz7xQYyiFlA U2L9Ln2IsKPEx47djBDz+SRuvBUECTMDmZO2TWeGCPNKdLQJQVSrScw6vg5u7cELl5ghbA+J g3/boaE1gVFi2ennbBMY5WchLFvAyLiKUTy1tDg3PbXYOC+1XK84Mbe4NC9dLzk/dxMjMMGc /nf86w7GFa8+6h1iZOJgPMQowcGsJMLbW3o9Xog3JbGyKrUoP76oNCe1+BCjNAeLkjjvrq1r 4oUE0hNLUrNTUwtSi2CyTBycUg1MeVuvSM/j28HOU9BnV1J/VEvRICzD/NK/C81TD0tU711t 8Cw9g2NbRp9zSHqhyOkl2WFhYvLhB+sS3pm3sr+NdpjY95Lxl9jhl/cOPTh/aNvZu0Jv/u1g u/Lryv5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uq9qcX5TFwnfFFtyTlFVlYXubp5Pf6PT+Y/KEIwZcdf0pGx/M23DFq/9k+SvzAjfJ gn8v7xVovo/fmh8Uvn9q7IXPEhuDvIPktT1WdIvcW13/uifk1J+aVOfu3V9Dzl3es+xn3pLb SxwcntVdZEs5Hvjy8xJxXx7Tuj2sicftYqIVXDdMc8rewsUf2WIuP0NePyRViaU4I9FQi7mo OBEAfq89K/8CAAA= X-CMS-MailID: 20201215165446eucas1p1c627adde04ee9da682e665756c5e934c X-Msg-Generator: CA X-RootMTR: 20201215165446eucas1p1c627adde04ee9da682e665756c5e934c X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20201215165446eucas1p1c627adde04ee9da682e665756c5e934c References: <20201215144230.9235-7-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 --- Resend reason: get rid of the Change-Id tag, that was still in v2. --- 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; }