From patchwork Fri Apr 7 13:57:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shengyu Qu X-Patchwork-Id: 80853 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp319345vqo; Fri, 7 Apr 2023 07:19:44 -0700 (PDT) X-Google-Smtp-Source: AKy350Yiv0S8oEhlAA3KNuM8O0H8e7xspxOR2MoaIhirWY0HWUKPEsjCmcgyHkg2bBfhJrBc85I8 X-Received: by 2002:a17:907:76fa:b0:949:7c05:71ab with SMTP id kg26-20020a17090776fa00b009497c0571abmr2852440ejc.66.1680877184322; Fri, 07 Apr 2023 07:19:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1680877184; cv=pass; d=google.com; s=arc-20160816; b=RypVtty5X9AWIRF1DGGy4l0NNl9i0fH7W+Qlhw3bpfrz+lbtN87zFLI/wWXBzWd75g P7ShwMG42ME2AiXWxKE2Yi+zQ/NQJjZ/nnEom/fDSgp5L9vpHJdeSbnlhfBXQZ2zQ8tH nQc35ivjIScMlQmRgVnS/mgN4qgY5VMlKuUpv8WNWh5KSW5OPTtcyGqKQTXwNfxB2yY8 1LmYyJWmZTyHcJfk2qIpIioNBAuyQrR6VF/TXAieDmv3evMv/enCX/It6c3sfrzfpzoa /VNkLjXf0C8oSY20X+IeUpis/ZG+bRqV2BgqPa2f29f944fQKLhtDKTkxsEV7JzHK7+i qmyA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=SQqG7RbxSW47jhVFKn/QZwZ9GUFuTehvAioXj/SsODk=; b=uQy6VIpIzu6YfAuIJCbxwRwLRuXbululqz85jcDoU/idqRhk3ZMniEFW8nw356N7tv 4ncG69HFwhow1OPFTDE8ZvhbD/qoQkcD7Z3uZHf+UQfPRAm4fUhS8trXmswwFq6xS0oM cRSkPqPbtxipeOcd8wtgax//WFD+M5f84OQkwgAEP/VQCY2oSN/VNBwD9fMki2K3/pwq vMmI0O09qpMWOiva9A1Cbhb0AgInS9r6umhUrJEncW7e61Zk9xqLYLU+R9mmYHtRV8PW MnsueWoY2iItrEwcbFa6ddLOv8DX12PLUSsRty52g1hzB7FtZexUC8W1HuoA1orR3888 EMFg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@outlook.com header.s=selector1 header.b=bRDTMD4N; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e26-20020a50ec9a000000b004fc9c1d2f07si3542916edr.554.2023.04.07.07.19.20; Fri, 07 Apr 2023 07:19:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@outlook.com header.s=selector1 header.b=bRDTMD4N; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239268AbjDGN62 (ORCPT + 99 others); Fri, 7 Apr 2023 09:58:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237677AbjDGN6K (ORCPT ); Fri, 7 Apr 2023 09:58:10 -0400 Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01olkn2105.outbound.protection.outlook.com [40.92.98.105]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 088C79ED1; Fri, 7 Apr 2023 06:58:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=P1idNOF2P6tafSsofclpDtwfhP886KAOz7nYjDnexgZgniPDrSEe2NAuTaYuMStLqUaC3+GjDn1jHEijoPbaqHUPZf/C0Nf7QtBBJkzzQKCxbkGK77ls2uDYSi87zH1GSrdEpPym10anOoYxd4ZQudREc5TCJ83R8tvnTGata3zk6wCxqo/4nqkrGSG9fhMdi+zluYaK/FsgkTIw4/zVOyMUhF/fYGjqqL6SyeLKE5ffyXmLYZ3FS6d3Oxhkri5EOQrbgH7KvAb6oDunO9/IJLEymgeqOKR+d8c8o0kUmFMDvFNI9sdyOHrJUi3WFBdvDIso/1o0urswu8F7jFHh9Q== 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=SQqG7RbxSW47jhVFKn/QZwZ9GUFuTehvAioXj/SsODk=; b=h9J+oYtXHf0zkagL06qlQJfCht+fkEjjfNlyrvEg2uykKv+kF3Mk9fPD09pRxlO7xQr92iVWU6s2S9ReuVw0NsW7NWCoTyX+iFQchQ3DfZWG1dUnw1xcqerSa1KdXd8SSiqrBK30NQE32d5KQdhnfrPRJCF8ghneNs0kV7uSV/WJHuanJq1IvBWsmBEm3uWVYs/CaZfwLB9EztZmShQgSy5IvKeb0B3TP+5MNlskCt5vZbFvjA86FcB5TPTHgER2IaQ713ZKqoqvCbl0unQXjxiiiFckwx4s82lhjXzIEELm2p+nEIMQpzjAvjC5bwrml2SVch8x+T8NvwKp3mzrng== 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=SQqG7RbxSW47jhVFKn/QZwZ9GUFuTehvAioXj/SsODk=; b=bRDTMD4NV2kVcir1yZ/8vqC7ndq1aAsgc5LHhvd14+VZ2YnQHiWSD04rvVNUjt8wrqw9gWvPMSqIeVdwptAcpnxQCi+hRsPNo1jLyzhoysFCSrFtCjS+IfsCEIzXzXA6JI81FQN5L7xLpJTOnKMmph0XHDlx3sXFZryUqgVAYJ5qEs/IjFtQRCAltd6dP2oP01vwWF2LohjoFNLl4VX9Hb5/FJQesK4Q72EhFHn8c6qRAZ2ZQM2Y+DxzatVTjMNdHAayn85YIEHaeLjDmZDErL6BrDC0GKYqlXRGhBL14+D7k2VlCu44pNQ3V8+mFeLM1DUlDMVngjqA1OW2jJav2g== Received: from TY3P286MB2611.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:252::12) by OSZP286MB2208.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:18d::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.35; Fri, 7 Apr 2023 13:58:00 +0000 Received: from TY3P286MB2611.JPNP286.PROD.OUTLOOK.COM ([fe80::d190:6e4d:5a1e:59a]) by TY3P286MB2611.JPNP286.PROD.OUTLOOK.COM ([fe80::d190:6e4d:5a1e:59a%3]) with mapi id 15.20.6277.033; Fri, 7 Apr 2023 13:58:00 +0000 From: Shengyu Qu To: lee@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, wens@csie.org, lgirdwood@gmail.com, broonie@kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Shengyu Qu Subject: [PATCH v1 1/4] dt-bindings: mfd: x-powers,axp152: Document the AXP15060 variant Date: Fri, 7 Apr 2023 21:57:14 +0800 Message-ID: X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230407135717.17381-1-wiagn233@outlook.com> References: <20230407135717.17381-1-wiagn233@outlook.com> X-TMN: [nNTPEQTo0Bhv5r1cvL4/uFupfPtdtKHv] X-ClientProxiedBy: SJ0PR05CA0050.namprd05.prod.outlook.com (2603:10b6:a03:33f::25) To TY3P286MB2611.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:252::12) X-Microsoft-Original-Message-ID: <20230407135717.17381-2-wiagn233@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TY3P286MB2611:EE_|OSZP286MB2208:EE_ X-MS-Office365-Filtering-Correlation-Id: 06502207-85d5-4d3a-6c2c-08db37701912 X-MS-Exchange-SLBlob-MailProps: AZnQBsB9Xmovywdyt6JbrF6Sw9xOtJae8eAFX/kUmKMBqm+sVascIKU2uWF3XKRikHKwdka+SBO8uxvhewXfSyGZmOPhQbXYiwjKRVACNi0R//MBuUwkmy7kyefyyAvL6lk15aYwyGwNCvYrScfvMrw5rQeOD9O66JRvWCEOIwwsp35x6pZf/WE39CdWv586DPibk5hFnACgGDslYl/U0VbKcojktCtQCietmQZx8HUjVGVyozaWPKBDG9rjmvltBvwm9e0uUbOye1Wp5hKuAw2Xtu9P0ifxt8xLozr14niIrhC7mUkmSTgBWJOK+X9g908VWgkoZ6Pu7H3na8HRFDzcpJ3uBwlN9GcrWq0mvXd+g4YytSo7qqozDFOLMfMOFflGEdAZv02eW5hDPWy0t1q3p9VrBWnuJ/CwuJ22D8PfXqMCZeKZFze/uaC9WpfpW/XPWriLMRq6LD3GE8Pn5MLsH/n3mXUeGrBzL1OTNwYhDxywHrJ8t+sYz3mEsc1KYqIsbgfETh8GO8ovtnQlrBrTlzSYyw5yeAWQ1S1UHayYaErBzTS0YpvgZOZo3VwQbqfC6GJGLuD8HjZstlR3cYakpMcHg1VTZwZs7v1xtNOKdhsoeqLQ8fhfdqPLh6+3QfO2dFz+aM33+kui/VgANDtkamq7sbwF1husbLw9lav3tc3XvOVYXM65zHp+cIVtYkmUOGlxtHC4hY7SNOPm8j6xRzWYvYDbMHs3voeB7Imnbs6Lzm7q/hjZIV0iX6VO1ap58bzFF4k= X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: iUdwcPyEkkkHEZe2DaR3MuRkpzrOvOJaG3SdjDRCud6SGrVihJTdYAmtkCUsNNDmyotDzeB3hJKoIJSTpP+nxU7+6FevfmNH8mK/EosaKBzuABuwHzylleAXw9g2f4/BcwXlCY7eAz5vAYlriog4U1GvbtNMGrc0MxHkweujisY0oX9XRVY0G9BNUecC0MUTmAPldMFQtw/S8w3MNGHXXp5ChQVJpJt92FBjB3cv8WhZCGVi1UUOBC+0FKgpuBDG+LXE7uOFmkkYXizHajZVCnGqwl1l2ilZh8vqV2xFO8NHb7htJZfcoY51oSgZKtfCnhe5YAoarFvVe7RrUDTFlFdItWRa/VEM2brd/kSgZLsa7Jv1CIb6jOOpaeNOhmZ/Gm5nTWKnaPXfUVltheIXjONCoajES05m5775zV4mi6uaVwegzsief8Tn87aP3XAR+Ak19SZA5Ljk+6cCQcS1fmM99XDtwmw7B69FhqfiNzpsWxMsgO2wbIgeNZqbUyl1WWxWR6Ucjd6hlEytmWXCl0ZSXcHwjsyOP7Bp1cE0L0dM1MIn+cPdNQUqP9dc7pRzh+WAZcjXNw9jjZPdVBCzHFxw2LRAoxSC60rIl2gSVhmx6bNmgaYVsmzwgosVFvIg X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: H0S63I4sV1BIOnit698YPm22dQqVpfXk2D9N3zfQ7ZUbpdnmudxrf1Vtf+BiuAnTis3wEtJ3jTCPivCiIrZqsl/mVRT3cqi/41oZ2sj22efaciM/cAsTU9nhjlONGha8fauBFd9Of1qc1jZb+Hp/OandWpd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g== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 06502207-85d5-4d3a-6c2c-08db37701912 X-MS-Exchange-CrossTenant-AuthSource: TY3P286MB2611.JPNP286.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Apr 2023 13:58:00.3296 (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: OSZP286MB2208 X-Spam-Status: No, score=0.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762527474179945568?= X-GMAIL-MSGID: =?utf-8?q?1762527474179945568?= The X-Powers AXP15060 is a PMIC seen on Starfive Visionfive 2 board. Add relative compatible item and CPUSLDO support for it. Signed-off-by: Shengyu Qu --- Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml b/Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml index b7a8747d5fa0..e150a8bf040a 100644 --- a/Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml +++ b/Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml @@ -92,6 +92,7 @@ properties: - x-powers,axp806 - x-powers,axp809 - x-powers,axp813 + - x-powers,axp15060 - items: - const: x-powers,axp228 - const: x-powers,axp221 @@ -260,7 +261,7 @@ properties: Defines the work frequency of DC-DC in kHz. patternProperties: - "^(([a-f])?ldo[0-9]|dcdc[0-7a-e]|ldo(_|-)io(0|1)|(dc1)?sw|rtc(_|-)ldo|drivevbus|dc5ldo)$": + "^(([a-f])?ldo[0-9]|dcdc[0-7a-e]|ldo(_|-)io(0|1)|cpusldo|(dc1)?sw|rtc(_|-)ldo|drivevbus|dc5ldo)$": $ref: /schemas/regulator/regulator.yaml# type: object unevaluatedProperties: false From patchwork Fri Apr 7 13:57:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shengyu Qu X-Patchwork-Id: 80850 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp318199vqo; Fri, 7 Apr 2023 07:18:01 -0700 (PDT) X-Google-Smtp-Source: AKy350bas3YVuyDgmubaPtgtpTMVwcQKw1fFhm7BnA/3zfvsXC/rqjbC/XKnpcJjZwhLR/Xuhqdi X-Received: by 2002:a17:906:7c0b:b0:947:d49e:a599 with SMTP id t11-20020a1709067c0b00b00947d49ea599mr2294053ejo.54.1680877081467; Fri, 07 Apr 2023 07:18:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1680877081; cv=pass; d=google.com; s=arc-20160816; b=WW7MMKJrlrxk2Pf8G1Ei2YDnxNIbxZx6k13puQ8DPXlXe9/q2cTjbzHAC7dpgcadFg WCMyE2znxhm0GzSsJpJgCPoxCf9+6LAEDj9UysoBzEQWDFyynin1/gQxaqu0PCgd/jgk +q2ai6XQnnrUkPLUtoBwV3+PHsmleZ3o/BUy1Tu94NViPNuHDhqY4vuBeLJaSjSMN7eC NqbdRagddOSkJwswu+q3vKOPyHGq8w4P0/M4BH8P2dxeukN3vzkr2N0SzwpMnLSuc4WP +3nPoTigygym4zFXjzZQXD3tkswCmZqKqgJ2hOJQjV6b6ascxawx9Wgq/JJi82/bWxeV WVxQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=oNdydiTzpJyZPcWN9hLe/9xc7/iFeYG00TjZn+iHq5g=; b=RuwjgMpY4K+4UAzZ6um5OfMQuCshXL9eOKbAZYJtd8SRrLW0iXXCvZ1sN/zNsrbkv8 ykElFkIzjGexso6ORZVswvGr6Vg9fEbwMqjB1P6NlWFATKPaPax0pagZtzmFBG6/aoPT 4tuWgK0cmreSR0N3ymXf2+8iHxqvjPAyUKlbRo5ezbnuHnCX46Gbk8Rn+C7rNLNrYCeD Th3uJOR5dBGPOwZPbc1BUQ3fWPvsVDybkgeTOSqpIvpyYGOgAXTifbd6V2F/gOW7Aaf5 vu4i/r4AepKAHGNon+7uINWLMYEYNhvys0uNwoIJ0we2zhxQSs2pr1U59Rj4koYf8CWP Vycg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@outlook.com header.s=selector1 header.b=itPtUJUh; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id zg19-20020a170907249300b008b17dfa77fdsi1661348ejb.127.2023.04.07.07.17.37; Fri, 07 Apr 2023 07:18:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@outlook.com header.s=selector1 header.b=itPtUJUh; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240393AbjDGN6i (ORCPT + 99 others); Fri, 7 Apr 2023 09:58:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231278AbjDGN6V (ORCPT ); Fri, 7 Apr 2023 09:58:21 -0400 Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01olkn2031.outbound.protection.outlook.com [40.92.98.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93DD99749; Fri, 7 Apr 2023 06:58:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eF9XzQ8PtINTBtnblJE7AcXA+tsfnSHS/1Su/DMjxtV6Y5o0uomhAOtUBJwsz/lxyLjBEopFEdfZ9zXUYO1iCVG90kJiSi08Py7rMZ1yBdg+Wdcu9rizaFFCdlmV7EfKrqV+PpBnfNOMI1mC1a5U8GefwWqk5iiDD7iKrMeGqUsB/+sGh5JxFpPIRA2sWbSKwQuFlPwiDW7J5egPVPZtzM/5VCCXjcz6TPrTEkUWiPomm6hNDN1ABCxOgzuZvo+jp2iSqB3zemhFZFwWWxmVrxRZ47f0kDNi160hfWhMQcFAFEdhSlA4gMtc3B5PM8drP75jrd1iskXcKP9QLCYz4A== 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=oNdydiTzpJyZPcWN9hLe/9xc7/iFeYG00TjZn+iHq5g=; b=WcRQs4TppN1BQ+bWk43NFBMVrTn+16HXOihU2W/19DhsSQv/ibMHKWjuhwjvM06ujsHWXBDQK+/nK/458YGJYiiZYGf9tu9b48zGsys493ATA95nr415BO97289AeVBbMLw/sB3rn0nQt7moa8jmjyazT21anUSLoOeWbH/3ySvhJJgGCKONRBqbjJD1IqjTXXq0AE8BXD43U8lJE8XfVXR7YU4pLUxTycPUcKatQ5ERKLMvWzd8gZttx6r69s4CrLH82FhK1nZ8k5LxVeAAiYBCgo7sMog1zDOpjFjOPCCjdsyj7LsXRL2idN5PZT6gq9BF4xqnd8D0eqYu87J/iw== 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=oNdydiTzpJyZPcWN9hLe/9xc7/iFeYG00TjZn+iHq5g=; b=itPtUJUh85QvhXdT3mRmZledDXuJKBptohfv3OiBnwlzBP2rW+c3UM/CJ5tBE/XZto5416AMVoZGgdof6LMX376rZLEjMtkFETLGobLPas5SZgdXxlgTRuPcqimiUdzDlQpvrcmpbKHcNqW3rd5ue8Lo1GTAnk7QYGVGGdlABZSEscAMFmKVZ1vVJW9/Gw+Dfu50yA0FUi7fjyIsGqGwItmHI7KEIi+71WcpHzohwdY4Jx+jBGk5LbTyRsuf4e88qlk3ndfAz0dUFN2jl5I6eSd3VK/kYolTeA20BBjK/XbdAnhqD0ZLWQ331QJRQwhfJEDIrQZB01S1qRHH6D49kg== Received: from TY3P286MB2611.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:252::12) by OSZP286MB2208.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:18d::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.35; Fri, 7 Apr 2023 13:58:09 +0000 Received: from TY3P286MB2611.JPNP286.PROD.OUTLOOK.COM ([fe80::d190:6e4d:5a1e:59a]) by TY3P286MB2611.JPNP286.PROD.OUTLOOK.COM ([fe80::d190:6e4d:5a1e:59a%3]) with mapi id 15.20.6277.033; Fri, 7 Apr 2023 13:58:09 +0000 From: Shengyu Qu To: lee@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, wens@csie.org, lgirdwood@gmail.com, broonie@kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Shengyu Qu Subject: [PATCH v1 2/4] mfd: axp20x: Add support for AXP15060 PMIC Date: Fri, 7 Apr 2023 21:57:15 +0800 Message-ID: X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230407135717.17381-1-wiagn233@outlook.com> References: <20230407135717.17381-1-wiagn233@outlook.com> X-TMN: [8jLPweEiGCVYOHPXxBCM4a4KLpncsKCM] X-ClientProxiedBy: SJ0PR05CA0050.namprd05.prod.outlook.com (2603:10b6:a03:33f::25) To TY3P286MB2611.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:252::12) X-Microsoft-Original-Message-ID: <20230407135717.17381-3-wiagn233@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TY3P286MB2611:EE_|OSZP286MB2208:EE_ X-MS-Office365-Filtering-Correlation-Id: 7529450c-a03c-49e2-c9cc-08db37701e6f X-MS-Exchange-SLBlob-MailProps: AZnQBsB9Xmovywdyt6JbrF6Sw9xOtJaeKrvFgPLelwiouCg4lKyp/mivNGUePMraoF3KmOqFohA53T9g9bwD/Fp+kD1S9TbusjhWIVvAZsAvM+aeFhJ3Te9JQjCElerYfXKZ0s5Fu2+P37WrTWp/Q6riYgeOu0y4sOsJsLzCBr6XForwolHAKFH2fjCGs5bwALpC63fHdDIzZizYY9MhnOtbPYBkHjk4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DCoI4QnTeVBUXGC8Jyc0DMt4FE1RUJdh+tpgeM/b0EumySXXZys4W12iLp6yMg7+LODGwlwIn9nCIr7TPwNokAFIw5iE8empxo1GmJqb+fTm6scO5NROyCElo7wYFoUHIykTxbeHW4rSNS3yOMWpyh2lFHvogwWT8x7hMjW1a4Te/pbx0rIPCYHLQC3opnnrBjtFBDgVY7ODKF7KY2u/lqunveZMFPA6tcBhgdgfTt6prKphwPs+vkl04bsrF9M1BfOREU0Uix1Yzhsl4CDQ0ESOOuinwHJ/tCwEu/yhw5bmOtMN6usrlvIejcuBd7fbD1B/uaSlbHf9FAf4r91Da/WwiukUyZXLPOI1V0tQTzRAdYBTWAlQlbyNiQ== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7529450c-a03c-49e2-c9cc-08db37701e6f X-MS-Exchange-CrossTenant-AuthSource: TY3P286MB2611.JPNP286.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Apr 2023 13:58:09.5352 (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: OSZP286MB2208 X-Spam-Status: No, score=0.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762527366232420352?= X-GMAIL-MSGID: =?utf-8?q?1762527366232420352?= The AXP15060 is a PMIC chip produced by X-Powers, and could be connected via an I2C bus. Describe the regmap and the MFD bits, along with the registers exposed via I2C. Eventually advertise the device using a new compatible string and add support for power off the system. The driver would disable PEK function if IRQ is not configured in device tree, since some boards (For example, Starfive Visionfive 2) didn't connect IRQ line of PMIC to SOC. GPIO function isn't enabled in this commit, since its configuration operation is different from any existing AXP PMICs and needs logic modification on existing driver. GPIO support might come in later patches. Signed-off-by: Shengyu Qu --- drivers/mfd/axp20x-i2c.c | 2 + drivers/mfd/axp20x.c | 90 ++++++++++++++++++++++++++++++++++++++ include/linux/mfd/axp20x.h | 85 +++++++++++++++++++++++++++++++++++ 3 files changed, 177 insertions(+) diff --git a/drivers/mfd/axp20x-i2c.c b/drivers/mfd/axp20x-i2c.c index f49fbd307958..b4f5cb457117 100644 --- a/drivers/mfd/axp20x-i2c.c +++ b/drivers/mfd/axp20x-i2c.c @@ -65,6 +65,7 @@ static const struct of_device_id axp20x_i2c_of_match[] = { { .compatible = "x-powers,axp223", .data = (void *)AXP223_ID }, { .compatible = "x-powers,axp803", .data = (void *)AXP803_ID }, { .compatible = "x-powers,axp806", .data = (void *)AXP806_ID }, + { .compatible = "x-powers,axp15060", .data = (void *)AXP15060_ID }, { }, }; MODULE_DEVICE_TABLE(of, axp20x_i2c_of_match); @@ -78,6 +79,7 @@ static const struct i2c_device_id axp20x_i2c_id[] = { { "axp223", 0 }, { "axp803", 0 }, { "axp806", 0 }, + { "axp15060", 0 }, { }, }; MODULE_DEVICE_TABLE(i2c, axp20x_i2c_id); diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c index 01a6bbb6d266..42ec27a4dfc4 100644 --- a/drivers/mfd/axp20x.c +++ b/drivers/mfd/axp20x.c @@ -43,6 +43,7 @@ static const char * const axp20x_model_names[] = { "AXP806", "AXP809", "AXP813", + "AXP15060", }; static const struct regmap_range axp152_writeable_ranges[] = { @@ -168,6 +169,31 @@ static const struct regmap_access_table axp806_volatile_table = { .n_yes_ranges = ARRAY_SIZE(axp806_volatile_ranges), }; +static const struct regmap_range axp15060_writeable_ranges[] = { + regmap_reg_range(AXP15060_PWR_OUT_CTRL1, AXP15060_DCDC_MODE_CTRL2), + regmap_reg_range(AXP15060_OUTPUT_MONITOR_DISCHARGE, AXP15060_CPUSLDO_V_CTRL), + regmap_reg_range(AXP15060_PWR_WAKEUP_CTRL, AXP15060_PWR_DISABLE_DOWN_SEQ), + regmap_reg_range(AXP15060_PEK_KEY, AXP15060_PEK_KEY), + regmap_reg_range(AXP15060_IRQ1_EN, AXP15060_IRQ2_EN), + regmap_reg_range(AXP15060_IRQ1_STATE, AXP15060_IRQ2_STATE), +}; + +static const struct regmap_range axp15060_volatile_ranges[] = { + regmap_reg_range(AXP15060_STARTUP_SRC, AXP15060_STARTUP_SRC), + regmap_reg_range(AXP15060_PWR_WAKEUP_CTRL, AXP15060_PWR_DISABLE_DOWN_SEQ), + regmap_reg_range(AXP15060_IRQ1_STATE, AXP15060_IRQ2_STATE), +}; + +static const struct regmap_access_table axp15060_writeable_table = { + .yes_ranges = axp15060_writeable_ranges, + .n_yes_ranges = ARRAY_SIZE(axp15060_writeable_ranges), +}; + +static const struct regmap_access_table axp15060_volatile_table = { + .yes_ranges = axp15060_volatile_ranges, + .n_yes_ranges = ARRAY_SIZE(axp15060_volatile_ranges), +}; + static const struct resource axp152_pek_resources[] = { DEFINE_RES_IRQ_NAMED(AXP152_IRQ_PEK_RIS_EDGE, "PEK_DBR"), DEFINE_RES_IRQ_NAMED(AXP152_IRQ_PEK_FAL_EDGE, "PEK_DBF"), @@ -236,6 +262,11 @@ static const struct resource axp809_pek_resources[] = { DEFINE_RES_IRQ_NAMED(AXP809_IRQ_PEK_FAL_EDGE, "PEK_DBF"), }; +static const struct resource axp15060_pek_resources[] = { + DEFINE_RES_IRQ_NAMED(AXP15060_IRQ_PEK_RIS_EDGE, "PEK_DBR"), + DEFINE_RES_IRQ_NAMED(AXP15060_IRQ_PEK_FAL_EDGE, "PEK_DBF"), +}; + static const struct regmap_config axp152_regmap_config = { .reg_bits = 8, .val_bits = 8, @@ -281,6 +312,15 @@ static const struct regmap_config axp806_regmap_config = { .cache_type = REGCACHE_RBTREE, }; +static const struct regmap_config axp15060_regmap_config = { + .reg_bits = 8, + .val_bits = 8, + .wr_table = &axp15060_writeable_table, + .volatile_table = &axp15060_volatile_table, + .max_register = AXP15060_IRQ2_STATE, + .cache_type = REGCACHE_RBTREE, +}; + #define INIT_REGMAP_IRQ(_variant, _irq, _off, _mask) \ [_variant##_IRQ_##_irq] = { .reg_offset = (_off), .mask = BIT(_mask) } @@ -502,6 +542,23 @@ static const struct regmap_irq axp809_regmap_irqs[] = { INIT_REGMAP_IRQ(AXP809, GPIO0_INPUT, 4, 0), }; +static const struct regmap_irq axp15060_regmap_irqs[] = { + INIT_REGMAP_IRQ(AXP15060, DIE_TEMP_HIGH_LV1, 0, 0), + INIT_REGMAP_IRQ(AXP15060, DIE_TEMP_HIGH_LV2, 0, 1), + INIT_REGMAP_IRQ(AXP15060, DCDC1_V_LOW, 0, 2), + INIT_REGMAP_IRQ(AXP15060, DCDC2_V_LOW, 0, 3), + INIT_REGMAP_IRQ(AXP15060, DCDC3_V_LOW, 0, 4), + INIT_REGMAP_IRQ(AXP15060, DCDC4_V_LOW, 0, 5), + INIT_REGMAP_IRQ(AXP15060, DCDC5_V_LOW, 0, 6), + INIT_REGMAP_IRQ(AXP15060, DCDC6_V_LOW, 0, 7), + INIT_REGMAP_IRQ(AXP15060, PEK_LONG, 1, 0), + INIT_REGMAP_IRQ(AXP15060, PEK_SHORT, 1, 1), + INIT_REGMAP_IRQ(AXP15060, GPIO1_INPUT, 1, 2), + INIT_REGMAP_IRQ(AXP15060, PEK_FAL_EDGE, 1, 3), + INIT_REGMAP_IRQ(AXP15060, PEK_RIS_EDGE, 1, 4), + INIT_REGMAP_IRQ(AXP15060, GPIO2_INPUT, 1, 5), +}; + static const struct regmap_irq_chip axp152_regmap_irq_chip = { .name = "axp152_irq_chip", .status_base = AXP152_IRQ1_STATE, @@ -581,6 +638,17 @@ static const struct regmap_irq_chip axp809_regmap_irq_chip = { .num_regs = 5, }; +static const struct regmap_irq_chip axp15060_regmap_irq_chip = { + .name = "axp15060", + .status_base = AXP15060_IRQ1_STATE, + .ack_base = AXP15060_IRQ1_STATE, + .unmask_base = AXP15060_IRQ1_EN, + .init_ack_masked = true, + .irqs = axp15060_regmap_irqs, + .num_irqs = ARRAY_SIZE(axp15060_regmap_irqs), + .num_regs = 2, +}; + static const struct mfd_cell axp20x_cells[] = { { .name = "axp20x-gpio", @@ -825,6 +893,16 @@ static const struct mfd_cell axp813_cells[] = { }, }; +static const struct mfd_cell axp15060_cells[] = { + { + .name = "axp221-pek", + .num_resources = ARRAY_SIZE(axp15060_pek_resources), + .resources = axp15060_pek_resources, + }, { + .name = "axp20x-regulator", + }, +}; + static int axp20x_power_off(struct sys_off_data *data) { struct axp20x_dev *axp20x = data->cb_data; @@ -934,6 +1012,18 @@ int axp20x_match_device(struct axp20x_dev *axp20x) */ axp20x->regmap_irq_chip = &axp803_regmap_irq_chip; break; + case AXP15060_ID: + /* Don't register the power key part if there is no interrupt line. */ + if (axp20x->irq > 0) { + axp20x->nr_cells = ARRAY_SIZE(axp15060_cells); + axp20x->cells = axp15060_cells; + } else { + axp20x->nr_cells = ARRAY_SIZE(axp806_cells); + axp20x->cells = axp806_cells; + } + axp20x->regmap_cfg = &axp15060_regmap_config; + axp20x->regmap_irq_chip = &axp15060_regmap_irq_chip; + break; default: dev_err(dev, "unsupported AXP20X ID %lu\n", axp20x->variant); return -EINVAL; diff --git a/include/linux/mfd/axp20x.h b/include/linux/mfd/axp20x.h index 2058194807bd..abc2bdc54bf5 100644 --- a/include/linux/mfd/axp20x.h +++ b/include/linux/mfd/axp20x.h @@ -21,6 +21,7 @@ enum axp20x_variants { AXP806_ID, AXP809_ID, AXP813_ID, + AXP15060_ID, NR_AXP20X_VARIANTS, }; @@ -131,6 +132,39 @@ enum axp20x_variants { /* Other DCDC regulator control registers are the same as AXP803 */ #define AXP813_DCDC7_V_OUT 0x26 +#define AXP15060_STARTUP_SRC 0x00 +#define AXP15060_PWR_OUT_CTRL1 0x10 +#define AXP15060_PWR_OUT_CTRL2 0x11 +#define AXP15060_PWR_OUT_CTRL3 0x12 +#define AXP15060_DCDC1_V_CTRL 0x13 +#define AXP15060_DCDC2_V_CTRL 0x14 +#define AXP15060_DCDC3_V_CTRL 0x15 +#define AXP15060_DCDC4_V_CTRL 0x16 +#define AXP15060_DCDC5_V_CTRL 0x17 +#define AXP15060_DCDC6_V_CTRL 0x18 +#define AXP15060_ALDO1_V_CTRL 0x19 +#define AXP15060_DCDC_MODE_CTRL1 0x1a +#define AXP15060_DCDC_MODE_CTRL2 0x1b +#define AXP15060_OUTPUT_MONITOR_DISCHARGE 0x1e +#define AXP15060_IRQ_PWROK_VOFF 0x1f +#define AXP15060_ALDO2_V_CTRL 0x20 +#define AXP15060_ALDO3_V_CTRL 0x21 +#define AXP15060_ALDO4_V_CTRL 0x22 +#define AXP15060_ALDO5_V_CTRL 0x23 +#define AXP15060_BLDO1_V_CTRL 0x24 +#define AXP15060_BLDO2_V_CTRL 0x25 +#define AXP15060_BLDO3_V_CTRL 0x26 +#define AXP15060_BLDO4_V_CTRL 0x27 +#define AXP15060_BLDO5_V_CTRL 0x28 +#define AXP15060_CLDO1_V_CTRL 0x29 +#define AXP15060_CLDO2_V_CTRL 0x2a +#define AXP15060_CLDO3_V_CTRL 0x2b +#define AXP15060_CLDO4_V_CTRL 0x2d +#define AXP15060_CPUSLDO_V_CTRL 0x2e +#define AXP15060_PWR_WAKEUP_CTRL 0x31 +#define AXP15060_PWR_DISABLE_DOWN_SEQ 0x32 +#define AXP15060_PEK_KEY 0x36 + /* Interrupt */ #define AXP152_IRQ1_EN 0x40 #define AXP152_IRQ2_EN 0x41 @@ -139,6 +173,11 @@ enum axp20x_variants { #define AXP152_IRQ2_STATE 0x49 #define AXP152_IRQ3_STATE 0x4a +#define AXP15060_IRQ1_EN 0x40 +#define AXP15060_IRQ2_EN 0x41 +#define AXP15060_IRQ1_STATE 0x48 +#define AXP15060_IRQ2_STATE 0x49 + #define AXP20X_IRQ1_EN 0x40 #define AXP20X_IRQ2_EN 0x41 #define AXP20X_IRQ3_EN 0x42 @@ -222,6 +261,8 @@ enum axp20x_variants { #define AXP22X_GPIO_STATE 0x94 #define AXP22X_GPIO_PULL_DOWN 0x95 +#define AXP15060_CLDO4_GPIO2_MODESET 0x2c + /* Battery */ #define AXP20X_CHRG_CC_31_24 0xb0 #define AXP20X_CHRG_CC_23_16 0xb1 @@ -419,6 +460,33 @@ enum { AXP813_REG_ID_MAX, }; +enum { + AXP15060_DCDC1 = 0, + AXP15060_DCDC2, + AXP15060_DCDC3, + AXP15060_DCDC4, + AXP15060_DCDC5, + AXP15060_DCDC6, + AXP15060_ALDO1, + AXP15060_ALDO2, + AXP15060_ALDO3, + AXP15060_ALDO4, + AXP15060_ALDO5, + AXP15060_BLDO1, + AXP15060_BLDO2, + AXP15060_BLDO3, + AXP15060_BLDO4, + AXP15060_BLDO5, + AXP15060_CLDO1, + AXP15060_CLDO2, + AXP15060_CLDO3, + AXP15060_CLDO4, + AXP15060_CPUSLDO, + AXP15060_SW, + AXP15060_RTC_LDO, + AXP15060_REG_ID_MAX, +}; + /* IRQs */ enum { AXP152_IRQ_LDO0IN_CONNECT = 1, @@ -637,6 +705,23 @@ enum axp809_irqs { AXP809_IRQ_GPIO0_INPUT, }; +enum axp15060_irqs { + AXP15060_IRQ_DIE_TEMP_HIGH_LV1 = 1, + AXP15060_IRQ_DIE_TEMP_HIGH_LV2, + AXP15060_IRQ_DCDC1_V_LOW, + AXP15060_IRQ_DCDC2_V_LOW, + AXP15060_IRQ_DCDC3_V_LOW, + AXP15060_IRQ_DCDC4_V_LOW, + AXP15060_IRQ_DCDC5_V_LOW, + AXP15060_IRQ_DCDC6_V_LOW, + AXP15060_IRQ_PEK_LONG, + AXP15060_IRQ_PEK_SHORT, + AXP15060_IRQ_GPIO1_INPUT, + AXP15060_IRQ_PEK_FAL_EDGE, + AXP15060_IRQ_PEK_RIS_EDGE, + AXP15060_IRQ_GPIO2_INPUT, +}; + struct axp20x_dev { struct device *dev; int irq; From patchwork Fri Apr 7 13:57:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shengyu Qu X-Patchwork-Id: 80836 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp308664vqo; Fri, 7 Apr 2023 07:05:29 -0700 (PDT) X-Google-Smtp-Source: AKy350a6R/xsyna8tFWDLqwmsE+fLQYESiboBkI5j9tJOsKZj6VjFCgcbDCkCgXcNTO5Lu5nZ4ZY X-Received: by 2002:aa7:d452:0:b0:4fd:2674:4ff2 with SMTP id q18-20020aa7d452000000b004fd26744ff2mr2741954edr.11.1680876329147; Fri, 07 Apr 2023 07:05:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1680876329; cv=pass; d=google.com; s=arc-20160816; b=tPS8tLfxGZs9UwbG9Vm5Xx6IF86oin0nGPaUvjatxvK/YkgK3wUHrEJS05lOpBzxah HUhHbh0oO4iATOqQGyI9Aqd34gVgf3jaQYe3+UX5PB7Plt+3Qr//Bk2RWWkX8K1Vmp1p ckzOGJ3E1IIJIRTKV/DkHVlOeI7n7lAAWJ1opT6MEHeZQu4X/i7nmBioIvEOxZlaAuoo Nbyis3HVawaryFPVDJps1D0EIUfl/k00XUi6SqKg1lkLIYMmUhTPGnExuKn2wmKPOr+N 7gT5QIm5WgPxNfnRPPtnE9XVW8s6xwzb5OoXCKeVHitcCkf3iMHNw//fMy+lXhru2FR0 3I5A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=CrKf4PujbmJPhHSFgCGHii7KflE/PVCC1x+XAk3orLI=; b=lWB3wq7j0qqNFFZzmhLtNSSeH72M1E0KeXOagDpvWR+tQ9fKr5HRl0pzj27QuDtNJD nNSlA1BITBc5cJn4oxMDOlABDtpQQfuyrV+nUr/CTJwC24YcGqkOU9qfeVBhYNOVtN5c 7CvlJ6phz3q8AprklgFVuF2j2J6cKMbuM+Y3eTT1js8jWMj+BeeQEqxWNcJ3WYx+Jsi7 5b6vthzz0BYEp+COugfBIkNnbdehKT1xtSOKtmsjofXDOEB/JIH22G8pzGT4/+kcWvYv xiogJcM3Ttg5mdtM3rXav+IWgKN5+oTsWapiJGbf6XThwNZOn9iidpZz5Iz4alJMAPUH ly0A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@outlook.com header.s=selector1 header.b="DElawGX/"; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w21-20020a056402129500b004acc68a5878si3489552edv.274.2023.04.07.07.04.46; Fri, 07 Apr 2023 07:05:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@outlook.com header.s=selector1 header.b="DElawGX/"; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239610AbjDGN6k (ORCPT + 99 others); Fri, 7 Apr 2023 09:58:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231724AbjDGN6X (ORCPT ); Fri, 7 Apr 2023 09:58:23 -0400 Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01olkn2031.outbound.protection.outlook.com [40.92.98.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 651329B; Fri, 7 Apr 2023 06:58:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PtWylB1XSExU67Z41xHH4qbTWerawkKwWrBQaQedsaXFRfmfioBJ5vbIMi4k8e6wBUhGtmq09+X1WB+DPEvvsypQGyjzA39oHqA9/rpfYod1D0mZRXDHSbRtXOwDqEsmsydgL9svDDPRfkgQDJaD0mCYEEOxn6ts4s7ALfNVryfftPCXXR9A0FvhxJefUgQqWFhbuwvPrAvqqIffc+OT5iX9KplexXDMH3zMosWC5TdyVAeIkJ6LK0TmNH5kDR9g7iu4Ql9M53v13M9bAfN8t3L0bI3JUFNyATSKo6rwrq0X9SWh3zQZsE1pDoVPVU5qW/pWG1ttqnBSPC4LurZcpA== 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=CrKf4PujbmJPhHSFgCGHii7KflE/PVCC1x+XAk3orLI=; b=Cr4AhyHMLCtXRjDjapOvTq1LtPr4oYHK6l5u5e4++g32kOOYpUizDBswFjT1aCTR1RpSiRrIP3057c4QCBB5OJ/Zm8/cqYUkoYiXD/eysu2Zd92O9FinriF3p9HrEt7ZyMRk6+CntDoWZ27gKiVY0ysfbWc4hmt43j8FNhQewWoPPPd0DXeeIzLh7Pq2Ivv2cB48xWN6mAAG2HB8L9K/GuhLID28sZZUwybHIVYTT5u17b3IvjLgJt6+iEQfQ7vTVxj+v01Nvu00EQ+DbtlIIaioNk6NcEC7aNGHyYrK50hS27PRYnxVd8LudTLjeFZAJ80y/p/osXYktnvx2nS4qw== 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=CrKf4PujbmJPhHSFgCGHii7KflE/PVCC1x+XAk3orLI=; b=DElawGX/43okMmVv7wDXqGyT2smW3yProVDX05Ik02XxJ7chjH6KaoD2QFbisSO95fhd1V3b36iHSdY15rVtBPTCtN7YgXsFJlC3eGTZe26ju/G26+1Ht4IiIqjmai5uawdsrZ3IvA3nyR5qzyiEXKT97Bzpr/lzaY3qeFFgPcgTixtGB5dvx+6lB1VpWJ3VRupmGSBDfrFhAUcqEZ+24ATZ/OKdYDl3yp/No0raYd+uGZ68NIn0jCWeBBZcEh88GjM5Q9E+ei/XAfbFSsoiTCQFfXIz/cwiFfYeYgS0eHfDC/k43Osmtd8ofeBxllcrgJf2Uq8rNJZ/8gYbx00JuA== Received: from TY3P286MB2611.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:252::12) by OSZP286MB2208.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:18d::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.35; Fri, 7 Apr 2023 13:58:16 +0000 Received: from TY3P286MB2611.JPNP286.PROD.OUTLOOK.COM ([fe80::d190:6e4d:5a1e:59a]) by TY3P286MB2611.JPNP286.PROD.OUTLOOK.COM ([fe80::d190:6e4d:5a1e:59a%3]) with mapi id 15.20.6277.033; Fri, 7 Apr 2023 13:58:16 +0000 From: Shengyu Qu To: lee@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, wens@csie.org, lgirdwood@gmail.com, broonie@kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Shengyu Qu Subject: [PATCH v1 3/4] regulator: axp20x: Add AXP15060 support Date: Fri, 7 Apr 2023 21:57:16 +0800 Message-ID: X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230407135717.17381-1-wiagn233@outlook.com> References: <20230407135717.17381-1-wiagn233@outlook.com> X-TMN: [7t6j8pVS9R2Y9n88xJJx4cfTTjqa8BWr] X-ClientProxiedBy: SJ0PR05CA0050.namprd05.prod.outlook.com (2603:10b6:a03:33f::25) To TY3P286MB2611.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:252::12) X-Microsoft-Original-Message-ID: <20230407135717.17381-4-wiagn233@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TY3P286MB2611:EE_|OSZP286MB2208:EE_ X-MS-Office365-Filtering-Correlation-Id: 21ef9863-b671-45f0-76d5-08db377022d9 X-MS-Exchange-SLBlob-MailProps: AZnQBsB9Xmovywdyt6JbrF6Sw9xOtJae5pVK+uvqGxEGEVNklWX8e9kfgIBfZDO8uZsYza1DSxY6oKRnHMC0+rUy4/lU5W9fhlTmI0zlRo+/u1vLRiKI+PqUGoGFegJD0BPBsWxP4HLT9sYylA8ynZJNJeG+/nWMivVX8m5Wvx4yFjg0lnKu2c2Ib+BLeYSlsE0CCkco6O7tTZw6RRB2FTb+F83k+ZwbvmyS70x+SGE3fnDpBme08U3b7Xx/VU23/mBsnKaPCkNQ2wqZcfUZhYr8hJblADCFWYoyvhJeTVUqaMiutSuXBO1p83K5XCNlBS3A6NEJ0PlDus1Khj7kFBY1/aUibGTcTAX9mwf+HX7jw9fp4DX7gI6UFfYOlNXUlWdOBnUFfc9PP8jyWqw6WYL1zjCX8wya7L+pxttSKJGhMJqJhMhTfKs8zltvR3fLbtLIjb0kHwbOVMU5uvphAvFqi0WUT1XCIdl7HIyqBTOc9+Qc2/vqwWvzyzcWWZsr4t/0eOQsMbAdzC/FEJsFfpGcF2rX/mIhNesCiLRpP0R67Mii42XnXjwnctWKR4yXcyvA9NEsbPP1wbSwHu0c5D+roR1t/VauR+yVWsnyYC7M4Zby1/tnOL1C79nU1NgFAbBg8ywkwtvN88KZtEz7FkY0Fr/WBF2pc/4koJVsowfQ+7M6xU5fEs3ZCF4h106nd+J+zzEGGyy2oRPa3KileM9/m9sRLYqWMuNp7yds+dFjPr5D4J/uPcF5iwejEIjBk6QzWRmPeGU= X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bjepaX4T2SyECUQfmeQ0VI1z859meCvcBggk7sDw67ajC1mht6Vt6j+KkI+Yzomt6mNTNmroJnPus7AFw2vIZE7Lb/1hSyUPUeEktBUFrywOwLURByZtchUKgLOj2WwXMi3rp/2BnbmC84GEgPJTOZIN3Bu/E0Z7TBws2am2lvh3gfKQAnwD+45VagqP62gb7wX01762z3XwPs32XVDZh8Y0PwEVcf6ulgxKC13P7NfmCOQoOLn2nxnvGR5DGln9kCu6zydurlFTBxyu+77Z4ypNNqydge9+WLh+DJRiHC8mgduB3ndEI4YDcf0hYOkDRUdNZPiSXnaKN4WZIXrGmZzVsvJo3Gx2x901Toj3na+UineVNUjZr/SE8OruHFruvU0agLO+IIb35wtpJ6Noi/bEXQcqzb0BcWRwJdduGdYfdODSgQqc+kG+842tG5XNYWspLDvSA6j9SOyO8rBFgcWIwikLt9CfVxX/631tfXfC4twsxhYdpTeOhap94YCy4Kf45BmQKL+ON623LJS1r6SClSweWnqQCsprAcQe53nKNDYQTXwagA31PP6Dzv+uDVFiU/jPAtsW2wGrMAhjzvFymu6fNnImD7SFIm9j8OSwGljCsLKs6m6CQWyyHm1G X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-Mess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M+jerlT+Tk+iOqIDRtRJCmJo+7RCBJlo93TrQ/cYueQiklFspBfWw3OmN1Jst0uVO5oxAoplXO5DnKMdJpYEqE7LWo/aL6yAb2KehP2lWFmN3RCuOXP2Bd/giqtOuY3Q1JiefNUNcN9yOF/41HPQf78qaYIPuGy+Vd70vCYQ== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 21ef9863-b671-45f0-76d5-08db377022d9 X-MS-Exchange-CrossTenant-AuthSource: TY3P286MB2611.JPNP286.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Apr 2023 13:58:16.8140 (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: OSZP286MB2208 X-Spam-Status: No, score=0.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762526577964819705?= X-GMAIL-MSGID: =?utf-8?q?1762526577964819705?= The AXP15060 is a typical I2C-controlled PMIC, seen on multiple boards with different default register value. Current driver is tested on Starfive Visionfive 2. The RTCLDO is fixed, and cannot even be turned on or off,. On top of that, its voltage is customisable (either 1.8V or 3.3V). We pretend it's a fixed 1.8V regulator since other AXP driver also do like this. Also, BSP code ignores this regulator and it's not used according to VF2 schematic. Describe the AXP15060's voltage settings and switch registers, how the voltages are encoded, and connect this to the MFD device via its regulator ID. Signed-off-by: Shengyu Qu --- drivers/regulator/axp20x-regulator.c | 229 ++++++++++++++++++++++++++- 1 file changed, 221 insertions(+), 8 deletions(-) diff --git a/drivers/regulator/axp20x-regulator.c b/drivers/regulator/axp20x-regulator.c index d260c442b788..ece4af93df7b 100644 --- a/drivers/regulator/axp20x-regulator.c +++ b/drivers/regulator/axp20x-regulator.c @@ -270,6 +270,74 @@ #define AXP813_PWR_OUT_DCDC7_MASK BIT_MASK(6) +#define AXP15060_DCDC1_V_CTRL_MASK GENMASK(4, 0) +#define AXP15060_DCDC2_V_CTRL_MASK GENMASK(6, 0) +#define AXP15060_DCDC3_V_CTRL_MASK GENMASK(6, 0) +#define AXP15060_DCDC4_V_CTRL_MASK GENMASK(6, 0) +#define AXP15060_DCDC5_V_CTRL_MASK GENMASK(6, 0) +#define AXP15060_DCDC6_V_CTRL_MASK GENMASK(4, 0) +#define AXP15060_ALDO1_V_CTRL_MASK GENMASK(4, 0) +#define AXP15060_ALDO2_V_CTRL_MASK GENMASK(4, 0) +#define AXP15060_ALDO3_V_CTRL_MASK GENMASK(4, 0) +#define AXP15060_ALDO4_V_CTRL_MASK GENMASK(4, 0) +#define AXP15060_ALDO5_V_CTRL_MASK GENMASK(4, 0) +#define AXP15060_BLDO1_V_CTRL_MASK GENMASK(4, 0) +#define AXP15060_BLDO2_V_CTRL_MASK GENMASK(4, 0) +#define AXP15060_BLDO3_V_CTRL_MASK GENMASK(4, 0) +#define AXP15060_BLDO4_V_CTRL_MASK GENMASK(4, 0) +#define AXP15060_BLDO5_V_CTRL_MASK GENMASK(4, 0) +#define AXP15060_CLDO1_V_CTRL_MASK GENMASK(4, 0) +#define AXP15060_CLDO2_V_CTRL_MASK GENMASK(4, 0) +#define AXP15060_CLDO3_V_CTRL_MASK GENMASK(4, 0) +#define AXP15060_CLDO4_V_CTRL_MASK GENMASK(5, 0) +#define AXP15060_CPUSLDO_V_CTRL_MASK GENMASK(3, 0) + +#define AXP15060_PWR_OUT_DCDC1_MASK BIT_MASK(0) +#define AXP15060_PWR_OUT_DCDC2_MASK BIT_MASK(1) +#define AXP15060_PWR_OUT_DCDC3_MASK BIT_MASK(2) +#define AXP15060_PWR_OUT_DCDC4_MASK BIT_MASK(3) +#define AXP15060_PWR_OUT_DCDC5_MASK BIT_MASK(4) +#define AXP15060_PWR_OUT_DCDC6_MASK BIT_MASK(5) +#define AXP15060_PWR_OUT_ALDO1_MASK BIT_MASK(0) +#define AXP15060_PWR_OUT_ALDO2_MASK BIT_MASK(1) +#define AXP15060_PWR_OUT_ALDO3_MASK BIT_MASK(2) +#define AXP15060_PWR_OUT_ALDO4_MASK BIT_MASK(3) +#define AXP15060_PWR_OUT_ALDO5_MASK BIT_MASK(4) +#define AXP15060_PWR_OUT_BLDO1_MASK BIT_MASK(5) +#define AXP15060_PWR_OUT_BLDO2_MASK BIT_MASK(6) +#define AXP15060_PWR_OUT_BLDO3_MASK BIT_MASK(7) +#define AXP15060_PWR_OUT_BLDO4_MASK BIT_MASK(0) +#define AXP15060_PWR_OUT_BLDO5_MASK BIT_MASK(1) +#define AXP15060_PWR_OUT_CLDO1_MASK BIT_MASK(2) +#define AXP15060_PWR_OUT_CLDO2_MASK BIT_MASK(3) +#define AXP15060_PWR_OUT_CLDO3_MASK BIT_MASK(4) +#define AXP15060_PWR_OUT_CLDO4_MASK BIT_MASK(5) +#define AXP15060_PWR_OUT_CPUSLDO_MASK BIT_MASK(6) +#define AXP15060_PWR_OUT_SW_MASK BIT_MASK(7) + +#define AXP15060_DCDC23_POLYPHASE_DUAL_MASK BIT_MASK(6) +#define AXP15060_DCDC46_POLYPHASE_DUAL_MASK BIT_MASK(7) + +#define AXP15060_DCDC234_500mV_START 0x00 +#define AXP15060_DCDC234_500mV_STEPS 70 +#define AXP15060_DCDC234_500mV_END \ + (AXP15060_DCDC234_500mV_START + AXP15060_DCDC234_500mV_STEPS) +#define AXP15060_DCDC234_1220mV_START 0x47 +#define AXP15060_DCDC234_1220mV_STEPS 16 +#define AXP15060_DCDC234_1220mV_END \ + (AXP15060_DCDC234_1220mV_START + AXP15060_DCDC234_1220mV_STEPS) +#define AXP15060_DCDC234_NUM_VOLTAGES 88 + +#define AXP15060_DCDC5_800mV_START 0x00 +#define AXP15060_DCDC5_800mV_STEPS 32 +#define AXP15060_DCDC5_800mV_END \ + (AXP15060_DCDC5_800mV_START + AXP15060_DCDC5_800mV_STEPS) +#define AXP15060_DCDC5_1140mV_START 0x21 +#define AXP15060_DCDC5_1140mV_STEPS 35 +#define AXP15060_DCDC5_1140mV_END \ + (AXP15060_DCDC5_1140mV_START + AXP15060_DCDC5_1140mV_STEPS) +#define AXP15060_DCDC5_NUM_VOLTAGES 69 + #define AXP_DESC_IO(_family, _id, _match, _supply, _min, _max, _step, _vreg, \ _vmask, _ereg, _emask, _enable_val, _disable_val) \ [_family##_##_id] = { \ @@ -1001,6 +1069,104 @@ static const struct regulator_desc axp813_regulators[] = { AXP22X_PWR_OUT_CTRL2, AXP22X_PWR_OUT_DC1SW_MASK), }; +static const struct linear_range axp15060_dcdc234_ranges[] = { + REGULATOR_LINEAR_RANGE(500000, + AXP15060_DCDC234_500mV_START, + AXP15060_DCDC234_500mV_END, + 10000), + REGULATOR_LINEAR_RANGE(1220000, + AXP15060_DCDC234_1220mV_START, + AXP15060_DCDC234_1220mV_END, + 20000), +}; + +static const struct linear_range axp15060_dcdc5_ranges[] = { + REGULATOR_LINEAR_RANGE(800000, + AXP15060_DCDC5_800mV_START, + AXP15060_DCDC5_800mV_END, + 10000), + REGULATOR_LINEAR_RANGE(1140000, + AXP15060_DCDC5_1140mV_START, + AXP15060_DCDC5_1140mV_END, + 20000), +}; + +static const struct regulator_desc axp15060_regulators[] = { + AXP_DESC(AXP15060, DCDC1, "dcdc1", "vin1", 1500, 3400, 100, + AXP15060_DCDC1_V_CTRL, AXP15060_DCDC1_V_CTRL_MASK, + AXP15060_PWR_OUT_CTRL1, AXP15060_PWR_OUT_DCDC1_MASK), + AXP_DESC_RANGES(AXP15060, DCDC2, "dcdc2", "vin2", + axp15060_dcdc234_ranges, AXP15060_DCDC234_NUM_VOLTAGES, + AXP15060_DCDC2_V_CTRL, AXP15060_DCDC2_V_CTRL_MASK, + AXP15060_PWR_OUT_CTRL1, AXP15060_PWR_OUT_DCDC2_MASK), + AXP_DESC_RANGES(AXP15060, DCDC3, "dcdc3", "vin3", + axp15060_dcdc234_ranges, AXP15060_DCDC234_NUM_VOLTAGES, + AXP15060_DCDC3_V_CTRL, AXP15060_DCDC3_V_CTRL_MASK, + AXP15060_PWR_OUT_CTRL1, AXP15060_PWR_OUT_DCDC3_MASK), + AXP_DESC_RANGES(AXP15060, DCDC4, "dcdc4", "vin4", + axp15060_dcdc234_ranges, AXP15060_DCDC234_NUM_VOLTAGES, + AXP15060_DCDC4_V_CTRL, AXP15060_DCDC4_V_CTRL_MASK, + AXP15060_PWR_OUT_CTRL1, AXP15060_PWR_OUT_DCDC4_MASK), + AXP_DESC_RANGES(AXP15060, DCDC5, "dcdc5", "vin5", + axp15060_dcdc5_ranges, AXP15060_DCDC5_NUM_VOLTAGES, + AXP15060_DCDC5_V_CTRL, AXP15060_DCDC5_V_CTRL_MASK, + AXP15060_PWR_OUT_CTRL1, AXP15060_PWR_OUT_DCDC5_MASK), + AXP_DESC(AXP15060, DCDC6, "dcdc6", "vin6", 500, 3400, 100, + AXP15060_DCDC6_V_CTRL, AXP15060_DCDC6_V_CTRL_MASK, + AXP15060_PWR_OUT_CTRL1, AXP15060_PWR_OUT_DCDC6_MASK), + AXP_DESC(AXP15060, ALDO1, "aldo1", "aldoin", 700, 3300, 100, + AXP15060_ALDO1_V_CTRL, AXP15060_ALDO1_V_CTRL_MASK, + AXP15060_PWR_OUT_CTRL2, AXP15060_PWR_OUT_ALDO1_MASK), + AXP_DESC(AXP15060, ALDO2, "aldo2", "aldoin", 700, 3300, 100, + AXP15060_ALDO2_V_CTRL, AXP15060_ALDO2_V_CTRL_MASK, + AXP15060_PWR_OUT_CTRL2, AXP15060_PWR_OUT_ALDO2_MASK), + AXP_DESC(AXP15060, ALDO3, "aldo3", "aldoin", 700, 3300, 100, + AXP15060_ALDO3_V_CTRL, AXP15060_ALDO3_V_CTRL_MASK, + AXP15060_PWR_OUT_CTRL2, AXP15060_PWR_OUT_ALDO3_MASK), + AXP_DESC(AXP15060, ALDO4, "aldo4", "aldoin", 700, 3300, 100, + AXP15060_ALDO4_V_CTRL, AXP15060_ALDO4_V_CTRL_MASK, + AXP15060_PWR_OUT_CTRL2, AXP15060_PWR_OUT_ALDO4_MASK), + AXP_DESC(AXP15060, ALDO5, "aldo5", "aldoin", 700, 3300, 100, + AXP15060_ALDO5_V_CTRL, AXP15060_ALDO5_V_CTRL_MASK, + AXP15060_PWR_OUT_CTRL2, AXP15060_PWR_OUT_ALDO5_MASK), + AXP_DESC(AXP15060, BLDO1, "bldo1", "bldoin", 700, 3300, 100, + AXP15060_BLDO1_V_CTRL, AXP15060_BLDO1_V_CTRL_MASK, + AXP15060_PWR_OUT_CTRL2, AXP15060_PWR_OUT_BLDO1_MASK), + AXP_DESC(AXP15060, BLDO2, "bldo2", "bldoin", 700, 3300, 100, + AXP15060_BLDO2_V_CTRL, AXP15060_BLDO2_V_CTRL_MASK, + AXP15060_PWR_OUT_CTRL2, AXP15060_PWR_OUT_BLDO2_MASK), + AXP_DESC(AXP15060, BLDO3, "bldo3", "bldoin", 700, 3300, 100, + AXP15060_BLDO3_V_CTRL, AXP15060_BLDO3_V_CTRL_MASK, + AXP15060_PWR_OUT_CTRL2, AXP15060_PWR_OUT_BLDO3_MASK), + AXP_DESC(AXP15060, BLDO4, "bldo4", "bldoin", 700, 3300, 100, + AXP15060_BLDO4_V_CTRL, AXP15060_BLDO4_V_CTRL_MASK, + AXP15060_PWR_OUT_CTRL3, AXP15060_PWR_OUT_BLDO4_MASK), + AXP_DESC(AXP15060, BLDO5, "bldo5", "bldoin", 700, 3300, 100, + AXP15060_BLDO5_V_CTRL, AXP15060_BLDO5_V_CTRL_MASK, + AXP15060_PWR_OUT_CTRL3, AXP15060_PWR_OUT_BLDO5_MASK), + AXP_DESC(AXP15060, CLDO1, "cldo1", "cldoin", 700, 3300, 100, + AXP15060_CLDO1_V_CTRL, AXP15060_CLDO1_V_CTRL_MASK, + AXP15060_PWR_OUT_CTRL3, AXP15060_PWR_OUT_CLDO1_MASK), + AXP_DESC(AXP15060, CLDO2, "cldo2", "cldoin", 700, 3300, 100, + AXP15060_CLDO2_V_CTRL, AXP15060_CLDO2_V_CTRL_MASK, + AXP15060_PWR_OUT_CTRL3, AXP15060_PWR_OUT_CLDO2_MASK), + AXP_DESC(AXP15060, CLDO3, "cldo3", "cldoin", 700, 3300, 100, + AXP15060_CLDO3_V_CTRL, AXP15060_CLDO3_V_CTRL_MASK, + AXP15060_PWR_OUT_CTRL3, AXP15060_PWR_OUT_CLDO3_MASK), + AXP_DESC(AXP15060, CLDO4, "cldo4", "cldoin", 700, 4200, 100, + AXP15060_CLDO4_V_CTRL, AXP15060_CLDO4_V_CTRL_MASK, + AXP15060_PWR_OUT_CTRL3, AXP15060_PWR_OUT_CLDO4_MASK), + AXP_DESC(AXP15060, CPUSLDO, "cpusldo", NULL, 700, 1400, 50, + AXP15060_CPUSLDO_V_CTRL, AXP15060_CPUSLDO_V_CTRL_MASK, + AXP15060_PWR_OUT_CTRL3, AXP15060_PWR_OUT_CPUSLDO_MASK), + /* Supply comes from DCDC5 */ + AXP_DESC_SW(AXP15060, SW, "swout", NULL, + AXP15060_PWR_OUT_CTRL3, AXP15060_PWR_OUT_SW_MASK), + /* Supply comes from DCDC1 */ + AXP_DESC_FIXED(AXP15060, RTC_LDO, "rtc-ldo", NULL, 1800), + /* Supply comes from ALDO1 */ +}; + static int axp20x_set_dcdc_freq(struct platform_device *pdev, u32 dcdcfreq) { struct axp20x_dev *axp20x = dev_get_drvdata(pdev->dev.parent); @@ -1145,6 +1311,15 @@ static int axp20x_set_dcdc_workmode(struct regulator_dev *rdev, int id, u32 work workmode <<= id - AXP813_DCDC1; break; + case AXP15060_ID: + reg = AXP15060_DCDC_MODE_CTRL2; + if (id < AXP15060_DCDC1 || id > AXP15060_DCDC6) + return -EINVAL; + + mask = AXP22X_WORKMODE_DCDCX_MASK(id - AXP15060_DCDC1); + workmode <<= id - AXP15060_DCDC1; + break; + default: /* should not happen */ WARN_ON(1); @@ -1164,7 +1339,7 @@ static bool axp20x_is_polyphase_slave(struct axp20x_dev *axp20x, int id) /* * Currently in our supported AXP variants, only AXP803, AXP806, - * and AXP813 have polyphase regulators. + * AXP813 and AXP15060 have polyphase regulators. */ switch (axp20x->variant) { case AXP803_ID: @@ -1196,6 +1371,17 @@ static bool axp20x_is_polyphase_slave(struct axp20x_dev *axp20x, int id) } break; + case AXP15060_ID: + regmap_read(axp20x->regmap, AXP15060_DCDC_MODE_CTRL1, ®); + + switch (id) { + case AXP15060_DCDC3: + return !!(reg & AXP15060_DCDC23_POLYPHASE_DUAL_MASK); + case AXP15060_DCDC6: + return !!(reg & AXP15060_DCDC46_POLYPHASE_DUAL_MASK); + } + break; + default: return false; } @@ -1217,6 +1403,7 @@ static int axp20x_regulator_probe(struct platform_device *pdev) u32 workmode; const char *dcdc1_name = axp22x_regulators[AXP22X_DCDC1].name; const char *dcdc5_name = axp22x_regulators[AXP22X_DCDC5].name; + const char *aldo1_name = axp15060_regulators[AXP15060_ALDO1].name; bool drivevbus = false; switch (axp20x->variant) { @@ -1252,6 +1439,10 @@ static int axp20x_regulator_probe(struct platform_device *pdev) drivevbus = of_property_read_bool(pdev->dev.parent->of_node, "x-powers,drive-vbus-en"); break; + case AXP15060_ID: + regulators = axp15060_regulators; + nregulators = AXP15060_REG_ID_MAX; + break; default: dev_err(&pdev->dev, "Unsupported AXP variant: %ld\n", axp20x->variant); @@ -1278,8 +1469,9 @@ static int axp20x_regulator_probe(struct platform_device *pdev) continue; /* - * Regulators DC1SW and DC5LDO are connected internally, - * so we have to handle their supply names separately. + * Regulators DC1SW, DC5LDO and RTCLDO on AXP15060 are + * connected internally, so we have to handle their supply + * names separately. * * We always register the regulators in proper sequence, * so the supply names are correctly read. See the last @@ -1288,7 +1480,8 @@ static int axp20x_regulator_probe(struct platform_device *pdev) */ if ((regulators == axp22x_regulators && i == AXP22X_DC1SW) || (regulators == axp803_regulators && i == AXP803_DC1SW) || - (regulators == axp809_regulators && i == AXP809_DC1SW)) { + (regulators == axp809_regulators && i == AXP809_DC1SW) || + (regulators == axp15060_regulators && i == AXP15060_SW)) { new_desc = devm_kzalloc(&pdev->dev, sizeof(*desc), GFP_KERNEL); if (!new_desc) @@ -1300,7 +1493,8 @@ static int axp20x_regulator_probe(struct platform_device *pdev) } if ((regulators == axp22x_regulators && i == AXP22X_DC5LDO) || - (regulators == axp809_regulators && i == AXP809_DC5LDO)) { + (regulators == axp809_regulators && i == AXP809_DC5LDO) || + (regulators == axp15060_regulators && i == AXP15060_CPUSLDO)) { new_desc = devm_kzalloc(&pdev->dev, sizeof(*desc), GFP_KERNEL); if (!new_desc) @@ -1311,6 +1505,18 @@ static int axp20x_regulator_probe(struct platform_device *pdev) desc = new_desc; } + + if (regulators == axp15060_regulators && i == AXP15060_RTC_LDO) { + new_desc = devm_kzalloc(&pdev->dev, sizeof(*desc), + GFP_KERNEL); + if (!new_desc) + return -ENOMEM; + + *new_desc = regulators[i]; + new_desc->supply_name = aldo1_name; + desc = new_desc; + } + rdev = devm_regulator_register(&pdev->dev, desc, &config); if (IS_ERR(rdev)) { dev_err(&pdev->dev, "Failed to register %s\n", @@ -1329,19 +1535,26 @@ static int axp20x_regulator_probe(struct platform_device *pdev) } /* - * Save AXP22X DCDC1 / DCDC5 regulator names for later. + * Save AXP22X DCDC1 / DCDC5 / AXP15060 ALDO1 regulator names for later. */ if ((regulators == axp22x_regulators && i == AXP22X_DCDC1) || - (regulators == axp809_regulators && i == AXP809_DCDC1)) + (regulators == axp809_regulators && i == AXP809_DCDC1) || + (regulators == axp15060_regulators && i == AXP15060_DCDC1)) of_property_read_string(rdev->dev.of_node, "regulator-name", &dcdc1_name); if ((regulators == axp22x_regulators && i == AXP22X_DCDC5) || - (regulators == axp809_regulators && i == AXP809_DCDC5)) + (regulators == axp809_regulators && i == AXP809_DCDC5) || + (regulators == axp15060_regulators && i == AXP15060_DCDC5)) of_property_read_string(rdev->dev.of_node, "regulator-name", &dcdc5_name); + + if (regulators == axp15060_regulators && i == AXP15060_ALDO1) + of_property_read_string(rdev->dev.of_node, + "regulator-name", + &aldo1_name); } if (drivevbus) { From patchwork Fri Apr 7 13:57:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shengyu Qu X-Patchwork-Id: 80843 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp313989vqo; Fri, 7 Apr 2023 07:12:00 -0700 (PDT) X-Google-Smtp-Source: AKy350ZFPfEmtzR8MEYpwrq/DCZ1lpuknzjUkRI6kZkKrAnO+XBOP58h1u0TSJloKBi1sw4U94qE X-Received: by 2002:a17:903:650:b0:19e:6c02:801c with SMTP id kh16-20020a170903065000b0019e6c02801cmr2458342plb.14.1680876719995; Fri, 07 Apr 2023 07:11:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1680876719; cv=pass; d=google.com; s=arc-20160816; b=vR1heqf98m4cswUOvdNh1uusEvOAfml+kmdlzLafpYLBh8LdL5gdY6imF7IYsyASkE c2TcW2rY1MnmS1iabun+2mJKLAlOVwkINHT6MwdXb7BbmMi1d7VnihHQ2gAcYrCJ7NCL Phb62Yz7RHs5p3Q0YPZuKRBEPVhfZBPc31eCHLmNfLcoHQ2pN9/uLpfZDXkc8EFIaKkv dzC4GDdwMOEN0J3h2+OZ8pceXIXObuohyx85Td0ZNax/P4jQJkTOKH7aPPrYfKW37Byt APhBUstVGAAfXXTQvqJtQKXJkFdYIuWfaIU37hyFeXjJIIXFer4g2DpWILtDRT6ZTuND Oxsg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=oY4jFFNw0M7yIh4a0N5pllOYfkbx7ClJRAnYHXblrLw=; b=Bc96j7P0N12WLQ2UNDqhpG55XhR0dGflkIt2TRyCoudaSHSQnblEyY4ILUEO/TCTC3 2Z0UJf+8bd9JyrelEwQn/mR10/GIGtI1RW6zR7mbvVQzF9kp2uEA24mboaju6rUh8ax/ clVy3saXAILb15eVGyNeU4CIVXvuv+l2A9NggwBe/9PAZ/p/fPyOCDbUToyVDfXooIWN IBNyJtDnM6exX28tt2Z6MLHWvh8b/tmHJk21o3p0i+8o8bFyAp5hFRMiDeX/VG5GhvOf 2wmkWLirxiC0EN7FhOQ/s6ROKknijooBv0Zr+G4YZmTCcxfchBnhpV+ZHtnGIk/CxhjI no9A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@outlook.com header.s=selector1 header.b="Tb9CxNE/"; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c18-20020a170902d49200b001a11cf69a5csi4212589plg.612.2023.04.07.07.11.47; Fri, 07 Apr 2023 07:11:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@outlook.com header.s=selector1 header.b="Tb9CxNE/"; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240529AbjDGN6o (ORCPT + 99 others); Fri, 7 Apr 2023 09:58:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239506AbjDGN62 (ORCPT ); Fri, 7 Apr 2023 09:58:28 -0400 Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01olkn2037.outbound.protection.outlook.com [40.92.98.37]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E8C8E60; Fri, 7 Apr 2023 06:58:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ms09a2RE6+ACR+d6cvcJqY95K+FR+uEwMv4khoRx5WJVevBvRBLyNboGB2vKSS8icjaaPg857eL//PeEq2sqDvucIrtOxwUbCcQDxU8gTKKSZ3Ggojti7a6eWaqw4+BO88+6kGXftCz6a+YQJ5VaYET0vZZExL5CtM8tBho98bhwVHBWLOtdI0DvlTyRniuSlZHtBHy0bQekGNoNVXGVlfNTCVgcx86w93gAd/K9gX9ZTCzPN+Ku0NWHcYKfWN6cNpMQ7Sh+K8zwYoKNJm5GC4XRlV93GEmFuoRqA3fkD2JSi2CKQmmDjQTPU8bBCpAr7f8MFXooV9yJwG5MW0w+5Q== 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=oY4jFFNw0M7yIh4a0N5pllOYfkbx7ClJRAnYHXblrLw=; b=mFWCgLkVjwr9Ocsz1at5g0w7efdTls7pY53iLoG2219DyZLNUjOZx2oX/RNnpI4dapdwOHFw7EFm1CxBwlixKjvA45Ltv9DbKEUDmHuzzEGuvpJrUb4VWv1SBxCI7DEj7PWHXX3m4g9+ZMK5FmUKLP1ZB237H32mpIXoD+EG/x7bIBtEgAGCfB7/gbw6YDIst8sTY4tFQw1xY+APaIwPjw83j2Iygc/F9lW8Z6sF/XW8va9JoSbo9cDtlvn+KChnrbWY/NKqE9zHKd/5db3mIU1H5KfZoWHa8yMLabVXrSjcdpNbdtofDeHvK/QMhZlJDKcpzm4rsrcuLwcfh2GSQw== 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=oY4jFFNw0M7yIh4a0N5pllOYfkbx7ClJRAnYHXblrLw=; b=Tb9CxNE/MHc+d9k9mzh7dgUlUAqW4b1DNdMwOYQR2UVkrFy6F+1/I8PBFyue1npJdP8RKwAgt2fWUusGz0mXKUEWJzCs7jZew5pdb03Mr27beuov54xqugj6QYyARVemquhM7BvUO0Smx+7jMWVXphf4txAnJHY4M+3dwgqN7oS4X8oYLdYKO7Nksi5gjJl6GlZ/v/L53wWuLZe98rPPSQ4Sxjeh/6cTMStcfH7VcISxL5W7Q4FKP7bLtvaWJwdq6i+Iqe/di7aKiL3JvRGgw9l7K2Zyccl65Omeds91RL6bz6Vmh4pj+F0b3a23SMrWbkL9pDzDQAvv89WJo2Nfrg== Received: from TY3P286MB2611.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:252::12) by OSZP286MB2208.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:18d::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.35; Fri, 7 Apr 2023 13:58:23 +0000 Received: from TY3P286MB2611.JPNP286.PROD.OUTLOOK.COM ([fe80::d190:6e4d:5a1e:59a]) by TY3P286MB2611.JPNP286.PROD.OUTLOOK.COM ([fe80::d190:6e4d:5a1e:59a%3]) with mapi id 15.20.6277.033; Fri, 7 Apr 2023 13:58:23 +0000 From: Shengyu Qu To: lee@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, wens@csie.org, lgirdwood@gmail.com, broonie@kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Shengyu Qu Subject: [PATCH v1 4/4] regulator: axp20x: Set DCDC frequency only when property exists Date: Fri, 7 Apr 2023 21:57:17 +0800 Message-ID: X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230407135717.17381-1-wiagn233@outlook.com> References: <20230407135717.17381-1-wiagn233@outlook.com> X-TMN: [5ASSQoryS6FYig2XikeZf+LtwxXlTot1] X-ClientProxiedBy: SJ0PR05CA0050.namprd05.prod.outlook.com (2603:10b6:a03:33f::25) To TY3P286MB2611.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:252::12) X-Microsoft-Original-Message-ID: <20230407135717.17381-5-wiagn233@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TY3P286MB2611:EE_|OSZP286MB2208:EE_ X-MS-Office365-Filtering-Correlation-Id: 7c052bec-f708-4899-5961-08db3770269f X-MS-Exchange-SLBlob-MailProps: AZnQBsB9Xmovywdyt6JbrF6Sw9xOtJaeu8ZRRwqj0GRz5gUysH2WYhzzjKQ5md5abvB2PUv/ROwRO2RXuix4ilWx9K2hwmd58vFtPYtzciewEPFndLjvEpkfqB7HbxgyjZTunatWUdtDt9NoMtrSFmcWOrvLjuOb88AEUhYHhIyPtwXm+0wakOL1YvGb1Cq90WB/xr9pTpSuGk9K0ieQsFf8q0b13LNCaMtCswVkcCXQvHjm93gfjupF8bX+SkkARiOZonTOpSo3DQ/GRL3kMr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hyZJy2k+XunPobIltBA7ufXnBv/urRJR5lrbfHaKfQcjwETI+Xe9O+VoG/cRpReCCSfQNNiLRHLkxMyEwcwYhjERgNYJmuOC1eEZ1PZ6eR+5btwOtODljmImBWiAD2ig7aQzizID73XO4k+XUNN5f4V0dHkHoEGNCCCOppq5Qj/2N/eVJB56x6knXuq3Oytkn+dPL+yBAzWlnCsi0X2GRfoAtdqby7PZoMTVziolMp0wezMK1S1bfx0950g+5r8xaB46TVv11gGd9e5Vz0hK+d4kr/tQ0vM26jUPHSaFcaDkmB4qpQfxpQVoW9Vzt0nRv2OFiIshCUH3GdRg== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7c052bec-f708-4899-5961-08db3770269f X-MS-Exchange-CrossTenant-AuthSource: TY3P286MB2611.JPNP286.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Apr 2023 13:58:23.0016 (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: OSZP286MB2208 X-Spam-Status: No, score=0.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762526987465788738?= X-GMAIL-MSGID: =?utf-8?q?1762526987465788738?= Current axp20x regulator driver would always set DCDC frequency even if there is no x-powers,dcdc-freq in device tree data. Causing meaningless warning info output on variants that do not support DCDC frequency modification. So only try to set DCDC frequency when there is frequency property. Signed-off-by: Shengyu Qu --- drivers/regulator/axp20x-regulator.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/regulator/axp20x-regulator.c b/drivers/regulator/axp20x-regulator.c index ece4af93df7b..12a12923bc7b 100644 --- a/drivers/regulator/axp20x-regulator.c +++ b/drivers/regulator/axp20x-regulator.c @@ -1247,10 +1247,10 @@ static int axp20x_regulator_parse_dt(struct platform_device *pdev) if (!regulators) { dev_warn(&pdev->dev, "regulators node not found\n"); } else { - of_property_read_u32(regulators, "x-powers,dcdc-freq", &dcdcfreq); - ret = axp20x_set_dcdc_freq(pdev, dcdcfreq); - if (ret < 0) { - dev_err(&pdev->dev, "Error setting dcdc frequency: %d\n", ret); + if (of_property_read_u32(regulators, "x-powers,dcdc-freq", &dcdcfreq) != -EINVAL) { + ret = axp20x_set_dcdc_freq(pdev, dcdcfreq); + if (ret < 0) + dev_err(&pdev->dev, "Error setting dcdc frequency: %d\n", ret); } of_node_put(regulators); }