From: Chen-Yu Tsai <wenst@chromium.org> To: Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org>, Mark Brown <broonie@kernel.org>, Liam Girdwood <lgirdwood@gmail.com>, Matthias Brugger <matthias.bgg@gmail.com>, AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Cc: Chen-Yu Tsai <wenst@chromium.org>, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 0/9] regulator: mt6358: Remove bogus regulators and improvements Date: Fri, 9 Jun 2023 16:29:57 +0800 [thread overview] Message-ID: <20230609083009.2822259-1-wenst@chromium.org> (raw) Hi, This series is a cleanup and improvement of the MT6358 regulator driver. Various discrepancies were found while preparing to upstream MT8186 device trees, which utilize the MT6366 PMIC, that is also covered by this driver. Patches 1~8 should go through the regulator tree, and patch 9 through the soc tree. This series (patches 7 and 8) depends on "regulator: Use bitfield values for range selectors" [1] I sent out earlier. This series can be seen as three parts: Part 1 - Fixing bogus regulators (patches 1~4 and 9) There are some regulators listed in the bindings and driver that have no corresponding pin on the actual hardware. MediaTek says these are a hardware construct for shared control of the same regulator in the VCN33 case and an alternative control scheme for low power suspend. In the VCN33 case, there's only one actual regulator, so we merge the two and rename them to match the hardware pin. No existing devices use these AFAICT, so this should be safe to change. In the *_SSHUB case, the two extra regulators refer to alternative configuration registers of the same regulators. They are intended for the SoC's low power mode companion processor to use, not the main processor or OS. It should be left to the implementation to choose which set of registers to actually control. Part 2 - Code cleanup (patches 5 and 6) Various tables in the regulator driver were not constant, even though they are just lookup tables. With some reworking of the code, they are made constant. Also, some regulators that have a single linear range were using linear range helpers. This is more complicated than just declaring the range and step directly in the description. This is simplified to use the latter approach. Part 3 - Output voltage fine tuning support (patches 7 and 8) Many of the LDOs on these PMIC support an extra level of output voltage fine tuning. Most default to no offset, but a couple have a non-zero offset by default. Previously this was unaccounted for in the driver and device tree constraints. On the outputs with non-zero offset, this ends up becoming a discrepancy between the device tree and actual hardware. These two patches adds support for this second level of tuning, modeled as bunch of linear ranges. While it's unlikely we need this level of control, it's nice to be able to read back the accurate hardware settings. Please have a look. After this series is done I'll send out patches for the MT6366 PMIC, which is what started this. That will also include updated YAML bindings for MT6366. I think we can merge MT6358 bindings into them afterwards. Thanks ChenYu [1] https://lore.kernel.org/linux-arm-kernel/20230609075032.2804554-1-wenst@chromium.org/ Chen-Yu Tsai (9): regulator: dt-bindings: mt6358: Merge ldo_vcn33_* regulators regulator: dt-bindings: mt6358: Drop *_sshub regulators regulator: mt6358: Merge VCN33_* regulators regulator: mt6358: Drop *_SSHUB regulators regulator: mt6358: Const-ify mt6358_regulator_info data structures regulator: mt6358: Use linear voltage helpers for single range regulators regulator: mt6358: Add output voltage fine tuning to fixed regulators regulator: mt6358: Add output voltage fine tuning to variable LDOs arm64: dts: mediatek: mt6358: Merge ldo_vcn33_* regulators .../bindings/regulator/mt6358-regulator.txt | 34 +- arch/arm64/boot/dts/mediatek/mt6358.dtsi | 11 +- drivers/regulator/mt6358-regulator.c | 499 ++++++++---------- include/linux/regulator/mt6358-regulator.h | 10 +- 4 files changed, 234 insertions(+), 320 deletions(-) -- 2.41.0.162.gfafddb0af9-goog _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
WARNING: multiple messages have this Message-ID (diff)
From: Chen-Yu Tsai <wenst@chromium.org> To: Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org>, Mark Brown <broonie@kernel.org>, Liam Girdwood <lgirdwood@gmail.com>, Matthias Brugger <matthias.bgg@gmail.com>, AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Cc: Chen-Yu Tsai <wenst@chromium.org>, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 0/9] regulator: mt6358: Remove bogus regulators and improvements Date: Fri, 9 Jun 2023 16:29:57 +0800 [thread overview] Message-ID: <20230609083009.2822259-1-wenst@chromium.org> (raw) Hi, This series is a cleanup and improvement of the MT6358 regulator driver. Various discrepancies were found while preparing to upstream MT8186 device trees, which utilize the MT6366 PMIC, that is also covered by this driver. Patches 1~8 should go through the regulator tree, and patch 9 through the soc tree. This series (patches 7 and 8) depends on "regulator: Use bitfield values for range selectors" [1] I sent out earlier. This series can be seen as three parts: Part 1 - Fixing bogus regulators (patches 1~4 and 9) There are some regulators listed in the bindings and driver that have no corresponding pin on the actual hardware. MediaTek says these are a hardware construct for shared control of the same regulator in the VCN33 case and an alternative control scheme for low power suspend. In the VCN33 case, there's only one actual regulator, so we merge the two and rename them to match the hardware pin. No existing devices use these AFAICT, so this should be safe to change. In the *_SSHUB case, the two extra regulators refer to alternative configuration registers of the same regulators. They are intended for the SoC's low power mode companion processor to use, not the main processor or OS. It should be left to the implementation to choose which set of registers to actually control. Part 2 - Code cleanup (patches 5 and 6) Various tables in the regulator driver were not constant, even though they are just lookup tables. With some reworking of the code, they are made constant. Also, some regulators that have a single linear range were using linear range helpers. This is more complicated than just declaring the range and step directly in the description. This is simplified to use the latter approach. Part 3 - Output voltage fine tuning support (patches 7 and 8) Many of the LDOs on these PMIC support an extra level of output voltage fine tuning. Most default to no offset, but a couple have a non-zero offset by default. Previously this was unaccounted for in the driver and device tree constraints. On the outputs with non-zero offset, this ends up becoming a discrepancy between the device tree and actual hardware. These two patches adds support for this second level of tuning, modeled as bunch of linear ranges. While it's unlikely we need this level of control, it's nice to be able to read back the accurate hardware settings. Please have a look. After this series is done I'll send out patches for the MT6366 PMIC, which is what started this. That will also include updated YAML bindings for MT6366. I think we can merge MT6358 bindings into them afterwards. Thanks ChenYu [1] https://lore.kernel.org/linux-arm-kernel/20230609075032.2804554-1-wenst@chromium.org/ Chen-Yu Tsai (9): regulator: dt-bindings: mt6358: Merge ldo_vcn33_* regulators regulator: dt-bindings: mt6358: Drop *_sshub regulators regulator: mt6358: Merge VCN33_* regulators regulator: mt6358: Drop *_SSHUB regulators regulator: mt6358: Const-ify mt6358_regulator_info data structures regulator: mt6358: Use linear voltage helpers for single range regulators regulator: mt6358: Add output voltage fine tuning to fixed regulators regulator: mt6358: Add output voltage fine tuning to variable LDOs arm64: dts: mediatek: mt6358: Merge ldo_vcn33_* regulators .../bindings/regulator/mt6358-regulator.txt | 34 +- arch/arm64/boot/dts/mediatek/mt6358.dtsi | 11 +- drivers/regulator/mt6358-regulator.c | 499 ++++++++---------- include/linux/regulator/mt6358-regulator.h | 10 +- 4 files changed, 234 insertions(+), 320 deletions(-) -- 2.41.0.162.gfafddb0af9-goog
next reply other threads:[~2023-06-09 8:31 UTC|newest] Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-06-09 8:29 Chen-Yu Tsai [this message] 2023-06-09 8:29 ` [PATCH 0/9] regulator: mt6358: Remove bogus regulators and improvements Chen-Yu Tsai 2023-06-09 8:29 ` [PATCH 1/9] regulator: dt-bindings: mt6358: Merge ldo_vcn33_* regulators Chen-Yu Tsai 2023-06-09 8:29 ` Chen-Yu Tsai 2023-06-09 15:47 ` Matthias Brugger 2023-06-09 15:47 ` Matthias Brugger 2023-06-09 16:02 ` Krzysztof Kozlowski 2023-06-09 16:02 ` Krzysztof Kozlowski 2023-06-09 8:29 ` [PATCH 2/9] regulator: dt-bindings: mt6358: Drop *_sshub regulators Chen-Yu Tsai 2023-06-09 8:29 ` Chen-Yu Tsai 2023-06-09 15:47 ` Matthias Brugger 2023-06-09 15:47 ` Matthias Brugger 2023-06-09 16:02 ` Krzysztof Kozlowski 2023-06-09 16:02 ` Krzysztof Kozlowski 2023-06-09 8:30 ` [PATCH 3/9] regulator: mt6358: Merge VCN33_* regulators Chen-Yu Tsai 2023-06-09 8:30 ` Chen-Yu Tsai 2023-06-09 8:58 ` AngeloGioacchino Del Regno 2023-06-09 8:58 ` AngeloGioacchino Del Regno 2023-06-12 3:41 ` Chen-Yu Tsai 2023-06-09 15:56 ` Conor Dooley 2023-06-09 15:56 ` Conor Dooley 2023-06-10 15:28 ` Conor Dooley 2023-06-12 4:19 ` Chen-Yu Tsai 2023-06-12 17:34 ` Conor Dooley 2023-06-12 17:34 ` Conor Dooley 2023-06-12 10:56 ` Fei Shao 2023-06-15 7:37 ` Chen-Yu Tsai 2023-06-15 7:37 ` Chen-Yu Tsai 2023-06-09 8:30 ` [PATCH 4/9] regulator: mt6358: Drop *_SSHUB regulators Chen-Yu Tsai 2023-06-09 8:30 ` Chen-Yu Tsai 2023-06-09 9:03 ` AngeloGioacchino Del Regno 2023-06-09 9:03 ` AngeloGioacchino Del Regno 2023-06-12 4:45 ` Chen-Yu Tsai 2023-06-12 18:13 ` Mark Brown 2023-06-12 18:13 ` Mark Brown 2023-06-14 7:39 ` AngeloGioacchino Del Regno 2023-06-14 7:39 ` AngeloGioacchino Del Regno 2023-06-09 15:52 ` Matthias Brugger 2023-06-09 15:52 ` Matthias Brugger 2023-06-09 8:30 ` [PATCH 5/9] regulator: mt6358: Const-ify mt6358_regulator_info data structures Chen-Yu Tsai 2023-06-09 8:30 ` Chen-Yu Tsai 2023-06-09 8:30 ` [PATCH 6/9] regulator: mt6358: Use linear voltage helpers for single range regulators Chen-Yu Tsai 2023-06-09 8:30 ` Chen-Yu Tsai 2023-06-09 8:30 ` [PATCH 7/9] regulator: mt6358: Add output voltage fine tuning to fixed regulators Chen-Yu Tsai 2023-06-09 8:30 ` Chen-Yu Tsai 2023-06-09 10:03 ` AngeloGioacchino Del Regno 2023-06-09 10:03 ` AngeloGioacchino Del Regno 2023-06-14 16:14 ` Mark Brown 2023-06-14 16:14 ` Mark Brown 2023-06-15 3:24 ` Chen-Yu Tsai 2023-06-15 3:24 ` Chen-Yu Tsai 2023-06-09 8:30 ` [PATCH 8/9] regulator: mt6358: Add output voltage fine tuning to variable LDOs Chen-Yu Tsai 2023-06-09 8:30 ` Chen-Yu Tsai 2023-06-09 10:03 ` AngeloGioacchino Del Regno 2023-06-09 10:03 ` AngeloGioacchino Del Regno 2023-06-09 8:30 ` [PATCH 9/9] arm64: dts: mediatek: mt6358: Merge ldo_vcn33_* regulators Chen-Yu Tsai 2023-06-09 8:30 ` Chen-Yu Tsai 2023-06-14 18:58 ` (subset) [PATCH 0/9] regulator: mt6358: Remove bogus regulators and improvements Mark Brown 2023-06-14 18:58 ` Mark Brown
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20230609083009.2822259-1-wenst@chromium.org \ --to=wenst@chromium.org \ --cc=angelogioacchino.delregno@collabora.com \ --cc=broonie@kernel.org \ --cc=conor+dt@kernel.org \ --cc=devicetree@vger.kernel.org \ --cc=krzysztof.kozlowski+dt@linaro.org \ --cc=lgirdwood@gmail.com \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-mediatek@lists.infradead.org \ --cc=matthias.bgg@gmail.com \ --cc=robh+dt@kernel.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.