From patchwork Tue Jan 26 09:50:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 370587 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp4802078jam; Tue, 26 Jan 2021 01:51:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJytTLh9SrGmI7K3dK9BRgI3InZx61ak7TQHv6/bw6WaOf6mw20aqz36Xfk65ByHIvzqqDb1 X-Received: by 2002:a17:907:3e06:: with SMTP id hp6mr2957417ejc.254.1611654688306; Tue, 26 Jan 2021 01:51:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611654688; cv=none; d=google.com; s=arc-20160816; b=TOluZFgaz9hy2qjtjGN7C4CclkFqfnm/29h04QEQpor3Q1t6Vy218ukTPY1mNopM3r aW0taYYeOws2yvPtkayag7k/K2wfx1is+BKrrLCRmt7zvgtDhzPzE5bPOni6d902geJl CFgpH/M1jNfnol207NGBJrnS6JLVy2XLXGix2JqKwQjbTB0vksQUgQj3lQAcXkcbv0e8 5abivp75U6y877ub7FIjcZ+h6KtzSYrjQNUfc3AWl9odTSfRK7Lw8cG5tmyt6vP7WWAR Us3k4dDY66e31PjEv3n08p5P4IJXpRPzvft+y2oHB0ezFRVAYrIblqsVyi/vvlF8dU6d o+dQ== 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=mrw1Am27lS8Hgq4OOG9yDXMlGg0SAcG2qHILTx2XzZI=; b=xbM9OOGyr7BjufYYJFnNIKwG/FFo/AM6LzLzmytMx3loS4Xc2lQZaa5acUmjGovNN9 PN7wxrE1Hn4D1oso6e9UZBqDU9THVY+fXXbUmkyTZLYcTOH7dVK6HoQLBRwNGGARkzZW 6lKuwv6PEcZZ62xpVbqM6XjeGB3mxlkaP9MfF5yFSOeUotYdo2a4/wkMRcZ1MtmWiFi0 TAZKUO1JvWKA5N3VDlSdtgZTDZ0hbsuueE56JJ93sZ7BdzI9vp/arCjvxQ8UOtefoWEB 0gnOAZIaZ9pOhh0EpehsVC5ydXlm9GNWX+2v58pQTR0Gc2ZpBHiBZm5Jh0Ea1Gx8c30q yvyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=t9vJLqmP; 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 g15si8297447edp.102.2021.01.26.01.51.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Jan 2021 01:51:28 -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=t9vJLqmP; 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 99D7F82603; Tue, 26 Jan 2021 10:51:24 +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="t9vJLqmP"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6BB16825EC; Tue, 26 Jan 2021 10:51:21 +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.3 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 2BA1982571 for ; Tue, 26 Jan 2021 10:51:13 +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 20210126095112euoutp0181aac84be0d65cc3351e04d3de658098~dv2K72_Rr0689906899euoutp01D for ; Tue, 26 Jan 2021 09:51:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20210126095112euoutp0181aac84be0d65cc3351e04d3de658098~dv2K72_Rr0689906899euoutp01D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1611654672; bh=mrw1Am27lS8Hgq4OOG9yDXMlGg0SAcG2qHILTx2XzZI=; h=From:To:Cc:Subject:Date:References:From; b=t9vJLqmPvBum9E5cBQxP78I1IkhSZdJPMt6c3psBOv1AyNJFYMs88a+F/L6hMR459 Log3zSanidG6ezxqi/emHiJ2d/X6zB4fS5fZMNcOoBCAIwGK+zd7UNlKedUC5b/dAo cqZtYalemp5+ouPfnYGqDRfxX6kwNdOPECDXinKY= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20210126095112eucas1p14f22cfbf7e87d903b705013c3aa632aa~dv2KmtSE40760807608eucas1p1s; Tue, 26 Jan 2021 09:51:12 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 02.4A.27958.F06EF006; Tue, 26 Jan 2021 09:51:12 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20210126095111eucas1p21e10e8470c39d555080f68fa36957c72~dv2KM-Af61979319793eucas1p2M; Tue, 26 Jan 2021 09:51:11 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20210126095111eusmtrp2d4df0b463d259e9ac145314696a207ef~dv2KMHA7N0431304313eusmtrp2Z; Tue, 26 Jan 2021 09:51:11 +0000 (GMT) X-AuditID: cbfec7f2-efdff70000006d36-98-600fe60f4f35 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 28.0A.21957.F06EF006; Tue, 26 Jan 2021 09:51:11 +0000 (GMT) Received: from AMDC2765.digital.local (unknown [106.120.51.73]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20210126095111eusmtip23e39f8788aec5f02233677a27d517986~dv2JsNetR0507105071eusmtip2C; Tue, 26 Jan 2021 09:51:11 +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 v5 0/4] VIM3: add support for checking 'Function' button state Date: Tue, 26 Jan 2021 10:50:32 +0100 Message-Id: <20210126095036.6429-1-m.szyprowski@sam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QkJXmAgAA X-CMS-MailID: 20210126095111eucas1p21e10e8470c39d555080f68fa36957c72 X-Msg-Generator: CA X-RootMTR: 20210126095111eucas1p21e10e8470c39d555080f68fa36957c72 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20210126095111eucas1p21e10e8470c39d555080f68fa36957c72 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--- Best regards Marek Szyprowski Samsung R&D Institute Poland Changelog: v5: - 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 (4): 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 configs/khadas-vim3_defconfig | 2 + configs/khadas-vim3l_defconfig | 2 + 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 | 156 ++++++++++++++++++++ 7 files changed, 257 insertions(+) create mode 100644 doc/device-tree-bindings/input/adc-keys.txt create mode 100644 drivers/button/button-adc.c -- 2.17.1