From patchwork Tue Dec 15 14:42:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 344013 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp3974885jai; Tue, 15 Dec 2020 06:43:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJwBA4yHN4Dp7+Bu1w4U8ZpsR5ehUuJDp27PcGB7Jac81skY+qyPepAB7k1HvLd+u1rWAJ3S X-Received: by 2002:aa7:d886:: with SMTP id u6mr30472381edq.139.1608043434968; Tue, 15 Dec 2020 06:43:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608043434; cv=none; d=google.com; s=arc-20160816; b=0ZQxIEfBabOp4lPB+Ze2ER5afmUpE+nLOe2U16e/p7uuQl4HJixvBdnNml9K676Gh6 zIGEbVHTjt9C7K5Se1X5b/zQPJnBxijHOmHgsFuQ+KMujjvnfc5IZSIrV+Gxk8C9JDwm 2kw8PPrO+A+iLRFLaBFduZXxTMbQ35jLYIvX5ieu6bGVKKnFMPPFuTSkXLPAP8yYobYJ gfMBbUmk20b/k9UvulnUv3y8m8+aq2J6I3Io8tT0SpY/Stpr5nG5bXoCvFet/WsF10y4 oKgSVqhoQ7Nx5zPweZIJvaa1ybuiRV2/iDdO1pFqxTyAYLUh2SFqpCSckYqU9fHYgd1s lwpw== 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=qwSuF1jh/esXi6KlelBRAFBzXKlF2KJbW5RtxUp/CsE=; b=adVu0xTpczwXx12qhE0UZch6aNXL7kfVCOevuePAo97rZju28/lTmoLtHaXUHn6Df3 rOrSrTX1W46TysvetPB/ARfGTVbu1gW9uu7Jp4iao2o7HIxV8jb6QZY/xhLLCj1Rgrcz k6Z2IIa3cjvrpxhZ+8nlUIAn/SnDaJFc5R3CqmdwM3kGqPXVR+6QMg9h0BB471R5ssFJ J6+OJWi42upKg5CXThHbwTixx8oe6zS7tsEe30INtgFjIWvKFzz4p3PSyUQWNBRCgMrr PU6AWDFBPhlL6WqlDoqNU1g1axpOx3VHCrt/btAplb1LRIxsNISnDHCjHvuf+wGROgqs PsVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=IdbYjy1P; 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 n8si963358edy.54.2020.12.15.06.43.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Dec 2020 06:43:54 -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=IdbYjy1P; 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 EFF09829BB; Tue, 15 Dec 2020 15:43:15 +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="IdbYjy1P"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B94B3829A3; Tue, 15 Dec 2020 15:43:04 +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 6327A829A4 for ; Tue, 15 Dec 2020 15:42:58 +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 mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20201215144248euoutp02e803c7d080f050dc399678782ecfe4d5~Q6uxnjtbW1508115081euoutp02l for ; Tue, 15 Dec 2020 14:42:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20201215144248euoutp02e803c7d080f050dc399678782ecfe4d5~Q6uxnjtbW1508115081euoutp02l DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1608043368; bh=qwSuF1jh/esXi6KlelBRAFBzXKlF2KJbW5RtxUp/CsE=; h=From:To:Cc:Subject:Date:References:From; b=IdbYjy1PD5gAo5yptoq7v9AHO75uH1yUXgI5dMpMqhVxFqQ0sw7pxfEWBdHVoQuqX MFFtMvHF8SntWHahbQzje4Fg5h6KnjNvI3IgHL94DxhI7LrPfFRg89/8KqcYFyKhpi HpZJR9mwTKggnnWUNlBixY1GfQiRM0kFm8PX9ZaI= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20201215144242eucas1p13a77fe7af566ea5330c8ac232d1bc185~Q6ushT3nT0460704607eucas1p1b; Tue, 15 Dec 2020 14:42:42 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id B0.36.27958.26BC8DF5; Tue, 15 Dec 2020 14:42:42 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20201215144242eucas1p1c837ea82b7365808b5384c9eb204b593~Q6usCUM6A0190001900eucas1p12; Tue, 15 Dec 2020 14:42:42 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20201215144242eusmtrp2813de848ec9f9fa6e5417c5ac36bc64b~Q6usBrQHq2514325143eusmtrp2X; Tue, 15 Dec 2020 14:42:42 +0000 (GMT) X-AuditID: cbfec7f2-efdff70000006d36-85-5fd8cb62e33a Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id DF.90.21957.16BC8DF5; Tue, 15 Dec 2020 14:42:41 +0000 (GMT) Received: from AMDC2765.digital.local (unknown [106.120.51.73]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20201215144241eusmtip2171f52b0f0dc9a3b06053681543bb2cd~Q6urgWBPE3173131731eusmtip2m; Tue, 15 Dec 2020 14:42:41 +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 0/7] VIM3: add support for checking 'Function' button state Date: Tue, 15 Dec 2020 15:42:23 +0100 Message-Id: <20201215144230.9235-1-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrHIsWRmVeSWpSXmKPExsWy7djP87pJp2/EGzz4KmWxccZ6Vosbv9pY LZ6/u8xksfbIXXaLQ33RFh2HlS2+bdnGaDFpwi82i7d7O9ktDk/9wOjA5fH+Riu7x+yGiywe 82adYPH48DHOY37ndyaPs3d2MHr0bVnF6LFx2QHmAI4oLpuU1JzMstQifbsErozPt+axFVzi rVi7sZ+5gfEBVxcjB4eEgInEo/XWXYxcHEICKxglLs58zALhfGGUaH18kAnC+cwo8Wn3dRaY jkVHPCHiyxkldmy6wAzX8Xr7HaAiTg42AUOJrrddbCC2iICRxKWmHWBjmQXuMEl0TW4AKxIW CJC4vq6BCcRmEVCV2PPyD1gDr4CNxNFrixlBbAkBeYnVGw6AbZAQWMshce7tSyaIhIvErCn7 oWxhiVfHt7BD2DIS/3fOZ4JoaGaUeHhuLTuE08MocblpBtRYa4k7536xgTzELKApsX6XPkTY UeLur9NQf/JJ3HgrCBJmBjInbZvODBHmlehoE4KoVpOYdXwd3NqDFy4xQ9geEv9nngFbJCQQ K3FgyhSWCYxysxB2LWBkXMUonlpanJueWmyYl1quV5yYW1yal66XnJ+7iRGYRE7/O/5pB+Pc Vx/1DjEycTAeYpTgYFYS4e0tvR4vxJuSWFmVWpQfX1Sak1p8iFGag0VJnHfV7DXxQgLpiSWp 2ampBalFMFkmDk6pBib2ze9yFBdvCpv25mVlgazCm/KVt0t/GirffzjrqNK7j6YqukkPf8o9 vR9u9kx4o4DYoxMcIe5clgvSOiIvPblR318eoygdzL73YNveT13+vQWsHPbMP1dNqbj+Xpxr l67o/uWbvlidcfdluMw4cXLIFRWW5VIsx7jd788+cz9EfbL0CruXf1uyItim6P7Z1JXY37A8 y0Zu/u5PinLfUmVPOrc1qr+aEsqkWL+ubXdQ/hOPFia7upveqZpPpLa1vfZ77s3/PevA8a1a k6sfPE9kavi77I1L+a6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ZR6j1ksn/rrsbPgX2BCmxFGckGmoxFxUnAgB7aVBF5wIAAA== X-CMS-MailID: 20201215144242eucas1p1c837ea82b7365808b5384c9eb204b593 X-Msg-Generator: CA X-RootMTR: 20201215144242eucas1p1c837ea82b7365808b5384c9eb204b593 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20201215144242eucas1p1c837ea82b7365808b5384c9eb204b593 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 lines 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 button Function if test ${button} = on then echo Selected alternative boot ... fi --->8--- Best regards Marek Szyprowski Samsung R&D Institute Poland Changelog: v2: - 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 (7): clk: meson: add minimal driver for g12a-ao clocks adc: meson-saradc: add G12A variant adc: meson-saradc: skip hardware init only if ADC is enabled configs: khadas-vim3: enable ADC device support button: add a simple ADC-based button driver cmd: button: store button state in the 'button' env configs: khadas-vim3: enable Function button support cmd/button.c | 4 +- configs/khadas-vim3_defconfig | 4 ++ drivers/adc/meson-saradc.c | 9 ++- drivers/button/Kconfig | 8 +++ drivers/button/Makefile | 1 + drivers/button/button-adc.c | 117 ++++++++++++++++++++++++++++++++++ drivers/clk/meson/Makefile | 1 + drivers/clk/meson/g12a-ao.c | 83 ++++++++++++++++++++++++ 8 files changed, 224 insertions(+), 3 deletions(-) create mode 100644 drivers/button/button-adc.c create mode 100644 drivers/clk/meson/g12a-ao.c -- 2.17.1