From patchwork Thu Sep 28 08:55:24 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: 13402337 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 74049CE7B0E for ; Thu, 28 Sep 2023 08:56: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: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=9iD0br92Mi3FEv1QG2Kf4eCLBfYQpUd8Py3TNLj725s=; b=KSaLNRQnaVRNSx QBxBshQR+7Mvac+qrk2D+bIjGMbyeHJUwblZNChsUAtop1eYaiYDmvfSmAYzjUjh7KJi3kDE2zIpf RUUR0l9vu9Jqj+mPZUby4BwzWMKGtMXIeriZf60TIi91XGvJCdcoy9VvKZkGhd0gDubjSFMRuYkuk xfiwdCp8QF5Y4WCM1qDaAX8MkY0EQDi6e41WQ7sNOYz69FhYjbKpduKPOqX5zcB7Dwkv7vpNOQ+Td B5r1L+jUi/hZuzFTD1jFhVLtBm0+8/T5OJl3xNPoIOa9fqe67/MuB97Cc+lZCozVY3n2dJQ+Xm17y c86vnqJKCyEl8O7vEeRg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qlmoZ-002fT5-2l; Thu, 28 Sep 2023 08:56:07 +0000 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qlmoO-002fNQ-2D for linux-arm-kernel@lists.infradead.org; Thu, 28 Sep 2023 08:55:58 +0000 Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-692779f583fso9267051b3a.0 for ; Thu, 28 Sep 2023 01:55:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1695891356; x=1696496156; darn=lists.infradead.org; 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=FRtfnBP9AwX73M7WqRrv6j9K/SzoRky3umOfoZElyY0=; b=LX+MZufPtbNizg/hyI7Lz6zkRr6JFX/Ihg9HPx0nOGRJfU6VJGsXvlTjjE3qa/M3KY beuBfUPSi8mDyiiuRpq7/2LIYUL6SngFMYKBp843w4qHxgqnlpFirEEgkwG8E6xnxuio oD3jUX4F4vV2XyhFqrM7R83iQXoc27wBiMQLk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695891356; x=1696496156; 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=FRtfnBP9AwX73M7WqRrv6j9K/SzoRky3umOfoZElyY0=; b=Sz3GAcPEc4p263djHOZfKMOK8xQMVSyRNm4fdqtV1UosCBw2AZ3OM1vHav+Uxm5btb /lP/0QnRD/NIPei7rUxQVsW+MGjsuS9aX1nHthKWlKHqZoMDJOUVz1APMyFo3PtE0R7+ 9MOjxHPYsnfVbHiKgccizEZ6seQk+ZftvSjDQMviYrNfmuCX6yc2DCQ+xhZ84e0QojeD bRsJLJrgPojJpvYi6MCrLtHu1Cgw6T2H8OHvRbE1vFIxXymSeLIRupXZVQeC5V3Txy1i +5CVrqwUBjjHo/hu74BdTC/mJdyyqMUy2GHhxtxQgDz0/63LXbNORazZgKR36PnFE4PC 0AgA== X-Gm-Message-State: AOJu0YxXuQt9ph8zM2wqVgO5d3RuQM80jVheImRTfBlZ9QeK4X30wPvJ bbKu3hqYmRgmGVi/KRiCwDPrZQ== X-Google-Smtp-Source: AGHT+IFM5vuqerQOsjNfjBDCVwTrMH1Xk0IlOBL7t8bM4NJqtTrVxCstFnITrUdBqIH6D1ZRG2/Aqg== X-Received: by 2002:a05:6a00:14c9:b0:693:3783:4a29 with SMTP id w9-20020a056a0014c900b0069337834a29mr619701pfu.20.1695891356126; Thu, 28 Sep 2023 01:55:56 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:6747:c12a:dbfd:2cc7]) by smtp.gmail.com with ESMTPSA id y7-20020aa78047000000b006879493aca0sm1754016pfm.26.2023.09.28.01.55.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 01:55:55 -0700 (PDT) From: Chen-Yu Tsai To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Mark Brown Cc: Chen-Yu Tsai , Lee Jones , Zhiyong Tao , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Krzysztof Kozlowski Subject: [PATCH v4 01/12] dt-bindings: mfd: mt6397: Split out compatible for MediaTek MT6366 PMIC Date: Thu, 28 Sep 2023 16:55:24 +0800 Message-ID: <20230928085537.3246669-2-wenst@chromium.org> X-Mailer: git-send-email 2.42.0.582.g8ccd20d70d-goog In-Reply-To: <20230928085537.3246669-1-wenst@chromium.org> References: <20230928085537.3246669-1-wenst@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230928_015556_760108_960B86F0 X-CRM114-Status: GOOD ( 14.87 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 Reviewed-by: AngeloGioacchino Del Regno --- 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 Thu Sep 28 08:55:25 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: 13402338 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 632D7CE7B0F for ; Thu, 28 Sep 2023 08:56:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=23oNCF1u/ZBm9HehWiAf1DDSKriBKu47z570fF5BLRk=; b=VzCVMyzK/GfX+W HDPK2/LQSCxrYlQSwEgwG/7gHdNTpacRDiOfVinVODlzhBgFW9oXVV+xcoDe2i12e1EHD8zv1uRHn Y+YshbtoYq5uCDOlfgFF80u1nshaQs9ScgaNdHtK3JxE8yW9NeqeZFbw8L9ckQpJGl2o7ai2osE8v Kb6clf3x+nOtkmneL7rfXDjFzvstaHyTY11Yh6hf3Ty9TtyZVb4fKINLUg/Yc6D9wB9fjQ/mLJdbm B85l3RIqceO8GpVgbxvfzV+ZHRrENYdvDiXDnWhWUCmJzfT10bMvaBNUhXCNRVVIOLLXMoHg0T961 wnyv9GSwQ92UE6lngtTQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qlmok-002fZV-1j; Thu, 28 Sep 2023 08:56:18 +0000 Received: from mail-oi1-x231.google.com ([2607:f8b0:4864:20::231]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qlmoT-002fOS-2W for linux-arm-kernel@lists.infradead.org; Thu, 28 Sep 2023 08:56:04 +0000 Received: by mail-oi1-x231.google.com with SMTP id 5614622812f47-3af603d9eb5so1072971b6e.3 for ; Thu, 28 Sep 2023 01:55:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1695891359; x=1696496159; darn=lists.infradead.org; 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=ysGU0NHAfSl5TPVH0vlT20ZS5CDkj15M8GMRxHz/ex0=; b=UCFB3FAgKnFZYOzET8eHrpU215oBZqdf1eLiHzCG3rs+gzczD1EdQ9iFYUXa42/Zog qmAnuZx13JUoNLOHgvx6W2KMpR69DE/VGDGBzcNF7BvG+rp/okWnLBcZWVknqDoveZtp Uk3mApe5bEp5vVJeM9a3/I7cVBpW9LjC+kbds= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695891359; x=1696496159; 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=ysGU0NHAfSl5TPVH0vlT20ZS5CDkj15M8GMRxHz/ex0=; b=tAfzEUvBDPAOFQtKWbdlijZ30JA/SvOQw++2E73D6PIKw/d5rMl9rRrTis8CYSkWgA n/NmpEfs/m1zbFSsFzlzxkRxXP75SC15DGhSPouBI8qYvJ0us9bxpftUGQxOrDzc5CXi 82mdJu0N4ODoCOCr1iOnMguA0w8mmb5gbtlRbgzRb6IyymJ0ynbEUvELIYFfYOL8/RQx cDE5Tt3XhoIKn3OMqJ3GlnU2chog96E0hl8pwkUGkbr7f+9Akb7SKaU4BrS2z5Uf9/fd dmk1xK2MMqRLeL6NRDYG0P5e8YwpgVy1vPcOUP+b1La06nALzFWJHi9G5ReRPf54qhO4 Z78A== X-Gm-Message-State: AOJu0Yw18l8ebW/LCK5fRmwNh7VmYG8+5GSYfra9IuHFdRjz8VcCs4ya 1oOj8ebhsZUnGUQzPb+IN6JWfw== X-Google-Smtp-Source: AGHT+IHVRjTLKMH+nTy6eEwICCrIN4MLnLx2K0V8wXgzZHwk1cef5q50UCqet/MC9L6cK/MaQxCFpw== X-Received: by 2002:a54:4002:0:b0:3a7:8725:f37c with SMTP id x2-20020a544002000000b003a78725f37cmr581850oie.10.1695891358789; Thu, 28 Sep 2023 01:55:58 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:6747:c12a:dbfd:2cc7]) by smtp.gmail.com with ESMTPSA id y7-20020aa78047000000b006879493aca0sm1754016pfm.26.2023.09.28.01.55.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 01:55:58 -0700 (PDT) From: Chen-Yu Tsai To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Mark Brown Cc: Chen-Yu Tsai , Lee Jones , Zhiyong Tao , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH v4 02/12] regulator: dt-bindings: mt6358: Convert to DT schema Date: Thu, 28 Sep 2023 16:55:25 +0800 Message-ID: <20230928085537.3246669-3-wenst@chromium.org> X-Mailer: git-send-email 2.42.0.582.g8ccd20d70d-goog In-Reply-To: <20230928085537.3246669-1-wenst@chromium.org> References: <20230928085537.3246669-1-wenst@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230928_015601_832326_DDF2A6EC X-CRM114-Status: GOOD ( 18.82 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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, minus some properties that aren't covered by the bindings yet, or don't make sense on their own. The original submitter seems to have left MediaTek, so instead the submitter and maintainer for the MT6366 binding is listed as the maintainer here. Cc: Zhiyong Tao Signed-off-by: Chen-Yu Tsai Reviewed-by: Rob Herring --- Changes since v3: - ldo_vxo22 and ldo_vusb moved to properties Changes since v2: - Added missing end-of-string match to regulator names - regulator-coupled-* properties in example dropped - #include and regulator-allowed-modes moved to new patch .../regulator/mediatek,mt6358-regulator.yaml | 98 +++++ .../bindings/regulator/mt6358-regulator.txt | 350 ------------------ 2 files changed, 98 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..126f502a2bda --- /dev/null +++ b/Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml @@ -0,0 +1,98 @@ +# 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 + + ldo_vxo22: + description: LDOs with fixed 2.2V 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 + + +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_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_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: + - | + 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>; + }; + + ldo_vsram_gpu { + regulator-name = "vsram_gpu"; + regulator-min-microvolt = <850000>; + regulator-max-microvolt = <1000000>; + regulator-ramp-delay = <6250>; + regulator-enable-ramp-delay = <240>; + }; + }; + +... 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 Thu Sep 28 08:55:26 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: 13402339 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 4A0D2CE7B10 for ; Thu, 28 Sep 2023 08:56:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=wjmjGxfMG1AWf3viM3+V4eTD+FfKrcB1itGCtkrmVDg=; b=YCBZM4jAs/aFcp 7Z0aU+NktWimqRYcOZwgrz8aF5V4a5fViUkHbE8NGGF9kjmhUa0pMwcgn+iDxcif0/SK0n39kwM+8 7buDm0cI4SQcdSwztEuC127XbSQKGn1x5LF5oGP/w7LNG8mai7dYDk1cbuBhJJClW6HabE3F72VHh QKk9s68P4L7DsFAG5owRHRuR4U2WSNcs9QDG4rWIPi0TSlLUYoACA1d2iHXZCu3YIef5cRaIcnWkf IEsC5OCoko+/OTslVQ/Uk/xI6a6wLQYQUIUgQD1veDja4j78to+ua6V0tU0/lYZzxsrQvq3ozm/v8 eXhOsZfkFK3Bk0kNkksA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qlmoj-002fZ7-1u; Thu, 28 Sep 2023 08:56:17 +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 1qlmoU-002fQE-2h for linux-arm-kernel@lists.infradead.org; Thu, 28 Sep 2023 08:56:04 +0000 Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-68fb85afef4so10688961b3a.1 for ; Thu, 28 Sep 2023 01:56:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1695891361; x=1696496161; darn=lists.infradead.org; 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=B70I1HVdZcndWp3UgCKKWWEd0o3XW1h61Xx1jg7vsRI=; b=jjpHfKHcLaceZgLXaukjdpdXJZ9Bt7kvacdnTvEco2/FyHxb18kWckIHf+jGwgndmz 0n8oeg0pufI+wKhWloVMUXeHegIqbXpFPWpUbPhl1EL3TtoZk8HO2Q3UopGw3yKKNu3q mWWts0wLaQVmRjGa21qMET/+96jP1wdEVJLYg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695891361; x=1696496161; 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=B70I1HVdZcndWp3UgCKKWWEd0o3XW1h61Xx1jg7vsRI=; b=hWixl2L3Ai1cVWuzQSXwKlpuR3CGe2hO0cQqzL75+k6k3Efn2sB56QDuMGLDiWsNIr OPlW3RO0uxOf9Zb8nETIXKGzA3aDDLKj/ANLM958/zDd8hChxHwtHihZVEhWSOrjHq8D xTBk8SbIIZ69FkSgCCXdIoxkhO4p+qsJk+63tfhJfLnsgwHHXoXqDOJ5jikKzoI+vMgd 1tU1hIUC06g3J7IEA0nXHG7EBHjLelXA07smdZ5I4n8Tropu/T4zWaza5P85vwt2o/N7 2JCjmghlm0r2oJl7EMZs1mgnwq8sFMXKCCzXbQ7VDMC1iSdMw7Vnh7b+T6BVTz3R55hU gjSw== X-Gm-Message-State: AOJu0YzxwwTes4ZvedGi7++3nYjn3RBieVwORFPw8156wToNcl/ufjSh /fX261qapEh5TJixh63KpFIRYw== X-Google-Smtp-Source: AGHT+IFl04ON4D1Ic/k0X0ZMnVLo7gttKdtn9tcBSXQrLi5Wav4rpOb6iw9rZiRkyCAm/WOP7TMYPw== X-Received: by 2002:a05:6a00:17a1:b0:693:3c11:4293 with SMTP id s33-20020a056a0017a100b006933c114293mr628490pfg.14.1695891361353; Thu, 28 Sep 2023 01:56:01 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:6747:c12a:dbfd:2cc7]) by smtp.gmail.com with ESMTPSA id y7-20020aa78047000000b006879493aca0sm1754016pfm.26.2023.09.28.01.55.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 01:56:01 -0700 (PDT) From: Chen-Yu Tsai To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Mark Brown Cc: Chen-Yu Tsai , Lee Jones , Zhiyong Tao , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH v4 03/12] regulator: dt-bindings: mt6358: Add regulator-allowed-modes property Date: Thu, 28 Sep 2023 16:55:26 +0800 Message-ID: <20230928085537.3246669-4-wenst@chromium.org> X-Mailer: git-send-email 2.42.0.582.g8ccd20d70d-goog In-Reply-To: <20230928085537.3246669-1-wenst@chromium.org> References: <20230928085537.3246669-1-wenst@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230928_015602_915584_C8A22796 X-CRM114-Status: GOOD ( 16.31 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The MT6358 PMIC allows changing operating modes for the buck regulators, but not the LDOs. Existing device trees and the Linux implementation already utilize this through the standard regulator-allowed-modes property. The values currently used in existing device trees are simply raw numbers. The values in the Linux driver are matching numbers defined with macros denoting the two supported modes. Turns out these two modes are common across parts of the larger MT63xx PMIC family. The MT6397 regulator binding already has macros for the two modes, with matching numbers. Codify the supported values for regulator-allowed-modes for the MT6358 in the device tree binding: 0 and 1 are supported for buck regulators, and the property should not be present for LDO regulators. Users should use the dt-bindings/regulator/mediatek,mt6397-regulator.h header for the macros, instead of using raw numbers. Signed-off-by: Chen-Yu Tsai Reviewed-by: Rob Herring --- Changes since v3: - adapt to ldo_vxo22 and ldo_vusb movement to properties Changes since v2: - new patch .../regulator/mediatek,mt6358-regulator.yaml | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml b/Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml index 126f502a2bda..e8c3299d698f 100644 --- a/Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml +++ b/Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml @@ -22,12 +22,16 @@ properties: description: LDOs with fixed 2.2V output and 0~100/10mV tuning type: object $ref: regulator.yaml# + properties: + regulator-allowed-modes: false unevaluatedProperties: false ldo_vusb: description: LDOs with fixed 3.0V output and 0~100/10mV tuning type: object $ref: regulator.yaml# + properties: + regulator-allowed-modes: false unevaluatedProperties: false @@ -36,36 +40,55 @@ patternProperties: description: Buck regulators type: object $ref: regulator.yaml# + properties: + regulator-allowed-modes: + description: | + Buck regulatpr operating modes allowed. Valid values below. + Users should use the macros from dt-bindings/regulator/mediatek,mt6397-regulator.h + 0 (MT6397_BUCK_MODE_AUTO): Auto PFM/PWM mode + 1 (MT6397_BUCK_MODE_FORCE_PWM): Forced PWM mode + items: + enum: [0, 1] unevaluatedProperties: false "^ldo_v(a|rf)12$": description: LDOs with fixed 1.2V output and 0~100/10mV tuning type: object $ref: regulator.yaml# + properties: + regulator-allowed-modes: false 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# + properties: + regulator-allowed-modes: false 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# + properties: + regulator-allowed-modes: false unevaluatedProperties: false "^ldo_vsram_(gpu|others|proc1[12])$": description: LDOs with variable output type: object $ref: regulator.yaml# + properties: + regulator-allowed-modes: false 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# + properties: + regulator-allowed-modes: false unevaluatedProperties: false required: @@ -75,6 +98,8 @@ additionalProperties: false examples: - | + #include + regulator { compatible = "mediatek,mt6358-regulator"; @@ -84,6 +109,8 @@ examples: regulator-max-microvolt = <900000>; regulator-ramp-delay = <6250>; regulator-enable-ramp-delay = <200>; + regulator-allowed-modes = ; }; ldo_vsram_gpu { From patchwork Thu Sep 28 08:55:27 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: 13402340 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 72BD8CE7B0F for ; Thu, 28 Sep 2023 08:57:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=xQ0zLT7MEEVuG1sL9zSgCQaR5gV1P4fnetShzVk7byM=; b=NwXYqvCwB/H4sd vbgDQh3YxjjqdOza89DWCLws+0u0MfdBUYtRaTWubUlVu0PVb7OkJxZ4jn68PqzVWxkPcaW/gz+0O AcDt/pBoZ0kIrCKZCRgqpY9RwSOSDflXl0H5XU+uwecZ7BXUtkqp/HVFR+maFOy7vGXpVcRKwdwa+ 2P40dI3FRSthEadcDHRnfj3j9iXgHE95XpB3ZQKJYuCWXNzagoCfo37Zh+LJJoRQs1XLw4Vu3XCH9 O0dnoZFuGj6vRy2th6EPWKxAJALIydVSTy0+djcxXeqGd0PJzISv6bIjDTpz1D14T2tEiTLylquOw 8Z5//ckmJY47toFltTvw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qlmp0-002fkT-30; Thu, 28 Sep 2023 08:56:35 +0000 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qlmoW-002fRf-1c for linux-arm-kernel@lists.infradead.org; Thu, 28 Sep 2023 08:56:06 +0000 Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-68bed2c786eso10200909b3a.0 for ; Thu, 28 Sep 2023 01:56:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1695891364; x=1696496164; darn=lists.infradead.org; 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=8VUxLWLgQ80Pm3L1prBCg/hMI4tne1YjHqrpTBd8u2Q=; b=W7FSm1ajs2tz6nrf56ZrKu44hDKadLT2HAei6/6B9ExmmjJt4nGyTLNsg4I/CUk1H9 8eNYzWdzZ7hgCJGfWWwax54VsAnML2yxFbdxQYCyVVQPNb2rXWpN6bYGxnVSb7Lf2Oif u1bqWd6b4ZL6OTaiufXThsz3UgHZRKDJEOyI8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695891364; x=1696496164; 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=8VUxLWLgQ80Pm3L1prBCg/hMI4tne1YjHqrpTBd8u2Q=; b=wyf6pqnqcplu3kChgg3S1Kk8cPjTidUhPdyCkNkZWd1HKyJdW/nbfFkANgv+475mbz H4R2qqJh3NwCh3ZM8Iv5gPCcRXDx7M4EGQwfvTD42x8mR2Ysav1j6pCMN8MN7GwbGipo 9xyl0FgT3ovxjBpOU90JrfZ+UJBLwiDIhUJWtRGxijH3iSVBTkMgCHIKWZJmwxhDjT4g 3rN/8QlGpXxmzQrrunzIQqUuqTekXV8le++qsPBXg+WoIYGDo+gT5iZ4DhPElg4eGv+W +lxxcUyxg/JYOd9dz3wmFXm0v+qE+dJi3slOfEf9M1qJDYXH80gw6FdqiD0pH63YiGAl Ipwg== X-Gm-Message-State: AOJu0YyHo2l9N/G1P3DOc1xcPS6lDalyWWbG+Fx5lzFQA4DM0lz8yA6U gva51k1oLgORyDyUjwRwD6g2mg== X-Google-Smtp-Source: AGHT+IHtrWewxnhjNB2afm44QHya+LkWPvHNgUDR7Ji3onSnvYMF6drgVnRdKj2wM7M/V1Ql8GZGLA== X-Received: by 2002:a05:6a00:1381:b0:690:4362:7012 with SMTP id t1-20020a056a00138100b0069043627012mr612979pfg.28.1695891364006; Thu, 28 Sep 2023 01:56:04 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:6747:c12a:dbfd:2cc7]) by smtp.gmail.com with ESMTPSA id y7-20020aa78047000000b006879493aca0sm1754016pfm.26.2023.09.28.01.56.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 01:56:03 -0700 (PDT) From: Chen-Yu Tsai To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Mark Brown Cc: Chen-Yu Tsai , Lee Jones , Zhiyong Tao , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH v4 04/12] regulator: dt-bindings: mt6358: Add regulator supplies Date: Thu, 28 Sep 2023 16:55:27 +0800 Message-ID: <20230928085537.3246669-5-wenst@chromium.org> X-Mailer: git-send-email 2.42.0.582.g8ccd20d70d-goog In-Reply-To: <20230928085537.3246669-1-wenst@chromium.org> References: <20230928085537.3246669-1-wenst@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230928_015604_558138_A1F72F9D X-CRM114-Status: GOOD ( 11.09 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 Reviewed-by: Rob Herring --- .../regulator/mediatek,mt6358-regulator.yaml | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml b/Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml index e8c3299d698f..f2219d8656c2 100644 --- a/Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml +++ b/Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml @@ -34,6 +34,40 @@ properties: regulator-allowed-modes: false unevaluatedProperties: false + 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])$": From patchwork Thu Sep 28 08:55:28 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: 13402342 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 7FE61CE7B0E for ; Thu, 28 Sep 2023 08:57:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=yL3LmSFhKajHIj7jrRPnMNQjoLHQ2cd4fmeygJ5Yz4o=; b=S/M4NZzx6zIG0C YnNm7e02rxWvjiiI7NOMZs2YqcTSC022xMejho9R7EJT4tWhZoTfBt3PaGeDxfgwXqyHlv8zB0tww tTnNc1vfhJg7s9gMOdycwTjieowTKKLSK+qZbmzz9/5nsg98Am1wSw6XoPwkCX7gcbzlYL0rgxNbJ FHLLlxEWZ7tSzcjWTgFtt+Wm30tDwrjAxI2haHSOEzSYo3y6ZiswnQxjbb+PlYDU1JqW1SoJk4H8W Rzdn6XbPzJHf7G+HzYvxUKZFs5LeeUwwnhEbKyOSRuALG+BmVkjvlDRbyKsIpQIiwchX7H2j5ToB0 OKcVMMBPFPqHBPADm7Hw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qlmpF-002fqb-00; Thu, 28 Sep 2023 08:56:49 +0000 Received: from mail-oi1-x232.google.com ([2607:f8b0:4864:20::232]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qlmoa-002fSz-2G for linux-arm-kernel@lists.infradead.org; Thu, 28 Sep 2023 08:56:12 +0000 Received: by mail-oi1-x232.google.com with SMTP id 5614622812f47-3af603da0d1so1040724b6e.1 for ; Thu, 28 Sep 2023 01:56:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1695891366; x=1696496166; darn=lists.infradead.org; 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=Ml17AIOxe5tHr3zPSTgOdnGea7Wg+T/JGUBI6JLZOVQ=; b=MG8kHo/lDhueBAlOs4iazE1FgwE+aeuHtt8IEX86Q69R4XR/+8GjuDdKN8LIReOkGq GODLAtIKxAHKVPUSNOC6MyCfGd6Ka2yd7LB61uy+OFdCjTE+Vy+t8SYb7ecRBM+LXz3l z15Q0c8EKWEDKcU2C5CI4kRsJ4ex80wng2OTY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695891366; x=1696496166; 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=Ml17AIOxe5tHr3zPSTgOdnGea7Wg+T/JGUBI6JLZOVQ=; b=UgCsjaOcZJv5ejWtdIrtJLoOLjmyOU7l0bTjcxq6bH8hWeTrBMVh6rbubo/azuqbGu i4q1WV90KS9PprqwKdEQQbox5amrqYUNXCD6+CaQSo4kRByUFMLnti8/ILjqPdLIQENA RPPAbLtz7DlWE4uv3CPq0muzYt7l/eVxS5UUIimYLJN4Qi+Gu/FG7+hTTfvBABWSu//A yj878C40N+LvVPm9kPijNcrBXxblX0IrFrkz1jGGQ1ts/fREPBo0Esmzbi8aKkP8hcLb VULTJIDoL260kRA87mxdnabnaBkbMTK0o3Sk+0wAQw/n7oUrGTzr+HHdX4yM9z/zOMjK FJdw== X-Gm-Message-State: AOJu0YzjPCM5ix9Bmj1nciH6F+7aoBa9tRV2u5+mlm7mgmohYC8qB39y EeHmgi6LOgPuoQOrBzi6F0YKpw== X-Google-Smtp-Source: AGHT+IHBu1CZg5LGb52qF5VrtaNXiMiIG2wETBHHrIdDmEuoupIcRkNgt4i6rGh21fZffNiQjylfcg== X-Received: by 2002:a05:6808:2a53:b0:3a4:2204:e9e6 with SMTP id fa19-20020a0568082a5300b003a42204e9e6mr552245oib.21.1695891366659; Thu, 28 Sep 2023 01:56:06 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:6747:c12a:dbfd:2cc7]) by smtp.gmail.com with ESMTPSA id y7-20020aa78047000000b006879493aca0sm1754016pfm.26.2023.09.28.01.56.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 01:56:06 -0700 (PDT) From: Chen-Yu Tsai To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Mark Brown Cc: Zhiyong Tao , Lee Jones , 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 v4 05/12] regulator: dt-bindings: mt6358: Add MT6366 PMIC Date: Thu, 28 Sep 2023 16:55:28 +0800 Message-ID: <20230928085537.3246669-6-wenst@chromium.org> X-Mailer: git-send-email 2.42.0.582.g8ccd20d70d-goog In-Reply-To: <20230928085537.3246669-1-wenst@chromium.org> References: <20230928085537.3246669-1-wenst@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230928_015608_765253_C4804D18 X-CRM114-Status: GOOD ( 20.45 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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. The differences compared to the MT6358 are minimal: - Regulators removed: VCAMA1, VCAMA2, VCAMD, VCAMIO, VLDO28 - Regulators added: VM18, VMDDR, VSRAM_CORE Both PMIC models contain a chip ID register at the same address that can be used to differentiate the actual model. Thus, even though the MT6366 is not fully backward compatible with the MT6358, it still falls back on the MT6358 compatible string. It is up to the implementation to use the chip ID register as a probing mechanism. Update the MT6358 regulator binding and add entries for all the MT6366's regulators and their supplies. The regulator node names follow a cleaned up style without type prefixes and with underscores replaced with hyphens. Signed-off-by: Zhiyong Tao [wens@chromium.org: major rework and added commit message] Signed-off-by: Chen-Yu Tsai Reviewed-by: Rob Herring --- Changes since v3: - Expanded commit message to mention why a fallback compatible is used - Adapted to ldo_vxo22 and ldo_vusb movement to properties in previous patch - Split example into two, one for each variant - Renamed regulator node in examples to just "regulator" Changes since v2: - Merged all the propertyPatterns together; the if-then sections now only block out invalid properties 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 | 149 ++++++++++++++---- 1 file changed, 120 insertions(+), 29 deletions(-) diff --git a/Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml b/Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml index f2219d8656c2..c50402fcba72 100644 --- a/Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml +++ b/Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml @@ -16,30 +16,18 @@ description: properties: compatible: - const: mediatek,mt6358-regulator - - ldo_vxo22: - description: LDOs with fixed 2.2V output and 0~100/10mV tuning - type: object - $ref: regulator.yaml# - properties: - regulator-allowed-modes: false - unevaluatedProperties: false - - ldo_vusb: - description: LDOs with fixed 3.0V output and 0~100/10mV tuning - type: object - $ref: regulator.yaml# - properties: - regulator-allowed-modes: false - unevaluatedProperties: false + 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: @@ -59,18 +47,20 @@ 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, vm18 (MT6366 only) 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 + description: + Supply for LDOs vsram-core (MT6366 only), 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])$": + "^(buck_)?v(core|dram1|gpu|modem|pa|proc1[12]|s[12])$": description: Buck regulators type: object $ref: regulator.yaml# @@ -85,7 +75,7 @@ patternProperties: enum: [0, 1] unevaluatedProperties: false - "^ldo_v(a|rf)12$": + "^(ldo_)?v(a|rf)12$": description: LDOs with fixed 1.2V output and 0~100/10mV tuning type: object $ref: regulator.yaml# @@ -93,15 +83,24 @@ patternProperties: regulator-allowed-modes: false unevaluatedProperties: false - "^ldo_v((aux|cn|io|rf)18|camio)$": - description: LDOs with fixed 1.8V output and 0~100/10mV tuning + "^(ldo_)?v((aux|cn|io|rf)18|camio)$": + description: + LDOs with fixed 1.8V output and 0~100/10mV tuning (vcn18 on MT6366 has variable output) + type: object + $ref: regulator.yaml# + properties: + regulator-allowed-modes: false + unevaluatedProperties: false + + "^(ldo_)?vxo22$": + description: LDOs with fixed 2.2V output and 0~100/10mV tuning type: object $ref: regulator.yaml# properties: regulator-allowed-modes: false unevaluatedProperties: false - "^ldo_v(aud|bif|cn|fe|io)28$": + "^(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# @@ -109,7 +108,15 @@ patternProperties: regulator-allowed-modes: false unevaluatedProperties: false - "^ldo_vsram_(gpu|others|proc1[12])$": + "^(ldo_)?vusb$": + description: LDOs with fixed 3.0V output and 0~100/10mV tuning + type: object + $ref: regulator.yaml# + properties: + regulator-allowed-modes: false + unevaluatedProperties: false + + "^(ldo_)?vsram[_-](core|gpu|others|proc1[12])$": description: LDOs with variable output type: object $ref: regulator.yaml# @@ -117,7 +124,7 @@ patternProperties: regulator-allowed-modes: false unevaluatedProperties: false - "^ldo_v(cama[12]|camd|cn33|dram2|efuse|emc|ibr|ldo28|mc|mch|sim[12])$": + "^(ldo_)?v(cama[12]|camd|cn33|dram2|efuse|emc|ibr|ldo28|m18|mc|mch|mddr|sim[12])$": description: LDOs with variable output and 0~100/10mV tuning type: object $ref: regulator.yaml# @@ -130,6 +137,45 @@ required: additionalProperties: false +allOf: + - if: + properties: + compatible: + const: mediatek,mt6358-regulator + then: + patternProperties: + # Old regulator node name scheme (with prefix and underscores) only + # ([^y-] is used to avoid matching -supply + "^(? @@ -156,4 +202,49 @@ examples: }; }; + - | + #include + + 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 Thu Sep 28 08:55:29 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: 13402341 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 2350ECE7B12 for ; Thu, 28 Sep 2023 08:57:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=s8TdVx5FBsm8Yw8WcDwV7kIm5ztwsO2qDc5lghcy/bU=; b=nop11F+lgCuMqy DB4BM1OW3wpwVN5QD+rxPO+woUotT8B/8psYFWAqO8MVRoj42lMhXAvLp/QIBWX/0K25W5oMgzcwR LDbVXNTgf2CkbgoDCdAE7Ag4d124dNk2VXeyo8lKhw/aDSld+jLs+loiqQQhF+lC3mkEHF4MRC9ny cFCWs2MPXNG5Zc0JsOaWHZDQWc3o+vCMFNF9cfLGTOx7m7aRm+OqcpDMPXYrAwWicckAdTMu78Ieq J8UMURI5cYsyynkKEtZtHUOUTAE3LrIwc8KJUQDkkttR+3qOA6w60TnNxxl1gcd9ryPnW/1fGhGRX hgBjIvvdeKfRmPrp5asA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qlmpF-002frt-2y; Thu, 28 Sep 2023 08:56:50 +0000 Received: from mail-oi1-x22a.google.com ([2607:f8b0:4864:20::22a]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qlmod-002fUg-0b for linux-arm-kernel@lists.infradead.org; Thu, 28 Sep 2023 08:56:12 +0000 Received: by mail-oi1-x22a.google.com with SMTP id 5614622812f47-3ae5ce4a4ceso2377758b6e.1 for ; Thu, 28 Sep 2023 01:56:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1695891369; x=1696496169; darn=lists.infradead.org; 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=CZNL2xap7oS9tgNofh5Q08A9m6sr7oqpmvudQ+aQQzo=; b=fXnM0A2ROtgAc05SbPk7tkVA3SFJvxY2VSVr4sgWbLdJKIBf+1KnTyRRpbHbSMn+SQ /L/4koY57zsOEVd7Qa1y8s8YRwsdqofm2xaEJxQ00cQHU9e0YRfJLDBtGcWiAVUduSdR 1fQH8RqAdWb71d+R+b/wiSUMrGGioHKvQUwyo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695891369; x=1696496169; 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=CZNL2xap7oS9tgNofh5Q08A9m6sr7oqpmvudQ+aQQzo=; b=g1zTW4mFgqugLDg04298BMmmnTBfc5N8OqUqqjpLdtNHMO0aWL9wKzJhGveGzjuLcK KrpLoaKQpTxIdNW0CvVF0QzVCQsVCQLb70jTyGsVqJTgUexUBlMMLWUp83jidrj6AZeW RdcdvumusJpYifWtiR5SRre9ix08LuF2+B/Hjzv0Ey7kLqWHykiJU+Mu1fP3+exsCedx 7NtQsh+sKBMRfIdWoGdtVr4qP/UKUnrhIN0XWw1wu2mq7jJT/aoKmSRyTk9Tcld1EhHh u2tYlefrCcWJLAIOGmHuyD1Y0jT4fokhZ8MQGH0F8D+bNpW36TSCqnsGVHM68dvad6m0 cOkQ== X-Gm-Message-State: AOJu0YyoNigJX0vvONzLBVefCTfAoqWXoF2yyWQUP9BJ5p/SlUVb8Q30 FoEEo8SuM68YtPShg08hmmrZ5A== X-Google-Smtp-Source: AGHT+IHebtThJXaKtrU9g5yT/aInEDgutgbt2q6VlFhzqf+DJC7Yjfbm2/1ZK8V2h/BRrv/cAxfijQ== X-Received: by 2002:a05:6808:1b29:b0:3a4:2941:af49 with SMTP id bx41-20020a0568081b2900b003a42941af49mr787460oib.22.1695891369299; Thu, 28 Sep 2023 01:56:09 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:6747:c12a:dbfd:2cc7]) by smtp.gmail.com with ESMTPSA id y7-20020aa78047000000b006879493aca0sm1754016pfm.26.2023.09.28.01.56.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 01:56:08 -0700 (PDT) From: Chen-Yu Tsai To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Mark Brown Cc: Chen-Yu Tsai , Lee Jones , Zhiyong Tao , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH v4 06/12] regulator: mt6358: Use mt6397-regulator.h binding header for buck mode macros Date: Thu, 28 Sep 2023 16:55:29 +0800 Message-ID: <20230928085537.3246669-7-wenst@chromium.org> X-Mailer: git-send-email 2.42.0.582.g8ccd20d70d-goog In-Reply-To: <20230928085537.3246669-1-wenst@chromium.org> References: <20230928085537.3246669-1-wenst@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230928_015611_235050_9D594FD7 X-CRM114-Status: GOOD ( 15.76 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The (undocumented) possible values for the buck operating modes on the MT6358 are the same as those on the MT6397, both for the device tree bindings and the actual hardware register values. Reuse the macros for the MT6397 PMIC in the MT6358 regulator driver by including the mt6397-regulator.h binding header and replacing the existing macros. This aligns it with other PMIC. Signed-off-by: Chen-Yu Tsai Reviewed-by: AngeloGioacchino Del Regno --- Changes since v3: none Changes since v2: - new patch drivers/regulator/mt6358-regulator.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/regulator/mt6358-regulator.c b/drivers/regulator/mt6358-regulator.c index c4ecac5f3fc8..f966eedbbd6e 100644 --- a/drivers/regulator/mt6358-regulator.c +++ b/drivers/regulator/mt6358-regulator.c @@ -13,8 +13,7 @@ #include #include -#define MT6358_BUCK_MODE_AUTO 0 -#define MT6358_BUCK_MODE_FORCE_PWM 1 +#include /* * MT6358 regulators' information @@ -326,7 +325,7 @@ static const struct linear_range vldo28_ranges[] = { static unsigned int mt6358_map_mode(unsigned int mode) { - return mode == MT6358_BUCK_MODE_AUTO ? + return mode == MT6397_BUCK_MODE_AUTO ? REGULATOR_MODE_NORMAL : REGULATOR_MODE_FAST; } @@ -371,10 +370,10 @@ static int mt6358_regulator_set_mode(struct regulator_dev *rdev, switch (mode) { case REGULATOR_MODE_FAST: - val = MT6358_BUCK_MODE_FORCE_PWM; + val = MT6397_BUCK_MODE_FORCE_PWM; break; case REGULATOR_MODE_NORMAL: - val = MT6358_BUCK_MODE_AUTO; + val = MT6397_BUCK_MODE_AUTO; break; default: return -EINVAL; @@ -402,9 +401,9 @@ static unsigned int mt6358_regulator_get_mode(struct regulator_dev *rdev) } switch ((regval & info->modeset_mask) >> (ffs(info->modeset_mask) - 1)) { - case MT6358_BUCK_MODE_AUTO: + case MT6397_BUCK_MODE_AUTO: return REGULATOR_MODE_NORMAL; - case MT6358_BUCK_MODE_FORCE_PWM: + case MT6397_BUCK_MODE_FORCE_PWM: return REGULATOR_MODE_FAST; default: return -EINVAL; From patchwork Thu Sep 28 08:55:30 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: 13402348 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 04FBACE7B0C for ; Thu, 28 Sep 2023 08:58:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Ko6kGtT5kSC+gI3HWeScimBckrJLAuG+AZbkrKzSSEQ=; b=kUGH7pkGoDywt9 VIVdSulIzq6WQGgpuf+n1A3qIH4UA4zXcVlZ13Ww0pKNvVz7wmkMWfVwXGUFrJtjuTQn+0P6rEHHo 61plvV1O/jlFNXtYSOC3GmFhBhJ20wMYv/qQ7O8tMl8S0QTs+hpRtwSKZkH7h6cwX/LK3xwDwZTSd A9LqjDtRfKvewBJmg2BPDepEeaa3iav9W1UFlIRWX0d++1OoEbBpKc8OaBZ8Gp0lhtEbl7lJ1u1cb CbVLVSIIYOZCQ2hSPfMHPBUH4KDoCPRoxEh44wvDeV6O3OuXWc/uLYCR44hZAX1BXgxw90OehOixe iKYHFioy8MLgDjtOTFVA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qlmpz-002gGl-1t; Thu, 28 Sep 2023 08:57:35 +0000 Received: from mail-qk1-x734.google.com ([2607:f8b0:4864:20::734]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qlmog-002fWd-2r for linux-arm-kernel@lists.infradead.org; Thu, 28 Sep 2023 08:56:17 +0000 Received: by mail-qk1-x734.google.com with SMTP id af79cd13be357-774141bb415so691912385a.3 for ; Thu, 28 Sep 2023 01:56:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1695891372; x=1696496172; darn=lists.infradead.org; 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=UjsABOahH1p3zhr22T+S1Bqbs2ncgSaDPI7dTvpXP1g=; b=EU2bOAKs6SoMfjBIrGt5CXENRUIyltYWFPYcD3Iq34eAXdj2P3ACi3OI3td9+QpiGQ cObubBR5+B042DiIRY3jZagVeh1jHmYEXxrC71J2Qz9A74Tfd/P7Z5LqqHF0pCojPtbI Y0DX7sKOmAWSGq7s16Qhtu8BAoyoH9edfmP1M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695891372; x=1696496172; 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=UjsABOahH1p3zhr22T+S1Bqbs2ncgSaDPI7dTvpXP1g=; b=Ue8j00cN5lPTR7eDPa1tfUXDIedJsWMiCyaauL83ZDpqFdX65rQ4q7VpW/vJFPk7rM OFTHjc077x4N+MudtZ/gHv8mwvXF/xIQHu1H4CErzKU1rNuhFlFuIrQggON1h6HFOBbk b21Vq7tzUbyRGTx5AtdrzhzApjqaxf77UTMhM5voC/CIall9lc1OgFzOMoBaCwt4pQJv wOIwlsgHy+9/IBdaVhSEU+FvxSpkyhzxdZtiY+eJ4DcCBHb9jdmzxpD2fFu5CdxMFqhB GNhZ8fgH43sGzr8f67GZwIewZOi2DIcuOf1gC1RaJdJAxEem4QhpuJakXV6QL4mDsfMv J04Q== X-Gm-Message-State: AOJu0YzmTspDzaqElgw6o6rwGO3ESpil9nyC/y5v/lyoGm2K7Hm4us8s 8MF9h25P1UheJ+ZS90U84kuOWw== X-Google-Smtp-Source: AGHT+IFZINVPeqfJXErTN2rCie2lFwVJ1BC+/JJWIaLnQxgJjiXywQtmxwUlS2Xc1aMsn0eo3VO4Bw== X-Received: by 2002:a05:620a:22b8:b0:774:cf9:b206 with SMTP id p24-20020a05620a22b800b007740cf9b206mr483427qkh.42.1695891371958; Thu, 28 Sep 2023 01:56:11 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:6747:c12a:dbfd:2cc7]) by smtp.gmail.com with ESMTPSA id y7-20020aa78047000000b006879493aca0sm1754016pfm.26.2023.09.28.01.56.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 01:56:11 -0700 (PDT) From: Chen-Yu Tsai To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Mark Brown Cc: Chen-Yu Tsai , Lee Jones , Zhiyong Tao , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH v4 07/12] regulator: mt6358: Add supply names for MT6358 regulators Date: Thu, 28 Sep 2023 16:55:30 +0800 Message-ID: <20230928085537.3246669-8-wenst@chromium.org> X-Mailer: git-send-email 2.42.0.582.g8ccd20d70d-goog In-Reply-To: <20230928085537.3246669-1-wenst@chromium.org> References: <20230928085537.3246669-1-wenst@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230928_015614_946720_A2C71C9E X-CRM114-Status: GOOD ( 13.51 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 Reviewed-by: AngeloGioacchino Del Regno --- 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 f966eedbbd6e..3eb986d4e84b 100644 --- a/drivers/regulator/mt6358-regulator.c +++ b/drivers/regulator/mt6358-regulator.c @@ -33,12 +33,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_buck_ops, \ .type = REGULATOR_VOLTAGE, \ @@ -61,10 +62,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, \ @@ -85,12 +87,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, \ @@ -110,11 +112,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, \ @@ -463,79 +465,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 Thu Sep 28 08:55:31 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: 13402343 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 1F793CE7B0E for ; Thu, 28 Sep 2023 08:57:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=gRh+y18QKlCrYvQ9gsqAtVi1DpnOki5Kh4bO2C7N+ro=; b=UKAXuDL9cgVzvp RDoOAHnXIef7xb0lpfRb1icWJZ6FnOStq4BcyIURCJM8HqtbwPdoGwhzZ5z9U3vepm//0JfC0gUfr NUaulUj7K09rSGwBWnOLKxonpaEaEp8Ao5rcprGI4bPOVbZXFKPvuMOZhx8Q6dRBU6kgcMrHKQ2Ss FN+CK1GLL9jZmcntPkErgUIfqqqjlGYCnn3kLtk2UjmdDx0IS3VuK7t74VIWqWwrdxN2Q4rkTD5yx kc268PPp7dd59ap1PuS0XOoMMTa99K1Ut4tRGowIAejLkGhA+5n6oQwzz8sfKrSlp4CSgJmhO9E+Z IG5SX7tJ8w3KsT6miXtQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qlmpX-002g0t-2L; Thu, 28 Sep 2023 08:57:07 +0000 Received: from mail-oi1-x231.google.com ([2607:f8b0:4864:20::231]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qlmoh-002fXb-0m for linux-arm-kernel@lists.infradead.org; Thu, 28 Sep 2023 08:56:19 +0000 Received: by mail-oi1-x231.google.com with SMTP id 5614622812f47-3af609b9264so1043054b6e.2 for ; Thu, 28 Sep 2023 01:56:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1695891374; x=1696496174; darn=lists.infradead.org; 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=KS43ugTtRv88TppfROT73t1X2vCZps6UnoTX6p94tt4=; b=WVUsQEsB3ZpWN92uIEKPgqwQskytzEWTDLRVxWNlKWHm8Pyfk6FIaqyvFi6GuzhBgd rhg1pNS0UR+X0ZfFWLlLzh39XQJemGedclQGbeuscUEY3tJzbc8aYdv0ACBZOfC/bJv2 05OS4VhU5HjG4oXyfROlXyxcPvlpNGuVALlFc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695891374; x=1696496174; 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=KS43ugTtRv88TppfROT73t1X2vCZps6UnoTX6p94tt4=; b=nYPn/sXddJvsSB4MgX5Mo6XiLQtgNNi8rji0ds6r76Nff9K+tslI5WgFFp052qQHb3 n9lEgM0d1eUnA7SfO9ESECQVC0N157w11PQO1F2ZhWnE2S0aGMc0XjuOjdY85NdJMjh2 VuRNTFfe49emKVZxHunuFvLdqptDp+keHx7Z+h0FvHGhHkVaYWZNle3Wl8J1dKW70/3H Uf4onI5EWT4uJVdE6AJ8O0Ic3Z62mOb8SjobwGD7WbDeC0oP354Gvm06njDcDkPDr8BW nIgcvw2M6Tq76hNKyV2Po7U/XFOUE50/6oSjM/g7jeFl4vu162Lo58g5fbov1WROCRyH PrfQ== X-Gm-Message-State: AOJu0YywcKd3vwHLZyZaq4h3VSN3Oyd111A9/YSeH3klKfXuGmOCHo1G HZaTsHUfFy8B8myQUvi3iNrflA== X-Google-Smtp-Source: AGHT+IHx1NuPOchnwlk6KQlnQW1OFg5wY6MxUmswPEp9oZ2AJYSTUrGRiQF2pWEkziZ4A945PulJnw== X-Received: by 2002:a54:4002:0:b0:3a7:4cf6:f0cb with SMTP id x2-20020a544002000000b003a74cf6f0cbmr641906oie.21.1695891374605; Thu, 28 Sep 2023 01:56:14 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:6747:c12a:dbfd:2cc7]) by smtp.gmail.com with ESMTPSA id y7-20020aa78047000000b006879493aca0sm1754016pfm.26.2023.09.28.01.56.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 01:56:14 -0700 (PDT) From: Chen-Yu Tsai To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Mark Brown Cc: Chen-Yu Tsai , Lee Jones , Zhiyong Tao , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH v4 08/12] regulator: mt6358: fix and drop type prefix in MT6366 regulator node names Date: Thu, 28 Sep 2023 16:55:31 +0800 Message-ID: <20230928085537.3246669-9-wenst@chromium.org> X-Mailer: git-send-email 2.42.0.582.g8ccd20d70d-goog In-Reply-To: <20230928085537.3246669-1-wenst@chromium.org> References: <20230928085537.3246669-1-wenst@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230928_015615_292995_83C40B12 X-CRM114-Status: GOOD ( 12.04 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 3eb986d4e84b..14ed728fba69 100644 --- a/drivers/regulator/mt6358-regulator.c +++ b/drivers/regulator/mt6358-regulator.c @@ -537,68 +537,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 Thu Sep 28 08:55:32 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: 13402345 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 0BD2CCE7B0F for ; Thu, 28 Sep 2023 08:57:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=0USmn0/pshNub1VSCAFSE6OAnJcCGjfXK9Qd9CZk2dQ=; b=NK2/mfsKoOVLpq MpQnTGoAYjV1FCLE0wiZxcW3pHhkaZdo3633e9T9i2R+SEXbLfWtqcDSNtLtkBWirfMNcNpZouam2 0+VN0iLIckDD/mWZttNnxijijlaKreIjzM/tgSBggRg4XWoYdilF0J3MVT8Gm5fUVsIxVieTX7Mu2 3zcVk0GBCUdXphZ+b6XdUFBku1x/rLKvQJYTgenU+w0nYZsrnzxdxGUvCo9OfoD+LNjkfmdz+xKVg q8g68S2OXvLGMoXxBflR/uVg6DhGr6CUL0pKyB0GJCg0jv7p2tyC0DhO4haYj4fWRsZnitZ50JIv8 DpUuMSVtvZcMbrNQ0nOg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qlmpi-002g6U-0R; Thu, 28 Sep 2023 08:57:18 +0000 Received: from mail-qk1-x72a.google.com ([2607:f8b0:4864:20::72a]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qlmol-002fZB-1w for linux-arm-kernel@lists.infradead.org; Thu, 28 Sep 2023 08:56:22 +0000 Received: by mail-qk1-x72a.google.com with SMTP id af79cd13be357-774141bb415so691916585a.3 for ; Thu, 28 Sep 2023 01:56:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1695891377; x=1696496177; darn=lists.infradead.org; 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=lkJYdDv7vj4Uy20rk51h7r68X+BWwdYjEPU0JRU45tk=; b=i8DOvINyXqamuB9zU+O4qgHzlwGf2DFCN2w8SU8hhFxecGngbJC2f+98h4XUya4rnk 1vjXtNQopXN1gfgSOLpP0Sd+EAELsin8W7qZFEuLj3OL8CRP2L4pjDoGdipV+VpG5C1a oY7ZfoE+8c6A/NNF6iDEOlWyLhxmoDvuCJTzc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695891377; x=1696496177; 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=lkJYdDv7vj4Uy20rk51h7r68X+BWwdYjEPU0JRU45tk=; b=Lv5ZJsWHckAua7Dg9CUOqg2zL1IejcI5lK4nk1YKeQ6J3afrvkeKQCRgTPJxgnBU91 g+LRyan56eeQhdA6rhn5ckisTu/w1uV/+HtRDTOyVn7vAldXMeIXZbthFSLLyIDtRZLw zYCFXkWgpa5V7N06q6qNkeCtaOoSztcLTuiMaBzIbPNKtHBYzqsQqsP/47egFnmuHBd+ C747B3T2l468ibwzCQmcXqgUPiF2fRPTCDQOjZbP00UKyd2cOsItthTds1sCBp7ymwcx wj3GJYCr7HYYh+xVjgyKkVkIzhA1llu834OGTFuv0g9QxlQXMvuVpXe3WOrxk4xTP15K OfJw== X-Gm-Message-State: AOJu0Ywd1628AKeqGwkl/6+V5hn8d9IKpWbZQvQSffZt9xxLKanHQFj3 sVBCoEMcfbhUyZOqv+D+vJR7wQ== X-Google-Smtp-Source: AGHT+IFJJUO5Hu6UJlnYtKh2hlhvcGkIEdCg29daSxtYpNQfNXcbnh8wqyTgQizr5sFN95VktY0cuQ== X-Received: by 2002:a05:620a:25ce:b0:773:a229:5a4a with SMTP id y14-20020a05620a25ce00b00773a2295a4amr491245qko.25.1695891377265; Thu, 28 Sep 2023 01:56:17 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:6747:c12a:dbfd:2cc7]) by smtp.gmail.com with ESMTPSA id y7-20020aa78047000000b006879493aca0sm1754016pfm.26.2023.09.28.01.56.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 01:56:16 -0700 (PDT) From: Chen-Yu Tsai To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Mark Brown Cc: Chen-Yu Tsai , Lee Jones , Zhiyong Tao , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH v4 09/12] regulator: mt6358: Make MT6366 vcn18 LDO configurable Date: Thu, 28 Sep 2023 16:55:32 +0800 Message-ID: <20230928085537.3246669-10-wenst@chromium.org> X-Mailer: git-send-email 2.42.0.582.g8ccd20d70d-goog In-Reply-To: <20230928085537.3246669-1-wenst@chromium.org> References: <20230928085537.3246669-1-wenst@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230928_015619_662131_52D6C6BC X-CRM114-Status: GOOD ( 14.53 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=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 14ed728fba69..946f62242718 100644 --- a/drivers/regulator/mt6358-regulator.c +++ b/drivers/regulator/mt6358-regulator.c @@ -325,6 +325,27 @@ static const struct linear_range vldo28_ranges[] = { REGULATOR_LINEAR_RANGE(3000000, 0, 10, 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, 0, 10, 10000), + REGULATOR_LINEAR_RANGE(800000, 0, 10, 10000), + REGULATOR_LINEAR_RANGE(900000, 0, 10, 10000), + REGULATOR_LINEAR_RANGE(1000000, 0, 10, 10000), + REGULATOR_LINEAR_RANGE(1100000, 0, 10, 10000), + REGULATOR_LINEAR_RANGE(1200000, 0, 10, 10000), + REGULATOR_LINEAR_RANGE(1300000, 0, 10, 10000), + REGULATOR_LINEAR_RANGE(1400000, 0, 10, 10000), + REGULATOR_LINEAR_RANGE(1500000, 0, 10, 10000), + REGULATOR_LINEAR_RANGE(1600000, 0, 10, 10000), + REGULATOR_LINEAR_RANGE(1700000, 0, 10, 10000), + REGULATOR_LINEAR_RANGE(1800000, 0, 10, 10000), + REGULATOR_LINEAR_RANGE(1900000, 0, 10, 10000), + REGULATOR_LINEAR_RANGE(2000000, 0, 10, 10000), + REGULATOR_LINEAR_RANGE(2100000, 0, 10, 10000), +}; + static unsigned int mt6358_map_mode(unsigned int mode) { return mode == MT6397_BUCK_MODE_AUTO ? @@ -559,7 +580,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), @@ -592,6 +612,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 Thu Sep 28 08:55:33 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: 13402344 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 74855CE7B0C for ; Thu, 28 Sep 2023 08:57:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=g2Y5FMTYev/tJ5kb0z1U11ZiSvivjQY+lRzzlWn30ik=; b=o2lNDxbjU90JbR HkltYBQGPoFX50z84VBf2JhjyEW/fFyoWsgRcTYoA0iCDsswBTaabibyavUnePXC4CFRtt2ch/2T/ UOQeEs+ilmoIdVeN61Q400QpBSt4apdpmmVvUIkUTQx/a8/FWUqCUaoyg4YjCh68y+Nf7ANqoDIye YQkBLonMBWz8BI1+LLlxh8xnA4BSNnbRu8y0bmsJT4dUZjmnWd5exEbx0n7phY6JS9kFmktBkYplE fdpRR5KqhOG+QN7LjU5KUFyvUJspdw2QBLzk9iOQqZ0qf+B32wMYE0p3klrbhnIO+sa0bpF9OG3i5 ykSrOsL8h/G6TNNPmqtQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qlmpj-002g7L-1g; Thu, 28 Sep 2023 08:57:19 +0000 Received: from mail-qk1-x72d.google.com ([2607:f8b0:4864:20::72d]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qlmon-002fbN-2J for linux-arm-kernel@lists.infradead.org; Thu, 28 Sep 2023 08:56:23 +0000 Received: by mail-qk1-x72d.google.com with SMTP id af79cd13be357-77433e7a876so496479285a.3 for ; Thu, 28 Sep 2023 01:56:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1695891380; x=1696496180; darn=lists.infradead.org; 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=Y1ysO43s7Il7U+jMzlGc1ao7ahn2IQqlVk/2MjJCLAQ=; b=TE5mFyrVdrErzNqqxjT/PfGwXd1qLzMnZQlKUECmIbD2nKI4J0mic3o2Cud4J9o0Eh ufRL4+kcFhXSKibrRTAuAGs/ZO7rSR4Rd2Jy2rQzjh8v5tc+uf0c74qamWDm0wLvCQP9 8Ut4oitlaIKfZ1dz/VOhKhVd6ind1LUEoIZHE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695891380; x=1696496180; 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=Y1ysO43s7Il7U+jMzlGc1ao7ahn2IQqlVk/2MjJCLAQ=; b=PPD3iMOD1FzOzA1xy1+nBjrfAcpGfnDvGsOzdT6YIAILoC2xdCaFMNFW/GjtpWtkG0 bVQdX5lElR9kDKJg+4DLjybcVK2AUji4I1/Xk39LG2UBG5D8WWOnIVYzjp6YNlEed+R4 RUpLl+7bji8Mrrfd1HGClawo2O0oEfN4PneWpi3Bmf0kFtPDoWsukfoUUpuj/sbLIlCm 8oJPO7bWuhWojU/EY/2QZ7eEOpN6XHdFmMLMtxjKPxy2Jt7NB94b4N7XqTvSXBV+CLLU DZu7TpJ4kG42vbTT9l/In3TtoPXNHBU3LyFx3f/hb0yVRPRBUgIVyr/7GfRt/22vLKqV BXbQ== X-Gm-Message-State: AOJu0YyuEcGNyVIN4O7ZOnR0/3MLanzNA63hBwxaSV9zxNzbVulJygbK jH590SswUpiliqOnxV3Zk2+eNw== X-Google-Smtp-Source: AGHT+IHdGRzcQ+qBUJeM0+BjeTmyn/JEOqWxoDA/9cGUAzgTiR0JAVlEKcqVpHsjOcPeWdSwpV48Jw== X-Received: by 2002:a05:620a:458b:b0:76f:f64:58bf with SMTP id bp11-20020a05620a458b00b0076f0f6458bfmr620884qkb.18.1695891379911; Thu, 28 Sep 2023 01:56:19 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:6747:c12a:dbfd:2cc7]) by smtp.gmail.com with ESMTPSA id y7-20020aa78047000000b006879493aca0sm1754016pfm.26.2023.09.28.01.56.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 01:56:19 -0700 (PDT) From: Chen-Yu Tsai To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Mark Brown Cc: Chen-Yu Tsai , Lee Jones , Zhiyong Tao , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH v4 10/12] regulator: mt6358: Add missing regulators for MT6366 Date: Thu, 28 Sep 2023 16:55:33 +0800 Message-ID: <20230928085537.3246669-11-wenst@chromium.org> X-Mailer: git-send-email 2.42.0.582.g8ccd20d70d-goog In-Reply-To: <20230928085537.3246669-1-wenst@chromium.org> References: <20230928085537.3246669-1-wenst@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230928_015621_846125_0B2F05DB X-CRM114-Status: GOOD ( 16.95 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 Acked-by: Lee Jones --- drivers/regulator/mt6358-regulator.c | 20 ++++++++++++++++++++ include/linux/mfd/mt6358/registers.h | 17 +++++++++++++++++ include/linux/regulator/mt6358-regulator.h | 3 +++ 3 files changed, 40 insertions(+) diff --git a/drivers/regulator/mt6358-regulator.c b/drivers/regulator/mt6358-regulator.c index 946f62242718..5e23b2aa3486 100644 --- a/drivers/regulator/mt6358-regulator.c +++ b/drivers/regulator/mt6358-regulator.c @@ -325,6 +325,20 @@ static const struct linear_range vldo28_ranges[] = { REGULATOR_LINEAR_RANGE(3000000, 0, 10, 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, 0, 10, 10000), + REGULATOR_LINEAR_RANGE(800000, 0, 10, 10000), + REGULATOR_LINEAR_RANGE(900000, 0, 10, 10000), + REGULATOR_LINEAR_RANGE(1000000, 0, 10, 10000), + REGULATOR_LINEAR_RANGE(1100000, 0, 10, 10000), + REGULATOR_LINEAR_RANGE(1200000, 0, 10, 10000), + REGULATOR_LINEAR_RANGE(1300000, 0, 10, 10000), + REGULATOR_LINEAR_RANGE(1500000, 0, 10, 10000), + REGULATOR_LINEAR_RANGE(1800000, 0, 10, 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[] = { @@ -614,6 +628,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, @@ -622,6 +640,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/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__ */ 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 Thu Sep 28 08:55:34 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: 13402346 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 E8E15CE7B0E for ; Thu, 28 Sep 2023 08:57:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=VDUhm+IT6+7Ir5tSzcxNxbyhkD3UKj7VAcKQt82WCZs=; b=rHMoqeyOX8oFSp t9uAprdVzfJi2Gfas80a09x4q4DoXobbzAC2zf1IoWTzHsRvKP+iU843E3HPupGrEfSbNBO7aq3vp UqBAsGHJgjs58bTeEDhWmMHLXARdP89QgfkqESBk+bdjeCBsytikejkJglFRovmo0yOyXdvYPEkmX Fn5xLPocqNeYoVk61AdurAkfmSuxfEtyBkI4S54pPr9CozU76nYOMFB2g9SacIKiox+rw9IjT6l48 8AaMBN2jls7zKl/0zX/HamXugK9ArN45k2TpVh64i+vmkAEeIDw6L+NqyR6jDgQX0QsvpycF5KUZL 398mDpsv8FGTROlcnVAg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qlmq1-002gIP-25; Thu, 28 Sep 2023 08:57:37 +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 1qlmot-002fdX-0V for linux-arm-kernel@lists.infradead.org; Thu, 28 Sep 2023 08:56:29 +0000 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-690bccb0d8aso10090796b3a.0 for ; Thu, 28 Sep 2023 01:56:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1695891382; x=1696496182; darn=lists.infradead.org; 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=7qcgxDDgTxmmlWPjM/0+c7XReaFHyX/zuBcA4QvtDQY=; b=FHk9OhCKzKVzR1t4SwK2/avpA/ieicShofjly+NJWTKpMx3rTKFHwbrZDlo9+xuTn6 TB8KOnPmPkT17ucx7JvUxNRbB9TD/ZR6Wz7A1y5vZOaBtABNeN8pFuSAQCG0B3g7juDw OMDqRXbcQSq3jbZME+ue/f2lKb1M0DMpxIBek= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695891382; x=1696496182; 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=7qcgxDDgTxmmlWPjM/0+c7XReaFHyX/zuBcA4QvtDQY=; b=CmmjsaPdgzJfj5LrDE1ETMIeq1cwZFsi8k8BNmMt2m0Jf0OW7WDKcErsFViVZU6f6K NCMypGGKlXmI7bWM8hi7kpIIlM1iJNhTWB/9aH2AnIipW8mmLcqk7RjbBa7Mez0aKjvU CzCQJ7z9WEUzpJdQawzi5trGnpqTFe8gYBlfaricN5FM6s44wzXtaIeeWZ+H8yBZuUZL g7rLcY9fjF3Mbu+4JIVSc/4u4+NNzIRdoMkQZlFLm9AgOW1j0nRr+tIkLayFQ8U0addA NYZ8qVu39YBGaPKJfGSVRy8mN+dZbAmAa6UuRy/a5rfct41KddUQPoC9yqVOgTL2/ghq CBiw== X-Gm-Message-State: AOJu0Yx0CBO6/8zMpbbvj3URgnVYQQvdYcyk1+8MG+QI9QqrrcG3hcNY GWB7IN3iUoWSDGl8RQhmbvm4tQ== X-Google-Smtp-Source: AGHT+IEbC1DfcQTzvr/VDegJYIwKsqykMBRcPoCKDGRSMbMMOGpy+69L6M58eH14QgMEqyDtdQtl2Q== X-Received: by 2002:a05:6a00:3a1e:b0:68e:417c:ed5c with SMTP id fj30-20020a056a003a1e00b0068e417ced5cmr519182pfb.32.1695891382577; Thu, 28 Sep 2023 01:56:22 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:6747:c12a:dbfd:2cc7]) by smtp.gmail.com with ESMTPSA id y7-20020aa78047000000b006879493aca0sm1754016pfm.26.2023.09.28.01.56.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 01:56:22 -0700 (PDT) From: Chen-Yu Tsai To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Mark Brown Cc: Chen-Yu Tsai , Lee Jones , Zhiyong Tao , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH v4 11/12] regulator: mt6358: Add supply names for MT6366 regulators Date: Thu, 28 Sep 2023 16:55:34 +0800 Message-ID: <20230928085537.3246669-12-wenst@chromium.org> X-Mailer: git-send-email 2.42.0.582.g8ccd20d70d-goog In-Reply-To: <20230928085537.3246669-1-wenst@chromium.org> References: <20230928085537.3246669-1-wenst@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230928_015627_205241_17C9E5E3 X-CRM114-Status: GOOD ( 13.51 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 --- 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 5e23b2aa3486..e4745f616cea 100644 --- a/drivers/regulator/mt6358-regulator.c +++ b/drivers/regulator/mt6358-regulator.c @@ -140,6 +140,7 @@ struct mt6358_regulator_info { [MT6366_ID_##vreg] = { \ .desc = { \ .name = #vreg, \ + .supply_name = "vsys-" match, \ .of_match = of_match_ptr(match), \ .ops = &mt6358_buck_ops, \ .type = REGULATOR_VOLTAGE, \ @@ -162,10 +163,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, \ @@ -186,12 +188,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, \ @@ -211,11 +213,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, \ @@ -590,57 +592,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 Thu Sep 28 08:55:35 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: 13402347 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 5BB67CE7B0C for ; Thu, 28 Sep 2023 08:58:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=6Iu87A47+9DhhCJMQNF4TyMSOnojL5fnsUzH7X/pfcs=; b=4J0AcNpI7A1ynx tGaB8UEOydgzDaX6UiD+7AEdaxx/aBHShCsBPOIuB09Mg7QMCf3y88PpBxP9bzE+1IjdsnvpV/OEB akDsDTGoyuNdgOCdts0rPp5QW3y8F59pH6120pzUvBubKMipPYX9yJ9KcSmXwNbDnPD5HCwfmxrl3 1hTD3DXXOSL22yHawXgE+mlPQaSvavYOOY/WUe03lLzs8SAQpkRDv1VQi+zeupcBrQJBIjh1aC/rP cd+5ytSFvJxoSfidEHak6YnW0md4q/d8TcBcAis36b6GXt5NlPZNn+Wl2DaVxbnQa/oxCXvTODZXi DthEh+4h8XQs1RD/JQKQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qlmq0-002gHO-1f; Thu, 28 Sep 2023 08:57:36 +0000 Received: from mail-qk1-x72b.google.com ([2607:f8b0:4864:20::72b]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qlmot-002ffL-17 for linux-arm-kernel@lists.infradead.org; Thu, 28 Sep 2023 08:56:29 +0000 Received: by mail-qk1-x72b.google.com with SMTP id af79cd13be357-7757523362fso178151485a.0 for ; Thu, 28 Sep 2023 01:56:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1695891385; x=1696496185; darn=lists.infradead.org; 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=qgeyQ9XqFkXYBeBValgSP4KCftxD8NcYA2elGZ0g2+A=; b=cU7iNHLvHwgq31Ur7C5hv2nFptZono0HCwNc1roPAvHdTKa+Z1XKz2OWvOU8G+GcQk y4oJhfqc0bAhxDraSPjJgqpd7l4DRxyBy4evaWrEBPqFmB/KHHPHns3MZY3qI5vGR4xZ j9bQ8e4dLwHgbVFWFn6nAG80pzLm7KFwQw2a8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695891385; x=1696496185; 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=qgeyQ9XqFkXYBeBValgSP4KCftxD8NcYA2elGZ0g2+A=; b=ct8sV05Tw+YyVNrsHBRZ45Y+NahJJb/k60CQ7lJj27zGun8G0Tv+zWHkBR8n7cLbUk SKChYpiCyZ4reGXOEILVHxd+ETUz04TmYqnhpeYQv62xKh4m4gx1QNzrLlVf67Pjq00S 49cPgqW5CIgbEgW08gL4BCRXFQUgpA9U23FHr506g5JDPqdyy7WAU0GXcvJu0kp1Uf5b 1Z9qIH/TdDFT+96nQfA1/piZw0JcWIsssgu/qPnw00kxyuYB4168bhLqV43jREBAYva6 HQk76RKGze/Or5SZ+izZzYyma7CrDWY4D9cIILZEUy28NSHKi/cqnUQ+Swp2bek4wUrd 9/pQ== X-Gm-Message-State: AOJu0YwAocfP6gMps1mo9jHIfjlQs5iVVDvIKb8byv3aex4HTlOwOBlc VRiv/6i+A+mwZTNDyviC6BtM8g== X-Google-Smtp-Source: AGHT+IFqaLEZNfjA5pU7uen9wRPCrpJO5khkqsKxmyJDY4pM7Sk8LJdyfVsz0G2Qn3psaxuRQUKg3Q== X-Received: by 2002:a05:620a:2191:b0:76e:ec77:10a4 with SMTP id g17-20020a05620a219100b0076eec7710a4mr561459qka.77.1695891385357; Thu, 28 Sep 2023 01:56:25 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:6747:c12a:dbfd:2cc7]) by smtp.gmail.com with ESMTPSA id y7-20020aa78047000000b006879493aca0sm1754016pfm.26.2023.09.28.01.56.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 01:56:24 -0700 (PDT) From: Chen-Yu Tsai To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Mark Brown Cc: Chen-Yu Tsai , Lee Jones , Zhiyong Tao , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH v4 12/12] arm64: dts: mediatek: mt8183-kukui: Add PMIC regulator supplies Date: Thu, 28 Sep 2023 16:55:35 +0800 Message-ID: <20230928085537.3246669-13-wenst@chromium.org> X-Mailer: git-send-email 2.42.0.582.g8ccd20d70d-goog In-Reply-To: <20230928085537.3246669-1-wenst@chromium.org> References: <20230928085537.3246669-1-wenst@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230928_015627_518511_E02FF9DE X-CRM114-Status: GOOD ( 12.37 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 Reviewed-by: AngeloGioacchino Del Regno --- .../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 ab2eb4500643..bf7de35ffcbc 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>;