From patchwork Thu Feb 18 10:33:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 384387 Delivered-To: patch@linaro.org Received: by 2002:a02:c80e:0:0:0:0:0 with SMTP id p14csp3559471jao; Thu, 18 Feb 2021 02:34:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJyp0PJ3ZrK/oWNrSTmvd+wq98jsAYK+2+Bt/uiNmL9Wh2doz1ws6QQs2ySo0ArK0Ew9j5X1 X-Received: by 2002:a17:907:96aa:: with SMTP id hd42mr3324185ejc.526.1613644485690; Thu, 18 Feb 2021 02:34:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613644485; cv=none; d=google.com; s=arc-20160816; b=r183YKBe3dZ+lW1n70kyxZrNTqJozrrRVouyB61kSeeKQgMvPjolUvZkR9oEzsyyYZ I+6a1fiW0r/h9nsI6ubh6gcA5Zmj81429awhmtynz+nnV3BEdwDPpbQ8V4mOSgYDI8W8 GMqhVhkHz3wElvxESab0j1BSQml2HwH960T2YSh8bpJxITByu9zXGtgqkx93uqvbOreY RjYw9PadqhClQSNS6Fq/DFh8KCq/x92VC040hn9gsMytfZxOYesFC7axxeSkgqD42aEN tTsr/dN555AMRjgLe1qYEsRtAwiaGWLR2r1+nJWtOD8MoGDazJzi3ROH0KPs138jKxNI 1Vpg== 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:message-id :date:subject:cc:to:from:dkim-signature:dkim-filter; bh=vreSUw+crzqxuRleoqAc2OUiYRXT1/7jWBMBoXISeRQ=; b=cYrmN+Wdn8trdSGFIcOxwN7OAP9/hPgapff/8YZwbb82Ck3RDmKSFedKZLiC+artqQ bkXL2tPdxFAm1B0ABgq+uHYrfxjh6gzd5o/ixH4WAqeOL/Az/FAVXYy66O2oKPSR5kYH z+xpXdWKB4aLUrz9e77fQDDcmsjeQyOqpvE8SuIwkQ9czcyQS5ZlH3XK1x9MaaXkRSsU jdeFKdfuAF72+/6DEc4XOU1HUlJDVlpjDPOuGr9UDGTtaXr7cIIe+L+IuQab0ExlEx24 /NIjL1fGn/9UxNxHvsuQarR4n6cHXDH3T8LzVXd6OziJPjwdEQuW1XTf3z+gVJ8ipyAQ frPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=O6C3rzCz; 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 i6si3346361ejy.133.2021.02.18.02.34.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Feb 2021 02:34:45 -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=O6C3rzCz; 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 28837826D4; Thu, 18 Feb 2021 11:34:30 +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="O6C3rzCz"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1A3ED82730; Thu, 18 Feb 2021 11:33:53 +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=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,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 0246382483 for ; Thu, 18 Feb 2021 11:33:44 +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 20210218103333euoutp010ce51ad25922281a1b8571c859103087~k0Qtzf4cI1718817188euoutp01C for ; Thu, 18 Feb 2021 10:33:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20210218103333euoutp010ce51ad25922281a1b8571c859103087~k0Qtzf4cI1718817188euoutp01C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1613644413; bh=vreSUw+crzqxuRleoqAc2OUiYRXT1/7jWBMBoXISeRQ=; h=From:To:Cc:Subject:Date:References:From; b=O6C3rzCzNGLyXrwG+8+eDERReDemugm1mWG/gAdRcijEIucHXEE4u3QfSK/S/CEaP eY8xDKcNxlqCWg938xAgLLvQOukNZVuNyhCdGPslVN0t9vWUTmBNHRnCM9FzUcxSAg zrhSeJ88+QLq5NkB1fOf+Prd7BSqZN2YYv7WFKK8= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20210218103328eucas1p2de7073f5882e71bf85ff4ec925426ec6~k0Qo6tpI72028920289eucas1p2x; Thu, 18 Feb 2021 10:33:28 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 85.6A.45488.8724E206; Thu, 18 Feb 2021 10:33:28 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20210218103327eucas1p21cbeb2ae82a75cb350e1b1a683e30a73~k0QoSIyAU2028920289eucas1p2w; Thu, 18 Feb 2021 10:33:27 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20210218103327eusmtrp2b68dbf69ea933f255a97a6d3dac6a835~k0QoQZNMs2025120251eusmtrp2k; Thu, 18 Feb 2021 10:33:27 +0000 (GMT) X-AuditID: cbfec7f5-c77ff7000000b1b0-e2-602e4278c46e Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 04.73.21957.7724E206; Thu, 18 Feb 2021 10:33:27 +0000 (GMT) Received: from AMDC2765.digital.local (unknown [106.120.51.73]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20210218103327eusmtip2118845b6d001ff8c7bcddc2849fcdf5d~k0Qnv2DJW0363403634eusmtip2i; Thu, 18 Feb 2021 10:33:27 +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 v7 0/5] VIM3: add support for checking 'Function' button state Date: Thu, 18 Feb 2021 11:33:13 +0100 Message-Id: <20210218103318.18915-1-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrDIsWRmVeSWpSXmKPExsWy7djPc7oVTnoJBhMn8VpsnLGe1eLGrzZW i+fvLjNZrD1yl93iUF+0RcdhZYtvW7YxWkya8IvN4u3eTnaLw1M/MDpweby/0cruMbvhIovH vFknWDw+fIzzmN/5ncnj7J0djB59W1YxemxcdoA5gCOKyyYlNSezLLVI3y6BK2PljrXsBXfE K5Zf2MzWwHhFqIuRg0NCwERi+7mQLkYuDiGBFYwST1ZPYoNwvjBKfDnaygThfGaUuP7xE2MX IydYR8/6B6wQieWMEm/2rmAFSYC1/N0rDmKzCRhKdL3tYgOxRQSMJC417WABaWAWuMMk0TW5 gQUkISwQINH55gU7iM0ioCrxYP13JhCbV8BW4sWKdVDb5CVWbzjADNIsIbCSQ+LViWuMEIe7 SFzewAJRIyzx6vgWdghbRuL/zvlMEPXNjBIPz61lh3B6GCUuN82AmmotcefcLzaQQcwCmhLr d+lDhB0ltj+cyAYxn0/ixltBkDAzkDlp23RmiDCvREebEES1msSs4+vg1h68cAmqxEPi2WI7 SJDESuzetZB9AqPcLIRVCxgZVzGKp5YW56anFhvnpZbrFSfmFpfmpesl5+duYgQmkNP/jn/d wbji1Ue9Q4xMHIyHGCU4mJVEeNk/ayUI8aYkVlalFuXHF5XmpBYfYpTmYFES5921dU28kEB6 YklqdmpqQWoRTJaJg1OqgWnaX8ES49Ppi7LkfW29/G/vmqJp+ocjpjdxMqMks3vZV/U4qwuC zltf3tP/tadqX808JtWtd2ddFYw9GPMwr/aKsP453ZXaScm/VHe8fj312qR1PfJqbUGqxxT1 MsJXXCqs+6G/pj/WfMsuk4hbW1jlDsQYLdBIOTLvaoM6a+wz39Rl7sv0Tu9KMXjcb+s9zeLd 7Vdvdl1+dWJnnUB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M2J8DK66FPeXp+X31nmTCh4bYqfMr f8REFHJPEGIx9/9Yd3DO3Gr//TuN9Kf//TzZsVvOWImlOCPRUIu5qDgRAOvI5uPoAgAA X-CMS-MailID: 20210218103327eucas1p21cbeb2ae82a75cb350e1b1a683e30a73 X-Msg-Generator: CA X-RootMTR: 20210218103327eucas1p21cbeb2ae82a75cb350e1b1a683e30a73 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20210218103327eucas1p21cbeb2ae82a75cb350e1b1a683e30a73 References: 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 Hi All, This patchset adds all building blocks needed for checking the 'Function' button state in the boot script on Amlogic A311D based VIM3 board. This button is connected to the ADC line of the SoC, so it required to enable meson SARADC, the clocks needed for it and a simple button-adc drivers. Once applied, one can use following commands in the boot scripts: -->8--- echo Checking Func button state: \\c if button Function then echo Selected alternative boot ... fi --->8--- Best regards Marek Szyprowski Samsung R&D Institute Poland Changelog: v7: - added linux,code properties to the test.dts v6: https://lists.denx.de/pipermail/u-boot/2021-February/441039.html - added a simple sandbox test for adc-keys - use of_to_plat and adc_raw_to_uV to simplify code in the adc button driver v5: https://lists.denx.de/pipermail/u-boot/2021-January/438751.html - rebased onto latest uboot-amlogic/u-boot-amlogic-next branch - synchronized adc-keys binding with the recent version from the Linux kernel - updated adc-keys driver to match behavior from dt-bindings - added a patch for meson-saradc driver to register vdd reference supply to the ADC framework v4: https://lists.denx.de/pipermail/u-boot/2020-December/435641.html - rebased onto uboot-amlogic/u-boot-amlogic-next and dropped merged patches - added adc-keys bindings docs (copied from Linux kernel) - minor code adjustments pointed by Simon - enabled driver also in khadas-vim3l_defconfig v3: https://lists.denx.de/pipermail/u-boot/2020-December/435072.html - removed 'button' env variable - extended kconfig and patch descriptions v2: https://lists.denx.de/pipermail/u-boot/2020-December/434991.html - removed Change-Id tags - split defconfig changes into ADC and button related v1: https://lists.denx.de/pipermail/u-boot/2020-December/434875.html - initial submission Patch summary: Marek Szyprowski (5): dt-bindings: input: adc-keys bindings documentation button: add a simple Analog to Digital Converter device based button driver adc: meson-saradc: add support for getting reference voltage value configs: khadas-vim3(l): enable Function button support test: add a simple test for the adc-keys button driver arch/sandbox/dts/test.dts | 27 +++- configs/khadas-vim3_defconfig | 2 + configs/khadas-vim3l_defconfig | 2 + configs/sandbox_defconfig | 1 + doc/device-tree-bindings/input/adc-keys.txt | 67 +++++++++ drivers/adc/meson-saradc.c | 21 +++ drivers/button/Kconfig | 8 ++ drivers/button/Makefile | 1 + drivers/button/button-adc.c | 146 ++++++++++++++++++++ test/dm/button.c | 50 ++++++- 10 files changed, 322 insertions(+), 3 deletions(-) create mode 100644 doc/device-tree-bindings/input/adc-keys.txt create mode 100644 drivers/button/button-adc.c -- 2.17.1