On 8/28/23 12:36, Chen-Yu Tsai wrote:
External email : Please do not click links or open attachments until you
have verified the sender or the content.
On Fri, Aug 25, 2023 at 7:46 PM Macpaul Lin <macpaul.lin@xxxxxxxxxxxx> wrote:
MT6360 is the secondary PMIC for MT8195.
It supports USB Type-C and PD functions.
Add MT6360 related common nodes which is used for MT8195 platform, includes
- charger
- ADC
- LED
- regulators
Signed-off-by: Macpaul Lin <macpaul.lin@xxxxxxxxxxxx>
---
arch/arm64/boot/dts/mediatek/mt6360.dtsi | 112 +++++++++++++++++++++++
[snip..]
+ regulator {
+ compatible = "mediatek,mt6360-regulator";
+ LDO_VIN3-supply = <&mt6360_buck2>;
+
+ mt6360_buck1: buck1 {
+ regulator-compatible = "BUCK1";
+ regulator-name = "mt6360,buck1";
Normally there's no need to provide a default name. Any used regulator
should have been named to match the power rail name from the board's
schematics.
I have 2 schematics on hand. One is mt8195-demo board and the other is
genio-1200-evk board. There are 2 PMIC used on these board
with "the same" sub power rail name for "BUCK1~BUCK4". One is mt6315,
and the other is mt6360.
I've also inspected other dtsi of the regulators, such as mt6357 and
mt6359. They have regulator nodes with named for their purpose. For the
schematics of mt8195-demo and genio-1200-evk boards, there are no
explicit usage for "BUCK1~BUCK4" for both mt6135 and mt6360. In order to
specify the sub power rail for mt6360, MediaTek chooses name like
"mt6360,buck1" instead of simple name "buck1" for distinguish with
"buck1" of mt6351.
+ regulator-min-microvolt = <300000>;
+ regulator-max-microvolt = <1300000>;
These values correspond to the regulator's range. They make no sense as
regulator constraints. The min/max values are supposed to be the most
restrictive set of voltages of the regulator consumers. If what is fed
by this regulator can only take 0.7V ~ 1.1V, then it should save 0.7V
and 1.1V here. If the regulator is unused, then there are no constraints,
and these can be left out.
Just leave them out of the file.
Both comments apply to all the regulators.
ChenYu
There are some common circuit design for these regulators like mt6359,
mt6360 and mt6315 used on many products. MediaTek put the most common
and expected default values in their dtsi. However, some changes still
need to be applied to derivative boards according to product's
requirements. The actual value be used will be applied in board's dts
file to override the default settings in dtsi.
The regulator node "mt6360,ldo6" is not used by mt8195-demo and
genio-1200-evk. I'll remove it in the next version.
Thanks for the review.
+ regulator-allowed-modes = <MT6360_OPMODE_NORMAL
+ MT6360_OPMODE_LP
+ MT6360_OPMODE_ULP>;
+ };
+
+ mt6360_buck2: buck2 {
+ regulator-compatible = "BUCK2";
+ regulator-name = "mt6360,buck2";
+ regulator-min-microvolt = <300000>;
+ regulator-max-microvolt = <1300000>;
+ regulator-allowed-modes = <MT6360_OPMODE_NORMAL
+ MT6360_OPMODE_LP
+ MT6360_OPMODE_ULP>;
+ };
+
+ mt6360_ldo1: ldo1 {
+ regulator-compatible = "LDO1";
+ regulator-name = "mt6360,ldo1";
+ regulator-min-microvolt = <1200000>;
+ regulator-max-microvolt = <3600000>;
+ regulator-allowed-modes = <MT6360_OPMODE_NORMAL
+ MT6360_OPMODE_LP>;
+ };
+
+ mt6360_ldo2: ldo2 {
+ regulator-compatible = "LDO2";
+ regulator-name = "mt6360,ldo2";
+ regulator-min-microvolt = <1200000>;
+ regulator-max-microvolt = <3600000>;
+ regulator-allowed-modes = <MT6360_OPMODE_NORMAL
+ MT6360_OPMODE_LP>;
+ };
+
+ mt6360_ldo3: ldo3 {
+ regulator-compatible = "LDO3";
+ regulator-name = "mt6360,ldo3";
+ regulator-min-microvolt = <1200000>;
+ regulator-max-microvolt = <3600000>;
+ regulator-allowed-modes = <MT6360_OPMODE_NORMAL
+ MT6360_OPMODE_LP>;
+ };
+
+ mt6360_ldo5: ldo5 {
+ regulator-compatible = "LDO5";
+ regulator-name = "mt6360,ldo5";
+ regulator-min-microvolt = <2700000>;
+ regulator-max-microvolt = <3600000>;
+ regulator-allowed-modes = <MT6360_OPMODE_NORMAL
+ MT6360_OPMODE_LP>;
+ };
+
+ mt6360_ldo6: ldo6 {
+ regulator-compatible = "LDO6";
+ regulator-name = "mt6360,ldo6";
+ regulator-min-microvolt = <500000>;
+ regulator-max-microvolt = <2100000>;
+ regulator-allowed-modes = <MT6360_OPMODE_NORMAL
+ MT6360_OPMODE_LP>;
+ };
+
+ mt6360_ldo7: ldo7 {
+ regulator-compatible = "LDO7";
+ regulator-name = "mt6360,ldo7";
+ regulator-min-microvolt = <500000>;
+ regulator-max-microvolt = <2100000>;
+ regulator-allowed-modes = <MT6360_OPMODE_NORMAL
+ MT6360_OPMODE_LP>;
+ };
+ };
+};
--
2.18.0
Best regards,
Macpaul Lin.