From patchwork Mon Dec 14 11:24:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 343490 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp2911837jai; Mon, 14 Dec 2020 03:25:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJz6YVeqty0XrJ98BqmSD5X1hF9I0D7gSMtOzLgubcpAOOBdCy9CcIRnRzKpafQqTjQz4Ezr X-Received: by 2002:a17:906:5796:: with SMTP id k22mr5512910ejq.435.1607945156497; Mon, 14 Dec 2020 03:25:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607945156; cv=none; d=google.com; s=arc-20160816; b=BjGmhjGVb2s/idXK4IxGzhoo4q1vvmvx853lu87y4JWLFYQoH18kGkh7zvDHFDvm7Y UxVxVq8knD0KkqcuLYHtjsOiPvlGdDszY35MX9UNCU2RuQAPO8B/PD2YAydJSuMZT/As h/o9L0t8/0ecVOgWE9Xd+o8HZ3LcLj5hq9k5MVAHoxxB7XSseF+QkfTByutMG+5vDb7U MuovZRE6BPT7dLEZklqSDP+kU6Fc1XbAMyeRp2qDbApZBB7PY6ETLNugYrMc17pjJx8g 7EN1W7sPo955c93s1OdBcL+NmCNxuyuxpb9FNOZZwEn0IDWYHtVWOJAoSDVYrYpgTkQb fTlA== 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=GAtq9w9p9jAEKxT5Ja90cjvbtW3OXTS+9gKCvMoivqg=; b=kKG+St2j8UHAWBKZWwb83ba+JCConGOG6QOzlLfSf8xZ/+Cjeo+n2ce4bL7bK5BF31 JWij91dqcEkE785b7Qa5KAX7XZ/Yio7q/btYER5x9c9Z5ZlGP27pAgJQDvOLz3bZ2XQZ ZVYo4Hy/rtnn7QgKxt1nMV8+q+YgbQJYedS4BOnFNiji5vqsbRXnjI6iCWVb3AV5bh9y GUdZye/vH7qSe56xgyVbIbAw178h/GuiZoXSp5N3ghyvbS0qagsYJXCnkt4To9O99doU lKhMni3/nHDDJG7eSCdcGOtd2xswu/dqbJbA/iZfKa5xhkrXsn3Mcj9yr5nkNcfrDzYR PjHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=X1R1STAE; 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 i34si2809743edd.44.2020.12.14.03.25.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Dec 2020 03:25:56 -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=X1R1STAE; 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 EE49B82837; Mon, 14 Dec 2020 12:25:18 +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="X1R1STAE"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C880182822; Mon, 14 Dec 2020 12:25:12 +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 E21EC82819 for ; Mon, 14 Dec 2020 12:25:05 +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 20201214112455euoutp01b6ec03a04357defd26eddf777417d9a3~QkYt9__Ss3266632666euoutp01F for ; Mon, 14 Dec 2020 11:24:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20201214112455euoutp01b6ec03a04357defd26eddf777417d9a3~QkYt9__Ss3266632666euoutp01F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1607945095; bh=GAtq9w9p9jAEKxT5Ja90cjvbtW3OXTS+9gKCvMoivqg=; h=From:To:Cc:Subject:Date:References:From; b=X1R1STAEjZbfobc/WNq2Daoc1QzIDywXfKJURph4tlBHewuwNO2clHWxkQyyQFKbk ksS5wrHIVQHztgXtXC99UjVjcl4sbPr/jbltf2hBKxFcgfI6JJSkTmyl28N7SPDWFz dZYeYkcZ7KXb3eLuWshbfVC2kZodqWx8zdu2gGuY= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20201214112449eucas1p14ae2a798799340d489f23e3ef24b123e~QkYozn5922254522545eucas1p1A; Mon, 14 Dec 2020 11:24:49 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 39.C0.45488.18B47DF5; Mon, 14 Dec 2020 11:24:49 +0000 (GMT) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20201214112449eucas1p28f3ade12253fb8b60c1396c706a65220~QkYoO0JVR0494304943eucas1p2u; Mon, 14 Dec 2020 11:24:49 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20201214112449eusmtrp1d38c00e755d77864a479004bcfbacc29~QkYoIW3yC1608516085eusmtrp1d; Mon, 14 Dec 2020 11:24:49 +0000 (GMT) X-AuditID: cbfec7f5-c77ff7000000b1b0-2a-5fd74b819260 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 17.9B.21957.08B47DF5; Mon, 14 Dec 2020 11:24:48 +0000 (GMT) Received: from AMDC2765.digital.local (unknown [106.120.51.73]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20201214112448eusmtip15f1b7e0d447463b7c5fa30377b2fb48e~QkYnozIs62398123981eusmtip1Q; Mon, 14 Dec 2020 11:24:48 +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 0/6] VIM3: add support for checking 'Function' button state Date: Mon, 14 Dec 2020 12:24:31 +0100 Message-Id: <20201214112437.18757-1-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrDIsWRmVeSWpSXmKPExsWy7djPc7qN3tfjDTrOqltsnLGe1eLGrzZW i+fvLjNZrD1yl93iUF+0RcdhZYtvW7YxWkya8IvN4u3eTnaLw1M/MDpweby/0cruMbvhIovH vFknWDw+fIzzmN/5ncnj7J0djB59W1YxemxcdoA5gCOKyyYlNSezLLVI3y6BK2Py9P/MBSe5 K6Y8mMncwNjK2cXIySEhYCLxZW8HO4gtJLCCUeLaTBsI+wujROd0Rgj7M6PEryVCMPWfjk5g 62LkAoovZ5RYcG4vE4QD1LBn3zKwSWwChhJdb7vYQGwRASOJS007WECKmAXuMEl0TW5gAUkI C3hLPN1/jBXEZhFQlZjRdxHM5hWwldjV/ocRYp28xOoNB5hBmiUElnJITN3dzQyRcJFYu/8G VJGwxKvjW9ghbBmJ05N7WCAamhklHp5byw7h9DBKXG6aAdVhLXHn3C+g+ziAbtKUWL9LHyLs KPHp63R2kLCEAJ/EjbeCIGFmIHPStunMEGFeiY42aFCoScw6vg5u7cELl6BKPCQWv3eFhFys xLY5XUwTGOVmIaxawMi4ilE8tbQ4Nz212DgvtVyvODG3uDQvXS85P3cTIzCBnP53/OsOxhWv PuodYmTiYDzEKMHBrCTC+7v+crwQb0piZVVqUX58UWlOavEhRmkOFiVx3l1b18QLCaQnlqRm p6YWpBbBZJk4OKUamMpktbe6Ld/IN3Xl7JcZV184WSbVX3h9YHXn4das+e5f2H/1Xm6v0De6 vLKC4dORWoNV1Y8CJTWVF/XpsWusTv48y1v63pmm6fZt7UvYLol939i+ee6L3TNvia3YmnB5 P7tuDRfznADlWz46epeDrm3TKFtd2Xpg95qL67J+xW/+mJH83K6Nkc/Jz2OO6Ks7D4PytF79 PhrwaskG/+ZbD9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nNtP8875KX9ZdfJJzgmvpXVFFjmGu6/ZzO/LMu+4hO1kgbn9MVrv9/4J 4M+VaWKZder7iYU6Elvj/qzhFy49vvfWY4afSizFGYmGWsxFxYkAZom7PugCAAA= X-CMS-MailID: 20201214112449eucas1p28f3ade12253fb8b60c1396c706a65220 X-Msg-Generator: CA X-RootMTR: 20201214112449eucas1p28f3ade12253fb8b60c1396c706a65220 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20201214112449eucas1p28f3ade12253fb8b60c1396c706a65220 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 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 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