From patchwork Thu Feb 11 08:47:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 380890 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp1885060jah; Thu, 11 Feb 2021 00:48:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJxWOM+do4GIvX6j8lg4waj0YpMf3NunzefnNNZ4mZgOTcr27dHP0Oa/cFjLJlaII0UEPfKr X-Received: by 2002:a05:6402:1ad1:: with SMTP id ba17mr7396652edb.243.1613033322111; Thu, 11 Feb 2021 00:48:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613033322; cv=none; d=google.com; s=arc-20160816; b=ZPmw67rtJM7VEGYkQ0tn5EqXjxiNv6uihaKgjOoqXxPvz2y/ld+I4LYL2aqj15tZUM AZDTmoTdt6X/qpi0B1LiQfpzxQuujZ56PM24FETlDGH6Tgd1oXP75Qm9a40JMFEaMmPS 9cgBuJU/NIsMTbOZ/3wGozVLnOo7qxDI83LCuZDFXTaVrjm1EHLt3iY7i5G/xpj8UkZD Csz6CzOmzrsyxSzc/zqXQcsSsTZAHhn2nscVol4MZ2lQUqUGotzz9eIddPB4mOeXYBXr jO5RkDAMWitrrru9tXoElpq9IeEUeLAPoiVrxlC9FWDJpoX6kmVP2aOrGkBcUyvR+pQe oyfQ== 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=s8BPsGqdJEQL/i6/Wtj1wFLNwudKf0DpiBLJBfJ87lo=; b=b5s9/Tlx/2v2j9GTkB41vsDNn5gWhizUwsUv2IfR+mps90/G+Y9X9JiSDirrdN9tdv 5daQ3PoJdXyrBe++gF290m6D7RL7Oz5zcDpv6Wya6U6qVLZenEfFbVfTfMg/mdNjFc1j VY2QrXLco7sYbvJIBBdsd2fhZNA5mHxYTNCAH7f+rpWr7VcQMpJmXVPzB4jXfoQYjmfP 6Yx4JxCLU2qWjObumn3u7m4Na7U9QLB2XC7VmSj1xxNPQ2pwv7L8JVLzL3DBjyWEkRSt +1x5YE+VsMqQee6xiwO5d4Q9sa5D7yjmlJHyL2um+9IceT36IoJ2BDDPKx2s9abqde1r GqUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=Qs8Gm3e7; 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 y17si3396551ejh.440.2021.02.11.00.48.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Feb 2021 00:48:42 -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=Qs8Gm3e7; 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 CC9A28269D; Thu, 11 Feb 2021 09:48:22 +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="Qs8Gm3e7"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2A8D882694; Thu, 11 Feb 2021 09:48:16 +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.6 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 0F13B82318 for ; Thu, 11 Feb 2021 09:48:06 +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 20210211084805euoutp0143ef3dbbf2f576c7946701740f6635bb~ipToxhXn11377313773euoutp01D for ; Thu, 11 Feb 2021 08:48:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20210211084805euoutp0143ef3dbbf2f576c7946701740f6635bb~ipToxhXn11377313773euoutp01D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1613033285; bh=s8BPsGqdJEQL/i6/Wtj1wFLNwudKf0DpiBLJBfJ87lo=; h=From:To:Cc:Subject:Date:References:From; b=Qs8Gm3e7rsA9HtHAG06yyFy7rn6G/yU0CQKbHsJEcY/ZG80gCMxhczgIBvwOupnVw 7fuI27f62x4UaCzdyyozKYBcm2fOeLgy17zNVLhCYbOGbkCJPGBal3Tq56TyYaVbGf SqGUIgFmbIfo9s5cER08+X7XAbi7qjH8+JjF+vXE= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20210211084805eucas1p14ab1b264a0f69cd842213e80a014d66f~ipToap9ss1565815658eucas1p1h; Thu, 11 Feb 2021 08:48:05 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id EB.11.27958.54FE4206; Thu, 11 Feb 2021 08:48:05 +0000 (GMT) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20210211084804eucas1p111b64b0251fd991f2aa6f2470341634a~ipTn11FMA0546905469eucas1p1y; Thu, 11 Feb 2021 08:48:04 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20210211084804eusmtrp19f01444f5d747fe812fe5e0975358ae9~ipTn1L2eb3224632246eusmtrp1R; Thu, 11 Feb 2021 08:48:04 +0000 (GMT) X-AuditID: cbfec7f2-efdff70000006d36-99-6024ef45bd98 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id BC.56.16282.44FE4206; Thu, 11 Feb 2021 08:48:04 +0000 (GMT) Received: from AMDC2765.digital.local (unknown [106.120.51.73]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20210211084804eusmtip146cd70e71c6fc7afe8fc55603979dc69~ipTnTd5fc2069520695eusmtip1c; Thu, 11 Feb 2021 08:48:04 +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 v6 0/5] VIM3: add support for checking 'Function' button state Date: Thu, 11 Feb 2021 09:47:52 +0100 Message-Id: <20210211084757.22759-1-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrHIsWRmVeSWpSXmKPExsWy7djPc7qu71USDM4clLbYOGM9q8WNX22s Fs/fXWayWHvkLrvFob5oi47DyhbftmxjtJg04Rebxdu9newWh6d+YHTg8nh/o5XdY3bDRRaP ebNOsHh8+BjnMb/zO5PH2Ts7GD36tqxi9Ni47ABzAEcUl01Kak5mWWqRvl0CV8bKa28ZC56K Vczctpm9gfGVYBcjB4eEgInE67/FXYxcHEICKxgl7vXfYoNwvjBKzO6/wA7hfGaUePz6BmMX IydYx7MzN1ggEssZJToOL2cDSYC13GwoB7HZBAwlut52gcVFBIwkLjXtAGtgFrjDJNE1uYEF JCEsECDRfuEPO4jNIqAq8WTLbmYQm1fAVuLd+UNQ2+QlVm84wAzSLCGwkkNi2YffzBAJF4ln 07uhbGGJV8e3sEPYMhKnJ/ewQDQ0M0o8PLeWHcLpYZS43DQDaqy1xJ1zv9hAQcAsoCmxfpc+ RNhR4tDHLcyQkOGTuPFWECTMDGRO2jYdKswr0dEmBFGtJjHr+Dq4tQcvXII6x0Nia9dJZkig xEr0zZrLNoFRbhbCrgWMjKsYxVNLi3PTU4sN81LL9YoTc4tL89L1kvNzNzECk8jpf8c/7WCc ++qj3iFGJg7GQ4wSHMxKIrz8rSoJQrwpiZVVqUX58UWlOanFhxilOViUxHlXzV4TLySQnliS mp2aWpBaBJNl4uCUamCKt/utsH/G57fX43aF/Cn6kbtMOiufK6Bm/t9LN4LcHdu//v06l7++ /FXIrG0Fyrz6pxTElsYV3GdeKfSH//HCczHXWrxmSau6N8e0eXiskRcqvRf4Z01kwZpJB60f qEyz/u9548vyBtPHq66/i0o/oBv7K2ONz1Y1+56Z7NMbVd/X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iUbDbji 1vv5dT//1xl7s630vNvdMtb9Ma2cvTESjHtvOGQcuLuws/48nxD33d9KzgnXq3xVdtdEf9jT lRRl8qmx4ULJfY77kcc2FE5N06zYFjqB/WFuiJMSS3FGoqEWc1FxIgD1Yxu76AIAAA== X-CMS-MailID: 20210211084804eucas1p111b64b0251fd991f2aa6f2470341634a X-Msg-Generator: CA X-RootMTR: 20210211084804eucas1p111b64b0251fd991f2aa6f2470341634a X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20210211084804eucas1p111b64b0251fd991f2aa6f2470341634a 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: v6: - 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 | 24 +++- 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, 319 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