diff mbox series

[v2,4/4] arm64: dts: mediatek: mt8195-demo: simplify mt6360 nodes

Message ID 20230830111532.9048-4-macpaul.lin@mediatek.com
State New
Headers show
Series [v2,1/4] arm64: dts: mediatek: mt8195-demo: fix the memory size to 8GB | expand

Commit Message

Macpaul Lin Aug. 30, 2023, 11:15 a.m. UTC
The dts file for the MediaTek MT8195 demo board has been refactored
to improve the configuration of the MT6360 multi-function PMIC.

The changes include:
 - Addition of the mt6360.dtsi include file, which contains the common
   configuration of the MT6360 for all mt8195 boards.
 - Removal of the direct inclusion of the mt6360-regulator.h file.
 - Removal of the common configuration of the MT6360 PMIC since
   the included mt6360.dtsi is used.
 - Add names according to the schematic of mt8195-demo board for
   mt6360 nodes.

Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
---
 arch/arm64/boot/dts/mediatek/mt8195-demo.dts | 173 ++++++++-----------
 1 file changed, 74 insertions(+), 99 deletions(-)

Comments

Krzysztof Kozlowski Aug. 30, 2023, 11:30 a.m. UTC | #1
On 30/08/2023 13:15, Macpaul Lin wrote:
> The dts file for the MediaTek MT8195 demo board has been refactored
> to improve the configuration of the MT6360 multi-function PMIC.
> 
> The changes include:
>  - Addition of the mt6360.dtsi include file, which contains the common
>    configuration of the MT6360 for all mt8195 boards.
>  - Removal of the direct inclusion of the mt6360-regulator.h file.
>  - Removal of the common configuration of the MT6360 PMIC since
>    the included mt6360.dtsi is used.
>  - Add names according to the schematic of mt8195-demo board for
>    mt6360 nodes.
> 
> Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
> ---
>  arch/arm64/boot/dts/mediatek/mt8195-demo.dts | 173 ++++++++-----------
>  1 file changed, 74 insertions(+), 99 deletions(-)
> 
> diff --git a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
> index 8aea6f5d72b3..d082d679dbbe 100644
> --- a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
> +++ b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
> @@ -11,7 +11,6 @@
>  #include <dt-bindings/gpio/gpio.h>
>  #include <dt-bindings/input/input.h>
>  #include <dt-bindings/pinctrl/mt8195-pinfunc.h>
> -#include <dt-bindings/regulator/mediatek,mt6360-regulator.h>
>  
>  / {
>  	model = "MediaTek MT8195 demo board";
> @@ -130,103 +129,9 @@
>  	mt6360: pmic@34 {
>  		compatible = "mediatek,mt6360";
>  		reg = <0x34>;
> -		interrupt-controller;
> +		pinctrl-0 = <&mt6360_pins>;
> +		pinctrl-names = "default";
>  		interrupts-extended = <&pio 101 IRQ_TYPE_EDGE_FALLING>;
> -		interrupt-names = "IRQB";
> -
> -		charger {
> -			compatible = "mediatek,mt6360-chg";
> -			richtek,vinovp-microvolt = <14500000>;
> -
> -			otg_vbus_regulator: usb-otg-vbus-regulator {
> -				regulator-compatible = "usb-otg-vbus";
> -				regulator-name = "usb-otg-vbus";
> -				regulator-min-microvolt = <4425000>;
> -				regulator-max-microvolt = <5825000>;
> -			};
> -		};
> -
> -		regulator {
> -			compatible = "mediatek,mt6360-regulator";
> -			LDO_VIN3-supply = <&mt6360_buck2>;
> -
> -			mt6360_buck1: buck1 {

Your patchset does not look bisectable. Does not look tested, either...
Why having duplicated regulators (?) and then removing correct
regulators and keeping wrong ones?

> -				regulator-compatible = "BUCK1";
> -				regulator-name = "mt6360,buck1";
> -				regulator-min-microvolt = <300000>;
> -				regulator-max-microvolt = <1300000>;
> -				regulator-allowed-modes = <MT6360_OPMODE_NORMAL
> -							   MT6360_OPMODE_LP
> -							   MT6360_OPMODE_ULP>;
> -				regulator-always-on;
> -			};

...

>  	};
>  };
>  
> @@ -259,8 +164,8 @@
>  	cap-sd-highspeed;
>  	sd-uhs-sdr50;
>  	sd-uhs-sdr104;
> -	vmmc-supply = <&mt6360_ldo5>;
> -	vqmmc-supply = <&mt6360_ldo3>;
> +	vmmc-supply = <&mt6360_vmch_pmu_ldo5_reg>;
> +	vqmmc-supply = <&mt6360_vmc_pmu_ldo3_reg>;
>  	status = "okay";
>  };
>  
> @@ -300,6 +205,67 @@
>  	regulator-always-on;
>  };
>  
> +#include "mt6360.dtsi"

Includes are in the top part of the DTS. Sometimes bottom, but never in
the middle.


Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
index 8aea6f5d72b3..d082d679dbbe 100644
--- a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
+++ b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
@@ -11,7 +11,6 @@ 
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
 #include <dt-bindings/pinctrl/mt8195-pinfunc.h>
-#include <dt-bindings/regulator/mediatek,mt6360-regulator.h>
 
 / {
 	model = "MediaTek MT8195 demo board";
@@ -130,103 +129,9 @@ 
 	mt6360: pmic@34 {
 		compatible = "mediatek,mt6360";
 		reg = <0x34>;
-		interrupt-controller;
+		pinctrl-0 = <&mt6360_pins>;
+		pinctrl-names = "default";
 		interrupts-extended = <&pio 101 IRQ_TYPE_EDGE_FALLING>;
-		interrupt-names = "IRQB";
-
-		charger {
-			compatible = "mediatek,mt6360-chg";
-			richtek,vinovp-microvolt = <14500000>;
-
-			otg_vbus_regulator: usb-otg-vbus-regulator {
-				regulator-compatible = "usb-otg-vbus";
-				regulator-name = "usb-otg-vbus";
-				regulator-min-microvolt = <4425000>;
-				regulator-max-microvolt = <5825000>;
-			};
-		};
-
-		regulator {
-			compatible = "mediatek,mt6360-regulator";
-			LDO_VIN3-supply = <&mt6360_buck2>;
-
-			mt6360_buck1: buck1 {
-				regulator-compatible = "BUCK1";
-				regulator-name = "mt6360,buck1";
-				regulator-min-microvolt = <300000>;
-				regulator-max-microvolt = <1300000>;
-				regulator-allowed-modes = <MT6360_OPMODE_NORMAL
-							   MT6360_OPMODE_LP
-							   MT6360_OPMODE_ULP>;
-				regulator-always-on;
-			};
-
-			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>;
-				regulator-always-on;
-			};
-
-			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>;
-				regulator-always-on;
-			};
-		};
 	};
 };
 
@@ -259,8 +164,8 @@ 
 	cap-sd-highspeed;
 	sd-uhs-sdr50;
 	sd-uhs-sdr104;
-	vmmc-supply = <&mt6360_ldo5>;
-	vqmmc-supply = <&mt6360_ldo3>;
+	vmmc-supply = <&mt6360_vmch_pmu_ldo5_reg>;
+	vqmmc-supply = <&mt6360_vmc_pmu_ldo3_reg>;
 	status = "okay";
 };
 
@@ -300,6 +205,67 @@ 
 	regulator-always-on;
 };
 
+#include "mt6360.dtsi"
+
+&otg_vbus_regulator {
+	regulator-name = "usb-otg-vbus";
+	regulator-min-microvolt = <4425000>;
+	regulator-max-microvolt = <5825000>;
+};
+
+&mt6360_emi_vdd2_buck1_reg {
+	regulator-name = "emi_vdd2";
+	regulator-min-microvolt = <300000>;
+	regulator-max-microvolt = <1300000>;
+	regulator-always-on;
+};
+
+&mt6360_emi_vddq_buck2_reg {
+	regulator-name = "emi_vddq";
+	regulator-min-microvolt = <300000>;
+	regulator-max-microvolt = <1300000>;
+	regulator-always-on;
+};
+
+&mt6360_tp1_p3v0_ldo1_reg {
+	regulator-name = "tp1_p3v0";
+	regulator-min-microvolt = <3000000>;
+	regulator-max-microvolt = <3000000>;
+	regulator-always-on;
+};
+
+&mt6360_panel1_p1v8_ldo2_reg {
+	regulator-name = "panel1_p1v8";
+	regulator-min-microvolt = <1800000>;
+	regulator-max-microvolt = <1800000>;
+};
+
+&mt6360_vmc_pmu_ldo3_reg {
+	regulator-name = "vmc_pmu";
+	regulator-min-microvolt = <1200000>;
+	regulator-max-microvolt = <3600000>;
+};
+
+&mt6360_vmch_pmu_ldo5_reg {
+	regulator-name = "vmch_pmu";
+	regulator-min-microvolt = <2700000>;
+	regulator-max-microvolt = <3600000>;
+};
+
+/* measure point on board */
+&mt6360_ldo6_reg {
+	regulator-name = "mt6360_ldo6";
+	regulator-min-microvolt = <500000>;
+	regulator-max-microvolt = <2100000>;
+};
+
+&mt6360_emi_vmddr_en_ldo7_reg {
+	regulator-name = "emi_vmddr_en";
+	regulator-min-microvolt = <500000>;
+	regulator-max-microvolt = <2100000>;
+	regulator-always-on;
+};
+
 &pio {
 	eth_default_pins: eth-default-pins {
 		pins-txd {
@@ -496,6 +462,15 @@ 
 				 <PINMUX_GPIO103__FUNC_URXD1>;
 		};
 	};
+
+	mt6360_pins: mt6360-pins {
+		pins {
+			pinmux = <PINMUX_GPIO100__FUNC_GPIO100>,
+				 <PINMUX_GPIO101__FUNC_GPIO101>;
+			input-enable;
+			bias-pull-up;
+		};
+	};
 };