From patchwork Tue Aug 22 08:45:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 13360354 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 E05B2EE49A3 for ; Tue, 22 Aug 2023 08:45:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=scA3slj2GnANfQZ9WmrZNWN3UDRBxFFiMbyHn692ZM4=; b=oA1s6++LebXz2dlBlA6hA3O4Zu rKOlvzjpzRIuJppKJSh6cuYsp2zjpRNX/Wvq311cNbUIJUa4YoQH2FGOSYB8WtUgJVryBdCNTT7qY feXI3vmPFpzo/S/Gj58icnIDOSBPM0v0fAGf+q2P9RyRuGecPIF9AZ+kGKhffqDBrOmyN57uiYevc v6TJ+ZbzEP0h5QwVPMqZQRAqYgEKKCXgERm3ERWyHm9DrZgicw6v2JrEa5FrwK37Mc4Y4q8n1lt2t tY2FJoGt00DmsfxyrqkrneVTQFNVJySzL79dixFqQT8ridH9cXdBuKmbAUporPFp3ZysXkCmAZSob Q7E8DU3A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qYN1A-00FU7G-2U; Tue, 22 Aug 2023 08:45:40 +0000 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qYN15-00FU2h-2n for linux-mediatek@lists.infradead.org; Tue, 22 Aug 2023 08:45:37 +0000 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-68a520dba33so1421169b3a.0 for ; Tue, 22 Aug 2023 01:45:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1692693933; x=1693298733; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=scA3slj2GnANfQZ9WmrZNWN3UDRBxFFiMbyHn692ZM4=; b=Y6BM3dWQ2i1ulThxW8v48ZRSijPKfGGDZU7YePxZx4AQcVIlA/ORIdCKMV08hkCpCY qPNYEzQkzeGYFKSMV8pGTxo2/wvqI8UxJHVruSp1Y+nVqJz8GWV514e3wRNI1sTiDPYK nUL7pKK3A3Qh1AOStKX69Lnb2vawQmrTGjUGY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692693933; x=1693298733; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=scA3slj2GnANfQZ9WmrZNWN3UDRBxFFiMbyHn692ZM4=; b=Wt6VhO/T/0+PR38IDBR4pjqoGsp/3Kjzg4sl1IDEdK8g0I0EQ3iWPLyhMxhqWYgV+I 1cW3tZx26FxGOhjItkLJ1lMMs8Xl3Cd5Xi0ictl5UvFXSJbiS3xUCSuN2K1h1zktA+w8 UfTGjZHCqTVD5fZ4ML8qC2gmT513UTvJ9W6NrXHQ4Lmi/bfMKZpomz0fMcJ35JgXorS8 vD3/1fuaxCKHrrb6Y3ozBbSemT7D7M03zex77mCbURnl6tkGhsFJLOmr9kDOZu54ExuK 2f8myJLWwGqfMUABRhXQrQcmJnnDfgOSMeBgnK1P2Xc3Uv+w/57EoSW2pE7grnf0pJQ8 MyeQ== X-Gm-Message-State: AOJu0YytyUtD+Fj547ySBwd+KsrPGwt0WXj1HFkXCSbDTgUgqlG38T68 brB34Hn0lGdfYgoCfMjIAblxEQ== X-Google-Smtp-Source: AGHT+IHW6ePGH6SgC29qM4b5i2IL+bnaOrlXSniE0MdltskRkrxsbx0tRAxYxqvSf6DSgpjVj78adQ== X-Received: by 2002:a05:6a00:1492:b0:68a:4312:e0d6 with SMTP id v18-20020a056a00149200b0068a4312e0d6mr7109893pfu.10.1692693932995; Tue, 22 Aug 2023 01:45:32 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:e619:3fa0:1a90:6bb0]) by smtp.gmail.com with ESMTPSA id s26-20020aa78d5a000000b00666b012baedsm7304790pfe.158.2023.08.22.01.45.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Aug 2023 01:45:32 -0700 (PDT) From: Chen-Yu Tsai To: Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Mark Brown Cc: Chen-Yu Tsai , Zhiyong Tao , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH v2 01/11] dt-bindings: mfd: mt6397: Split out compatible for MediaTek MT6366 PMIC Date: Tue, 22 Aug 2023 16:45:09 +0800 Message-ID: <20230822084520.564937-2-wenst@chromium.org> X-Mailer: git-send-email 2.42.0.rc1.204.g551eb34607-goog In-Reply-To: <20230822084520.564937-1-wenst@chromium.org> References: <20230822084520.564937-1-wenst@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230822_014535_901928_7D347EF9 X-CRM114-Status: GOOD ( 14.06 ) X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org The MT6366 PMIC is mostly, but not fully, compatible with MT6358. It has a different set of regulators. Specifically, it lacks the camera related VCAM* LDOs and VLDO28, but has additional VM18, VMDDR, and VSRAM_CORE LDOs. The PMICs contain a chip ID register that can be used to detect which exact model is preset, so it is possible to share a common base compatible string. Add a separate compatible for the MT6366 PMIC, with a fallback to the MT6358 PMIC. Fixes: 49be16305587 ("dt-bindings: mfd: Add compatible for the MediaTek MT6366 PMIC") Signed-off-by: Chen-Yu Tsai Acked-by: Krzysztof Kozlowski --- Dropped Conor's Reviewed-by tag as this patch is now completely different. Documentation/devicetree/bindings/mfd/mt6397.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/mfd/mt6397.txt b/Documentation/devicetree/bindings/mfd/mt6397.txt index 294693a8906c..10540aa7afa1 100644 --- a/Documentation/devicetree/bindings/mfd/mt6397.txt +++ b/Documentation/devicetree/bindings/mfd/mt6397.txt @@ -22,8 +22,9 @@ compatible: "mediatek,mt6323" for PMIC MT6323 "mediatek,mt6331" for PMIC MT6331 and MT6332 "mediatek,mt6357" for PMIC MT6357 - "mediatek,mt6358" for PMIC MT6358 and MT6366 + "mediatek,mt6358" for PMIC MT6358 "mediatek,mt6359" for PMIC MT6359 + "mediatek,mt6366", "mediatek,mt6358" for PMIC MT6366 "mediatek,mt6397" for PMIC MT6397 Optional subnodes: @@ -40,6 +41,7 @@ Optional subnodes: - compatible: "mediatek,mt6323-regulator" see ../regulator/mt6323-regulator.txt - compatible: "mediatek,mt6358-regulator" + - compatible: "mediatek,mt6366-regulator", "mediatek-mt6358-regulator" see ../regulator/mt6358-regulator.txt - compatible: "mediatek,mt6397-regulator" see ../regulator/mt6397-regulator.txt From patchwork Tue Aug 22 08:45:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 13360355 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 8B3D6EE49AB for ; Tue, 22 Aug 2023 08:45:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=k79wdmYHctxTtTviGEsItx8Rkhv7MYSzlD064SW+BWo=; b=T6xry1/k3LRYQJGSzOtUnLl7ej mbC9rqBMYdmmfCvt4desrM/dVbR811lgSbFCulx+hTpG0GGHCggd0ES03eX5z4/tvtG60I+1ihs3g 6yR93Qxf0nVIWs4NgO4U8aQeL89YkwyLEH5mqoXaB/dNZFfNCeW4Syn9GM5uA6YmjfhUtNyjW+cvc PAA5i5ROLXz21myZu6F5390NV7HQKe/nheuIsvFRZrBlOGQvG7iMT9l5v1xznoxOG17PTicFQxDrU XlhXqQSkTWDGArmx7p2vx8b5QX3F0eHaWpgsqBxHLVhsd3V5FonSWuXCaZ1c4HLaTVQjdpELOZZzW vPhlvUQw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qYN1L-00FUEQ-1b; Tue, 22 Aug 2023 08:45:51 +0000 Received: from mail-oa1-x31.google.com ([2001:4860:4864:20::31]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qYN17-00FU3m-18 for linux-mediatek@lists.infradead.org; Tue, 22 Aug 2023 08:45:39 +0000 Received: by mail-oa1-x31.google.com with SMTP id 586e51a60fabf-1cc61f514baso1443786fac.1 for ; Tue, 22 Aug 2023 01:45:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1692693935; x=1693298735; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=k79wdmYHctxTtTviGEsItx8Rkhv7MYSzlD064SW+BWo=; b=l3UNByXtp7EcL+5pV348GVt6NJLrnCD5W0g9jVmO89nbf6Dt9TJc7YhaUQr9r8jSi+ NTk+SdWvqrIUWXCWUNUfLZB8bFQ8+DFThbyCe1qmx/G4NGmarLbYM1uGQxD4M6rfqIPI Kat4JQ8Me81NQIcTYoTx+JFs3gDoEGAyzlc5E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692693935; x=1693298735; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=k79wdmYHctxTtTviGEsItx8Rkhv7MYSzlD064SW+BWo=; b=WW0/K+IukSJHJRLVP/UnRGLqjRe6cZoxqvgqe/7XhMLPxYgZZ89r5Yx40E5IB068w3 0pHwp9dgkHc/w0IJxVBQ4FqzFDKTZ8fabAQnQdRf7XO+Yym5QNAJ43Ogjeiu83ykeb9k tI/rAsvoSDOK+wnL0ltLW25VtjzQdgJqqGKU5r5MlMHOgC5rrYXpTqHWZf4EkX9/ylq6 LfFk26SaV6D15rP8DkfipUK2pvJq2F4eVJLufjkIXooOAyXm/FWxjzgy53CPJOWNMO/F XHDPffMnim7HrudtwjvfQZXLLKgh2nGLXeBibV9KeYClJVzM+LW/xJuWNhjj7Lh2Kwcq BYpQ== X-Gm-Message-State: AOJu0Ywsk8O8Ybq4C8B939yskKjq/tL4WZnO0cMoUGRCVEcju8LA83Up E9eVBAlaM6iGLlcZhxTqm5EiXg== X-Google-Smtp-Source: AGHT+IFrqNfX0Z2M1qPDMP5VU3WvMzTEBG6FxwX95QutkiDBAyygmWZFCFMonYMFDSbc3GnKB2Qo8A== X-Received: by 2002:a05:6870:211:b0:1c8:d72a:d6b4 with SMTP id j17-20020a056870021100b001c8d72ad6b4mr9470932oad.2.1692693935466; Tue, 22 Aug 2023 01:45:35 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:e619:3fa0:1a90:6bb0]) by smtp.gmail.com with ESMTPSA id s26-20020aa78d5a000000b00666b012baedsm7304790pfe.158.2023.08.22.01.45.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Aug 2023 01:45:35 -0700 (PDT) From: Chen-Yu Tsai To: Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Mark Brown Cc: Chen-Yu Tsai , Zhiyong Tao , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH v2 02/11] mfd: mt6358: Add registers for MT6366 specific regulators Date: Tue, 22 Aug 2023 16:45:10 +0800 Message-ID: <20230822084520.564937-3-wenst@chromium.org> X-Mailer: git-send-email 2.42.0.rc1.204.g551eb34607-goog In-Reply-To: <20230822084520.564937-1-wenst@chromium.org> References: <20230822084520.564937-1-wenst@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230822_014537_391634_D107DBCA X-CRM114-Status: GOOD ( 12.81 ) X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org The MT6366 PMIC, compared to the MT6358, does away with the VCAM* regulators. Two regulators VM18 and VMDDR reuse their register space. There's also a VSRAM type regulator VSRAM_CORE thats' split between the VCAM* register space and other parts. Add register address macros for these MT6366 specific regulators. Signed-off-by: Chen-Yu Tsai Reviewed-by: AngeloGioacchino Del Regno Acked-by: Lee Jones --- include/linux/mfd/mt6358/registers.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/include/linux/mfd/mt6358/registers.h b/include/linux/mfd/mt6358/registers.h index 5ea2590be710..d83e87298ac4 100644 --- a/include/linux/mfd/mt6358/registers.h +++ b/include/linux/mfd/mt6358/registers.h @@ -294,4 +294,21 @@ #define MT6358_AUD_TOP_INT_CON0 0x2228 #define MT6358_AUD_TOP_INT_STATUS0 0x2234 +/* + * MT6366 has no VCAM*, but has other regulators in its place. The names + * keep the MT6358 prefix for ease of use in the regulator driver. + */ +#define MT6358_LDO_VSRAM_CON5 0x1bf8 +#define MT6358_LDO_VM18_CON0 MT6358_LDO_VCAMA1_CON0 +#define MT6358_LDO_VM18_CON1 MT6358_LDO_VCAMA1_CON1 +#define MT6358_LDO_VM18_CON2 MT6358_LDO_VCAMA1_CON2 +#define MT6358_LDO_VMDDR_CON0 MT6358_LDO_VCAMA2_CON0 +#define MT6358_LDO_VMDDR_CON1 MT6358_LDO_VCAMA2_CON1 +#define MT6358_LDO_VMDDR_CON2 MT6358_LDO_VCAMA2_CON2 +#define MT6358_LDO_VSRAM_CORE_CON0 MT6358_LDO_VCAMD_CON0 +#define MT6358_LDO_VSRAM_CORE_DBG0 0x1cb6 +#define MT6358_LDO_VSRAM_CORE_DBG1 0x1cb8 +#define MT6358_VM18_ANA_CON0 MT6358_VCAMA1_ANA_CON0 +#define MT6358_VMDDR_ANA_CON0 MT6358_VCAMD_ANA_CON0 + #endif /* __MFD_MT6358_REGISTERS_H__ */ From patchwork Tue Aug 22 08:45:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 13360356 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 E173CEE4993 for ; Tue, 22 Aug 2023 08:45:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=jxGCtJ2Wep5efB+WkbsRfN8SMwC+vT6DRMJNr+uJtTM=; b=aDMjT3m3VSeroBnstZ0HUuzhR1 0LiEnNFfqDvHO53oq4X9wizOsMV+bunYdBBnc3uT3CTupVsH1m84hgmgLAjeW1wAA5y+8MPHyJqRY wUl6Ojiyioe+aK2bNkVPBJI/+qfdePN6E8dW6vmV4V7qw4qsC0Fi1kAIkzQU7OwdpA08EEcd2YJzP Ijm893428cpoOfwD80Kv1IH1cCX003d5rWXqo3hJ+XErJK5BhUWDJkpiId8EfgU5cBA61bHqAX5Fw KVjfz4tGRVS391a0jUOG3w9xZEKyckklthio+bTgpuRHe7FQCHDEGidBmW21e11Q8O/DyDhScLaVU EoASU+CQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qYN1P-00FUHG-24; Tue, 22 Aug 2023 08:45:55 +0000 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qYN18-00FU5d-1s for linux-mediatek@lists.infradead.org; Tue, 22 Aug 2023 08:45:41 +0000 Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-68a5457b930so1122191b3a.2 for ; Tue, 22 Aug 2023 01:45:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1692693938; x=1693298738; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=jxGCtJ2Wep5efB+WkbsRfN8SMwC+vT6DRMJNr+uJtTM=; b=cee35XBJgWrPIQZvclRYmKKPTK9TteoVtq9KR3/9hzVU2nQck7y1o5DKhwVRs7XFKK 4NNAL4bucDmYnAC41qmpYUalcs3WZJxxorUDN3ByYWT2Z+itOdYmg9JElY4L3SgA0z+D Aw6ZodFVgTHZEDCF6UcY5gD1H1sWwuxiB5K0g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692693938; x=1693298738; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jxGCtJ2Wep5efB+WkbsRfN8SMwC+vT6DRMJNr+uJtTM=; b=W9x8GZVrh2liXMFysHp56F5hwyj6U4cP/YdlJ/UJOxRiDcoWR9HqmS/kBW2HSyA166 FAMb7jG9F2n6b+zkU02I4cYeC/Ew4HNwiXyCw0NhcnW7wtI4ATbGWYfLBsayTLc/hU26 bjnl9LMNgzsplt1/DmhJcps9CLzfXbltlpjcXk3qlf9PUDxbmii4Hnhw/Ie+R2xoKqsF T3PlmYx+6whdyP1QVEvPOMur9XoMdGFuxPbdo7W0Jz03HP6frhTZn4mTsB3c4p1U0EDq uES2Bz9tUxGf05CIjZWVfn59lsHMeAgcNVTNt3fhLkwQn1a2nImY9pv08ubhoXPyRXIU xASQ== X-Gm-Message-State: AOJu0YzUV2tSecIREL4XXYPpBWNSKzAd/nwFQmMxKCCqC6UmipUGgOMc YF/7OO9lluIf4u+hLfOCjXuwUA== X-Google-Smtp-Source: AGHT+IFYd2YL0KrDWvgUIXKMErFKQPaxg058X5tel5M+GH8U6Yi8Ag0PHyjiaxw7yRafBPsTLXVK+A== X-Received: by 2002:a05:6a00:2389:b0:688:9516:f703 with SMTP id f9-20020a056a00238900b006889516f703mr8179341pfc.31.1692693937996; Tue, 22 Aug 2023 01:45:37 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:e619:3fa0:1a90:6bb0]) by smtp.gmail.com with ESMTPSA id s26-20020aa78d5a000000b00666b012baedsm7304790pfe.158.2023.08.22.01.45.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Aug 2023 01:45:37 -0700 (PDT) From: Chen-Yu Tsai To: Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Mark Brown Cc: Chen-Yu Tsai , Zhiyong Tao , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH v2 03/11] regulator: dt-bindings: mt6358: Convert to DT schema Date: Tue, 22 Aug 2023 16:45:11 +0800 Message-ID: <20230822084520.564937-4-wenst@chromium.org> X-Mailer: git-send-email 2.42.0.rc1.204.g551eb34607-goog In-Reply-To: <20230822084520.564937-1-wenst@chromium.org> References: <20230822084520.564937-1-wenst@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230822_014538_655244_D3914A40 X-CRM114-Status: GOOD ( 16.35 ) X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org Convert this from the old style text based binding to the new DT schema style. This will make adding the MT6366 portion easier. The examples have been trimmed down considerably, and the remaining entries now match what is seen in actual device trees. The original submitter seems to have left MediaTek, so instead the submitter and maintainer for the MT6366 binding is listed. Cc: Zhiyong Tao Signed-off-by: Chen-Yu Tsai --- .../regulator/mediatek,mt6358-regulator.yaml | 105 ++++++ .../bindings/regulator/mt6358-regulator.txt | 350 ------------------ 2 files changed, 105 insertions(+), 350 deletions(-) create mode 100644 Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml delete mode 100644 Documentation/devicetree/bindings/regulator/mt6358-regulator.txt diff --git a/Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml b/Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml new file mode 100644 index 000000000000..4d7924c5cc7d --- /dev/null +++ b/Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml @@ -0,0 +1,105 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/regulator/mediatek,mt6358-regulator.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: MediaTek MT6358 Regulator + +maintainers: + - Zhiyong Tao + +description: | + Regulator node of the PMIC. This node should under the PMIC's device node. + All voltage regulators provided by the PMIC are described as sub-nodes of + this node. + +properties: + compatible: + const: mediatek,mt6358-regulator + +patternProperties: + "^buck_v(core|dram1|gpu|modem|pa|proc1[12]|s[12])$": + description: Buck regulators + type: object + $ref: regulator.yaml# + unevaluatedProperties: false + + "^ldo_v(a|rf)12": + description: LDOs with fixed 1.2V output and 0~100/10mV tuning + type: object + $ref: regulator.yaml# + unevaluatedProperties: false + + "^ldo_v((aux|cn|io|rf)18|camio)": + description: LDOs with fixed 1.8V output and 0~100/10mV tuning + type: object + $ref: regulator.yaml# + unevaluatedProperties: false + + "^ldo_vxo22": + description: LDOs with fixed 2.2V output and 0~100/10mV tuning + type: object + $ref: regulator.yaml# + unevaluatedProperties: false + + "^ldo_v(aud|bif|cn|fe|io)28": + description: LDOs with fixed 2.8V output and 0~100/10mV tuning + type: object + $ref: regulator.yaml# + unevaluatedProperties: false + + "^ldo_vusb": + description: LDOs with fixed 3.0V output and 0~100/10mV tuning + type: object + $ref: regulator.yaml# + unevaluatedProperties: false + + "^ldo_vsram_(gpu|others|proc1[12])$": + description: LDOs with variable output + type: object + $ref: regulator.yaml# + unevaluatedProperties: false + + "^ldo_v(cama[12]|camd|cn33|dram2|efuse|emc|ibr|ldo28|mc|mch|sim[12])$": + description: LDOs with variable output and 0~100/10mV tuning + type: object + $ref: regulator.yaml# + unevaluatedProperties: false + +required: + - compatible + +additionalProperties: false + +examples: + - | + #include + + regulator { + compatible = "mediatek,mt6358-regulator"; + + buck_vgpu { + regulator-name = "vgpu"; + regulator-min-microvolt = <625000>; + regulator-max-microvolt = <900000>; + regulator-ramp-delay = <6250>; + regulator-enable-ramp-delay = <200>; + regulator-allowed-modes = ; + regulator-coupled-with = <&mt6358_vsram_gpu_reg>; + regulator-coupled-max-spread = <100000>; + }; + + ldo_vsram_gpu { + regulator-name = "vsram_gpu"; + regulator-min-microvolt = <850000>; + regulator-max-microvolt = <1000000>; + regulator-ramp-delay = <6250>; + regulator-enable-ramp-delay = <240>; + regulator-coupled-with = <&mt6358_vgpu_reg>; + regulator-coupled-max-spread = <100000>; + }; + }; + +... diff --git a/Documentation/devicetree/bindings/regulator/mt6358-regulator.txt b/Documentation/devicetree/bindings/regulator/mt6358-regulator.txt deleted file mode 100644 index b6384306db5c..000000000000 --- a/Documentation/devicetree/bindings/regulator/mt6358-regulator.txt +++ /dev/null @@ -1,350 +0,0 @@ -MediaTek MT6358 Regulator - -All voltage regulators provided by the MT6358 PMIC are described as the -subnodes of the MT6358 regulators node. Each regulator is named according -to its regulator type, buck_ and ldo_. The definition for each -of these nodes is defined using the standard binding for regulators at -Documentation/devicetree/bindings/regulator/regulator.txt. - -The valid names for regulators are:: -BUCK: - buck_vdram1, buck_vcore, buck_vpa, buck_vproc11, buck_vproc12, buck_vgpu, - buck_vs2, buck_vmodem, buck_vs1 -LDO: - ldo_vdram2, ldo_vsim1, ldo_vibr, ldo_vrf12, ldo_vio18, ldo_vusb, ldo_vcamio, - ldo_vcamd, ldo_vcn18, ldo_vfe28, ldo_vsram_proc11, ldo_vcn28, ldo_vsram_others, - ldo_vsram_gpu, ldo_vxo22, ldo_vefuse, ldo_vaux18, ldo_vmch, ldo_vbif28, - ldo_vsram_proc12, ldo_vcama1, ldo_vemc, ldo_vio28, ldo_va12, ldo_vrf18, - ldo_vcn33, ldo_vcama2, ldo_vmc, ldo_vldo28, ldo_vaud28, ldo_vsim2 - -Example: - - pmic { - compatible = "mediatek,mt6358"; - - mt6358regulator: mt6358regulator { - compatible = "mediatek,mt6358-regulator"; - - mt6358_vdram1_reg: buck_vdram1 { - regulator-compatible = "buck_vdram1"; - regulator-name = "vdram1"; - regulator-min-microvolt = <500000>; - regulator-max-microvolt = <2087500>; - regulator-ramp-delay = <12500>; - regulator-enable-ramp-delay = <0>; - regulator-always-on; - }; - - mt6358_vcore_reg: buck_vcore { - regulator-name = "vcore"; - regulator-min-microvolt = <500000>; - regulator-max-microvolt = <1293750>; - regulator-ramp-delay = <6250>; - regulator-enable-ramp-delay = <200>; - regulator-always-on; - }; - - mt6358_vpa_reg: buck_vpa { - regulator-name = "vpa"; - regulator-min-microvolt = <500000>; - regulator-max-microvolt = <3650000>; - regulator-ramp-delay = <50000>; - regulator-enable-ramp-delay = <250>; - }; - - mt6358_vproc11_reg: buck_vproc11 { - regulator-name = "vproc11"; - regulator-min-microvolt = <500000>; - regulator-max-microvolt = <1293750>; - regulator-ramp-delay = <6250>; - regulator-enable-ramp-delay = <200>; - regulator-always-on; - }; - - mt6358_vproc12_reg: buck_vproc12 { - regulator-name = "vproc12"; - regulator-min-microvolt = <500000>; - regulator-max-microvolt = <1293750>; - regulator-ramp-delay = <6250>; - regulator-enable-ramp-delay = <200>; - regulator-always-on; - }; - - mt6358_vgpu_reg: buck_vgpu { - regulator-name = "vgpu"; - regulator-min-microvolt = <500000>; - regulator-max-microvolt = <1293750>; - regulator-ramp-delay = <6250>; - regulator-enable-ramp-delay = <200>; - }; - - mt6358_vs2_reg: buck_vs2 { - regulator-name = "vs2"; - regulator-min-microvolt = <500000>; - regulator-max-microvolt = <2087500>; - regulator-ramp-delay = <12500>; - regulator-enable-ramp-delay = <0>; - regulator-always-on; - }; - - mt6358_vmodem_reg: buck_vmodem { - regulator-name = "vmodem"; - regulator-min-microvolt = <500000>; - regulator-max-microvolt = <1293750>; - regulator-ramp-delay = <6250>; - regulator-enable-ramp-delay = <900>; - regulator-always-on; - }; - - mt6358_vs1_reg: buck_vs1 { - regulator-name = "vs1"; - regulator-min-microvolt = <1000000>; - regulator-max-microvolt = <2587500>; - regulator-ramp-delay = <12500>; - regulator-enable-ramp-delay = <0>; - regulator-always-on; - }; - - mt6358_vdram2_reg: ldo_vdram2 { - regulator-name = "vdram2"; - regulator-min-microvolt = <600000>; - regulator-max-microvolt = <1800000>; - regulator-enable-ramp-delay = <3300>; - }; - - mt6358_vsim1_reg: ldo_vsim1 { - regulator-name = "vsim1"; - regulator-min-microvolt = <1700000>; - regulator-max-microvolt = <3100000>; - regulator-enable-ramp-delay = <540>; - }; - - mt6358_vibr_reg: ldo_vibr { - regulator-name = "vibr"; - regulator-min-microvolt = <1200000>; - regulator-max-microvolt = <3300000>; - regulator-enable-ramp-delay = <60>; - }; - - mt6358_vrf12_reg: ldo_vrf12 { - compatible = "regulator-fixed"; - regulator-name = "vrf12"; - regulator-min-microvolt = <1200000>; - regulator-max-microvolt = <1200000>; - regulator-enable-ramp-delay = <120>; - }; - - mt6358_vio18_reg: ldo_vio18 { - compatible = "regulator-fixed"; - regulator-name = "vio18"; - regulator-min-microvolt = <1800000>; - regulator-max-microvolt = <1800000>; - regulator-enable-ramp-delay = <2700>; - regulator-always-on; - }; - - mt6358_vusb_reg: ldo_vusb { - regulator-name = "vusb"; - regulator-min-microvolt = <3000000>; - regulator-max-microvolt = <3100000>; - regulator-enable-ramp-delay = <270>; - regulator-always-on; - }; - - mt6358_vcamio_reg: ldo_vcamio { - compatible = "regulator-fixed"; - regulator-name = "vcamio"; - regulator-min-microvolt = <1800000>; - regulator-max-microvolt = <1800000>; - regulator-enable-ramp-delay = <270>; - }; - - mt6358_vcamd_reg: ldo_vcamd { - regulator-name = "vcamd"; - regulator-min-microvolt = <900000>; - regulator-max-microvolt = <1800000>; - regulator-enable-ramp-delay = <270>; - }; - - mt6358_vcn18_reg: ldo_vcn18 { - compatible = "regulator-fixed"; - regulator-name = "vcn18"; - regulator-min-microvolt = <1800000>; - regulator-max-microvolt = <1800000>; - regulator-enable-ramp-delay = <270>; - }; - - mt6358_vfe28_reg: ldo_vfe28 { - compatible = "regulator-fixed"; - regulator-name = "vfe28"; - regulator-min-microvolt = <2800000>; - regulator-max-microvolt = <2800000>; - regulator-enable-ramp-delay = <270>; - }; - - mt6358_vsram_proc11_reg: ldo_vsram_proc11 { - regulator-name = "vsram_proc11"; - regulator-min-microvolt = <500000>; - regulator-max-microvolt = <1293750>; - regulator-ramp-delay = <6250>; - regulator-enable-ramp-delay = <240>; - regulator-always-on; - }; - - mt6358_vcn28_reg: ldo_vcn28 { - compatible = "regulator-fixed"; - regulator-name = "vcn28"; - regulator-min-microvolt = <2800000>; - regulator-max-microvolt = <2800000>; - regulator-enable-ramp-delay = <270>; - }; - - mt6358_vsram_others_reg: ldo_vsram_others { - regulator-name = "vsram_others"; - regulator-min-microvolt = <500000>; - regulator-max-microvolt = <1293750>; - regulator-ramp-delay = <6250>; - regulator-enable-ramp-delay = <240>; - regulator-always-on; - }; - - mt6358_vsram_gpu_reg: ldo_vsram_gpu { - regulator-name = "vsram_gpu"; - regulator-min-microvolt = <500000>; - regulator-max-microvolt = <1293750>; - regulator-ramp-delay = <6250>; - regulator-enable-ramp-delay = <240>; - }; - - mt6358_vxo22_reg: ldo_vxo22 { - compatible = "regulator-fixed"; - regulator-name = "vxo22"; - regulator-min-microvolt = <2200000>; - regulator-max-microvolt = <2200000>; - regulator-enable-ramp-delay = <120>; - regulator-always-on; - }; - - mt6358_vefuse_reg: ldo_vefuse { - regulator-name = "vefuse"; - regulator-min-microvolt = <1700000>; - regulator-max-microvolt = <1900000>; - regulator-enable-ramp-delay = <270>; - }; - - mt6358_vaux18_reg: ldo_vaux18 { - compatible = "regulator-fixed"; - regulator-name = "vaux18"; - regulator-min-microvolt = <1800000>; - regulator-max-microvolt = <1800000>; - regulator-enable-ramp-delay = <270>; - }; - - mt6358_vmch_reg: ldo_vmch { - regulator-name = "vmch"; - regulator-min-microvolt = <2900000>; - regulator-max-microvolt = <3300000>; - regulator-enable-ramp-delay = <60>; - }; - - mt6358_vbif28_reg: ldo_vbif28 { - compatible = "regulator-fixed"; - regulator-name = "vbif28"; - regulator-min-microvolt = <2800000>; - regulator-max-microvolt = <2800000>; - regulator-enable-ramp-delay = <270>; - }; - - mt6358_vsram_proc12_reg: ldo_vsram_proc12 { - regulator-name = "vsram_proc12"; - regulator-min-microvolt = <500000>; - regulator-max-microvolt = <1293750>; - regulator-ramp-delay = <6250>; - regulator-enable-ramp-delay = <240>; - regulator-always-on; - }; - - mt6358_vcama1_reg: ldo_vcama1 { - regulator-name = "vcama1"; - regulator-min-microvolt = <1800000>; - regulator-max-microvolt = <3000000>; - regulator-enable-ramp-delay = <270>; - }; - - mt6358_vemc_reg: ldo_vemc { - regulator-name = "vemc"; - regulator-min-microvolt = <2900000>; - regulator-max-microvolt = <3300000>; - regulator-enable-ramp-delay = <60>; - regulator-always-on; - }; - - mt6358_vio28_reg: ldo_vio28 { - compatible = "regulator-fixed"; - regulator-name = "vio28"; - regulator-min-microvolt = <2800000>; - regulator-max-microvolt = <2800000>; - regulator-enable-ramp-delay = <270>; - }; - - mt6358_va12_reg: ldo_va12 { - compatible = "regulator-fixed"; - regulator-name = "va12"; - regulator-min-microvolt = <1200000>; - regulator-max-microvolt = <1200000>; - regulator-enable-ramp-delay = <270>; - regulator-always-on; - }; - - mt6358_vrf18_reg: ldo_vrf18 { - compatible = "regulator-fixed"; - regulator-name = "vrf18"; - regulator-min-microvolt = <1800000>; - regulator-max-microvolt = <1800000>; - regulator-enable-ramp-delay = <120>; - }; - - mt6358_vcn33_reg: ldo_vcn33 { - regulator-name = "vcn33"; - regulator-min-microvolt = <3300000>; - regulator-max-microvolt = <3500000>; - regulator-enable-ramp-delay = <270>; - }; - - mt6358_vcama2_reg: ldo_vcama2 { - regulator-name = "vcama2"; - regulator-min-microvolt = <1800000>; - regulator-max-microvolt = <3000000>; - regulator-enable-ramp-delay = <270>; - }; - - mt6358_vmc_reg: ldo_vmc { - regulator-name = "vmc"; - regulator-min-microvolt = <1800000>; - regulator-max-microvolt = <3300000>; - regulator-enable-ramp-delay = <60>; - }; - - mt6358_vldo28_reg: ldo_vldo28 { - regulator-name = "vldo28"; - regulator-min-microvolt = <2800000>; - regulator-max-microvolt = <3000000>; - regulator-enable-ramp-delay = <270>; - }; - - mt6358_vaud28_reg: ldo_vaud28 { - compatible = "regulator-fixed"; - regulator-name = "vaud28"; - regulator-min-microvolt = <2800000>; - regulator-max-microvolt = <2800000>; - regulator-enable-ramp-delay = <270>; - }; - - mt6358_vsim2_reg: ldo_vsim2 { - regulator-name = "vsim2"; - regulator-min-microvolt = <1700000>; - regulator-max-microvolt = <3100000>; - regulator-enable-ramp-delay = <540>; - }; - }; - }; From patchwork Tue Aug 22 08:45:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 13360357 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 8A5F2EE49A8 for ; Tue, 22 Aug 2023 08:46:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=uWvqEYx7nigLStoTHfBNGDNnZRGlEQKlFX9KEKxxWao=; b=j8eJjlmi8lrY42vFTYObMX9a9S fq58LnXihOOY5pmVSd5i2qq8de7WE5vJXLotQeLnKnOXjmy4WosDjrTZjCi378HXLQbj/rI7rYyJo JcldFo/d0+dEb6HOsLlPBtJwjgPG9mC6Ez9hOGDjbIYAhK48cYgQunJ41xLqa/+cWd4TDLouvRE0I fcr5jpjPBRFmHDdVU22mueFfGJcUgWVfr/J7K2Ous2PxEkHhmj3C3n10ts+89QO4vZ+8Lewv6XBzf jc7C8v/Jjfbpzp9wUpVR3S14hnRRImF2EjS8BMsqL8WV1939LHjO7fBwIAdXlhvUm3eTvF0ny8LG/ z5muG/NA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qYN1X-00FUNe-1P; Tue, 22 Aug 2023 08:46:03 +0000 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qYN1D-00FU7J-19 for linux-mediatek@lists.infradead.org; Tue, 22 Aug 2023 08:45:44 +0000 Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-68a4025b5e8so1563854b3a.3 for ; Tue, 22 Aug 2023 01:45:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1692693940; x=1693298740; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=uWvqEYx7nigLStoTHfBNGDNnZRGlEQKlFX9KEKxxWao=; b=jZv7Hu3uyjMHvZQPJZuxOzNjrT44nxbUjsoA5wMpqxP3QTGgr5mvNpeRrAZlXVFI1O wjJnR3722qCjZYmkUdTqeAS3LQSGR/N+mgDw6oU5vf2UQsfQEbQ+8Mo5QAHXjek0D+4D +T0FFLVlm+5+pS+Qi2nVB5tZOW74+MqSDCjDM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692693940; x=1693298740; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uWvqEYx7nigLStoTHfBNGDNnZRGlEQKlFX9KEKxxWao=; b=Pyo8xkHYAaq/dZap4nxMFfiHzoPqLaaZs/wN1xAw50+QHtzxqANeKwqpcuYOlY1jgA eaOHDnsk1UY47MDz2sFeaLmjC9FXOcInl9SxNC9ZCpJE0udb95vnTaTXaoiEhbtBpBky tZppRdLSZARY5kYmkxUUWFNOtnH+VEx06MigP0Yx9ZmJrpLOVLsmoIhboVRMblk9ovZ3 3Xnr+C8BhZJ4DnvBAOYMp6t/qBOeY+bOs3/T4zKvqelRPL8uZqKH3FY1XlkRGkpHs/FQ XRpVMS0Hj0Kcbq52nX24Su4naNDlX9tpe0wCKXoP46mp4LcvDPYr8iUbknGGeJEmZTxM UXTQ== X-Gm-Message-State: AOJu0YwB67oxDhLqbYH4E9QmxMCk7R/6f+EtEnlHG43K1v39LyVSOcPI ElhA3DI88Jwt21lXbSxb3a5D9A== X-Google-Smtp-Source: AGHT+IFb23fhs9Apos2oL1dgOhgh6KyRZEOAL6GURDoRrpRHDeYzqpoHYXqhuvJFd8+IVfDagjd+2Q== X-Received: by 2002:a05:6a00:2190:b0:687:8417:ab51 with SMTP id h16-20020a056a00219000b006878417ab51mr7254197pfi.8.1692693940475; Tue, 22 Aug 2023 01:45:40 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:e619:3fa0:1a90:6bb0]) by smtp.gmail.com with ESMTPSA id s26-20020aa78d5a000000b00666b012baedsm7304790pfe.158.2023.08.22.01.45.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Aug 2023 01:45:40 -0700 (PDT) From: Chen-Yu Tsai To: Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Mark Brown Cc: Chen-Yu Tsai , Zhiyong Tao , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH v2 04/11] regulator: dt-bindings: mt6358: Add regulator supplies Date: Tue, 22 Aug 2023 16:45:12 +0800 Message-ID: <20230822084520.564937-5-wenst@chromium.org> X-Mailer: git-send-email 2.42.0.rc1.204.g551eb34607-goog In-Reply-To: <20230822084520.564937-1-wenst@chromium.org> References: <20230822084520.564937-1-wenst@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230822_014543_403482_7AA8C53C X-CRM114-Status: UNSURE ( 9.61 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org The MT6358 PMIC has various regulator power supply pins that should be supplied from external power sources or routed from one of its outputs. Add these regulator supplies to the binding. The names are the actual names from the datasheet, with hyphens replacing underscores. Signed-off-by: Chen-Yu Tsai --- .../regulator/mediatek,mt6358-regulator.yaml | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml b/Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml index 4d7924c5cc7d..82328fe17680 100644 --- a/Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml +++ b/Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml @@ -18,6 +18,41 @@ properties: compatible: const: mediatek,mt6358-regulator + vsys-ldo1-supply: + description: Supply for LDOs vfe28, vxo22, vcn28, vaux18, vaud28, vsim1, vusb, vbif28 + vsys-ldo2-supply: + description: Supply for LDOs vldo28, vio28, vmc, vmch, vsim2 + vsys-ldo3-supply: + description: Supply for LDOs vcn33, vcama1, vcama2, vemc, vibr + vsys-vcore-supply: + description: Supply for buck regulator vcore + vsys-vdram1-supply: + description: Supply for buck regulator vdram1 + vsys-vgpu-supply: + description: Supply for buck regulator vgpu + vsys-vmodem-supply: + description: Supply for buck regulator vmodem + vsys-vpa-supply: + description: Supply for buck regulator vpa + vsys-vproc11-supply: + description: Supply for buck regulator vproc11 + vsys-vproc12-supply: + description: Supply for buck regulator vproc12 + vsys-vs1-supply: + description: Supply for buck regulator vs1 + vsys-vs2-supply: + description: Supply for buck regulator vs2 + vs1-ldo1-supply: + description: Supply for LDOs vrf18, vefuse, vcn18, vcamio, vio18 + vs2-ldo1-supply: + description: Supply for LDOs vdram2 + vs2-ldo2-supply: + description: Supply for LDOs vrf12, va12 + vs2-ldo3-supply: + description: Supply for LDOs vsram-gpu, vsram-others, vsram-proc11, vsram-proc12 + vs2-ldo4-supply: + description: Supply for LDO vcamd + patternProperties: "^buck_v(core|dram1|gpu|modem|pa|proc1[12]|s[12])$": description: Buck regulators From patchwork Tue Aug 22 08:45:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 13360359 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 D2706EE49A3 for ; Tue, 22 Aug 2023 08:46:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=WLEot2bDhTp9fvAY+MekQ5I92rdYBwqTaNw+kjYI3xE=; b=NY4FxcvhyC962J/vx4eUYDX+Fb IXermB4+D3KHLVRZxOQN1nLtRujbKEUD+1KawS7t4QZ1lKtDrdzkMe8F62dCPEQ9dHthcZ3vptdAC +dqNthc2+LLYyOn24qQUr3daHP/1lCHFgp3JcrgXb+z+X2ln+fEf3IeJFceGxY2L74gzjNfdhuh/q CuVWA1E31A14L25iq/Md3h07aEEXdpgwNJS2Na2nfPUI3W0rARk811SkrZ2xjLbcQwCLUmDije3xV YPORaJC9lRFMc3ptOW3nNuEUy6+s2ILyLnlrPL4oIujfbPe7SS8KzxRkJxKHPoD3xCFwPwiuE4eR/ ukBG4pYA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qYN1f-00FUTO-2P; Tue, 22 Aug 2023 08:46:11 +0000 Received: from mail-oi1-x22f.google.com ([2607:f8b0:4864:20::22f]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qYN1G-00FU8z-0A for linux-mediatek@lists.infradead.org; Tue, 22 Aug 2023 08:45:48 +0000 Received: by mail-oi1-x22f.google.com with SMTP id 5614622812f47-3a85b9deeb3so1251220b6e.1 for ; Tue, 22 Aug 2023 01:45:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1692693943; x=1693298743; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=WLEot2bDhTp9fvAY+MekQ5I92rdYBwqTaNw+kjYI3xE=; b=bnm1i9X2gp09V0zgSPwBCRpNicnZuPQI0JQJOMCeX2jjLWF+2hvADTVUtkZqmkaHGQ NdznPI11uv+eYRR1cPob88YLm1ZYnwrdzCnxu7pnh4vyvrMmfHTssJwlEyr0V/DQ6pRc hnK1BHbAtK6RUrchYkV1DyVgM+wWCwGDzy1kw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692693943; x=1693298743; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WLEot2bDhTp9fvAY+MekQ5I92rdYBwqTaNw+kjYI3xE=; b=lw4yHGk3zS1cwboAGocZN4dMi2ohkK9wrmt1Z4Rfh4GeVv6GQV/voLsnuzd+R294IJ X1Ihj/9zpBxAFlNR5CezWm3OiTB1JI/TCgW1PdTcIL0V+lffXrNfpbvJuXSq9ud/kOmC rmHaORZO86WmLr+rxAAxWP89bMfb91Q9sQKFdgO7YAbg3dwDsO9mLW2zphQs0juISCt9 sg/9kZMgFaCp4HYNSNQ61JvdO0C7d0PeKaNKfu0D+aG9ZBh/jtI+3uy8mxApotM71BHN xQFhO5OAf3PwYoJehMOrkEhKw7HLzD+/0iKOitnltn6Z7nsuDJX6e91XExDLSlBx27Ge /GWQ== X-Gm-Message-State: AOJu0YyGCQCK5NGokywf8Hey1Eev8UDFjUtPaWPOI6lpOkOSZqgSlffR 1v6N+mhokKlO2xCOn19q3uI8jQ== X-Google-Smtp-Source: AGHT+IFNt2EgkeunTDPvWWg/on0wlZbvPpea12PvOVP6FS/BMcSpdshX9dsOIoXG4JruqK2haZdgzA== X-Received: by 2002:aca:674d:0:b0:3a4:67b6:454e with SMTP id b13-20020aca674d000000b003a467b6454emr10552276oiy.6.1692693943041; Tue, 22 Aug 2023 01:45:43 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:e619:3fa0:1a90:6bb0]) by smtp.gmail.com with ESMTPSA id s26-20020aa78d5a000000b00666b012baedsm7304790pfe.158.2023.08.22.01.45.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Aug 2023 01:45:42 -0700 (PDT) From: Chen-Yu Tsai To: Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Mark Brown Cc: Zhiyong Tao , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Chen-Yu Tsai Subject: [PATCH v2 05/11] regulator: dt-bindings: mediatek: Add MT6366 PMIC Date: Tue, 22 Aug 2023 16:45:13 +0800 Message-ID: <20230822084520.564937-6-wenst@chromium.org> X-Mailer: git-send-email 2.42.0.rc1.204.g551eb34607-goog In-Reply-To: <20230822084520.564937-1-wenst@chromium.org> References: <20230822084520.564937-1-wenst@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230822_014546_098943_15161CF1 X-CRM114-Status: GOOD ( 13.03 ) X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org From: Zhiyong Tao The MediaTek MT6366 PMIC is similar to the MT6358 PMIC. It is designed to be paired with the MediaTek MT8186 SoC. It has 9 buck regulators and 29 LDO regulators, not counting ones that feed internally and basically have no controls. The regulators are named after their intended usage for the SoC and system design, thus not named generically as ldoX or dcdcX, but as vcn33 or vgpu. Add a binding document describing all the regulators and their supplies. Signed-off-by: Zhiyong Tao [wens@chromium.org: major rework and added commit message] Signed-off-by: Chen-Yu Tsai --- Changes since v1: - Replaced underscores in supply names to hyphens - Merged with MT6358 regulator binding - Added MT6358 fallback compatible to MT6366 regulator Changes since Zhiyong's last version (v4) [1]: - simplified regulator names - added descriptions to regulators - removed bogus regulators (*_sshub) - merged vcn33-wifi and vcn33-bt as vcn33 - added missing regulators (vm18, vmddr, vsram-core) - cut down examples to a handful of cases and made them complete - expanded commit message a lot [1] https://lore.kernel.org/linux-arm-kernel/20220823123745.14061-1-zhiyong.tao@mediatek.com/ .../regulator/mediatek,mt6358-regulator.yaml | 227 +++++++++++++----- 1 file changed, 168 insertions(+), 59 deletions(-) diff --git a/Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml b/Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml index 82328fe17680..b350181f33ff 100644 --- a/Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml +++ b/Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml @@ -16,14 +16,18 @@ description: | properties: compatible: - const: mediatek,mt6358-regulator + oneOf: + - const: mediatek,mt6358-regulator + - items: + - const: mediatek,mt6366-regulator + - const: mediatek,mt6358-regulator vsys-ldo1-supply: description: Supply for LDOs vfe28, vxo22, vcn28, vaux18, vaud28, vsim1, vusb, vbif28 vsys-ldo2-supply: - description: Supply for LDOs vldo28, vio28, vmc, vmch, vsim2 + description: Supply for LDOs vldo28 (MT6358 only), vio28, vmc, vmch, vsim2 vsys-ldo3-supply: - description: Supply for LDOs vcn33, vcama1, vcama2, vemc, vibr + description: Supply for LDOs vcn33, vcama[12] (MT6358 only), vemc, vibr vsys-vcore-supply: description: Supply for buck regulator vcore vsys-vdram1-supply: @@ -43,75 +47,138 @@ properties: vsys-vs2-supply: description: Supply for buck regulator vs2 vs1-ldo1-supply: - description: Supply for LDOs vrf18, vefuse, vcn18, vcamio, vio18 + description: Supply for LDOs vrf18, vefuse, vcn18, vcamio (MT6358 only), vio18 vs2-ldo1-supply: - description: Supply for LDOs vdram2 + description: Supply for LDOs vdram2, vmddr (MT6366 only) vs2-ldo2-supply: description: Supply for LDOs vrf12, va12 vs2-ldo3-supply: - description: Supply for LDOs vsram-gpu, vsram-others, vsram-proc11, vsram-proc12 - vs2-ldo4-supply: - description: Supply for LDO vcamd - -patternProperties: - "^buck_v(core|dram1|gpu|modem|pa|proc1[12]|s[12])$": - description: Buck regulators - type: object - $ref: regulator.yaml# - unevaluatedProperties: false - - "^ldo_v(a|rf)12": - description: LDOs with fixed 1.2V output and 0~100/10mV tuning - type: object - $ref: regulator.yaml# - unevaluatedProperties: false - - "^ldo_v((aux|cn|io|rf)18|camio)": - description: LDOs with fixed 1.8V output and 0~100/10mV tuning - type: object - $ref: regulator.yaml# - unevaluatedProperties: false - - "^ldo_vxo22": - description: LDOs with fixed 2.2V output and 0~100/10mV tuning - type: object - $ref: regulator.yaml# - unevaluatedProperties: false - - "^ldo_v(aud|bif|cn|fe|io)28": - description: LDOs with fixed 2.8V output and 0~100/10mV tuning - type: object - $ref: regulator.yaml# - unevaluatedProperties: false - - "^ldo_vusb": - description: LDOs with fixed 3.0V output and 0~100/10mV tuning - type: object - $ref: regulator.yaml# - unevaluatedProperties: false - - "^ldo_vsram_(gpu|others|proc1[12])$": - description: LDOs with variable output - type: object - $ref: regulator.yaml# - unevaluatedProperties: false - - "^ldo_v(cama[12]|camd|cn33|dram2|efuse|emc|ibr|ldo28|mc|mch|sim[12])$": - description: LDOs with variable output and 0~100/10mV tuning - type: object - $ref: regulator.yaml# - unevaluatedProperties: false + description: Supply for LDOs vsram-core (MT6366 only), vsram-gpu, vsram-others, vsram-proc11, vsram-proc12 required: - compatible -additionalProperties: false +unevaluatedProperties: false + +allOf: + - if: + properties: + compatible: + const: mediatek,mt6358-regulator + then: + properties: + vs2-ldo4-supply: + description: Supply for LDO vcamd + + patternProperties: + "^buck_v(core|dram1|gpu|modem|pa|proc1[12]|s[12])$": + description: Buck regulators + type: object + $ref: regulator.yaml# + unevaluatedProperties: false + + "^ldo_v(a|rf)12": + description: LDOs with fixed 1.2V output and 0~100/10mV tuning + type: object + $ref: regulator.yaml# + unevaluatedProperties: false + + "^ldo_v((aux|cn|io|rf)18|camio)": + description: LDOs with fixed 1.8V output and 0~100/10mV tuning + type: object + $ref: regulator.yaml# + unevaluatedProperties: false + + "^ldo_vxo22": + description: LDOs with fixed 2.2V output and 0~100/10mV tuning + type: object + $ref: regulator.yaml# + unevaluatedProperties: false + + "^ldo_v(aud|bif|cn|fe|io)28": + description: LDOs with fixed 2.8V output and 0~100/10mV tuning + type: object + $ref: regulator.yaml# + unevaluatedProperties: false + + "^ldo_vusb": + description: LDOs with fixed 3.0V output and 0~100/10mV tuning + type: object + $ref: regulator.yaml# + unevaluatedProperties: false + + "^ldo_vsram_(gpu|others|proc1[12])$": + description: LDOs with variable output + type: object + $ref: regulator.yaml# + unevaluatedProperties: false + + "^ldo_v(cama[12]|camd|cn33|dram2|efuse|emc|ibr|ldo28|mc|mch|sim[12])$": + description: LDOs with variable output and 0~100/10mV tuning + type: object + $ref: regulator.yaml# + unevaluatedProperties: false + + - if: + properties: + compatible: + contains: + const: mediatek,mt6366-regulator + then: + patternProperties: + "^v(core|dram1|gpu|modem|pa|proc1[12]|s[12])$": + description: Buck regulators + type: object + $ref: regulator.yaml# + unevaluatedProperties: false + + "^v(a|rf)12": + description: LDOs with fixed 1.2V output and 0~100/10mV tuning + type: object + $ref: regulator.yaml# + unevaluatedProperties: false + + "^v(aux|io|rf)18": + description: LDOs with fixed 1.8V output and 0~100/10mV tuning + type: object + $ref: regulator.yaml# + unevaluatedProperties: false + + "^vxo22": + description: LDOs with fixed 2.2V output and 0~100/10mV tuning + type: object + $ref: regulator.yaml# + unevaluatedProperties: false + + "^v(aud|bif|cn|fe|io)28": + description: LDOs with fixed 2.8V output and 0~100/10mV tuning + type: object + $ref: regulator.yaml# + unevaluatedProperties: false + + "^vusb": + description: LDOs with fixed 3.0V output and 0~100/10mV tuning + type: object + $ref: regulator.yaml# + unevaluatedProperties: false + + "^vsram-(core|gpu|others|proc1[12])$": + description: LDOs with variable output + type: object + $ref: regulator.yaml# + unevaluatedProperties: false + + "^v(cn18|cn33|dram2|efuse|emc|ibr|m18|mc|mch|mddr|sim[12])$": + description: LDOs with variable output and 0~100/10mV tuning + type: object + $ref: regulator.yaml# + unevaluatedProperties: false examples: - | #include - regulator { + mt6358-regulator { compatible = "mediatek,mt6358-regulator"; buck_vgpu { @@ -137,4 +204,46 @@ examples: }; }; + mt6366-regulator { + compatible = "mediatek,mt6366-regulator", "mediatek,mt6358-regulator"; + + vdram1 { + regulator-name = "pp1125_emi_vdd2"; + regulator-min-microvolt = <1125000>; + regulator-max-microvolt = <1125000>; + regulator-ramp-delay = <12500>; + regulator-enable-ramp-delay = <0>; + regulator-allowed-modes = ; + regulator-always-on; + }; + + vproc11 { + regulator-name = "ppvar_dvdd_proc_bc_mt6366"; + regulator-min-microvolt = <600000>; + regulator-max-microvolt = <1200000>; + regulator-ramp-delay = <6250>; + regulator-enable-ramp-delay = <200>; + regulator-allowed-modes = ; + regulator-always-on; + }; + + vmddr { + regulator-name = "pm0750_emi_vmddr"; + regulator-min-microvolt = <700000>; + regulator-max-microvolt = <750000>; + regulator-enable-ramp-delay = <325>; + regulator-always-on; + }; + + vsram-proc11 { + regulator-name = "pp0900_dvdd_sram_bc"; + regulator-min-microvolt = <850000>; + regulator-max-microvolt = <1120000>; + regulator-ramp-delay = <6250>; + regulator-enable-ramp-delay = <240>; + regulator-always-on; + }; + }; ... From patchwork Tue Aug 22 08:45:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 13360358 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 2C558EE49AC for ; Tue, 22 Aug 2023 08:46:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=UpiVif2mdv3ig7H2FjeqypVWX5tyPx6doaDt74YKlhk=; b=zWmqp2B3PdLGLbF+wrPHs7XaiR 5ZJYTCBZRxQH0nRxIZJtNPKf7kcfenDe5jvt4waozkIZ4hacv3EvSlhuuYRQll0IIKOJvQuthRbhK OuwTBkvPJtXfoASikn4eJOLvLWTVETaZe9qixfe7BJognYra8TSc53f01CK3xd3AzuVR2T3ecqQYL qEWLXzY2igJ2n9NWmnjneaW2MCRTSnqpvmPEiz794mQUAih9xYY4FJYLbexC8USWaI4nbsc+ZjWGp AJ6DBUC7gJIf1e/yHcmivlr/2ySfKkXc5EGwXr5i0q+vhfvHrvp5+JmKoZSJZz5kKgBdCya47zeNW WYJgyqBg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qYN1g-00FUTi-0K; Tue, 22 Aug 2023 08:46:12 +0000 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qYN1G-00FUAm-0X for linux-mediatek@lists.infradead.org; Tue, 22 Aug 2023 08:45:48 +0000 Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-68a3b66f350so2164745b3a.3 for ; Tue, 22 Aug 2023 01:45:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1692693945; x=1693298745; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=UpiVif2mdv3ig7H2FjeqypVWX5tyPx6doaDt74YKlhk=; b=jlVHlY2MPbzdFfvndETtF9LbfUuUHNZ8xl2H9uZja8FWMMXW+lrh3UdctXtAckivcg UdkAuhMNBRzeygIMnbH8p+tsbhRJoIWOnGZpJVoLouIoW80FY6Jp7H9tOS2kcfxicYz2 fkDlN2jjiDK00bjEj2esFR4HyI+MYEBeS+YaQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692693945; x=1693298745; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UpiVif2mdv3ig7H2FjeqypVWX5tyPx6doaDt74YKlhk=; b=hoFo3ryDkfQ/U9rG78muaZ44kt7i3fCpGOs6E/bTVnkgW5fGtA6A7DQHK5csjZWr7q sire6lm4QbWK1U0f7rqUyvNnixWv+EMwBmMGQFreECuNkrmH/XJhpaRYrBkfpZZ/caQP EjotAZAyBSaxFK5IwEIRrlBveJzrEW2toJQWhE+Ezd/G21HXG/EZH9ExSSQLnj18xclX 7KH9/6EJka08HG34qhm8NdqPL1Ye6dNeEOxfstUTst5HkoiyKD4AyOcUysGno2VGKDiQ bEwgSd8cxaX01XkM8DueKBG5szew2gH1Yg0kL2TMt2kaEphHAz2L7C7Aa6LMEcVH2amh utOw== X-Gm-Message-State: AOJu0YzhpRJAxSO/esHWFe82jpjjaBB+nWt217QgpvUgsC/565P/EL8t EkWI/mYi/o6duqET+YN/VTIUhg== X-Google-Smtp-Source: AGHT+IHwLyLZpwPRsnQ6Ln01otKWQq6V/kVvhHPZAOTGcAKbTVRT6DJvkfV6jW9gNLc83YyucshwMg== X-Received: by 2002:a05:6a21:7182:b0:148:2d35:5a11 with SMTP id wq2-20020a056a21718200b001482d355a11mr10841998pzb.40.1692693945607; Tue, 22 Aug 2023 01:45:45 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:e619:3fa0:1a90:6bb0]) by smtp.gmail.com with ESMTPSA id s26-20020aa78d5a000000b00666b012baedsm7304790pfe.158.2023.08.22.01.45.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Aug 2023 01:45:45 -0700 (PDT) From: Chen-Yu Tsai To: Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Mark Brown Cc: Chen-Yu Tsai , Zhiyong Tao , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH v2 06/11] regulator: mt6358: Add supply names for MT6358 regulators Date: Tue, 22 Aug 2023 16:45:14 +0800 Message-ID: <20230822084520.564937-7-wenst@chromium.org> X-Mailer: git-send-email 2.42.0.rc1.204.g551eb34607-goog In-Reply-To: <20230822084520.564937-1-wenst@chromium.org> References: <20230822084520.564937-1-wenst@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230822_014546_207350_DA0C79C1 X-CRM114-Status: GOOD ( 12.52 ) X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org The DT bindings for MT6358 regulator now defines the supply names for the PMIC. Add support for them by adding .supply_name field settings for each regulator. Signed-off-by: Chen-Yu Tsai --- drivers/regulator/mt6358-regulator.c | 106 +++++++++++++-------------- 1 file changed, 51 insertions(+), 55 deletions(-) diff --git a/drivers/regulator/mt6358-regulator.c b/drivers/regulator/mt6358-regulator.c index 3cb2e6768e25..db75f644966a 100644 --- a/drivers/regulator/mt6358-regulator.c +++ b/drivers/regulator/mt6358-regulator.c @@ -34,12 +34,13 @@ struct mt6358_regulator_info { #define to_regulator_info(x) container_of((x), struct mt6358_regulator_info, desc) -#define MT6358_BUCK(match, vreg, min, max, step, \ - vosel_mask, _da_vsel_reg, _da_vsel_mask, \ - _modeset_reg, _modeset_shift) \ +#define MT6358_BUCK(match, vreg, supply, min, max, step, \ + vosel_mask, _da_vsel_reg, _da_vsel_mask, \ + _modeset_reg, _modeset_shift) \ [MT6358_ID_##vreg] = { \ .desc = { \ .name = #vreg, \ + .supply_name = supply, \ .of_match = of_match_ptr(match), \ .ops = &mt6358_volt_range_ops, \ .type = REGULATOR_VOLTAGE, \ @@ -62,10 +63,11 @@ struct mt6358_regulator_info { .modeset_mask = BIT(_modeset_shift), \ } -#define MT6358_LDO(match, vreg, volt_ranges, enreg, enbit, vosel, vosel_mask) \ +#define MT6358_LDO(match, vreg, supply, volt_ranges, enreg, enbit, vosel, vosel_mask) \ [MT6358_ID_##vreg] = { \ .desc = { \ .name = #vreg, \ + .supply_name = supply, \ .of_match = of_match_ptr(match), \ .ops = &mt6358_volt_table_ops, \ .type = REGULATOR_VOLTAGE, \ @@ -86,12 +88,12 @@ struct mt6358_regulator_info { .qi = BIT(15), \ } -#define MT6358_LDO1(match, vreg, min, max, step, \ - _da_vsel_reg, _da_vsel_mask, \ - vosel, vosel_mask) \ +#define MT6358_LDO1(match, vreg, supply, min, max, step, \ + _da_vsel_reg, _da_vsel_mask, vosel, vosel_mask) \ [MT6358_ID_##vreg] = { \ .desc = { \ .name = #vreg, \ + .supply_name = supply, \ .of_match = of_match_ptr(match), \ .ops = &mt6358_volt_range_ops, \ .type = REGULATOR_VOLTAGE, \ @@ -111,11 +113,11 @@ struct mt6358_regulator_info { .qi = BIT(0), \ } -#define MT6358_REG_FIXED(match, vreg, \ - enreg, enbit, volt) \ +#define MT6358_REG_FIXED(match, vreg, supply, enreg, enbit, volt) \ [MT6358_ID_##vreg] = { \ .desc = { \ .name = #vreg, \ + .supply_name = supply, \ .of_match = of_match_ptr(match), \ .ops = &mt6358_volt_fixed_ops, \ .type = REGULATOR_VOLTAGE, \ @@ -458,79 +460,73 @@ static const struct regulator_ops mt6358_volt_fixed_ops = { /* The array is indexed by id(MT6358_ID_XXX) */ static const struct mt6358_regulator_info mt6358_regulators[] = { - MT6358_BUCK("buck_vdram1", VDRAM1, 500000, 2087500, 12500, + MT6358_BUCK("buck_vdram1", VDRAM1, "vsys-vdram1", 500000, 2087500, 12500, 0x7f, MT6358_BUCK_VDRAM1_DBG0, 0x7f, MT6358_VDRAM1_ANA_CON0, 8), - MT6358_BUCK("buck_vcore", VCORE, 500000, 1293750, 6250, + MT6358_BUCK("buck_vcore", VCORE, "vsys-vcore", 500000, 1293750, 6250, 0x7f, MT6358_BUCK_VCORE_DBG0, 0x7f, MT6358_VCORE_VGPU_ANA_CON0, 1), - MT6358_BUCK("buck_vpa", VPA, 500000, 3650000, 50000, + MT6358_BUCK("buck_vpa", VPA, "vsys-vpa", 500000, 3650000, 50000, 0x3f, MT6358_BUCK_VPA_DBG0, 0x3f, MT6358_VPA_ANA_CON0, 3), - MT6358_BUCK("buck_vproc11", VPROC11, 500000, 1293750, 6250, + MT6358_BUCK("buck_vproc11", VPROC11, "vsys-vproc11", 500000, 1293750, 6250, 0x7f, MT6358_BUCK_VPROC11_DBG0, 0x7f, MT6358_VPROC_ANA_CON0, 1), - MT6358_BUCK("buck_vproc12", VPROC12, 500000, 1293750, 6250, + MT6358_BUCK("buck_vproc12", VPROC12, "vsys-vproc12", 500000, 1293750, 6250, 0x7f, MT6358_BUCK_VPROC12_DBG0, 0x7f, MT6358_VPROC_ANA_CON0, 2), - MT6358_BUCK("buck_vgpu", VGPU, 500000, 1293750, 6250, + MT6358_BUCK("buck_vgpu", VGPU, "vsys-vgpu", 500000, 1293750, 6250, 0x7f, MT6358_BUCK_VGPU_ELR0, 0x7f, MT6358_VCORE_VGPU_ANA_CON0, 2), - MT6358_BUCK("buck_vs2", VS2, 500000, 2087500, 12500, + MT6358_BUCK("buck_vs2", VS2, "vsys-vs2", 500000, 2087500, 12500, 0x7f, MT6358_BUCK_VS2_DBG0, 0x7f, MT6358_VS2_ANA_CON0, 8), - MT6358_BUCK("buck_vmodem", VMODEM, 500000, 1293750, 6250, + MT6358_BUCK("buck_vmodem", VMODEM, "vsys-vmodem", 500000, 1293750, 6250, 0x7f, MT6358_BUCK_VMODEM_DBG0, 0x7f, MT6358_VMODEM_ANA_CON0, 8), - MT6358_BUCK("buck_vs1", VS1, 1000000, 2587500, 12500, + MT6358_BUCK("buck_vs1", VS1, "vsys-vs1", 1000000, 2587500, 12500, 0x7f, MT6358_BUCK_VS1_DBG0, 0x7f, MT6358_VS1_ANA_CON0, 8), - MT6358_REG_FIXED("ldo_vrf12", VRF12, - MT6358_LDO_VRF12_CON0, 0, 1200000), - MT6358_REG_FIXED("ldo_vio18", VIO18, - MT6358_LDO_VIO18_CON0, 0, 1800000), - MT6358_REG_FIXED("ldo_vcamio", VCAMIO, - MT6358_LDO_VCAMIO_CON0, 0, 1800000), - MT6358_REG_FIXED("ldo_vcn18", VCN18, MT6358_LDO_VCN18_CON0, 0, 1800000), - MT6358_REG_FIXED("ldo_vfe28", VFE28, MT6358_LDO_VFE28_CON0, 0, 2800000), - MT6358_REG_FIXED("ldo_vcn28", VCN28, MT6358_LDO_VCN28_CON0, 0, 2800000), - MT6358_REG_FIXED("ldo_vxo22", VXO22, MT6358_LDO_VXO22_CON0, 0, 2200000), - MT6358_REG_FIXED("ldo_vaux18", VAUX18, - MT6358_LDO_VAUX18_CON0, 0, 1800000), - MT6358_REG_FIXED("ldo_vbif28", VBIF28, - MT6358_LDO_VBIF28_CON0, 0, 2800000), - MT6358_REG_FIXED("ldo_vio28", VIO28, MT6358_LDO_VIO28_CON0, 0, 2800000), - MT6358_REG_FIXED("ldo_va12", VA12, MT6358_LDO_VA12_CON0, 0, 1200000), - MT6358_REG_FIXED("ldo_vrf18", VRF18, MT6358_LDO_VRF18_CON0, 0, 1800000), - MT6358_REG_FIXED("ldo_vaud28", VAUD28, - MT6358_LDO_VAUD28_CON0, 0, 2800000), - MT6358_LDO("ldo_vdram2", VDRAM2, vdram2, + MT6358_REG_FIXED("ldo_vrf12", VRF12, "vs2-ldo2", MT6358_LDO_VRF12_CON0, 0, 1200000), + MT6358_REG_FIXED("ldo_vio18", VIO18, "vs1-ldo1", MT6358_LDO_VIO18_CON0, 0, 1800000), + MT6358_REG_FIXED("ldo_vcamio", VCAMIO, "vs1-ldo1", MT6358_LDO_VCAMIO_CON0, 0, 1800000), + MT6358_REG_FIXED("ldo_vcn18", VCN18, "vs1-ldo1", MT6358_LDO_VCN18_CON0, 0, 1800000), + MT6358_REG_FIXED("ldo_vfe28", VFE28, "vsys-ldo1", MT6358_LDO_VFE28_CON0, 0, 2800000), + MT6358_REG_FIXED("ldo_vcn28", VCN28, "vsys-ldo1", MT6358_LDO_VCN28_CON0, 0, 2800000), + MT6358_REG_FIXED("ldo_vxo22", VXO22, "vsys-ldo1", MT6358_LDO_VXO22_CON0, 0, 2200000), + MT6358_REG_FIXED("ldo_vaux18", VAUX18, "vsys-ldo1", MT6358_LDO_VAUX18_CON0, 0, 1800000), + MT6358_REG_FIXED("ldo_vbif28", VBIF28, "vsys-ldo1", MT6358_LDO_VBIF28_CON0, 0, 2800000), + MT6358_REG_FIXED("ldo_vio28", VIO28, "vsys-ldo2", MT6358_LDO_VIO28_CON0, 0, 2800000), + MT6358_REG_FIXED("ldo_va12", VA12, "vs2-ldo2", MT6358_LDO_VA12_CON0, 0, 1200000), + MT6358_REG_FIXED("ldo_vrf18", VRF18, "vs1-ldo1", MT6358_LDO_VRF18_CON0, 0, 1800000), + MT6358_REG_FIXED("ldo_vaud28", VAUD28, "vsys-ldo1", MT6358_LDO_VAUD28_CON0, 0, 2800000), + MT6358_LDO("ldo_vdram2", VDRAM2, "vs2-ldo1", vdram2, MT6358_LDO_VDRAM2_CON0, 0, MT6358_LDO_VDRAM2_ELR0, 0xf), - MT6358_LDO("ldo_vsim1", VSIM1, vsim, + MT6358_LDO("ldo_vsim1", VSIM1, "vsys-ldo1", vsim, MT6358_LDO_VSIM1_CON0, 0, MT6358_VSIM1_ANA_CON0, 0xf00), - MT6358_LDO("ldo_vibr", VIBR, vibr, + MT6358_LDO("ldo_vibr", VIBR, "vsys-ldo3", vibr, MT6358_LDO_VIBR_CON0, 0, MT6358_VIBR_ANA_CON0, 0xf00), - MT6358_LDO("ldo_vusb", VUSB, vusb, + MT6358_LDO("ldo_vusb", VUSB, "vsys-ldo1", vusb, MT6358_LDO_VUSB_CON0_0, 0, MT6358_VUSB_ANA_CON0, 0x700), - MT6358_LDO("ldo_vcamd", VCAMD, vcamd, + MT6358_LDO("ldo_vcamd", VCAMD, "vs2-ldo4", vcamd, MT6358_LDO_VCAMD_CON0, 0, MT6358_VCAMD_ANA_CON0, 0xf00), - MT6358_LDO("ldo_vefuse", VEFUSE, vefuse, + MT6358_LDO("ldo_vefuse", VEFUSE, "vs1-ldo1", vefuse, MT6358_LDO_VEFUSE_CON0, 0, MT6358_VEFUSE_ANA_CON0, 0xf00), - MT6358_LDO("ldo_vmch", VMCH, vmch_vemc, + MT6358_LDO("ldo_vmch", VMCH, "vsys-ldo2", vmch_vemc, MT6358_LDO_VMCH_CON0, 0, MT6358_VMCH_ANA_CON0, 0x700), - MT6358_LDO("ldo_vcama1", VCAMA1, vcama, + MT6358_LDO("ldo_vcama1", VCAMA1, "vsys-ldo3", vcama, MT6358_LDO_VCAMA1_CON0, 0, MT6358_VCAMA1_ANA_CON0, 0xf00), - MT6358_LDO("ldo_vemc", VEMC, vmch_vemc, + MT6358_LDO("ldo_vemc", VEMC, "vsys-ldo2", vmch_vemc, MT6358_LDO_VEMC_CON0, 0, MT6358_VEMC_ANA_CON0, 0x700), - MT6358_LDO("ldo_vcn33", VCN33, vcn33, + MT6358_LDO("ldo_vcn33", VCN33, "vsys-ldo3", vcn33, MT6358_LDO_VCN33_CON0_0, 0, MT6358_VCN33_ANA_CON0, 0x300), - MT6358_LDO("ldo_vcama2", VCAMA2, vcama, + MT6358_LDO("ldo_vcama2", VCAMA2, "vsys-ldo3", vcama, MT6358_LDO_VCAMA2_CON0, 0, MT6358_VCAMA2_ANA_CON0, 0xf00), - MT6358_LDO("ldo_vmc", VMC, vmc, + MT6358_LDO("ldo_vmc", VMC, "vsys-ldo2", vmc, MT6358_LDO_VMC_CON0, 0, MT6358_VMC_ANA_CON0, 0xf00), - MT6358_LDO("ldo_vldo28", VLDO28, vldo28, + MT6358_LDO("ldo_vldo28", VLDO28, "vsys-ldo2", vldo28, MT6358_LDO_VLDO28_CON0_0, 0, MT6358_VLDO28_ANA_CON0, 0x300), - MT6358_LDO("ldo_vsim2", VSIM2, vsim, + MT6358_LDO("ldo_vsim2", VSIM2, "vsys-ldo2", vsim, MT6358_LDO_VSIM2_CON0, 0, MT6358_VSIM2_ANA_CON0, 0xf00), - MT6358_LDO1("ldo_vsram_proc11", VSRAM_PROC11, 500000, 1293750, 6250, + MT6358_LDO1("ldo_vsram_proc11", VSRAM_PROC11, "vs2-ldo3", 500000, 1293750, 6250, MT6358_LDO_VSRAM_PROC11_DBG0, 0x7f00, MT6358_LDO_VSRAM_CON0, 0x7f), - MT6358_LDO1("ldo_vsram_others", VSRAM_OTHERS, 500000, 1293750, 6250, + MT6358_LDO1("ldo_vsram_others", VSRAM_OTHERS, "vs2-ldo3", 500000, 1293750, 6250, MT6358_LDO_VSRAM_OTHERS_DBG0, 0x7f00, MT6358_LDO_VSRAM_CON2, 0x7f), - MT6358_LDO1("ldo_vsram_gpu", VSRAM_GPU, 500000, 1293750, 6250, + MT6358_LDO1("ldo_vsram_gpu", VSRAM_GPU, "vs2-ldo3", 500000, 1293750, 6250, MT6358_LDO_VSRAM_GPU_DBG0, 0x7f00, MT6358_LDO_VSRAM_CON3, 0x7f), - MT6358_LDO1("ldo_vsram_proc12", VSRAM_PROC12, 500000, 1293750, 6250, + MT6358_LDO1("ldo_vsram_proc12", VSRAM_PROC12, "vs2-ldo3", 500000, 1293750, 6250, MT6358_LDO_VSRAM_PROC12_DBG0, 0x7f00, MT6358_LDO_VSRAM_CON1, 0x7f), }; From patchwork Tue Aug 22 08:45:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 13360360 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 82B38EE4993 for ; Tue, 22 Aug 2023 08:46:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=63jQ1kY7su1lCsx2tRGAaWVTfzqHu9OQUezgv59mi30=; b=hM8EMu4aXXjpnr0YukABBJHewU +TuVr5ZgIUXunzCBpJRIPZyFkVrLwI1lvZKvckIjnB4xqBYGpX/ACVqkjfX8FXeXqcTXeiyjJ8Igb BDdJX+CMxLhA3hihF9AYIoT1FG6Wr+Qe7D+P45Xoz/trkQ2MzrsBA0KQmoIlbvMwpfWSyqynedpJN dFT0W6NbM8CLGi+MmjOwZRVGZ4kfCNoktxDCXtFVcYBwzLodfQamxcydK5ieYLVNZ67HTLvA61n6k s3xoSSNMLstdqwxxyrb1sLypKUTwIZ7ofYAEUcJGXt+7ZJECp9yrirp0LMFgHtaf3A4lhJgvRTl9i h4FdpRxw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qYN1w-00FUgV-1K; Tue, 22 Aug 2023 08:46:28 +0000 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qYN1K-00FUC6-0P for linux-mediatek@lists.infradead.org; Tue, 22 Aug 2023 08:45:51 +0000 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-68a3daf4cf7so1431684b3a.3 for ; Tue, 22 Aug 2023 01:45:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1692693948; x=1693298748; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=63jQ1kY7su1lCsx2tRGAaWVTfzqHu9OQUezgv59mi30=; b=euyhApvgxt/Q4MkWGgkXf2m0xVZQ1jlXwo0cwZ2kR/Ph6JsCAdfPXn+6pi/yNAeRFg YLyHGIpJVdGgyp+ZNKHhHDJut16oUyPkQ6gZxy2SdFbIMcU6r9iX/zzxyOwVyY0Z/LQy Hh0DbdYOmHaGtyMFJ9uhSmuY+B1lNZO8aJN2s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692693948; x=1693298748; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=63jQ1kY7su1lCsx2tRGAaWVTfzqHu9OQUezgv59mi30=; b=ca+9yCMBP1Y3V2FWOHRjLC4NV24zNbC3uTHAuHHzLBh1Pm7gz0eT2AFQyByVCtyZ8A FR/xpidE6ly8KspkDinngtdCKLtUTzU7PjmDFMIVWd2F12piwygKTGSG9rT8aRjaVdZN c61vxlfKb/eLr7CmkDNsT8IZMoangEoym90luXeLcRUnq+qA7hJ35NdMPkyRAgJphk2X yt88xpbrvAWI/DgHHZnv7E3IIyJ5pzZ01WDER4ZaQdgHkRwtR9vrXdpZ81xdij7Dw5sg ItHHgR1uFxpiqfjf13afvoGZiEpLNOau7lAQKFCMr+E7LRDtQMh0o0hna2blUMAmlQhi Pqrw== X-Gm-Message-State: AOJu0YwcSq5+Q1IT05ps8fP9oQaPgCOHGaQHm+PPGURzTBjz5VGHuF4H uC+0jH20VyjBWTjrbCqZh+jU85ZxMXdG8ClotB4= X-Google-Smtp-Source: AGHT+IEfnsEAyLuzQuoLVVkbddi+FiEa94olPQ1J53s6w9Y/lSnpqa4nTLNupC70/wdRTpHMMRNvAA== X-Received: by 2002:a05:6a00:1a56:b0:687:41cb:e274 with SMTP id h22-20020a056a001a5600b0068741cbe274mr7774159pfv.9.1692693948082; Tue, 22 Aug 2023 01:45:48 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:e619:3fa0:1a90:6bb0]) by smtp.gmail.com with ESMTPSA id s26-20020aa78d5a000000b00666b012baedsm7304790pfe.158.2023.08.22.01.45.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Aug 2023 01:45:47 -0700 (PDT) From: Chen-Yu Tsai To: Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Mark Brown Cc: Chen-Yu Tsai , Zhiyong Tao , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH v2 07/11] regulator: mt6358: fix and drop type prefix in MT6366 regulator node names Date: Tue, 22 Aug 2023 16:45:15 +0800 Message-ID: <20230822084520.564937-8-wenst@chromium.org> X-Mailer: git-send-email 2.42.0.rc1.204.g551eb34607-goog In-Reply-To: <20230822084520.564937-1-wenst@chromium.org> References: <20230822084520.564937-1-wenst@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230822_014550_174121_B4EF2778 X-CRM114-Status: GOOD ( 10.90 ) X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org The new MT6366 binding does away with the type prefix ("buck_", "ldo_") in the regulator node names. This better matches the PMIC pin names. Remaining underscores in names are also replaced with hyphens. Drop the type prefixes and replace remaining underscores to match the MT6366 binding. Signed-off-by: Chen-Yu Tsai Reviewed-by: AngeloGioacchino Del Regno --- drivers/regulator/mt6358-regulator.c | 70 ++++++++++++++-------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/drivers/regulator/mt6358-regulator.c b/drivers/regulator/mt6358-regulator.c index db75f644966a..bc7fe2ff189d 100644 --- a/drivers/regulator/mt6358-regulator.c +++ b/drivers/regulator/mt6358-regulator.c @@ -532,68 +532,68 @@ static const struct mt6358_regulator_info mt6358_regulators[] = { /* The array is indexed by id(MT6366_ID_XXX) */ static const struct mt6358_regulator_info mt6366_regulators[] = { - MT6366_BUCK("buck_vdram1", VDRAM1, 500000, 2087500, 12500, + MT6366_BUCK("vdram1", VDRAM1, 500000, 2087500, 12500, 0x7f, MT6358_BUCK_VDRAM1_DBG0, 0x7f, MT6358_VDRAM1_ANA_CON0, 8), - MT6366_BUCK("buck_vcore", VCORE, 500000, 1293750, 6250, + MT6366_BUCK("vcore", VCORE, 500000, 1293750, 6250, 0x7f, MT6358_BUCK_VCORE_DBG0, 0x7f, MT6358_VCORE_VGPU_ANA_CON0, 1), - MT6366_BUCK("buck_vpa", VPA, 500000, 3650000, 50000, + MT6366_BUCK("vpa", VPA, 500000, 3650000, 50000, 0x3f, MT6358_BUCK_VPA_DBG0, 0x3f, MT6358_VPA_ANA_CON0, 3), - MT6366_BUCK("buck_vproc11", VPROC11, 500000, 1293750, 6250, + MT6366_BUCK("vproc11", VPROC11, 500000, 1293750, 6250, 0x7f, MT6358_BUCK_VPROC11_DBG0, 0x7f, MT6358_VPROC_ANA_CON0, 1), - MT6366_BUCK("buck_vproc12", VPROC12, 500000, 1293750, 6250, + MT6366_BUCK("vproc12", VPROC12, 500000, 1293750, 6250, 0x7f, MT6358_BUCK_VPROC12_DBG0, 0x7f, MT6358_VPROC_ANA_CON0, 2), - MT6366_BUCK("buck_vgpu", VGPU, 500000, 1293750, 6250, + MT6366_BUCK("vgpu", VGPU, 500000, 1293750, 6250, 0x7f, MT6358_BUCK_VGPU_ELR0, 0x7f, MT6358_VCORE_VGPU_ANA_CON0, 2), - MT6366_BUCK("buck_vs2", VS2, 500000, 2087500, 12500, + MT6366_BUCK("vs2", VS2, 500000, 2087500, 12500, 0x7f, MT6358_BUCK_VS2_DBG0, 0x7f, MT6358_VS2_ANA_CON0, 8), - MT6366_BUCK("buck_vmodem", VMODEM, 500000, 1293750, 6250, + MT6366_BUCK("vmodem", VMODEM, 500000, 1293750, 6250, 0x7f, MT6358_BUCK_VMODEM_DBG0, 0x7f, MT6358_VMODEM_ANA_CON0, 8), - MT6366_BUCK("buck_vs1", VS1, 1000000, 2587500, 12500, + MT6366_BUCK("vs1", VS1, 1000000, 2587500, 12500, 0x7f, MT6358_BUCK_VS1_DBG0, 0x7f, MT6358_VS1_ANA_CON0, 8), - MT6366_REG_FIXED("ldo_vrf12", VRF12, + MT6366_REG_FIXED("vrf12", VRF12, MT6358_LDO_VRF12_CON0, 0, 1200000), - MT6366_REG_FIXED("ldo_vio18", VIO18, + MT6366_REG_FIXED("vio18", VIO18, MT6358_LDO_VIO18_CON0, 0, 1800000), - MT6366_REG_FIXED("ldo_vcn18", VCN18, MT6358_LDO_VCN18_CON0, 0, 1800000), - MT6366_REG_FIXED("ldo_vfe28", VFE28, MT6358_LDO_VFE28_CON0, 0, 2800000), - MT6366_REG_FIXED("ldo_vcn28", VCN28, MT6358_LDO_VCN28_CON0, 0, 2800000), - MT6366_REG_FIXED("ldo_vxo22", VXO22, MT6358_LDO_VXO22_CON0, 0, 2200000), - MT6366_REG_FIXED("ldo_vaux18", VAUX18, + MT6366_REG_FIXED("vcn18", VCN18, MT6358_LDO_VCN18_CON0, 0, 1800000), + MT6366_REG_FIXED("vfe28", VFE28, MT6358_LDO_VFE28_CON0, 0, 2800000), + MT6366_REG_FIXED("vcn28", VCN28, MT6358_LDO_VCN28_CON0, 0, 2800000), + MT6366_REG_FIXED("vxo22", VXO22, MT6358_LDO_VXO22_CON0, 0, 2200000), + MT6366_REG_FIXED("vaux18", VAUX18, MT6358_LDO_VAUX18_CON0, 0, 1800000), - MT6366_REG_FIXED("ldo_vbif28", VBIF28, + MT6366_REG_FIXED("vbif28", VBIF28, MT6358_LDO_VBIF28_CON0, 0, 2800000), - MT6366_REG_FIXED("ldo_vio28", VIO28, MT6358_LDO_VIO28_CON0, 0, 2800000), - MT6366_REG_FIXED("ldo_va12", VA12, MT6358_LDO_VA12_CON0, 0, 1200000), - MT6366_REG_FIXED("ldo_vrf18", VRF18, MT6358_LDO_VRF18_CON0, 0, 1800000), - MT6366_REG_FIXED("ldo_vaud28", VAUD28, + MT6366_REG_FIXED("vio28", VIO28, MT6358_LDO_VIO28_CON0, 0, 2800000), + MT6366_REG_FIXED("va12", VA12, MT6358_LDO_VA12_CON0, 0, 1200000), + MT6366_REG_FIXED("vrf18", VRF18, MT6358_LDO_VRF18_CON0, 0, 1800000), + MT6366_REG_FIXED("vaud28", VAUD28, MT6358_LDO_VAUD28_CON0, 0, 2800000), - MT6366_LDO("ldo_vdram2", VDRAM2, vdram2, + MT6366_LDO("vdram2", VDRAM2, vdram2, MT6358_LDO_VDRAM2_CON0, 0, MT6358_LDO_VDRAM2_ELR0, 0x10), - MT6366_LDO("ldo_vsim1", VSIM1, vsim, + MT6366_LDO("vsim1", VSIM1, vsim, MT6358_LDO_VSIM1_CON0, 0, MT6358_VSIM1_ANA_CON0, 0xf00), - MT6366_LDO("ldo_vibr", VIBR, vibr, + MT6366_LDO("vibr", VIBR, vibr, MT6358_LDO_VIBR_CON0, 0, MT6358_VIBR_ANA_CON0, 0xf00), - MT6366_LDO("ldo_vusb", VUSB, vusb, + MT6366_LDO("vusb", VUSB, vusb, MT6358_LDO_VUSB_CON0_0, 0, MT6358_VUSB_ANA_CON0, 0x700), - MT6366_LDO("ldo_vefuse", VEFUSE, vefuse, + MT6366_LDO("vefuse", VEFUSE, vefuse, MT6358_LDO_VEFUSE_CON0, 0, MT6358_VEFUSE_ANA_CON0, 0xf00), - MT6366_LDO("ldo_vmch", VMCH, vmch_vemc, + MT6366_LDO("vmch", VMCH, vmch_vemc, MT6358_LDO_VMCH_CON0, 0, MT6358_VMCH_ANA_CON0, 0x700), - MT6366_LDO("ldo_vemc", VEMC, vmch_vemc, + MT6366_LDO("vemc", VEMC, vmch_vemc, MT6358_LDO_VEMC_CON0, 0, MT6358_VEMC_ANA_CON0, 0x700), - MT6366_LDO("ldo_vcn33", VCN33, vcn33, + MT6366_LDO("vcn33", VCN33, vcn33, MT6358_LDO_VCN33_CON0_0, 0, MT6358_VCN33_ANA_CON0, 0x300), - MT6366_LDO("ldo_vmc", VMC, vmc, + MT6366_LDO("vmc", VMC, vmc, MT6358_LDO_VMC_CON0, 0, MT6358_VMC_ANA_CON0, 0xf00), - MT6366_LDO("ldo_vsim2", VSIM2, vsim, + MT6366_LDO("vsim2", VSIM2, vsim, MT6358_LDO_VSIM2_CON0, 0, MT6358_VSIM2_ANA_CON0, 0xf00), - MT6366_LDO1("ldo_vsram_proc11", VSRAM_PROC11, 500000, 1293750, 6250, + MT6366_LDO1("vsram-proc11", VSRAM_PROC11, 500000, 1293750, 6250, MT6358_LDO_VSRAM_PROC11_DBG0, 0x7f00, MT6358_LDO_VSRAM_CON0, 0x7f), - MT6366_LDO1("ldo_vsram_others", VSRAM_OTHERS, 500000, 1293750, 6250, + MT6366_LDO1("vsram-others", VSRAM_OTHERS, 500000, 1293750, 6250, MT6358_LDO_VSRAM_OTHERS_DBG0, 0x7f00, MT6358_LDO_VSRAM_CON2, 0x7f), - MT6366_LDO1("ldo_vsram_gpu", VSRAM_GPU, 500000, 1293750, 6250, + MT6366_LDO1("vsram-gpu", VSRAM_GPU, 500000, 1293750, 6250, MT6358_LDO_VSRAM_GPU_DBG0, 0x7f00, MT6358_LDO_VSRAM_CON3, 0x7f), - MT6366_LDO1("ldo_vsram_proc12", VSRAM_PROC12, 500000, 1293750, 6250, + MT6366_LDO1("vsram-proc12", VSRAM_PROC12, 500000, 1293750, 6250, MT6358_LDO_VSRAM_PROC12_DBG0, 0x7f00, MT6358_LDO_VSRAM_CON1, 0x7f), }; From patchwork Tue Aug 22 08:45:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 13360361 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 46F39EE4993 for ; Tue, 22 Aug 2023 08:46:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=0LwYgNBbWG4PSO0ihWHLk9nZHuEXoxAxRNjJgweYAgo=; b=vxvPO/wO4Fszv4VkaQOctlx9CF IGhQpZsPkiFEOIYeOYfzOTdwWeeCGsli+Rv9ckH9jTaE39sYPQIUjHuEfTbfirta5Fcs2NgO+K8qL 5El/D8XiaA69aoQ1fBP8hAvUJtfpaPRQ8vYRJ0wRdUHk0DKFPVsf+VR+WCq1NhN3Fz3fu0iWr+px8 8t3vx1DvcOC8tbbkXqu0iSxM5m6ByQ5lJQ/4SemZA7gW9arvLpNIVV9T6R+Mu49y12oSffH7ab7l9 Pe8JFFfyrZfwBZVm6zKDpkqL4iJokMWV4VARL4f0sDD5wh44Kk9kI8Vsg622EzBGBkHqwhoHGX+rB UXmTPjcw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qYN23-00FUkh-0L; Tue, 22 Aug 2023 08:46:35 +0000 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qYN1N-00FUDk-1N for linux-mediatek@lists.infradead.org; Tue, 22 Aug 2023 08:45:54 +0000 Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-68a40d85593so1359937b3a.2 for ; Tue, 22 Aug 2023 01:45:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1692693950; x=1693298750; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0LwYgNBbWG4PSO0ihWHLk9nZHuEXoxAxRNjJgweYAgo=; b=J+QwwhCGW2PlgVOsRScY8jHu/1OXjqYru7xvZ9s/ADQ+nrzIBUfmTMymsmARfmL+4H AnOM17YVkaTixQaITrtFF8mB4PIQH7vD2wxC9P0Wt/KHqbmc+wkQBbsNkZwTP8AZQI86 Gjr9GSPn7c742h8Sl49vW2v7oDE6df7wU7f0I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692693950; x=1693298750; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0LwYgNBbWG4PSO0ihWHLk9nZHuEXoxAxRNjJgweYAgo=; b=Y6KVoygUi7RIQ6hb+cV7IQZT2e0N+K8m0sOHBh0V94uhG+wsSIG8hEjkqRtOnhnBSY bPtQluEq5Gx//P63y7WWjkzkkn6iHKdWKopSMG/ae0L9EaC0w4qdM0b0bFTCgRIEoPCu mrewEFAJNz/gUs8TZkf9Ir40YAIKQF13Bp4m7znmOwKfcSOuaxs0nDbdy/mNK7P2l14E 9apVDxgeSALd1cFvPI259XEl4Fun1velf0iIvaZDVxL8yUvoJ330jgU+GfPulAI/ENEY o1TtU3zEprR9WOYmGOclVO/6uRKhm6tT/uK4gQFkfUpunLqhxlsRhhSPL5meyUz5SalD EjTQ== X-Gm-Message-State: AOJu0Yxc0bbUxB4C/r/65liQgx5jn/Z3GlGMm60UXPF3y17SvAJL3RZU uoKSdDYKx4eAUI4xKF1WvvTI0A== X-Google-Smtp-Source: AGHT+IFIC8qxSyPLsrbBGKQMJZIOzJn7IR8m1rXKz78wmhnuJtgxM/t0Jtr5jd2AOa6QjktQ1pwRYg== X-Received: by 2002:a05:6a20:6a05:b0:134:d4d3:f0a8 with SMTP id p5-20020a056a206a0500b00134d4d3f0a8mr7998627pzk.3.1692693950531; Tue, 22 Aug 2023 01:45:50 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:e619:3fa0:1a90:6bb0]) by smtp.gmail.com with ESMTPSA id s26-20020aa78d5a000000b00666b012baedsm7304790pfe.158.2023.08.22.01.45.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Aug 2023 01:45:50 -0700 (PDT) From: Chen-Yu Tsai To: Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Mark Brown Cc: Chen-Yu Tsai , Zhiyong Tao , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH v2 08/11] regulator: mt6358: Make MT6366 vcn18 LDO configurable Date: Tue, 22 Aug 2023 16:45:16 +0800 Message-ID: <20230822084520.564937-9-wenst@chromium.org> X-Mailer: git-send-email 2.42.0.rc1.204.g551eb34607-goog In-Reply-To: <20230822084520.564937-1-wenst@chromium.org> References: <20230822084520.564937-1-wenst@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230822_014553_470032_53A694EF X-CRM114-Status: GOOD ( 13.35 ) X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org The VCN18 regulator on the MT6366 (only) actually has a wide configurable range of voltages, even though its name suggests a fixed output voltage. Convert it from a fixed LDO to a configurable LDO. Its range of settings is the same as the VM18 regulator, which is missing and will be added in a subsequent patch. Signed-off-by: Chen-Yu Tsai Reviewed-by: AngeloGioacchino Del Regno --- drivers/regulator/mt6358-regulator.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/drivers/regulator/mt6358-regulator.c b/drivers/regulator/mt6358-regulator.c index bc7fe2ff189d..587ee852c053 100644 --- a/drivers/regulator/mt6358-regulator.c +++ b/drivers/regulator/mt6358-regulator.c @@ -326,6 +326,27 @@ static const struct linear_range vldo28_ranges[] = { REGULATOR_LINEAR_RANGE(3000000, 11, 21, 10000), }; +static const unsigned int mt6366_vcn18_vm18_selectors[] = { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }; +static const struct linear_range mt6366_vcn18_vm18_ranges[] = { + REGULATOR_LINEAR_RANGE(600000, 0, 10, 10000), + REGULATOR_LINEAR_RANGE(700000, 11, 21, 10000), + REGULATOR_LINEAR_RANGE(800000, 22, 32, 10000), + REGULATOR_LINEAR_RANGE(900000, 33, 43, 10000), + REGULATOR_LINEAR_RANGE(1000000, 44, 54, 10000), + REGULATOR_LINEAR_RANGE(1100000, 55, 65, 10000), + REGULATOR_LINEAR_RANGE(1200000, 66, 76, 10000), + REGULATOR_LINEAR_RANGE(1300000, 77, 87, 10000), + REGULATOR_LINEAR_RANGE(1400000, 88, 98, 10000), + REGULATOR_LINEAR_RANGE(1500000, 99, 109, 10000), + REGULATOR_LINEAR_RANGE(1600000, 110, 120, 10000), + REGULATOR_LINEAR_RANGE(1700000, 121, 131, 10000), + REGULATOR_LINEAR_RANGE(1800000, 132, 142, 10000), + REGULATOR_LINEAR_RANGE(1900000, 143, 153, 10000), + REGULATOR_LINEAR_RANGE(2000000, 154, 164, 10000), + REGULATOR_LINEAR_RANGE(2100000, 165, 175, 10000), +}; + static unsigned int mt6358_map_mode(unsigned int mode) { return mode == MT6358_BUCK_MODE_AUTO ? @@ -554,7 +575,6 @@ static const struct mt6358_regulator_info mt6366_regulators[] = { MT6358_LDO_VRF12_CON0, 0, 1200000), MT6366_REG_FIXED("vio18", VIO18, MT6358_LDO_VIO18_CON0, 0, 1800000), - MT6366_REG_FIXED("vcn18", VCN18, MT6358_LDO_VCN18_CON0, 0, 1800000), MT6366_REG_FIXED("vfe28", VFE28, MT6358_LDO_VFE28_CON0, 0, 2800000), MT6366_REG_FIXED("vcn28", VCN28, MT6358_LDO_VCN28_CON0, 0, 2800000), MT6366_REG_FIXED("vxo22", VXO22, MT6358_LDO_VXO22_CON0, 0, 2200000), @@ -587,6 +607,8 @@ static const struct mt6358_regulator_info mt6366_regulators[] = { MT6358_LDO_VMC_CON0, 0, MT6358_VMC_ANA_CON0, 0xf00), MT6366_LDO("vsim2", VSIM2, vsim, MT6358_LDO_VSIM2_CON0, 0, MT6358_VSIM2_ANA_CON0, 0xf00), + MT6366_LDO("vcn18", VCN18, mt6366_vcn18_vm18, + MT6358_LDO_VCN18_CON0, 0, MT6358_VCN18_ANA_CON0, 0xf00), MT6366_LDO1("vsram-proc11", VSRAM_PROC11, 500000, 1293750, 6250, MT6358_LDO_VSRAM_PROC11_DBG0, 0x7f00, MT6358_LDO_VSRAM_CON0, 0x7f), MT6366_LDO1("vsram-others", VSRAM_OTHERS, 500000, 1293750, 6250, From patchwork Tue Aug 22 08:45:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 13360362 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 1ECE3EE49A8 for ; Tue, 22 Aug 2023 08:46:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=FJlvy9cp8YdYtNw+zjvbSQuMdmHyQIESMtjbg1P8AFk=; b=iNi/JSwlf1LLRbNFnfYfe1YmZ0 SjiI/HiY0gCKh8BtJXx74O0du2BRuYARGRTpI8M/mipaqCd5X2VsVIaiyCFl+B0qW0WTW4ceO5ya/ V7Z3RcOsKmYA+Ge+X8tD30ivgyHohKJxizk4vaPNo5vm2KeDFE7aMHT7vYCi6SFOGYGMa4NwO7+dX P7l+z/ml/ZzjGFrSnR2vb9jmH+g6z2etuYeC1GYlfy/xNfsKHZ9WQVesgb81gHwN0w4k+n+jWQHX5 032fDbZuL0Tc3CxKgvmbZWE1KsxQYThddtdvVs/f20uIQYiaK4QhX8xkqPcvdiSgHi6QK2tG0hhjT NQ8FGx6w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qYN24-00FUlS-0P; Tue, 22 Aug 2023 08:46:36 +0000 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qYN1P-00FUFj-2b for linux-mediatek@lists.infradead.org; Tue, 22 Aug 2023 08:45:57 +0000 Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-68a6cd7c6a6so420183b3a.1 for ; Tue, 22 Aug 2023 01:45:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1692693953; x=1693298753; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FJlvy9cp8YdYtNw+zjvbSQuMdmHyQIESMtjbg1P8AFk=; b=jslm9USmn7dRFDz6w4G2MzfvBdGji0khaqZCw0xGX9816ntX5c1o/8RAnphAMa38Nt V6NkjQBDRKn4oEnwJ06G//CAQqUnkvvIdtbmIGnCcTerUS2xodD4hrg8WkG0Ls16v4GA DRx58JL7aAFmkyFRJJWni+65VRSDHWw6x2mF8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692693953; x=1693298753; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FJlvy9cp8YdYtNw+zjvbSQuMdmHyQIESMtjbg1P8AFk=; b=apV345l+0CQofhUWHV+4BJfAkbV+cu63PCvIny5x59aFRbVISQe+rjUksXVkUFc/8f G2P8YAu2/Zk/PQ/AT3hTxP07sj9Vutx6oLNWv4jxvXY/6Cn0YOCsGhaPn8XVNUnBWmSQ R0sX3SRrZkI2eYmVvXtmEQfVyov9gVFVuI8uTgrWOx6Da+8A+Ird/IZZjzBfvYNJQ5IY HkxdvNWBDWTIJUvlw7BpN89LIRV6GSVKhfoHnXzYIB3g7SK2KS2nvh7hXyI+t0w2Rz15 EUKHu1cKOcSFsVezmVo/ibAwWZUUZFKfJRvO7vzlPg3xIX+NeGI9XALMx+UgK2FNsLkh qECw== X-Gm-Message-State: AOJu0Yw+nfcX99zuaIEjyb0JDOMDx/Q27HLbd85TwGRLOQvFM3VBBodu R/FsNmJZtuSLUQDAd8pToemLZA== X-Google-Smtp-Source: AGHT+IGhAEeSd5MyI4wpWI/9j0yldPpTY8zN3LuQHYHKCR7QGaBsbvecfXQ+vwtFphVPcWXhbIrv+g== X-Received: by 2002:a05:6a20:7d8e:b0:140:730b:4b3f with SMTP id v14-20020a056a207d8e00b00140730b4b3fmr8839855pzj.1.1692693952941; Tue, 22 Aug 2023 01:45:52 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:e619:3fa0:1a90:6bb0]) by smtp.gmail.com with ESMTPSA id s26-20020aa78d5a000000b00666b012baedsm7304790pfe.158.2023.08.22.01.45.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Aug 2023 01:45:52 -0700 (PDT) From: Chen-Yu Tsai To: Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Mark Brown Cc: Chen-Yu Tsai , Zhiyong Tao , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH v2 09/11] regulator: mt6358: Add missing regulators for MT6366 Date: Tue, 22 Aug 2023 16:45:17 +0800 Message-ID: <20230822084520.564937-10-wenst@chromium.org> X-Mailer: git-send-email 2.42.0.rc1.204.g551eb34607-goog In-Reply-To: <20230822084520.564937-1-wenst@chromium.org> References: <20230822084520.564937-1-wenst@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230822_014555_871590_BA254528 X-CRM114-Status: GOOD ( 14.02 ) X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org When support for the MT6366 PMIC regulators was added, it was assumed that it had the same functionality as MT6358. In reality there are differences. A few regulators have different ranges, or were renamed and repurposed, or removed altogether. Add the 3 regulators that were missing from the original submission. These are added for completeness. VSRAM_CORE is not used in existing projects. VM18 and VMDDR feed DRAM related consumers, and are not used in-kernel. Signed-off-by: Chen-Yu Tsai Reviewed-by: AngeloGioacchino Del Regno --- drivers/regulator/mt6358-regulator.c | 20 ++++++++++++++++++++ include/linux/regulator/mt6358-regulator.h | 3 +++ 2 files changed, 23 insertions(+) diff --git a/drivers/regulator/mt6358-regulator.c b/drivers/regulator/mt6358-regulator.c index 587ee852c053..658c4dbf478f 100644 --- a/drivers/regulator/mt6358-regulator.c +++ b/drivers/regulator/mt6358-regulator.c @@ -326,6 +326,20 @@ static const struct linear_range vldo28_ranges[] = { REGULATOR_LINEAR_RANGE(3000000, 11, 21, 10000), }; +static const unsigned int mt6366_vmddr_selectors[] = { 0, 1, 2, 3, 4, 5, 6, 7, 9, 12 }; +static const struct linear_range mt6366_vmddr_ranges[] = { + REGULATOR_LINEAR_RANGE(600000, 0, 10, 10000), + REGULATOR_LINEAR_RANGE(700000, 11, 21, 10000), + REGULATOR_LINEAR_RANGE(800000, 22, 32, 10000), + REGULATOR_LINEAR_RANGE(900000, 33, 43, 10000), + REGULATOR_LINEAR_RANGE(1000000, 44, 54, 10000), + REGULATOR_LINEAR_RANGE(1100000, 55, 65, 10000), + REGULATOR_LINEAR_RANGE(1200000, 66, 76, 10000), + REGULATOR_LINEAR_RANGE(1300000, 77, 87, 10000), + REGULATOR_LINEAR_RANGE(1500000, 88, 98, 10000), + REGULATOR_LINEAR_RANGE(1800000, 99, 109, 10000), +}; + static const unsigned int mt6366_vcn18_vm18_selectors[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }; static const struct linear_range mt6366_vcn18_vm18_ranges[] = { @@ -609,6 +623,10 @@ static const struct mt6358_regulator_info mt6366_regulators[] = { MT6358_LDO_VSIM2_CON0, 0, MT6358_VSIM2_ANA_CON0, 0xf00), MT6366_LDO("vcn18", VCN18, mt6366_vcn18_vm18, MT6358_LDO_VCN18_CON0, 0, MT6358_VCN18_ANA_CON0, 0xf00), + MT6366_LDO("vm18", VM18, mt6366_vcn18_vm18, + MT6358_LDO_VM18_CON0, 0, MT6358_VM18_ANA_CON0, 0xf00), + MT6366_LDO("vmddr", VMDDR, mt6366_vmddr, + MT6358_LDO_VMDDR_CON0, 0, MT6358_VMDDR_ANA_CON0, 0xf00), MT6366_LDO1("vsram-proc11", VSRAM_PROC11, 500000, 1293750, 6250, MT6358_LDO_VSRAM_PROC11_DBG0, 0x7f00, MT6358_LDO_VSRAM_CON0, 0x7f), MT6366_LDO1("vsram-others", VSRAM_OTHERS, 500000, 1293750, 6250, @@ -617,6 +635,8 @@ static const struct mt6358_regulator_info mt6366_regulators[] = { MT6358_LDO_VSRAM_GPU_DBG0, 0x7f00, MT6358_LDO_VSRAM_CON3, 0x7f), MT6366_LDO1("vsram-proc12", VSRAM_PROC12, 500000, 1293750, 6250, MT6358_LDO_VSRAM_PROC12_DBG0, 0x7f00, MT6358_LDO_VSRAM_CON1, 0x7f), + MT6366_LDO1("vsram-core", VSRAM_CORE, 500000, 1293750, 6250, + MT6358_LDO_VSRAM_CORE_DBG0, 0x7f00, MT6358_LDO_VSRAM_CON5, 0x7f), }; static int mt6358_sync_vcn33_setting(struct device *dev) diff --git a/include/linux/regulator/mt6358-regulator.h b/include/linux/regulator/mt6358-regulator.h index c71a6a9fce7a..562386f9b80e 100644 --- a/include/linux/regulator/mt6358-regulator.h +++ b/include/linux/regulator/mt6358-regulator.h @@ -86,6 +86,9 @@ enum { MT6366_ID_VMC, MT6366_ID_VAUD28, MT6366_ID_VSIM2, + MT6366_ID_VM18, + MT6366_ID_VMDDR, + MT6366_ID_VSRAM_CORE, MT6366_ID_RG_MAX, }; From patchwork Tue Aug 22 08:45:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 13360363 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 9899FEE49AC for ; Tue, 22 Aug 2023 08:46:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=jrDATXbws5HyoVxKw6+vLUMTkruOotP8pQDuc9L5CV0=; b=a29GRu/ukFzq5PrQnZZqXNG+pu BcbKPLppZD5OVq/Vb6BwIAKGfSeCEY/yIKVVCFgyyji7LC6q+SO2eoDg2l79EHTG1gz0xMZ98m6yb anGDGmX83Qc9mwSson5upBboYPeroajNYv+KBGwbvg6rTXZfJWxxbhVoXxsl6ZNuaPODAKouotu4N k1fntIDV39vz14QZ4Ein4VyGKmNlMwCZDVYISizcUySiCWLAiKSKIEjgANpVyoRPFrxr1IOHI4jt+ rlWvbv9Nqsa1RB8Ai/pkTcEi2Na8spmANvhiIQitiMRmrWlUUcOEqseI4K0k2UVJoLTm6iUsWtX/6 Qd5Hl3DQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qYN24-00FUlq-1T; Tue, 22 Aug 2023 08:46:36 +0000 Received: from mail-oa1-x31.google.com ([2001:4860:4864:20::31]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qYN1Q-00FUHh-0t for linux-mediatek@lists.infradead.org; Tue, 22 Aug 2023 08:45:59 +0000 Received: by mail-oa1-x31.google.com with SMTP id 586e51a60fabf-1c0fff40ec6so2581824fac.2 for ; Tue, 22 Aug 2023 01:45:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1692693955; x=1693298755; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=jrDATXbws5HyoVxKw6+vLUMTkruOotP8pQDuc9L5CV0=; b=AahAynSSwqqklGnOieWpiwev1YewTeQEJasNlRAeINMMGIi+RFZDQCbyhFnv9lT0ET vUd90ri/zi+hG7M9h1S3yi0xPmmNn3euftjPkk3Cubr2hOQrop6x7hRlVtbkdYFiRNp2 mgvLWMagRl5N7MS1Ll5Yhi46G+SoEydtAUw+Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692693955; x=1693298755; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jrDATXbws5HyoVxKw6+vLUMTkruOotP8pQDuc9L5CV0=; b=eym4YVYZKWkn6uYeH1SLgNByhrZ9XK7RZTcxw1JcI4lo4rXGMuHzvCs1CqEP8Hhvsr HzaUXgvQdjCDXkXKH+tGmMz4jd0M9Fmhxo6Fp7JmKigu5h3b7yR4qFOiE29g2ufWFGMk 5q4fcxB858a1L9iqrfgPy7pN4ngiFHFB2nCD6qxObb2tUAseTVVsJEl4a8tqpX957T8y 13b6K9vrKzAfcfKRIhYygNkFfqASJD/DwJvAluP1tyvEWNMDX+cT4HkocMfn5ApC1tt4 6mscQ03a3Svw4WWVKycFhVZ06+fpFbwzR23O0CMOiwYEbrUqyYSNqPQsyNF5coNwttQE Nc7Q== X-Gm-Message-State: AOJu0YxBfsE0fekoOwc2tRUDDeNj+PSIBRgPXDRUEczo8Vxg2AtV+Y8H AeZ9+y3++fNwpZhbtYfkgQfzBg== X-Google-Smtp-Source: AGHT+IEcbRmA1Ic/MwYkdWxmF4FnqY/IGmYo7qFR1gg+Ch7vEHEZH5CjQDg6P02c2DJOdM3gzIYiLA== X-Received: by 2002:a05:6871:8a4:b0:1bb:5480:4bc with SMTP id r36-20020a05687108a400b001bb548004bcmr11263042oaq.37.1692693955422; Tue, 22 Aug 2023 01:45:55 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:e619:3fa0:1a90:6bb0]) by smtp.gmail.com with ESMTPSA id s26-20020aa78d5a000000b00666b012baedsm7304790pfe.158.2023.08.22.01.45.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Aug 2023 01:45:55 -0700 (PDT) From: Chen-Yu Tsai To: Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Mark Brown Cc: Chen-Yu Tsai , Zhiyong Tao , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH v2 10/11] regulator: mt6358: Add supply names for MT6366 regulators Date: Tue, 22 Aug 2023 16:45:18 +0800 Message-ID: <20230822084520.564937-11-wenst@chromium.org> X-Mailer: git-send-email 2.42.0.rc1.204.g551eb34607-goog In-Reply-To: <20230822084520.564937-1-wenst@chromium.org> References: <20230822084520.564937-1-wenst@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230822_014556_324124_052CE7DF X-CRM114-Status: GOOD ( 12.57 ) X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org The DT bindings for MT6366 regulator defines the supply names for the PMIC. Add support for them by adding .supply_name field settings for each regulator. The buck regulators each have their own supply whose name can be derived from the regulator name. The LDOs have shared supplies. Signed-off-by: Chen-Yu Tsai Reviewed-by: AngeloGioacchino Del Regno --- Changes since v1: - Replaced underscores in supply names with hyphens - Reflowed a couple macros for readability drivers/regulator/mt6358-regulator.c | 77 +++++++++++++--------------- 1 file changed, 37 insertions(+), 40 deletions(-) diff --git a/drivers/regulator/mt6358-regulator.c b/drivers/regulator/mt6358-regulator.c index 658c4dbf478f..e6533fd62a82 100644 --- a/drivers/regulator/mt6358-regulator.c +++ b/drivers/regulator/mt6358-regulator.c @@ -141,6 +141,7 @@ struct mt6358_regulator_info { [MT6366_ID_##vreg] = { \ .desc = { \ .name = #vreg, \ + .supply_name = "vsys-" match, \ .of_match = of_match_ptr(match), \ .ops = &mt6358_volt_range_ops, \ .type = REGULATOR_VOLTAGE, \ @@ -163,10 +164,11 @@ struct mt6358_regulator_info { .modeset_mask = BIT(_modeset_shift), \ } -#define MT6366_LDO(match, vreg, volt_ranges, enreg, enbit, vosel, vosel_mask) \ +#define MT6366_LDO(match, vreg, volt_ranges, supply, enreg, enbit, vosel, vosel_mask) \ [MT6366_ID_##vreg] = { \ .desc = { \ .name = #vreg, \ + .supply_name = supply, \ .of_match = of_match_ptr(match), \ .ops = &mt6358_volt_table_ops, \ .type = REGULATOR_VOLTAGE, \ @@ -187,12 +189,12 @@ struct mt6358_regulator_info { .qi = BIT(15), \ } -#define MT6366_LDO1(match, vreg, min, max, step, \ - _da_vsel_reg, _da_vsel_mask, \ - vosel, vosel_mask) \ +#define MT6366_LDO1(match, vreg, supply, min, max, step, \ + _da_vsel_reg, _da_vsel_mask, vosel, vosel_mask) \ [MT6366_ID_##vreg] = { \ .desc = { \ .name = #vreg, \ + .supply_name = supply, \ .of_match = of_match_ptr(match), \ .ops = &mt6358_volt_range_ops, \ .type = REGULATOR_VOLTAGE, \ @@ -212,11 +214,11 @@ struct mt6358_regulator_info { .qi = BIT(0), \ } -#define MT6366_REG_FIXED(match, vreg, \ - enreg, enbit, volt) \ +#define MT6366_REG_FIXED(match, vreg, supply, enreg, enbit, volt) \ [MT6366_ID_##vreg] = { \ .desc = { \ .name = #vreg, \ + .supply_name = supply, \ .of_match = of_match_ptr(match), \ .ops = &mt6358_volt_fixed_ops, \ .type = REGULATOR_VOLTAGE, \ @@ -585,57 +587,52 @@ static const struct mt6358_regulator_info mt6366_regulators[] = { 0x7f, MT6358_BUCK_VMODEM_DBG0, 0x7f, MT6358_VMODEM_ANA_CON0, 8), MT6366_BUCK("vs1", VS1, 1000000, 2587500, 12500, 0x7f, MT6358_BUCK_VS1_DBG0, 0x7f, MT6358_VS1_ANA_CON0, 8), - MT6366_REG_FIXED("vrf12", VRF12, - MT6358_LDO_VRF12_CON0, 0, 1200000), - MT6366_REG_FIXED("vio18", VIO18, - MT6358_LDO_VIO18_CON0, 0, 1800000), - MT6366_REG_FIXED("vfe28", VFE28, MT6358_LDO_VFE28_CON0, 0, 2800000), - MT6366_REG_FIXED("vcn28", VCN28, MT6358_LDO_VCN28_CON0, 0, 2800000), - MT6366_REG_FIXED("vxo22", VXO22, MT6358_LDO_VXO22_CON0, 0, 2200000), - MT6366_REG_FIXED("vaux18", VAUX18, - MT6358_LDO_VAUX18_CON0, 0, 1800000), - MT6366_REG_FIXED("vbif28", VBIF28, - MT6358_LDO_VBIF28_CON0, 0, 2800000), - MT6366_REG_FIXED("vio28", VIO28, MT6358_LDO_VIO28_CON0, 0, 2800000), - MT6366_REG_FIXED("va12", VA12, MT6358_LDO_VA12_CON0, 0, 1200000), - MT6366_REG_FIXED("vrf18", VRF18, MT6358_LDO_VRF18_CON0, 0, 1800000), - MT6366_REG_FIXED("vaud28", VAUD28, - MT6358_LDO_VAUD28_CON0, 0, 2800000), - MT6366_LDO("vdram2", VDRAM2, vdram2, + MT6366_REG_FIXED("vrf12", VRF12, "vs2-ldo2", MT6358_LDO_VRF12_CON0, 0, 1200000), + MT6366_REG_FIXED("vio18", VIO18, "vs1-ldo1", MT6358_LDO_VIO18_CON0, 0, 1800000), + MT6366_REG_FIXED("vfe28", VFE28, "vsys-ldo1", MT6358_LDO_VFE28_CON0, 0, 2800000), + MT6366_REG_FIXED("vcn28", VCN28, "vsys-ldo1", MT6358_LDO_VCN28_CON0, 0, 2800000), + MT6366_REG_FIXED("vxo22", VXO22, "vsys-ldo1", MT6358_LDO_VXO22_CON0, 0, 2200000), + MT6366_REG_FIXED("vaux18", VAUX18, "vsys-ldo1", MT6358_LDO_VAUX18_CON0, 0, 1800000), + MT6366_REG_FIXED("vbif28", VBIF28, "vsys-ldo1", MT6358_LDO_VBIF28_CON0, 0, 2800000), + MT6366_REG_FIXED("vio28", VIO28, "vsys-ldo2", MT6358_LDO_VIO28_CON0, 0, 2800000), + MT6366_REG_FIXED("va12", VA12, "vs2-ldo2", MT6358_LDO_VA12_CON0, 0, 1200000), + MT6366_REG_FIXED("vrf18", VRF18, "vs1-ldo1", MT6358_LDO_VRF18_CON0, 0, 1800000), + MT6366_REG_FIXED("vaud28", VAUD28, "vsys-ldo1", MT6358_LDO_VAUD28_CON0, 0, 2800000), + MT6366_LDO("vdram2", VDRAM2, vdram2, "vs2-ldo1", MT6358_LDO_VDRAM2_CON0, 0, MT6358_LDO_VDRAM2_ELR0, 0x10), - MT6366_LDO("vsim1", VSIM1, vsim, + MT6366_LDO("vsim1", VSIM1, vsim, "vsys-ldo1", MT6358_LDO_VSIM1_CON0, 0, MT6358_VSIM1_ANA_CON0, 0xf00), - MT6366_LDO("vibr", VIBR, vibr, + MT6366_LDO("vibr", VIBR, vibr, "vsys-ldo3", MT6358_LDO_VIBR_CON0, 0, MT6358_VIBR_ANA_CON0, 0xf00), - MT6366_LDO("vusb", VUSB, vusb, + MT6366_LDO("vusb", VUSB, vusb, "vsys-ldo1", MT6358_LDO_VUSB_CON0_0, 0, MT6358_VUSB_ANA_CON0, 0x700), - MT6366_LDO("vefuse", VEFUSE, vefuse, + MT6366_LDO("vefuse", VEFUSE, vefuse, "vs1-ldo1", MT6358_LDO_VEFUSE_CON0, 0, MT6358_VEFUSE_ANA_CON0, 0xf00), - MT6366_LDO("vmch", VMCH, vmch_vemc, + MT6366_LDO("vmch", VMCH, vmch_vemc, "vsys-ldo2", MT6358_LDO_VMCH_CON0, 0, MT6358_VMCH_ANA_CON0, 0x700), - MT6366_LDO("vemc", VEMC, vmch_vemc, + MT6366_LDO("vemc", VEMC, vmch_vemc, "vsys-ldo3", MT6358_LDO_VEMC_CON0, 0, MT6358_VEMC_ANA_CON0, 0x700), - MT6366_LDO("vcn33", VCN33, vcn33, + MT6366_LDO("vcn33", VCN33, vcn33, "vsys-ldo3", MT6358_LDO_VCN33_CON0_0, 0, MT6358_VCN33_ANA_CON0, 0x300), - MT6366_LDO("vmc", VMC, vmc, + MT6366_LDO("vmc", VMC, vmc, "vsys-ldo2", MT6358_LDO_VMC_CON0, 0, MT6358_VMC_ANA_CON0, 0xf00), - MT6366_LDO("vsim2", VSIM2, vsim, + MT6366_LDO("vsim2", VSIM2, vsim, "vsys-ldo2", MT6358_LDO_VSIM2_CON0, 0, MT6358_VSIM2_ANA_CON0, 0xf00), - MT6366_LDO("vcn18", VCN18, mt6366_vcn18_vm18, + MT6366_LDO("vcn18", VCN18, mt6366_vcn18_vm18, "vs1-ldo1", MT6358_LDO_VCN18_CON0, 0, MT6358_VCN18_ANA_CON0, 0xf00), - MT6366_LDO("vm18", VM18, mt6366_vcn18_vm18, + MT6366_LDO("vm18", VM18, mt6366_vcn18_vm18, "vs1-ldo1", MT6358_LDO_VM18_CON0, 0, MT6358_VM18_ANA_CON0, 0xf00), - MT6366_LDO("vmddr", VMDDR, mt6366_vmddr, + MT6366_LDO("vmddr", VMDDR, mt6366_vmddr, "vs2-ldo1", MT6358_LDO_VMDDR_CON0, 0, MT6358_VMDDR_ANA_CON0, 0xf00), - MT6366_LDO1("vsram-proc11", VSRAM_PROC11, 500000, 1293750, 6250, + MT6366_LDO1("vsram-proc11", VSRAM_PROC11, "vs2-ldo3", 500000, 1293750, 6250, MT6358_LDO_VSRAM_PROC11_DBG0, 0x7f00, MT6358_LDO_VSRAM_CON0, 0x7f), - MT6366_LDO1("vsram-others", VSRAM_OTHERS, 500000, 1293750, 6250, + MT6366_LDO1("vsram-others", VSRAM_OTHERS, "vs2-ldo3", 500000, 1293750, 6250, MT6358_LDO_VSRAM_OTHERS_DBG0, 0x7f00, MT6358_LDO_VSRAM_CON2, 0x7f), - MT6366_LDO1("vsram-gpu", VSRAM_GPU, 500000, 1293750, 6250, + MT6366_LDO1("vsram-gpu", VSRAM_GPU, "vs2-ldo3", 500000, 1293750, 6250, MT6358_LDO_VSRAM_GPU_DBG0, 0x7f00, MT6358_LDO_VSRAM_CON3, 0x7f), - MT6366_LDO1("vsram-proc12", VSRAM_PROC12, 500000, 1293750, 6250, + MT6366_LDO1("vsram-proc12", VSRAM_PROC12, "vs2-ldo3", 500000, 1293750, 6250, MT6358_LDO_VSRAM_PROC12_DBG0, 0x7f00, MT6358_LDO_VSRAM_CON1, 0x7f), - MT6366_LDO1("vsram-core", VSRAM_CORE, 500000, 1293750, 6250, + MT6366_LDO1("vsram-core", VSRAM_CORE, "vs2-ldo3", 500000, 1293750, 6250, MT6358_LDO_VSRAM_CORE_DBG0, 0x7f00, MT6358_LDO_VSRAM_CON5, 0x7f), }; From patchwork Tue Aug 22 08:45:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 13360364 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 B39F7EE4993 for ; Tue, 22 Aug 2023 08:46:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=hlF1u7hcM0QcOf0dBRcVX4obCkl3j7F2WIt5v6FZgoU=; b=mxDBsWzQRV3N5UIBwVbz/97Gcn 52adDcn+fLrkWkv2RXZVKXIXfQaYhZSrRUewUhIcgXPB1ZcqQsSnsxydjkgiYo+19q/oO6lWXkV0Y TribGyhZHV9IcYLTMYsvbflvBe/bTy9j/ngbg4zAqR/GfENUphYuPJBKTQaWBOJIjNaxTx+YLz4Ih 08U5LrDUPMvm2/ogTMrORZ1+lwhjwEjFQJS/fxVMjbxnCb29JjVHHFLGsS1nbYMkmzUPfx1wgUmwl bzSSD41xzqzYWt8TkKp2/hhuJfQJ66yjvhwl+bKnq/o66SkK7lO4I43lwLgCUYWjIDTqsMBxy4CeN d2y30czA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qYN25-00FUmt-1Z; Tue, 22 Aug 2023 08:46:37 +0000 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qYN1S-00FUJf-1Q for linux-mediatek@lists.infradead.org; Tue, 22 Aug 2023 08:46:00 +0000 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-68a410316a2so1325138b3a.0 for ; Tue, 22 Aug 2023 01:45:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1692693958; x=1693298758; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=hlF1u7hcM0QcOf0dBRcVX4obCkl3j7F2WIt5v6FZgoU=; b=mhxuhaGqh88+7Ene1JAl6kiwkMKSUNbySevMtCh45aHQzwcstAH3Zxc0tfaKCOyV1g ZwwqbRmdYMX9iHwcax5SYaE3jG5u3ApPmK4LhMkh2aWnTo/Z5esP4OgtPTiTgS/X4fM8 loOv7lDpdU/vDqg55o1JV3nZuZZRDW4GO7AWQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692693958; x=1693298758; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hlF1u7hcM0QcOf0dBRcVX4obCkl3j7F2WIt5v6FZgoU=; b=h8GWeQq5DfszEtvlWcdvE5zw0sFqWaCSgsKAav/QaBICGh/59IUxOkhvZT7WFJcP3n Fdu5qkzauG3VzdGOVLc6vQ3lvz7yv/r80akzXe1DzTrdqVha3QxKAIlGMoPmG0LMQWv5 Gj0FZ4xjff3SoNT4BESfAf9IF9BO66iKEfHkNJsrTJ9g8hs1Dz60sL3ZPirmHG1xuKeg BLkhVytwNeDdCg/LlaQNpB41vR9VCYz8xf+RF9qOX3unJZAPRMaUdsTr6B1guT5rjtJ1 A+ExCqRiQugF4cdvzLN8cKvcIIVm4ioIqIQp1R4Al2fYT3c3FBjSz7hL+GkyZE43b06I yhXQ== X-Gm-Message-State: AOJu0Ywu8Ux8AIjfMYKGDmRjDoFxcKQ7Jni1qt0ZxJCl5JeU0YceDwfy cKznN3Q2xRjUd8LpT6tbKSvcbg== X-Google-Smtp-Source: AGHT+IHjB5kNMo/7EJRgipMgtPWyKH6stKI6IA+7/JLvg5/DHP/HLoq+swtjIZEl1DUHRTjCliTjJQ== X-Received: by 2002:a05:6a20:7347:b0:140:6979:2952 with SMTP id v7-20020a056a20734700b0014069792952mr7772550pzc.47.1692693957871; Tue, 22 Aug 2023 01:45:57 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:e619:3fa0:1a90:6bb0]) by smtp.gmail.com with ESMTPSA id s26-20020aa78d5a000000b00666b012baedsm7304790pfe.158.2023.08.22.01.45.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Aug 2023 01:45:57 -0700 (PDT) From: Chen-Yu Tsai To: Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Mark Brown Cc: Chen-Yu Tsai , Zhiyong Tao , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH v2 11/11] arm64: dts: mediatek: mt8183-kukui: Add PMIC regulator supplies Date: Tue, 22 Aug 2023 16:45:19 +0800 Message-ID: <20230822084520.564937-12-wenst@chromium.org> X-Mailer: git-send-email 2.42.0.rc1.204.g551eb34607-goog In-Reply-To: <20230822084520.564937-1-wenst@chromium.org> References: <20230822084520.564937-1-wenst@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230822_014558_508259_AB8FF4E4 X-CRM114-Status: GOOD ( 11.25 ) X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org The PMIC regulator node is missing regulator supplies. Now that the binding supports them, add all the power rail supplies. Most of them are fed from a system-wide semi-regulated power rail. A couple LDOs are fed from the PMIC's own buck regulator outputs. Signed-off-by: Chen-Yu Tsai --- .../arm64/boot/dts/mediatek/mt8183-kukui.dtsi | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi b/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi index 6ce16a265e05..d48c66cc8c18 100644 --- a/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi @@ -103,6 +103,14 @@ pp3300_alw: regulator6 { regulator-max-microvolt = <3300000>; }; + /* system wide semi-regulated power rail from charger */ + reg_vsys: regulator-vsys { + compatible = "regulator-fixed"; + regulator-name = "vsys"; + regulator-always-on; + regulator-boot-on; + }; + reserved_memory: reserved-memory { #address-cells = <2>; #size-cells = <2>; @@ -404,6 +412,26 @@ &mt6358codec { Avdd-supply = <&mt6358_vaud28_reg>; }; +&mt6358regulator { + vsys-ldo1-supply = <®_vsys>; + vsys-ldo2-supply = <®_vsys>; + vsys-ldo3-supply = <®_vsys>; + vsys-vcore-supply = <®_vsys>; + vsys-vdram1-supply = <®_vsys>; + vsys-vgpu-supply = <®_vsys>; + vsys-vmodem-supply = <®_vsys>; + vsys-vpa-supply = <®_vsys>; + vsys-vproc11-supply = <®_vsys>; + vsys-vproc12-supply = <®_vsys>; + vsys-vs1-supply = <®_vsys>; + vsys-vs2-supply = <®_vsys>; + vs1-ldo1-supply = <&mt6358_vs1_reg>; + vs2-ldo1-supply = <&mt6358_vdram1_reg>; + vs2-ldo2-supply = <&mt6358_vs2_reg>; + vs2-ldo3-supply = <&mt6358_vs2_reg>; + vs2-ldo4-supply = <&mt6358_vs2_reg>; +}; + &mt6358_vgpu_reg { regulator-min-microvolt = <625000>; regulator-max-microvolt = <900000>;