From patchwork Thu Apr 14 00:23:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 12812808 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 77B6AC433F5 for ; Thu, 14 Apr 2022 00:25:16 +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-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=3SHy8f55a6MKkgrwdGXFmfW0oh+y/l7JumRLcibMqBk=; b=n53rigtSNNOvF7 YSnbJjaX21TAiVu1UBlSDeScPgtLlgppKoN4OO9rZHOCVLWs8YR5qS3wnLw+nYxLR55Bqw7k8JpTP QGURERJEDaMcoI7UvcPlFhaOXFrZ0LnOamnNumD9g26AvPsPKSPo8P9SWbJMix19sVaDz7b+0BDXi TT1cYM1cqD47pp7WuDE3V0cLkReugv8Kx7MlkLBk9GN9Ax/Zq9ynDoEHm3cxN04B38tz0ZjIkr5M4 ge19u1cLEs+gm+2Xb3mjZiIZ4hhowDYyxmSRC8mWcXAQXosnm2+tdAqopDRN5dyr5lws7sSubbsYm tEDioVAD4g1Uv+CYvT0w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nenHO-003AJy-Jp; Thu, 14 Apr 2022 00:24:10 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nenHB-003AFA-PD for linux-arm-kernel@lists.infradead.org; Thu, 14 Apr 2022 00:24:00 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 417705C02EE; Wed, 13 Apr 2022 20:23:56 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Wed, 13 Apr 2022 20:23:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1649895836; x=1649982236; bh=sm LbHwGYtdmSDiKEj6LIJXKXjSMVo9Cyx4CzsqmRG0s=; b=kVU7oOEndcoeC/wDNm WIG/OFvtDRkrJgXrlDD5gXDjHyQrsgmbMR/lpl5pvOwp+5pDnVf+xMIeAkvNesWC Lo/gUVyS1SHoWT4EbbENN3anlwolpci1F5EzpCnTQJFYuk3u0rUrr/73qdHCChOk JM6oKIP4JZ9Ez2PLe76sJ78Wg6I3iJPujTfv/dbAzcuvjMX3Jy7b7rvaeouZ+u0c iyfDjfXTxOpFITa86oUWKwXkDJzvaY31nCDIWNDmbFZGpd8gJokDvltKy+O9AIWO c1bDLLcVXBZWbntMwGBNocCCsf2V53n955SwaC0YxJSVW73uS6F0wR6x0HHbdIr6 whzA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding: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= 1649895836; x=1649982236; bh=smLbHwGYtdmSDiKEj6LIJXKXjSMVo9Cyx4C zsqmRG0s=; b=rmD1yK6cd4LWEVBuWox9ngsZHkdSQWVFAXL2oaHNOYu0i8DE+0l +Cu51dE8lNsPimZ5w7reuORkr8m3nWrwke86WuAgb0qlbOZVQ1iNvMXH9FH/NHdh EOtjdHSkbiYTj1RJoooC1z494h6+M/6XlTjOktW6AK1ph9XlZhQLDXs0LkEPBGwG bNCprVgUgyxZTYRWx66l5Lwl+RFAmITGdAFwyZdKU8lQxixhq8pBEWOSp+4Za1oB xMyuX8aKw0r/LvjUR3hAsiXXTxn7m6aDIC8S637/sEwzlGYeFTNCf8GwCxgMFNFh YA6Xlj5824Be1pI44rSqR3TF9bkZdQieA5w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudelvddgfeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefurghmuhgv lhcujfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenucggtf frrghtthgvrhhnpeduhfejfedvhffgfeehtefghfeiiefgfeehgfdvvdevfeegjeehjedv gfejheeuieenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepmhgrihhlfhhroh hmpehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 13 Apr 2022 20:23:55 -0400 (EDT) From: Samuel Holland To: Dmitry Torokhov , Hans de Goede Cc: Samuel Holland , Maxime Ripard , Rob Herring , Chen-Yu Tsai , Jernej Skrabec , Krzysztof Kozlowski , Maxime Ripard , Rob Herring , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev Subject: [PATCH v2 3/3] Input: sun4i-lradc-keys: Add support for R329 and D1 Date: Wed, 13 Apr 2022 19:23:48 -0500 Message-Id: <20220414002349.24332-3-samuel@sholland.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220414002349.24332-1-samuel@sholland.org> References: <20220414002349.24332-1-samuel@sholland.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220413_172357_974105_F6E32A35 X-CRM114-Status: GOOD ( 13.44 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This LRADC variant uses the same 3/4*AVCC reference voltage as the A83T variant. The R329 and D1 LRADCs appear to be identical, so D1 support is accomplished through having the R329 LRADC as a fallback compatible. Signed-off-by: Samuel Holland Acked-by: Jernej Skrabec --- Changes in v2: - Set the new flag for the R329 variant. drivers/input/keyboard/sun4i-lradc-keys.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/input/keyboard/sun4i-lradc-keys.c b/drivers/input/keyboard/sun4i-lradc-keys.c index 5630334a6c09..8f9bfb05244d 100644 --- a/drivers/input/keyboard/sun4i-lradc-keys.c +++ b/drivers/input/keyboard/sun4i-lradc-keys.c @@ -78,6 +78,12 @@ static const struct lradc_variant r_lradc_variant_a83t = { .divisor_denominator = 4 }; +static const struct lradc_variant lradc_variant_r329 = { + .divisor_numerator = 3, + .divisor_denominator = 4, + .has_clock_reset = true, +}; + struct sun4i_lradc_keymap { u32 voltage; u32 keycode; @@ -323,6 +329,8 @@ static const struct of_device_id sun4i_lradc_of_match[] = { .data = &lradc_variant_a10 }, { .compatible = "allwinner,sun8i-a83t-r-lradc", .data = &r_lradc_variant_a83t }, + { .compatible = "allwinner,sun50i-r329-lradc", + .data = &lradc_variant_r329 }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, sun4i_lradc_of_match);