From patchwork Fri Apr 22 16:07:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: icenowy@outlook.com X-Patchwork-Id: 12823717 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7860EC433F5 for ; Fri, 22 Apr 2022 16:08:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244757AbiDVQKy (ORCPT ); Fri, 22 Apr 2022 12:10:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229574AbiDVQKx (ORCPT ); Fri, 22 Apr 2022 12:10:53 -0400 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam08olkn2047.outbound.protection.outlook.com [40.92.45.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 923205DA6D; Fri, 22 Apr 2022 09:07:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VgNRxK+DbbzLLbr421Ndn1XKyVm45BIAKMGHRRiblKaw27kFOeOo6zAgLyDitHdk0bTJgbs8z4rJePTzK6A5IIxv8yfTSsvXmazOdxFUcpV+cVL17mturRfd+vxJlZMOEUVixxsXcTaGN9L3xiVntIyxV+RYQxNE+jdDvg2RkLmr8NNIgjwVML5GphdtmEooVsv2QAIHFTT1pWriB2otZYzsjhy04cIXsW9gmIwSsOUKd3VPxYVe57hPQU7cJppSIyBPJpVJ2Yu3vTt5Jh9ulK38r/gWzRJBuujdqoh9fGtQUJNLGT8lWrxO/gwZnAwsO1D1j1FtaNa6HVNWpIpy5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=V04gzQDrOXt/6W2baqwFWUh45o7LO9Qz083Itn+KvO8=; b=apGT70Oj63DO/P4hpDAzZCwvvDOT0yScGLucnLqLXZzpATMvrvqGLhcOjYV5N9HRDUAece5Mqq7I2fJdMxBgJt4OxO4DU8h0wknHRrR+Z1axsRhIqrcADZplEI529v3UeeRGfcYXUBBipkti3Jxjg7v9ySYWOP/vlCmtOI9ynPNybxDySEZf1OLmTCnjLPmBmdCP8/CD8lDaWJRujTkpwiVnmMyoc2JhQd0Ca4nLUA1znBuLUk02YrzjPyCux20zZyvOyW09HbUxoo/GFa3KinSUTxxxnnZGUHQAiSr31DOGwsRl952aR6kW0KWQJFDlJyEfWp6ysED4hkWLxZNSpA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=V04gzQDrOXt/6W2baqwFWUh45o7LO9Qz083Itn+KvO8=; b=T0qR77whRBm23CQ2X2VwOFHWmynSfgIoHLiRrZUhykfnRx7WfQXSmTyy4YTqZJQKU0DDSAzItslREo+dzjrnQC2DqVoSY6R7cUgI2/i7L+Rk+uAM89uNeH54jK8GslX4QWnZHfF7stvhb5oukaTRCgR3yGNoeXooC/lOWtlTCcfobjwq8J/xg8BOI7kLHAUKGCU82e+UR5YysEPIOD4o2YJPRh+GQZDZiLLUDnMDrKcUm1sBb8tgn0ZXAvza5VJmV1MxzUs5poXJ6YzaUGByztfNzUuPxrZhYHILeJQqR8D6DkUfizyJLUqCWb+395uuKfDgRWD5Bh8RHYs53iyVsw== Received: from BYAPR20MB2472.namprd20.prod.outlook.com (2603:10b6:a03:155::16) by CH0PR20MB3756.namprd20.prod.outlook.com (2603:10b6:610:dc::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.14; Fri, 22 Apr 2022 16:07:58 +0000 Received: from BYAPR20MB2472.namprd20.prod.outlook.com ([fe80::3480:160a:eb92:d6e3]) by BYAPR20MB2472.namprd20.prod.outlook.com ([fe80::3480:160a:eb92:d6e3%6]) with mapi id 15.20.5186.015; Fri, 22 Apr 2022 16:07:58 +0000 From: icenowy@outlook.com To: Hans de Goede , Dmitry Torokhov , Rob Herring , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Maxime Ripard Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, Icenowy Zheng Subject: [PATCH 1/2] dt-bindings: input: sun4i-lradc-keys: add R329 LRADC binding Date: Sat, 23 Apr 2022 00:07:43 +0800 Message-ID: X-Mailer: git-send-email 2.35.1 X-TMN: [YRzp55R6WWnYnjjt6nK56KI/0nu7kwD3] X-ClientProxiedBy: HK2PR02CA0218.apcprd02.prod.outlook.com (2603:1096:201:20::30) To BYAPR20MB2472.namprd20.prod.outlook.com (2603:10b6:a03:155::16) X-Microsoft-Original-Message-ID: <20220422160744.1074052-1-icenowy@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0ea78f06-f8d2-4a9c-0964-08da247a445d X-MS-TrafficTypeDiagnostic: CH0PR20MB3756:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QfMfpS8uQyGDmJTrVDdkOWCz20kY2iqkAO2T1uWHw+/0Wkw7qbqCAPqIaFEVbjJqyd3ioNNqMaavBSoIs+CzbTEGd5lZb4amUfzQ0rlbtZMXiswSJKym2BqjYj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C5USujC3cSV8Xy9c5HOFZUZyxlvISxpZxMkemg8NrJVKg25naKGTGlbNTp10TTRvtdcVCw2M7WAxO+YglyEzbr75rZAno7BCzZUdSUysVne0ekYAbuK6TIG6UIV44kiRJ5q46C3l4YQcwLFco01WyO+WG6VQ8ntmt8CbyKLCbaGWLb09i+BTQW5Nv2lyUPSLpSnww70XaTEFBPSBhohdaOLoWmLlITPpgyZOf/77QCyqXToFJaCTXiBKFb6qKAzVv7RNMYzijS7/hpFNBvM/fTiB0tJQhF/39KJxHQwi1glyUlYDcbe+UtPI+mUaUzpkfbCeJzEhriUKiGod4VH6SvRZqVTQrZu8iRXnbvQ3fIr7HN00bnBYKEoYuKvOrh1ip04+DBbe9VNstXKhr7TaqVj/m/b8n4HDm8UCZZG12rRIgxTd5E/UmbKi9egVekM+KEqzY+FQdLd7OprQYSkkQGm8FBfejb6a27P6IoHWQyZguEFQ3i9so7sq6jaPxwGqZ4nHoRAgaBs+dPw+lyrEyTQBEZaoRBn3D8AQW5HAVBx9e54Bt6QL57mDaapx59mplNgw0BrvtFVXLk9fZ4E9rkprK7PqNN5tn9Z2Cx9hOZjPywJu3Ed5n9QU3e9g1dHkZXOa7uIY+UCEXDCZZG95UjBj8/o2Dkgy5oXfjyheYSEH8cQKpN5zmeQnrTSySeHMJh8yebwKw8RyvB7JgjeFbxr4wnBVBaFeFHdDQStSRuz3ByeML5cqw4W6jVVnijXPVWrl1whSAc11TzqArmjnBrwjqKU9ixBOi4DHO4M4SwcoxRsvkh/msgv+wIWRXLMu3G4CQKDqRp/RVqbei4s+Ciz4yV9UvcqUoga3f2ImMTnFBwKqJ4x5UFD3M5TGR1N+7WrT3f0= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0ea78f06-f8d2-4a9c-0964-08da247a445d X-MS-Exchange-CrossTenant-AuthSource: BYAPR20MB2472.namprd20.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Apr 2022 16:07:58.0560 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR20MB3756 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org From: Icenowy Zheng R329 has similar LRADC with previous Allwinner SoCs, but with bus clock and reset. Add binding for it. Signed-off-by: Icenowy Zheng --- .../input/allwinner,sun4i-a10-lradc-keys.yaml | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Documentation/devicetree/bindings/input/allwinner,sun4i-a10-lradc-keys.yaml b/Documentation/devicetree/bindings/input/allwinner,sun4i-a10-lradc-keys.yaml index d74f2002409e..e16f01510ea7 100644 --- a/Documentation/devicetree/bindings/input/allwinner,sun4i-a10-lradc-keys.yaml +++ b/Documentation/devicetree/bindings/input/allwinner,sun4i-a10-lradc-keys.yaml @@ -15,6 +15,7 @@ properties: oneOf: - const: allwinner,sun4i-a10-lradc-keys - const: allwinner,sun8i-a83t-r-lradc + - const: allwinner,sun50i-r329-lradc - items: - const: allwinner,sun50i-a64-lradc - const: allwinner,sun8i-a83t-r-lradc @@ -31,6 +32,26 @@ properties: wakeup-source: true +if: + properties: + compatible: + const: allwinner,sun50i-r329-lradc +then: + properties: + clocks: + description: + Bus clock gate for LRADC. + maxItems: 1 + + resets: + description: + Bus reset for LRADC. + maxItems: 1 + + required: + - clocks + - resets + patternProperties: "^button-[0-9]+$": type: object From patchwork Fri Apr 22 16:07:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: icenowy@outlook.com X-Patchwork-Id: 12823718 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 43BB3C433FE for ; Fri, 22 Apr 2022 16:08:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353512AbiDVQLV (ORCPT ); Fri, 22 Apr 2022 12:11:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229574AbiDVQLU (ORCPT ); Fri, 22 Apr 2022 12:11:20 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11olkn2105.outbound.protection.outlook.com [40.92.19.105]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3AD665E161; Fri, 22 Apr 2022 09:08:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BOLfevKZgghM5cDnQJ50seQLwRjPfY3lWzxgyWXjKqeRALHSZX/z8mNRDwPsh0kqLtyYK2cWeMNG5yAnjmV4xFHemac0dEKDsZZRs2YL2FI3JM/w4jQw6xGD2s4tDYuubOU6Rge4iXxn8nei1/4MJ8HPcEVVjAQzM1gdWHefB+gMutoctLFVx4i44Zzgsrb3ZRwxNwYZ+/u8YvtyFfrYiD3ir+0NoiAB+MCRhgc2RkOvKNYJrEafPIRPHHWl1FB+uUJBRMe3lmUOUnYaCXSVGN2mTydRhtHjiXbx6jDGNldY6uqp8J4X+9BiOF5IzqlnyMfH+OqFfUEfopBy+v+vZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=lT6NmnNPgJP0jHc/iRnZE4KM7wQ/M4jaYXih4ftQwe8=; b=YQA9kT83/F+WlDpqybfKXJYAA8SSiKXjc2HV5kUcc/0vc4Q3q0Ay30rJVoRTlMmuX/RD93/JPgUsUeZvcg5OY9ITSRjY63rRKmy1PbRhCCb7H5PZIgPf2SZlqGZvLA3QrobMoUnEN9R3TDjdazEysa/RrPDPFqzNWlTjhltKuW5602loMcLtWe9Li3tHN1ZwNOCDvVCfz9UaHEub+fkMxHzkLcZl9okQ8cjp73EwPID5OiS9CgvyBkXDPqhWBjdv+wzS3P+xOkELb7EvyopHKZzhQBli9ISepp8SCSe88ursgFKxn+CW8ICYlCnS9rfpiPE+OF3ooau96jR4dTJAlw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lT6NmnNPgJP0jHc/iRnZE4KM7wQ/M4jaYXih4ftQwe8=; b=iNrA1v5fBeuRjXotxSo1Dw0m+ophcGzmKTPwYaLLx7hGhHcLqRzdUol94N3i5lQ7x+iZ5q/eVFEyLgggtcHlvtBRJqpar3Oc+dvOuSkUuCwGVLIsxaG6r5KCYZMtOKRNLH03vOZeUG/go+Tgj0Id7kwVGYNU5IgxwoPKiMT5p1NAcFC716dkId4942lQSUZlxeipfxLvkJtBUhNWkJMk7+RIG5o0wwRczu405mTUc8KkWoa62nrmcMLKsYZEXTf5ODxktS7ojLDXofXCHoGzKQKCO09oi511MUNY8gX5U4JRoS/2ekPeWH05hA4jmWqduzMl4OT5Mk0RgVmAAY1h1g== Received: from BYAPR20MB2472.namprd20.prod.outlook.com (2603:10b6:a03:155::16) by CY4PR20MB1413.namprd20.prod.outlook.com (2603:10b6:903:15c::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.15; Fri, 22 Apr 2022 16:08:25 +0000 Received: from BYAPR20MB2472.namprd20.prod.outlook.com ([fe80::3480:160a:eb92:d6e3]) by BYAPR20MB2472.namprd20.prod.outlook.com ([fe80::3480:160a:eb92:d6e3%6]) with mapi id 15.20.5186.015; Fri, 22 Apr 2022 16:08:25 +0000 From: icenowy@outlook.com To: Hans de Goede , Dmitry Torokhov , Rob Herring , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Maxime Ripard Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, Icenowy Zheng Subject: [PATCH 2/2] Input: sun4i-lradc-keys - add support for R329 LRADC Date: Sat, 23 Apr 2022 00:07:44 +0800 Message-ID: X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220422160744.1074052-1-icenowy@outlook.com> References: <20220422160744.1074052-1-icenowy@outlook.com> X-TMN: [siOOfMH78WenmyrJqCZOtJs+xYBa7IvQ] X-ClientProxiedBy: HK2PR02CA0218.apcprd02.prod.outlook.com (2603:1096:201:20::30) To BYAPR20MB2472.namprd20.prod.outlook.com (2603:10b6:a03:155::16) X-Microsoft-Original-Message-ID: <20220422160744.1074052-2-icenowy@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fd0147f2-27f5-43fd-502f-08da247a5485 X-MS-TrafficTypeDiagnostic: CY4PR20MB1413:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZYdmVhZqqgyiWC1zEpiT7zHTWIsKqXuLW5m/f5WuaflQ6wl1FfwDgsOjMrehZSp9sxi6ihXBbpw2ntcb8HC1saCB6j8BvunxMxcXaXMqIX8W2bQsAB7pJ2IAkKj+0qd+xH2eUtJU4HJR6+9xagS3UakfYJx0kp6KsBFn/dkmnmqmNMH0eJsF7e6RhVOdx1SFH3TaRaGXPHYVN/kTS8F/B18XTPAwqJ/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UuSfD7hhWwyL9OqXhqu9A5Cf2dYGgE7pPylaKwPaYgJiNOoe+3wkS0PnCY+20Jd7eYEKCKOZHyoQRFb81Fa/mI2oVlLmPC3pPVzwyZLoJ9tbcMGu4K8Ht4w5l8bE1z4njMDlsrLduF2joxMs1G8nHXO3dKAZG+NnchiMsAa9eEEMxbEDdD4otrwr/ymrAwUtbBPnV1ji7buvcSWpVgn9j0zY5p0cm8E8p1ngrF5j4h8edBY0fxLo6CMTcUV2tkyhpT23PZbAHtlbzi0VSYyrdZF1Y4v6QJa7qWNYew58Pbq8qNt6R7a2mtJBO0BXDhtZ4kzlx3oSxWjBY61r9idhutpnciKOwH8FpRolU1r5lDV89falgTpl+0JvBIcJqm91fnndImI9DRFFebksIRA/nI4BqvMLT3MVg8obtdFk+ZBzqR6MfxoVAUxpgdmweKi8lqsHNDCyNCIxgbwev3gqz8Cxk0TxZKnodvrjNZVVni4doYljkWwhfFclhCJmbDeRGxbAM3/tZloYZKhjM8ZAWWNNCzwHMeS+2Q1G3lPcf/IgxEcSoljt3oZF2a4rYdFy4qknhQlAa25J/Ef1KoigdUjMguKOUfdUD2GhYs2EIAN6pi8ZphzW3XFjbTO5LZekyvbGpRA6xMtClD9L0Zrx4Wpn+6U6Q0naqBPyxNPFJAJylXC/2sy6QfNeugKYjOc0DPlx4Xg5abb2cH+EDJJkgCzWorBP1K0KYv20Cv9gX8/iuKZLAoXOohakOeTZhzuGRvQRs9JfIXNxoIPLaIyUx8WZLYZEXOf8= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: fd0147f2-27f5-43fd-502f-08da247a5485 X-MS-Exchange-CrossTenant-AuthSource: BYAPR20MB2472.namprd20.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Apr 2022 16:08:25.4135 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR20MB1413 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org From: Icenowy Zheng Allwinner R329 has similar LRADC with previous Allwinner SoCs, with a reference voltage of 3/4 AVCC. However, compared with previous SoCs, it has bus clock and reset for LRADC. Add support for it. Signed-off-by: Icenowy Zheng --- drivers/input/keyboard/sun4i-lradc-keys.c | 39 +++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/drivers/input/keyboard/sun4i-lradc-keys.c b/drivers/input/keyboard/sun4i-lradc-keys.c index 4a796bed48ac..29365a0646dc 100644 --- a/drivers/input/keyboard/sun4i-lradc-keys.c +++ b/drivers/input/keyboard/sun4i-lradc-keys.c @@ -14,6 +14,7 @@ * there are no boards known to use channel 1. */ +#include #include #include #include @@ -23,6 +24,7 @@ #include #include #include +#include #include #define LRADC_CTRL 0x00 @@ -58,10 +60,12 @@ /* struct lradc_variant - Describe sun4i-a10-lradc-keys hardware variant * @divisor_numerator: The numerator of lradc Vref internally divisor * @divisor_denominator: The denominator of lradc Vref internally divisor + * @has_bus_gate_reset: Whether the LRADC hardware has bus gate/reset */ struct lradc_variant { u8 divisor_numerator; u8 divisor_denominator; + bool has_bus_gate_reset; }; static const struct lradc_variant lradc_variant_a10 = { @@ -74,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_bus_gate_reset = true, +}; + struct sun4i_lradc_keymap { u32 voltage; u32 keycode; @@ -84,6 +94,8 @@ struct sun4i_lradc_data { struct input_dev *input; void __iomem *base; struct regulator *vref_supply; + struct clk *bus_clk; + struct reset_control *bus_rst; struct sun4i_lradc_keymap *chan0_map; const struct lradc_variant *variant; u32 chan0_map_count; @@ -140,6 +152,16 @@ static int sun4i_lradc_open(struct input_dev *dev) if (error) return error; + if (lradc->variant->has_bus_gate_reset) { + error = reset_control_deassert(lradc->bus_rst); + if (error) + return error; + + error = clk_prepare_enable(lradc->bus_clk); + if (error) + return error; + } + lradc->vref = regulator_get_voltage(lradc->vref_supply) * lradc->variant->divisor_numerator / lradc->variant->divisor_denominator; @@ -164,6 +186,11 @@ static void sun4i_lradc_close(struct input_dev *dev) SAMPLE_RATE(2), lradc->base + LRADC_CTRL); writel(0, lradc->base + LRADC_INTC); + if (lradc->variant->has_bus_gate_reset) { + clk_disable_unprepare(lradc->bus_clk); + reset_control_assert(lradc->bus_rst); + } + regulator_disable(lradc->vref_supply); } @@ -272,6 +299,16 @@ static int sun4i_lradc_probe(struct platform_device *pdev) if (IS_ERR(lradc->base)) return PTR_ERR(lradc->base); + if (lradc->variant->has_bus_gate_reset) { + lradc->bus_clk = devm_clk_get(dev, NULL); + if (IS_ERR(lradc->bus_clk)) + return PTR_ERR(lradc->bus_clk); + + lradc->bus_rst = devm_reset_control_get(dev, NULL); + if (IS_ERR(lradc->bus_rst)) + return PTR_ERR(lradc->bus_rst); + } + error = devm_request_irq(dev, platform_get_irq(pdev, 0), sun4i_lradc_irq, 0, "sun4i-a10-lradc-keys", lradc); @@ -290,6 +327,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);