From patchwork Tue Sep 19 10:43:44 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: 1836627 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=UjPI7JOa; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=permerror (SPF Permanent Error: More than 10 MX records returned) smtp.mailfrom=vger.kernel.org (client-ip=2604:1380:45e3:2400::1; helo=sv.mirrors.kernel.org; envelope-from=devicetree+bounces-1357-incoming-dt=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org [IPv6:2604:1380:45e3:2400::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RqdfM5hqZz1ync for ; Tue, 19 Sep 2023 20:47:39 +1000 (AEST) Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 542A6281AA0 for ; Tue, 19 Sep 2023 10:47:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7B6E61E511; Tue, 19 Sep 2023 10:47:30 +0000 (UTC) X-Original-To: devicetree@vger.kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0113A18622 for ; Tue, 19 Sep 2023 10:47:28 +0000 (UTC) Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4849C128 for ; Tue, 19 Sep 2023 03:47:27 -0700 (PDT) Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-1c43166b7e5so37263555ad.3 for ; Tue, 19 Sep 2023 03:47:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1695120446; x=1695725246; darn=vger.kernel.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=roMXUVdcRuUMZfWgJQHOy3KXiY94dTO1sbgsCPHuaMo=; b=UjPI7JOa8q9pVwx3Qf+QGU/XhBeSJCYRDJC7uce322v0a1eDmS7I5xldXQ3EpWObA2 FhTp/Zo9XPbcSiNfzT3J1bFVlfoF3H2PBHE8M8RcY+37Q9u8TwwHx6hlAedhzbPXjxEJ UStJ+At6ah7V9MAFwx3df//B6qw76NpfuCnZI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695120446; x=1695725246; 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=roMXUVdcRuUMZfWgJQHOy3KXiY94dTO1sbgsCPHuaMo=; b=xL+pbWj55cuUIO48stBTQzIB7xb5dFD0LZABrDaA8zBAuKwR43YXfMi/mgsLVREJmo jopDk7Dy5EmAtzJc0ei/Qg62w6Ocz422e6fsJe7NO4fVhgBv5QEZsvYDLMAYnh58fwvI tKjZJAUkrrueUjKVSMdo5f2NBatqULaP7H/ZWjNVGnXToXw6g1qRn8oG4N0Btlklkx03 gygYeZq10Tvk7uxFkqB9yR5A8L3vhKPQQmAlSLiFPHCSN+8BvlnZt48MygZYy+Pp2zsg 4q167LR6t7HeRahIt/L4cH5FKt8ndtosGZVBR2lRCYByOLbdETrE8pciC0/X9guLCgeZ ZxTg== X-Gm-Message-State: AOJu0Yy8+flcwnL+MWnwwcLNCFKvFnjE7SA6nMM2y1ehQ66wgcl7bN0M d6anHyPhMCKM9P2+izmDJ/0X/Q== X-Google-Smtp-Source: AGHT+IHByD4aXAEIfJqjVdUWt5nQ2XSTSmvOVgjkqXc4jrpM+uK3fZO6JsrMom+d02up4tdOT4JZyA== X-Received: by 2002:a17:902:ea0a:b0:1c0:9b7c:f82a with SMTP id s10-20020a170902ea0a00b001c09b7cf82amr14897917plg.53.1695120446625; Tue, 19 Sep 2023 03:47:26 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:40a:900d:e731:5a43]) by smtp.gmail.com with ESMTPSA id c10-20020a170902d48a00b001bc445e249asm6719578plg.124.2023.09.19.03.47.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 03:47:26 -0700 (PDT) From: Chen-Yu Tsai To: Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Mark Brown Cc: Chen-Yu Tsai , Zhiyong Tao , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Krzysztof Kozlowski Subject: [PATCH v3 01/12] dt-bindings: mfd: mt6397: Split out compatible for MediaTek MT6366 PMIC Date: Tue, 19 Sep 2023 18:43:44 +0800 Message-ID: <20230919104357.3971512-2-wenst@chromium.org> X-Mailer: git-send-email 2.42.0.459.ge4e396fd5e-goog In-Reply-To: <20230919104357.3971512-1-wenst@chromium.org> References: <20230919104357.3971512-1-wenst@chromium.org> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 --- Documentation/devicetree/bindings/mfd/mt6397.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/mfd/mt6397.txt b/Documentation/devicetree/bindings/mfd/mt6397.txt index 294693a8906c..10540aa7afa1 100644 --- a/Documentation/devicetree/bindings/mfd/mt6397.txt +++ b/Documentation/devicetree/bindings/mfd/mt6397.txt @@ -22,8 +22,9 @@ compatible: "mediatek,mt6323" for PMIC MT6323 "mediatek,mt6331" for PMIC MT6331 and MT6332 "mediatek,mt6357" for PMIC MT6357 - "mediatek,mt6358" for PMIC MT6358 and MT6366 + "mediatek,mt6358" for PMIC MT6358 "mediatek,mt6359" for PMIC MT6359 + "mediatek,mt6366", "mediatek,mt6358" for PMIC MT6366 "mediatek,mt6397" for PMIC MT6397 Optional subnodes: @@ -40,6 +41,7 @@ Optional subnodes: - compatible: "mediatek,mt6323-regulator" see ../regulator/mt6323-regulator.txt - compatible: "mediatek,mt6358-regulator" + - compatible: "mediatek,mt6366-regulator", "mediatek-mt6358-regulator" see ../regulator/mt6358-regulator.txt - compatible: "mediatek,mt6397-regulator" see ../regulator/mt6397-regulator.txt From patchwork Tue Sep 19 10:43:45 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: 1836630 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=E70vQfMn; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=permerror (SPF Permanent Error: More than 10 MX records returned) smtp.mailfrom=vger.kernel.org (client-ip=2604:1380:45e3:2400::1; helo=sv.mirrors.kernel.org; envelope-from=devicetree+bounces-1359-incoming-dt=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org [IPv6:2604:1380:45e3:2400::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RqdfZ6NhLz1ync for ; Tue, 19 Sep 2023 20:47:50 +1000 (AEST) Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 7F810281AB0 for ; Tue, 19 Sep 2023 10:47:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B9B822E65F; Tue, 19 Sep 2023 10:47:36 +0000 (UTC) X-Original-To: devicetree@vger.kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A74AD18622 for ; Tue, 19 Sep 2023 10:47:34 +0000 (UTC) Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C504CFB for ; Tue, 19 Sep 2023 03:47:29 -0700 (PDT) Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-1c328b53aeaso49364725ad.2 for ; Tue, 19 Sep 2023 03:47:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1695120449; x=1695725249; darn=vger.kernel.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=cWWr9tJkTGpmSZl1HYbndhbuM8BzxHdpYCoI6IJDPPY=; b=E70vQfMnlQ039f1xccLAM2mWD9jltPmvrvAj0vqbUQYr3PHFjHcHnO44wIqSwIcQgP 4Hu9uzwpezCnLMDF2XArQBfO39ZGxLz6BA1nDkglGj7y0cBkoXLe5q1ksfBThe2eGpfi W0I2MU9f0pET+No91pgMPD3308B4qZNj4NGv8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695120449; x=1695725249; 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=cWWr9tJkTGpmSZl1HYbndhbuM8BzxHdpYCoI6IJDPPY=; b=QcBaGZnOO0xC5Nhp7A5GH6qwLirTRiADoPIrpGhBXE0FW9F9mq8a0/AY1MCvPIXaIO xqa2trCHJZg+AiJ1WuSPJoUKtHOeDdW+oz+kOuOlIbWreOlpKAl/GNa3/4pQmYnAeKFl qEHqQj+gbaiVMaOp5en8yg50JTyLp2uBvbbmxZ8h594x0aM1E0hJrbbFqPB0kbuP2OxR 2g2jBWqwCCwzzP4URLvS0OBhZM2crietcR44l+I2ZzgeMnQHa7t8sSKGNBplvaL8yCae hnBKPIxXy/l8+mhiC/E6W90g/X2OjWFjm4WONBXZwmh20YHxLxxSyHoBzEMihLPOGk0n NzWA== X-Gm-Message-State: AOJu0YxRw/DZDKc3xwaZZUwBEaWL6tI6UUph8zcVGOMj4BwheBzmTRgk oixpRBAlqmkmNTwioK+PDF2IgQ== X-Google-Smtp-Source: AGHT+IEW0rCU6ATWAICVThioBhDiCy/XXNCa2chgHSYjOhSW+oAvm37Z98KXkYTlpdNADKZTnajRKg== X-Received: by 2002:a17:902:7796:b0:1bd:da96:dc70 with SMTP id o22-20020a170902779600b001bdda96dc70mr11145224pll.49.1695120449235; Tue, 19 Sep 2023 03:47:29 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:40a:900d:e731:5a43]) by smtp.gmail.com with ESMTPSA id c10-20020a170902d48a00b001bc445e249asm6719578plg.124.2023.09.19.03.47.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 03:47:28 -0700 (PDT) From: Chen-Yu Tsai To: Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Mark Brown Cc: Chen-Yu Tsai , Zhiyong Tao , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH v3 02/12] regulator: dt-bindings: mt6358: Convert to DT schema Date: Tue, 19 Sep 2023 18:43:45 +0800 Message-ID: <20230919104357.3971512-3-wenst@chromium.org> X-Mailer: git-send-email 2.42.0.459.ge4e396fd5e-goog In-Reply-To: <20230919104357.3971512-1-wenst@chromium.org> References: <20230919104357.3971512-1-wenst@chromium.org> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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. Cc: Zhiyong Tao Signed-off-by: Chen-Yu Tsai --- 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 | 97 +++++ .../bindings/regulator/mt6358-regulator.txt | 350 ------------------ 2 files changed, 97 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..5daef024de3e --- /dev/null +++ b/Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml @@ -0,0 +1,97 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/regulator/mediatek,mt6358-regulator.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: MediaTek MT6358 Regulator + +maintainers: + - Zhiyong Tao + +description: + Regulator node of the PMIC. This node should under the PMIC's device node. + All voltage regulators provided by the PMIC are described as sub-nodes of + this node. + +properties: + compatible: + const: mediatek,mt6358-regulator + +patternProperties: + "^buck_v(core|dram1|gpu|modem|pa|proc1[12]|s[12])$": + description: Buck regulators + type: object + $ref: regulator.yaml# + unevaluatedProperties: false + + "^ldo_v(a|rf)12$": + description: LDOs with fixed 1.2V output and 0~100/10mV tuning + type: object + $ref: regulator.yaml# + unevaluatedProperties: false + + "^ldo_v((aux|cn|io|rf)18|camio)$": + description: LDOs with fixed 1.8V output and 0~100/10mV tuning + type: object + $ref: regulator.yaml# + unevaluatedProperties: false + + "^ldo_vxo22$": + description: LDOs with fixed 2.2V output and 0~100/10mV tuning + type: object + $ref: regulator.yaml# + unevaluatedProperties: false + + "^ldo_v(aud|bif|cn|fe|io)28$": + description: LDOs with fixed 2.8V output and 0~100/10mV tuning + type: object + $ref: regulator.yaml# + unevaluatedProperties: false + + "^ldo_vusb$": + description: LDOs with fixed 3.0V output and 0~100/10mV tuning + type: object + $ref: regulator.yaml# + unevaluatedProperties: false + + "^ldo_vsram_(gpu|others|proc1[12])$": + description: LDOs with variable output + type: object + $ref: regulator.yaml# + unevaluatedProperties: false + + "^ldo_v(cama[12]|camd|cn33|dram2|efuse|emc|ibr|ldo28|mc|mch|sim[12])$": + description: LDOs with variable output and 0~100/10mV tuning + type: object + $ref: regulator.yaml# + unevaluatedProperties: false + +required: + - compatible + +additionalProperties: false + +examples: + - | + 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 Tue Sep 19 10:43:46 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: 1836629 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=nLVfyZne; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=permerror (SPF Permanent Error: More than 10 MX records returned) smtp.mailfrom=vger.kernel.org (client-ip=2604:1380:45e3:2400::1; helo=sv.mirrors.kernel.org; envelope-from=devicetree+bounces-1358-incoming-dt=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org [IPv6:2604:1380:45e3:2400::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RqdfT2xqrz1yny for ; Tue, 19 Sep 2023 20:47:45 +1000 (AEST) Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 27308281B21 for ; Tue, 19 Sep 2023 10:47:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4045727731; Tue, 19 Sep 2023 10:47:36 +0000 (UTC) X-Original-To: devicetree@vger.kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CDC96EAE1 for ; Tue, 19 Sep 2023 10:47:34 +0000 (UTC) Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75AEF12D for ; Tue, 19 Sep 2023 03:47:32 -0700 (PDT) Received: by mail-pg1-x530.google.com with SMTP id 41be03b00d2f7-57767b2058cso3181164a12.1 for ; Tue, 19 Sep 2023 03:47:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1695120452; x=1695725252; darn=vger.kernel.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=DfsDvbPSiwYQ6ykzK/+9gGTqaEflNO3ef5+ehoxsuns=; b=nLVfyZneTcBJ/lTRGHVYuKIhZKV9MUSv/+e5lYgHPZIrNtLR1Q4Jp+e6/q4YqWg4cJ 9w/sAHM68WJnsjp0tw1+qejgP5qMnYJ0QXLvAsm/ftp+xnC8d2QnCp7I2jKZ19EP/J9d iBN6pqwtESAE+nAm7qvjfi3oi8FeSnlKetiDQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695120452; x=1695725252; 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=DfsDvbPSiwYQ6ykzK/+9gGTqaEflNO3ef5+ehoxsuns=; b=qrd2V9TmgwekM7SFT2qgOaj99yiIhBjOkNSsKGOD4dQSQECIBQXNOBUjKYR8Pi4IhL l3s0rwqymU1SL/McpIBS7/O3mO/fsLjfGG6oSD9NpE7/auRHRZyxPgpIJjd1cYrg8aQW nKYic9qizuqSq3BX7wsZP8mstyyd7PZNiWdd6O6i2xxqoTDRBQwKuQSoGcSJDCFVBtja IMWCY4y8IilE/4oO35iyf/igPGGKs//6LosLEBob0+5pDf5uzncR4XIoxlGXTsuTmIcZ 1sJqGEzbR1ASoVsjPn57ayKUIir2KFgQdLaqcfnmoyBi22Qic6CiiEWd8v2tLsRQ2YsM 7NSg== X-Gm-Message-State: AOJu0YyPGMBL2PCxi4rmtHbyrlN4+vwFI7jom2vYhbfhskrWhwlBH1tX AWP5ZBEdUNXWcf1AJVkFLAq8OQ== X-Google-Smtp-Source: AGHT+IE5Vei5aZs2np5Axe2YBgPyKwPoboQ8aw1zKo4wXP/xj7KGpl92oYuS6GOzCirq4QXhP1nLtg== X-Received: by 2002:a05:6a21:498e:b0:142:aced:c643 with SMTP id ax14-20020a056a21498e00b00142acedc643mr10956371pzc.31.1695120451840; Tue, 19 Sep 2023 03:47:31 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:40a:900d:e731:5a43]) by smtp.gmail.com with ESMTPSA id c10-20020a170902d48a00b001bc445e249asm6719578plg.124.2023.09.19.03.47.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 03:47:31 -0700 (PDT) From: Chen-Yu Tsai To: Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Mark Brown Cc: Chen-Yu Tsai , Zhiyong Tao , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH v3 03/12] regulator: dt-bindings: mt6358: Add regulator-allowed-modes property Date: Tue, 19 Sep 2023 18:43:46 +0800 Message-ID: <20230919104357.3971512-4-wenst@chromium.org> X-Mailer: git-send-email 2.42.0.459.ge4e396fd5e-goog In-Reply-To: <20230919104357.3971512-1-wenst@chromium.org> References: <20230919104357.3971512-1-wenst@chromium.org> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 --- 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 5daef024de3e..62e8fa6b4306 100644 --- a/Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml +++ b/Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml @@ -23,48 +23,71 @@ 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_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$": 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_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_(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: @@ -74,6 +97,8 @@ additionalProperties: false examples: - | + #include + regulator { compatible = "mediatek,mt6358-regulator"; @@ -83,6 +108,8 @@ examples: regulator-max-microvolt = <900000>; regulator-ramp-delay = <6250>; regulator-enable-ramp-delay = <200>; + regulator-allowed-modes = ; }; ldo_vsram_gpu { From patchwork Tue Sep 19 10:43:47 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: 1836631 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=cRB+Fyg+; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=permerror (SPF Permanent Error: More than 10 MX records returned) smtp.mailfrom=vger.kernel.org (client-ip=2604:1380:45d1:ec00::1; helo=ny.mirrors.kernel.org; envelope-from=devicetree+bounces-1360-incoming-dt=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org [IPv6:2604:1380:45d1:ec00::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Rqdfj5CDgz1ync for ; Tue, 19 Sep 2023 20:47:57 +1000 (AEST) Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id A6D961C20CE7 for ; Tue, 19 Sep 2023 10:47:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F414F328A3; Tue, 19 Sep 2023 10:47:37 +0000 (UTC) X-Original-To: devicetree@vger.kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B368D2E65D for ; Tue, 19 Sep 2023 10:47:36 +0000 (UTC) Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E9AD512C for ; Tue, 19 Sep 2023 03:47:34 -0700 (PDT) Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-1c0c6d4d650so49565315ad.0 for ; Tue, 19 Sep 2023 03:47:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1695120454; x=1695725254; darn=vger.kernel.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=BSYY97oVgPZ5kb8TuDqHkXyCfyuOKBglbVv/457JBMY=; b=cRB+Fyg+q4cb0QH9ABSJaM+9ir+R6imGfBSqciQxsbna5lw9aTYb0Qmkmi/sAEFj8r QkSth+dHRy1y0QOm13mpCtAqBfJz8gsnjQA6xGndBmtR5BFcZV3pd06jip3AGW5iS7HA wrW+0VLskk+qLVZwqyw7gCLK94+9swqGY9ogI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695120454; x=1695725254; 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=BSYY97oVgPZ5kb8TuDqHkXyCfyuOKBglbVv/457JBMY=; b=Koh5jqTKjSb+d4s8Ojdc+h3tjuELgoPDrBP0kqLgzNhfpaMJeqnMG3L31A53El+JWE U2mO8l+6svJ36rWbKab27Klk5aL2+e4Y/ZGmCFmQq3ae8jIQdShadsc7ztiz4IscF6bs gmjCl2+EkeGrac63OKrvdUnlt2vTQfxScyD8iNqmC+3LAVNh/O5QS096ZwiXVR34ljhW h0u5vwoOGdjClmGHoYc4ujyM2j3CX1vQ8VBSEtdxfIAfuw1Bx1RPG8MvemWvKzHkGuSl ul4vI5Z9K3b3khDq8k8yHUu1djOpxB7PRXm2gRrUG2cEwmPTQm23WQcMXl72Ofg8jYNa /CWg== X-Gm-Message-State: AOJu0YzW7Zv1+BLp2LQ8j2vvgMpj2dDbSgLmXYpPIm/L9O/ZV8CU36y7 CKEZN3hBZlen7Ppu5Psm1WolCw== X-Google-Smtp-Source: AGHT+IH8dslqjluxddWZr48ltSB+HQMspK87ZRjKTboJ64j/tCHjB7w/HcgYb7fjZuvBhKtht5Dkqg== X-Received: by 2002:a17:902:be0a:b0:1c3:90c7:b99d with SMTP id r10-20020a170902be0a00b001c390c7b99dmr9899813pls.41.1695120454418; Tue, 19 Sep 2023 03:47:34 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:40a:900d:e731:5a43]) by smtp.gmail.com with ESMTPSA id c10-20020a170902d48a00b001bc445e249asm6719578plg.124.2023.09.19.03.47.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 03:47:34 -0700 (PDT) From: Chen-Yu Tsai To: Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Mark Brown Cc: Chen-Yu Tsai , Zhiyong Tao , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH v3 04/12] regulator: dt-bindings: mt6358: Add regulator supplies Date: Tue, 19 Sep 2023 18:43:47 +0800 Message-ID: <20230919104357.3971512-5-wenst@chromium.org> X-Mailer: git-send-email 2.42.0.459.ge4e396fd5e-goog In-Reply-To: <20230919104357.3971512-1-wenst@chromium.org> References: <20230919104357.3971512-1-wenst@chromium.org> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net The MT6358 PMIC has various regulator power supply pins that should be supplied from external power sources or routed from one of its outputs. Add these regulator supplies to the binding. The names are the actual names from the datasheet, with hyphens replacing underscores. Signed-off-by: Chen-Yu Tsai --- .../regulator/mediatek,mt6358-regulator.yaml | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml b/Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml index 62e8fa6b4306..c5f336318ec2 100644 --- a/Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml +++ b/Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml @@ -18,6 +18,41 @@ properties: compatible: const: mediatek,mt6358-regulator + vsys-ldo1-supply: + description: Supply for LDOs vfe28, vxo22, vcn28, vaux18, vaud28, vsim1, vusb, vbif28 + vsys-ldo2-supply: + description: Supply for LDOs vldo28, vio28, vmc, vmch, vsim2 + vsys-ldo3-supply: + description: Supply for LDOs vcn33, vcama1, vcama2, vemc, vibr + vsys-vcore-supply: + description: Supply for buck regulator vcore + vsys-vdram1-supply: + description: Supply for buck regulator vdram1 + vsys-vgpu-supply: + description: Supply for buck regulator vgpu + vsys-vmodem-supply: + description: Supply for buck regulator vmodem + vsys-vpa-supply: + description: Supply for buck regulator vpa + vsys-vproc11-supply: + description: Supply for buck regulator vproc11 + vsys-vproc12-supply: + description: Supply for buck regulator vproc12 + vsys-vs1-supply: + description: Supply for buck regulator vs1 + vsys-vs2-supply: + description: Supply for buck regulator vs2 + vs1-ldo1-supply: + description: Supply for LDOs vrf18, vefuse, vcn18, vcamio, vio18 + vs2-ldo1-supply: + description: Supply for LDOs vdram2 + vs2-ldo2-supply: + description: Supply for LDOs vrf12, va12 + vs2-ldo3-supply: + description: Supply for LDOs vsram-gpu, vsram-others, vsram-proc11, vsram-proc12 + vs2-ldo4-supply: + description: Supply for LDO vcamd + patternProperties: "^buck_v(core|dram1|gpu|modem|pa|proc1[12]|s[12])$": description: Buck regulators From patchwork Tue Sep 19 10:43:48 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: 1836632 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=myfoGqli; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=permerror (SPF Permanent Error: More than 10 MX records returned) smtp.mailfrom=vger.kernel.org (client-ip=2604:1380:45e3:2400::1; helo=sv.mirrors.kernel.org; envelope-from=devicetree+bounces-1361-incoming-dt=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org [IPv6:2604:1380:45e3:2400::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Rqdfp21TQz1ync for ; Tue, 19 Sep 2023 20:48:02 +1000 (AEST) Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 034DE281A0C for ; Tue, 19 Sep 2023 10:48:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A9544339AD; Tue, 19 Sep 2023 10:47:41 +0000 (UTC) X-Original-To: devicetree@vger.kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D333C1E511 for ; Tue, 19 Sep 2023 10:47:39 +0000 (UTC) Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C89B137 for ; Tue, 19 Sep 2023 03:47:37 -0700 (PDT) Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-1c0c6d4d650so49565645ad.0 for ; Tue, 19 Sep 2023 03:47:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1695120457; x=1695725257; darn=vger.kernel.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=c9zFZh0h9p1kqtm0gG5rSkGty3VYPPZg4qkioRraJ/c=; b=myfoGqli94TBKfLh/E5g4h5z+yuXWyrJQNYQhmmNrTRsbOiqvUQyUh55/olyMQ19G4 DjFmZf/+Y6++esgX8mFYlekBuvP8ZS/+D5KVkoLm+2sFfmViPWo7f6dCuc9zGGsKQXmG s1iyo7Y/x/ETS3Fyc5aRJkPivi+bjDBALUzi0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695120457; x=1695725257; 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=c9zFZh0h9p1kqtm0gG5rSkGty3VYPPZg4qkioRraJ/c=; b=SpjeHu2ZfYRyEs85vxbWhf2sAxiRDm7q3CtLDIo4sP7VguNexwDhS+BKNz4x/kE0kZ qgii04BwQ5WHywbgpHg/KEx3jyXZe+MVM5rMPMfhthLuIf0ptiBZct+36GUmK3tzof2k ooDU/99huu+8Y14qe8jxfXUs7p0YQyfJh1Co0GVIOG86jjHUkY0FK5oiaPw726pfom1X m2cdPx6clwdYngZPiFds6aZubDI8J2ZFUT56LZJ3TVC42mDCxfsEtcBXYWA8Viu9xDRh bDLoAB4HgvHwVnV466yYzULOiHVgSvAxAFhzsNEpKQbTpyfjhcMLP9+JyfT/uF4iuC+A 7KRg== X-Gm-Message-State: AOJu0YwqJ/VAwfmEFzJ0qpJaTOXw+WxvUCvm1fxZlGgO51VoTCTYFGvf Cbi1+agsbqWaaiXg1JAHfLFGzw== X-Google-Smtp-Source: AGHT+IG1RKBiEf6ISFyaQk2PCgcYVT8UnKNYyHU0skzdtpaIdg4ZYfNGz4Xy4SMVL8NsdB8dE5ouSg== X-Received: by 2002:a17:902:e74d:b0:1bd:c931:8c47 with SMTP id p13-20020a170902e74d00b001bdc9318c47mr10812191plf.68.1695120457075; Tue, 19 Sep 2023 03:47:37 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:40a:900d:e731:5a43]) by smtp.gmail.com with ESMTPSA id c10-20020a170902d48a00b001bc445e249asm6719578plg.124.2023.09.19.03.47.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 03:47:36 -0700 (PDT) From: Chen-Yu Tsai To: Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Mark Brown Cc: Zhiyong Tao , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Chen-Yu Tsai Subject: [PATCH v3 05/12] regulator: dt-bindings: mt6358: Add MT6366 PMIC Date: Tue, 19 Sep 2023 18:43:48 +0800 Message-ID: <20230919104357.3971512-6-wenst@chromium.org> X-Mailer: git-send-email 2.42.0.459.ge4e396fd5e-goog In-Reply-To: <20230919104357.3971512-1-wenst@chromium.org> References: <20230919104357.3971512-1-wenst@chromium.org> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 Add a binding document describing all the regulators and their supplies. Signed-off-by: Zhiyong Tao [wens@chromium.org: major rework and added commit message] Signed-off-by: Chen-Yu Tsai --- Changes since 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 | 120 +++++++++++++++--- 1 file changed, 104 insertions(+), 16 deletions(-) diff --git a/Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml b/Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml index c5f336318ec2..05e381899d08 100644 --- a/Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml +++ b/Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml @@ -16,14 +16,18 @@ description: properties: compatible: - const: mediatek,mt6358-regulator + oneOf: + - const: mediatek,mt6358-regulator + - items: + - const: mediatek,mt6366-regulator + - const: mediatek,mt6358-regulator vsys-ldo1-supply: description: Supply for LDOs vfe28, vxo22, vcn28, vaux18, vaud28, vsim1, vusb, vbif28 vsys-ldo2-supply: - description: Supply for LDOs vldo28, vio28, vmc, vmch, vsim2 + description: Supply for LDOs vldo28 (MT6358 only), vio28, vmc, vmch, vsim2 vsys-ldo3-supply: - description: Supply for LDOs vcn33, vcama1, vcama2, vemc, vibr + description: Supply for LDOs vcn33, vcama[12] (MT6358 only), vemc, vibr vsys-vcore-supply: description: Supply for buck regulator vcore vsys-vdram1-supply: @@ -43,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# @@ -69,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# @@ -77,15 +83,16 @@ 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$": + "^(ldo_)?vxo22$": description: LDOs with fixed 2.2V output and 0~100/10mV tuning type: object $ref: regulator.yaml# @@ -93,7 +100,7 @@ patternProperties: 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# @@ -101,7 +108,7 @@ patternProperties: regulator-allowed-modes: false unevaluatedProperties: false - "^ldo_vusb$": + "^(ldo_)?vusb$": description: LDOs with fixed 3.0V output and 0~100/10mV tuning type: object $ref: regulator.yaml# @@ -109,7 +116,7 @@ patternProperties: regulator-allowed-modes: false unevaluatedProperties: false - "^ldo_vsram_(gpu|others|proc1[12])$": + "^(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,11 +137,50 @@ 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 + "^(? - regulator { + mt6358-regulator { compatible = "mediatek,mt6358-regulator"; buck_vgpu { @@ -156,4 +202,46 @@ examples: }; }; + mt6366-regulator { + compatible = "mediatek,mt6366-regulator", "mediatek,mt6358-regulator"; + + vdram1 { + regulator-name = "pp1125_emi_vdd2"; + regulator-min-microvolt = <1125000>; + regulator-max-microvolt = <1125000>; + regulator-ramp-delay = <12500>; + regulator-enable-ramp-delay = <0>; + regulator-allowed-modes = ; + regulator-always-on; + }; + + vproc11 { + regulator-name = "ppvar_dvdd_proc_bc_mt6366"; + regulator-min-microvolt = <600000>; + regulator-max-microvolt = <1200000>; + regulator-ramp-delay = <6250>; + regulator-enable-ramp-delay = <200>; + regulator-allowed-modes = ; + regulator-always-on; + }; + + vmddr { + regulator-name = "pm0750_emi_vmddr"; + regulator-min-microvolt = <700000>; + regulator-max-microvolt = <750000>; + regulator-enable-ramp-delay = <325>; + regulator-always-on; + }; + + vsram-proc11 { + regulator-name = "pp0900_dvdd_sram_bc"; + regulator-min-microvolt = <850000>; + regulator-max-microvolt = <1120000>; + regulator-ramp-delay = <6250>; + regulator-enable-ramp-delay = <240>; + regulator-always-on; + }; + }; ...