Re: [PATCH 2/2] arm64: dts: qcom: qcm6490-fairphone-fp5: Configure PM8008 regulators

2024-06-21 Thread Dmitry Baryshkov
On Fri, Jun 21, 2024 at 10:42:31AM GMT, Luca Weiss wrote:
> PM8008 regulators are used for the cameras found on FP5. Configure the
> chip and its voltages.
> 
> Signed-off-by: Luca Weiss 
> ---
>  arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts | 105 
> -
>  1 file changed, 104 insertions(+), 1 deletion(-)
> 


Reviewed-by: Dmitry Baryshkov 

-- 
With best wishes
Dmitry



[PATCH 2/2] arm64: dts: qcom: qcm6490-fairphone-fp5: Configure PM8008 regulators

2024-06-21 Thread Luca Weiss
PM8008 regulators are used for the cameras found on FP5. Configure the
chip and its voltages.

Signed-off-by: Luca Weiss 
---
 arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts | 105 -
 1 file changed, 104 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts 
b/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts
index 25ed74d4ebd2..765585b0d09e 100644
--- a/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts
+++ b/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts
@@ -207,6 +207,25 @@ active-config0 {
};
};
 
+   pm8008-thermal {
+   polling-delay-passive = <100>;
+   thermal-sensors = <>;
+
+   trips {
+   trip0 {
+   temperature = <95000>;
+   hysteresis = <0>;
+   type = "passive";
+   };
+
+   trip1 {
+   temperature = <115000>;
+   hysteresis = <0>;
+   type = "critical";
+   };
+   };
+   };
+
quiet-thermal {
polling-delay-passive = <0>;
 
@@ -522,7 +541,76 @@ _dma1 {
  {
status = "okay";
 
-   /* PM8008 PMIC @ 8 and 9 */
+   pm8008: pmic@8 {
+   compatible = "qcom,pm8008";
+   reg = <0x8>;
+
+   interrupts-extended = < 25 IRQ_TYPE_EDGE_RISING>;
+   reset-gpios = <_gpios 3 GPIO_ACTIVE_LOW>;
+
+   vdd-l1-l2-supply = <_s8b>;
+   vdd-l3-l4-supply = <_bob>;
+   vdd-l5-supply = <_bob>;
+   vdd-l6-supply = <_s1b>;
+   vdd-l7-supply = <_bob>;
+
+   pinctrl-names = "default";
+   pinctrl-0 = <_int_default>, <_reset_n_default>;
+
+   gpio-controller;
+   #gpio-cells = <2>;
+   gpio-ranges = < 0 0 2>;
+
+   interrupt-controller;
+   #interrupt-cells = <2>;
+
+   #thermal-sensor-cells = <0>;
+
+   regulators {
+   vreg_l1p: ldo1 {
+   regulator-name = "vreg_l1p";
+   regulator-min-microvolt = <100>;
+   regulator-max-microvolt = <120>;
+   };
+
+   vreg_l2p: ldo2 {
+   regulator-name = "vreg_l2p";
+   regulator-min-microvolt = <95>;
+   regulator-max-microvolt = <1152000>;
+   };
+
+   vreg_l3p: ldo3 {
+   regulator-name = "vreg_l3p";
+   regulator-min-microvolt = <270>;
+   regulator-max-microvolt = <300>;
+   };
+
+   vreg_l4p: ldo4 {
+   regulator-name = "vreg_l4p";
+   regulator-min-microvolt = <270>;
+   regulator-max-microvolt = <290>;
+   };
+
+   vreg_l5p: ldo5 {
+   regulator-name = "vreg_l5p";
+   regulator-min-microvolt = <2704000>;
+   regulator-max-microvolt = <290>;
+   };
+
+   vreg_l6p: ldo6 {
+   regulator-name = "vreg_l6p";
+   regulator-min-microvolt = <170>;
+   regulator-max-microvolt = <1904000>;
+   };
+
+   vreg_l7p: ldo7 {
+   regulator-name = "vreg_l7p";
+   regulator-min-microvolt = <270>;
+   regulator-max-microvolt = <300>;
+   };
+   };
+   };
+
/* Pixelworks @ 26 */
/* FSA4480 USB audio switch @ 42 */
/* AW86927FCR haptics @ 5a */
@@ -653,6 +741,14 @@ wide-rfc-therm@4 {
};
 };
 
+_gpios {
+   pm8008_reset_n_default: pm8008-reset-n-default-state {
+   pins = "gpio3";
+   function = PMIC_GPIO_FUNC_NORMAL;
+   bias-pull-down;
+   };
+};
+
 _rtc {
status = "okay";
 };
@@ -810,6 +906,13 @@ hall_sensor_default: hall-sensor-default-state {
bias-pull-up;
};
 
+   pm8008_int_default: pm8008-int-default-state {
+   pins = "gpio25";
+   function = "gpio";
+   drive-strength = <2>;
+   bias-disable;
+   };
+