From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 25DB4C433F5 for ; Mon, 2 May 2022 11:22:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ptwx44gFxpTI2+k+H+QwDwrHLYDqlfDrBdw0hDzWj8k=; b=LAH8H7HQ7bQgKbhh7LXt27+DgY xW1QO4H6JKTfFILE6awKA3d0BKx9sDhX8Qu1dY1T2vTTao18fR5jnz9siqS5Yz+PJ4ALTgXxugKdO NwdGz9HH8BQqNpMgBkfdTEWwNtsTCzobVMVIXCYKCcN99czalbevcASYa+qvmLxN9SL0HQqD7Zho1 yXJECdXbLdjwGBvgBPVrOutpBG943o/dzDraDkYvwyjJu9MzbocnEVXJMHleCA0wcfnOapfloKbZ2 onkspWgy66Znv1oxyRQ+27629qPZhHBUtH7oWoKyT/2/8CBMoQXda7dKwtsbI6tcqUC3mjy1hkgll Oc4jBbwQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nlU7C-000wCG-LK; Mon, 02 May 2022 11:21:18 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nlU79-000wBS-Q2 for linux-arm-kernel@lists.infradead.org; Mon, 02 May 2022 11:21:17 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id E69735C009E; Mon, 2 May 2022 07:21:14 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Mon, 02 May 2022 07:21:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h=cc :cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm3; t=1651490474; x=1651576874; bh=/HFvyCgF45 DiVip9szDLN9IPhqJ4EuOs8Zamh5E+TEw=; b=UMq6g5QFW/N2Xm7MpjJOhNsH9S Z2udjefqHLtg0yV4fNRHD24cVPL5tY5uKcURG9ar+S36Mmx8Mf1sJGF+n6Dk1fvu txdSwExSetlsp7kxPElyT8WoPCS/K6zLyGL/LeF+FJYbkgDF2WffblkrrtX+dlu0 Y4PSQZfT3NmCiqgWbuZOvAJaLbAXLpoV9RItF2gZBO6ZB4nc1R8F7eihk+LrXqTY J/Vg8gtdSnD8afZm1OXftv/4kJWu7eDKMbv1sUWTS0af4j6m2bl1+xkFdKVS6H9j aULgyf1HSawcVz7gRnQ+P0NLmMtFZHaQSzU/JT4A7RgHuXl3hgoMwHAKoaWQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1651490474; x= 1651576874; bh=/HFvyCgF45DiVip9szDLN9IPhqJ4EuOs8Zamh5E+TEw=; b=t HHbNwQkNggwVCtXe3/M8PkMetlJJa15JOh1f6tKm6UvrQ8dUHg1JGt/EP6LvH5JB 8i3v7nlNYezBi40oIjw85yFyCjH6QqcqEA+lMvrjCon90H3Z8tLthnBQq4XLGJsp kFSw+WA3a3gjyPJXg/iZwrGnXGNgxripvvyFJHUvscVWH6h92TWFRztG0/5D4LiW YrZVKPo37tSOTpt78KaaBTXKW6JhVzEym7+/bzvgaNgTCPqTj4aN7fGbZWkXGl8L 59TjDf2icZLyZS6u48tD/2peTL+jnlug6wL5CrLJZiyB/8wnP511uRb5PsZRwz8n ZjmZ2ClAt7i+86HE0iWmg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvdehgdefjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfhfgggtuggjsehgtderredttdejnecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepgfduhedttdegudffuefgvefhveejtdevgeegteejudeuueefvdfgkedvuddv hfffnecuffhomhgrihhnpehkvghrnhgvlhdrohhrghenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrgigihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 2 May 2022 07:21:13 -0400 (EDT) Date: Mon, 2 May 2022 13:21:12 +0200 From: Maxime Ripard To: Icenowy Zheng Cc: Ruslan Zalata , Guenter Roeck , Jean Delvare , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev Subject: Re: [PATCH v2] hwmon: (sun4i-lradc) Add driver for LRADC found on Allwinner A13/A20 SoC Message-ID: <20220502112112.3ne7zy4b6gggxzoo@houat> References: <20220428210906.29527-1-rz@fabmicro.ru> <20220502110010.q7vvdkdpaiz5acjl@houat> <7433B295-D896-4BF8-87DF-87EB89D7A550@aosc.io> MIME-Version: 1.0 In-Reply-To: <7433B295-D896-4BF8-87DF-87EB89D7A550@aosc.io> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220502_042116_008844_DA12890E X-CRM114-Status: GOOD ( 34.53 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============3625882782578631607==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============3625882782578631607== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="mg35qjdbc5ra2hwr" Content-Disposition: inline --mg35qjdbc5ra2hwr Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, May 02, 2022 at 07:15:01PM +0800, Icenowy Zheng wrote: >=20 >=20 > =E4=BA=8E 2022=E5=B9=B45=E6=9C=882=E6=97=A5 GMT+08:00 =E4=B8=8B=E5=8D=887= :00:10, Maxime Ripard =E5=86=99=E5=88=B0: > >Hi, > > > >On Thu, Apr 28, 2022 at 09:09:03PM +0000, Ruslan Zalata wrote: > >> Some Allwinner SoCs like A13, A20 or T2 are equipped with two-channel > >> low rate (6 bit) ADC that is often used for extra keys. There's a driv= er > >> for that already implementing standard input device, but it has these > >> limitations: 1) it cannot be used for general ADC data equisition, and > >> 2) it uses only one LRADC channel of two available. > >>=20 > >> This driver provides basic hwmon interface to both channels of LRADC on > >> such Allwinner SoCs. > >>=20 > >> Signed-off-by: Ruslan Zalata > >> --- > >> MAINTAINERS | 6 + > >> drivers/hwmon/Kconfig | 13 ++ > >> drivers/hwmon/Makefile | 1 + > >> drivers/hwmon/sun4i-lradc-hwmon.c | 280 ++++++++++++++++++++++++++++++ > >> 4 files changed, 300 insertions(+) > >> create mode 100644 drivers/hwmon/sun4i-lradc-hwmon.c > >>=20 > >> diff --git a/MAINTAINERS b/MAINTAINERS > >> index 5e8c2f61176..d9c71e94133 100644 > >> --- a/MAINTAINERS > >> +++ b/MAINTAINERS > >> @@ -18861,6 +18861,12 @@ S: Maintained > >> F: Documentation/devicetree/bindings/input/allwinner,sun4i-a10-lradc-= keys.yaml > >> F: drivers/input/keyboard/sun4i-lradc-keys.c > >> =20 > >> +SUN4I LOW RES ADC HWMON DRIVER > >> +M: Ruslan Zalata > >> +L: linux-hwmon@vger.kernel.org > >> +S: Maintained > >> +F: drivers/hwmon/sun4i-lradc-hwmon.c > >> + > >> SUNDANCE NETWORK DRIVER > >> M: Denis Kirjanov > >> L: netdev@vger.kernel.org > >> diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig > >> index 68a8a27ab3b..86776488a81 100644 > >> --- a/drivers/hwmon/Kconfig > >> +++ b/drivers/hwmon/Kconfig > >> @@ -1691,6 +1691,19 @@ config SENSORS_SIS5595 > >> This driver can also be built as a module. If so, the module > >> will be called sis5595. > >> =20 > >> +config SENSORS_SUN4I_LRADC > >> + tristate "Allwinner A13/A20 LRADC hwmon" > >> + depends on ARCH_SUNXI && !KEYBOARD_SUN4I_LRADC > >> + help > >> + Say y here to support the LRADC found in Allwinner A13/A20 SoCs. > >> + Both channels are supported. > >> + > >> + This driver can also be built as module. If so, the module > >> + will be called sun4i-lradc-hwmon. > >> + > >> + This option is not compatible with KEYBOARD_SUN4I_LRADC, one > >> + of these must be used at a time. > > > >How do you plan on enforcing that? > > > >I guess a better path forward would be to either register an hwmon > >device in the original driver, or convert that driver to iio and use > >iio-hwmon. >=20 > I think this driver should be use IIO, and then try to probe an IIO input > if possible. It's been a while, but if I remember well we couldn't use IIO for that driver because it's not generating interrupts all the time but only when it goes over a given threshold: https://lore.kernel.org/all/52C5E9F1.9010700@redhat.com/ I'm not sure if it's still relevant, so we might just need to add an hwmon driver to the existing driver Maxime --mg35qjdbc5ra2hwr Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCYm++qAAKCRDj7w1vZxhR xZfzAP45baOfMHgE07gDuTms0R435nh6idYPLh86SZXpVD1x0wEA0e2PYbOvaM4Q hel2Z4Gtv0wdzACyM6T9aRjdarTmdww= =z935 -----END PGP SIGNATURE----- --mg35qjdbc5ra2hwr-- --===============3625882782578631607== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============3625882782578631607==--