From patchwork Wed Dec 16 07:51:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 344501 Delivered-To: patch@linaro.org Received: by 2002:a17:906:4755:0:0:0:0 with SMTP id j21csp163997ejs; Tue, 15 Dec 2020 23:53:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJyKC2swSQNCfTLHlZW4Q/vLFeK9dLmNTZq9theeLyy1wSSVzYmvOC6DpJZlTH3g6QLrW0bW X-Received: by 2002:a50:d553:: with SMTP id f19mr32005142edj.323.1608105182777; Tue, 15 Dec 2020 23:53:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608105182; cv=none; d=google.com; s=arc-20160816; b=W4LG20hhaPhSwmCiUncyCGH9ZMMOU6YaMX0NaYYR5t47cxXTGRjCbj5vc9HOA6zKgM NIV3QPZzrvYz5UJpPHNq6l2x5LpDxSUy23g3Nqb8S4k1unCZZA/1X10umOr6PwWVMRMR Y8dwfUndKE+hzu75+g8vAzvQmi9cH5nXq2xGp+pJ/FbsvHW6DK9yVgWoYeSNMc1aWkSc KUgxYR01zKOMPRZ0o/G0QiUAm/o/4PfWarfvPUC6+5uUYmsxOa8twE5m7X5ru4niEJ+w 5eszPHfv16xr8QGEIf+5giv7s1dr6HC435SxVe4NEty0iSJUjEZg9RnrJ2EJrk+SBA0O 3dVQ== 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=3TcxR5kF/t2gj5Q+KZvzZp616Dju0tO0NskbKLcotvc=; b=QuAJ46bz8pbfq9tSkaKyYeNxs+y761+RB4znMKpDaNf8kJaUDKDpvUY+bQiiYULVkX 3l0WQwrdYU3Hd1v5eIT9cMc/02G2hfhbcd3GIN4r68g2R0jkyfHrZFYkPmQFNmelr4/a JSgTy1cA9/V9Ou+gxYq3MDAWFo21hVm2cWjxtLWnjEugSPOfMTbfnboZAmddJkXk/hSi VJR6aHnZPxgAhTyuVBtnKaNT6ri3jejOWwXIfB80m8lfJ9HkNJRPcsCDvh3ffZ/R3vzm mYkx7WK/jT+XRx3L/hV/e0Ce7pRMFp7uXKZE76M0SSNQ74KDB+Z+xh8ngCHAtnxDOUJM RImw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=KgSv+gJ5; 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 dn1si1999395edb.113.2020.12.15.23.53.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Dec 2020 23:53:02 -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=KgSv+gJ5; 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 3EC0D82A60; Wed, 16 Dec 2020 08:52:32 +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="KgSv+gJ5"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7DD8582A54; Wed, 16 Dec 2020 08:52:23 +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 2E807828C0 for ; Wed, 16 Dec 2020 08:52:20 +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 mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20201216075209euoutp0147548e81c437a96e82b90bc87ffaaea3~RIxhfDDLB2594025940euoutp01e for ; Wed, 16 Dec 2020 07:52:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20201216075209euoutp0147548e81c437a96e82b90bc87ffaaea3~RIxhfDDLB2594025940euoutp01e DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1608105129; bh=3TcxR5kF/t2gj5Q+KZvzZp616Dju0tO0NskbKLcotvc=; h=From:To:Cc:Subject:Date:References:From; b=KgSv+gJ5gm47+LvlRQ+J3CfmkYYk6CAejoEElXb6FyqnofdpYtd7eCBn7DV5ii8TP xogVhxPu3jQ6qrpmFH15RBUNpkT7Eb8fOJldpIWCVd+PY2JbcpUxdYhC7ldphmSElY 4lc0hm7VlLsi28pADOsuglxJjtVEhjjRP5OJA7NE= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20201216075204eucas1p25e49bff22234a3d0dbca653b58e4c256~RIxcjwz2l0937409374eucas1p2x; Wed, 16 Dec 2020 07:52:04 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id D6.BB.44805.4ACB9DF5; Wed, 16 Dec 2020 07:52:04 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20201216075203eucas1p2607f08a1d296c130a18177bb012642fd~RIxcKE3um1128511285eucas1p2E; Wed, 16 Dec 2020 07:52:03 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20201216075203eusmtrp2f0447be5677f82bba1141765c594f87d~RIxcJWVe00040100401eusmtrp2x; Wed, 16 Dec 2020 07:52:03 +0000 (GMT) X-AuditID: cbfec7f4-b4fff7000000af05-87-5fd9bca4684f Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id FF.4A.16282.3ACB9DF5; Wed, 16 Dec 2020 07:52:03 +0000 (GMT) Received: from AMDC2765.digital.local (unknown [106.120.51.73]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20201216075203eusmtip2b3adff7a47cfe5418909319f1e6b1777~RIxbpN0Bq1905519055eusmtip2S; Wed, 16 Dec 2020 07:52:03 +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 v3 0/6] VIM3: add support for checking 'Function' button state Date: Wed, 16 Dec 2020 08:51:52 +0100 Message-Id: <20201216075158.16458-1-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrHIsWRmVeSWpSXmKPExsWy7djP87pL9tyMN3j4jNNi44z1rBY3frWx Wjx/d5nJYu2Ru+wWh/qiLToOK1t827KN0WLShF9sFm/3drJbHJ76gdGBy+P9jVZ2j9kNF1k8 5s06weLx4WOcx/zO70weZ+/sYPTo27KK0WPjsgPMARxRXDYpqTmZZalF+nYJXBkTJu9jKnjG VzHpWkwD42/uLkZODgkBE4kJi26ydjFycQgJrGCUWHX/NDuE84VRYnfjfKjMZ0aJzTtaGbsY OcBaFr4PhYgvZ5SYsOoeG1zHh1mnWEDmsgkYSnS97WIDsUUEjCQuNe1gASliFrjDJNE1uQGs SFggQOLm1AuMIDaLgKrEj7t7mEBsXgFbiYaDz5ghDpSXWL3hADNIs4TAWg6J+Ytns0MkXCT2 LrjGCmELS7w6vgUqLiPxf+d8JoiGZkaJh+fWskM4PYwSl5tmMEJUWUvcOfeLDeQhZgFNifW7 9CHCjhKTn29mgviTT+LGW0GQMDOQOWnbdGaIMK9ER5sQRLWaxKzj6+DWHrxwCepmD4nGju9g cSGBWIlLs7qZJjDKzULYtYCRcRWjeGppcW56arFRXmq5XnFibnFpXrpecn7uJkZgEjn97/iX HYzLX33UO8TIxMF4iFGCg1lJhPfP2xvxQrwpiZVVqUX58UWlOanFhxilOViUxHmTtqyJFxJI TyxJzU5NLUgtgskycXBKNTBFxf/nOc3RH8OWvn1d3rxt7JPddi26dP9Io8vOZSf/ZjE/1RUR 5lNc4nL/1K7U2cvvrGR+JfvtmuV+f+0tHtP/V+1qDdyw9HvYnOTyiY69XNldSbM8yi2sL8R7 V1bGbpsRs8NS6aKAs4rvTMbFMkF/ZPh0f4TZ27v6sxprbPCtMfjLscTh+IzWIsELNzYVhBso z79wNK1xbkv6pE+5KX+SedoFNP3uP4l5P98yUbI98Vh39rQlN+MjTDLWx33N2upXVWb2fMaP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U50//3xQGPbd543Ft4n/h4u+vvbK5drZaUSS3FGoqEWc1FxIgDnpznB5AIAAA== X-CMS-MailID: 20201216075203eucas1p2607f08a1d296c130a18177bb012642fd X-Msg-Generator: CA X-RootMTR: 20201216075203eucas1p2607f08a1d296c130a18177bb012642fd X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20201216075203eucas1p2607f08a1d296c130a18177bb012642fd 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 if button Function then echo Selected alternative boot ... fi --->8--- The above script requires commit a6bfd71a96 ("cmd/button: return button status") already present in mainline tree. Best regards Marek Szyprowski Samsung R&D Institute Poland Changelog: v3: - 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 (6): 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 configs: khadas-vim3: enable Function button support 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 ++++++++++++++++++++++++ 7 files changed, 221 insertions(+), 2 deletions(-) create mode 100644 drivers/button/button-adc.c create mode 100644 drivers/clk/meson/g12a-ao.c -- 2.17.1