Re: [PATCH v2 1/3] ARM: dts: stm32: add stpmic1 support on stm32mp157c ed1 board

2019-04-11 Thread Linus Walleij
On Tue, Apr 9, 2019 at 11:08 AM Pascal PAILLET-LME  wrote:

> This patch adds stpmic1 support on stm32mp157c ed1 board.
> The STPMIC1 is a PMIC from STMicroelectronics. The STPMIC1 integrates 10
> regulators, 3 power switches, a watchdog and an input for a power on key.
> The DMAs are disabled because the PMIC generates a very few traffic and
> DMA channels may lack for other usage.
>
> Signed-off-by: Pascal Paillet 

Reviewed-by: Linus Walleij 

Yours,
Linus Walleij


[PATCH v2 1/3] ARM: dts: stm32: add stpmic1 support on stm32mp157c ed1 board

2019-04-09 Thread Pascal PAILLET-LME
This patch adds stpmic1 support on stm32mp157c ed1 board.
The STPMIC1 is a PMIC from STMicroelectronics. The STPMIC1 integrates 10
regulators, 3 power switches, a watchdog and an input for a power on key.
The DMAs are disabled because the PMIC generates a very few traffic and
DMA channels may lack for other usage.

Signed-off-by: Pascal Paillet 
---
 arch/arm/boot/dts/stm32mp157c-ed1.dts | 156 ++
 1 file changed, 140 insertions(+), 16 deletions(-)

diff --git a/arch/arm/boot/dts/stm32mp157c-ed1.dts 
b/arch/arm/boot/dts/stm32mp157c-ed1.dts
index 9fd7943..62a8c78 100644
--- a/arch/arm/boot/dts/stm32mp157c-ed1.dts
+++ b/arch/arm/boot/dts/stm32mp157c-ed1.dts
@@ -8,6 +8,7 @@
 #include "stm32mp157c.dtsi"
 #include "stm32mp157-pinctrl.dtsi"
 #include 
+#include 
 
 / {
model = "STMicroelectronics STM32MP157C eval daughter";
@@ -42,22 +43,6 @@
regulator-always-on;
};
 
-   vdd_sd: regulator-vdd_sd {
-   compatible = "regulator-fixed";
-   regulator-name = "vdd_sd";
-   regulator-min-microvolt = <330>;
-   regulator-max-microvolt = <330>;
-   regulator-always-on;
-   };
-
-   vdd_usb: vdd-usb {
-   compatible = "regulator-fixed";
-   regulator-name = "vdd_usb";
-   regulator-min-microvolt = <330>;
-   regulator-max-microvolt = <330>;
-   regulator-always-on;
-   };
-
sd_switch: regulator-sd_switch {
compatible = "regulator-gpio";
regulator-name = "sd_switch";
@@ -82,6 +67,145 @@
i2c-scl-rising-time-ns = <185>;
i2c-scl-falling-time-ns = <20>;
status = "okay";
+   /* spare dmas for other usage */
+   /delete-property/dmas;
+   /delete-property/dma-names;
+
+   pmic: stpmic@33 {
+   compatible = "st,stpmic1";
+   reg = <0x33>;
+   interrupts-extended = < 0 IRQ_TYPE_EDGE_FALLING>;
+   interrupt-controller;
+   #interrupt-cells = <2>;
+   status = "okay";
+
+   regulators {
+   compatible = "st,stpmic1-regulators";
+   ldo1-supply = <>;
+   ldo2-supply = <>;
+   ldo3-supply = <_ddr>;
+   ldo5-supply = <>;
+   ldo6-supply = <>;
+   pwr_sw1-supply = <_out>;
+   pwr_sw2-supply = <_out>;
+
+   vddcore: buck1 {
+   regulator-name = "vddcore";
+   regulator-min-microvolt = <80>;
+   regulator-max-microvolt = <135>;
+   regulator-always-on;
+   regulator-initial-mode = <0>;
+   regulator-over-current-protection;
+   };
+
+   vdd_ddr: buck2 {
+   regulator-name = "vdd_ddr";
+   regulator-min-microvolt = <135>;
+   regulator-max-microvolt = <135>;
+   regulator-always-on;
+   regulator-initial-mode = <0>;
+   regulator-over-current-protection;
+   };
+
+   vdd: buck3 {
+   regulator-name = "vdd";
+   regulator-min-microvolt = <330>;
+   regulator-max-microvolt = <330>;
+   regulator-always-on;
+   st,mask-reset;
+   regulator-initial-mode = <0>;
+   regulator-over-current-protection;
+   };
+
+   v3v3: buck4 {
+   regulator-name = "v3v3";
+   regulator-min-microvolt = <330>;
+   regulator-max-microvolt = <330>;
+   regulator-always-on;
+   regulator-over-current-protection;
+   regulator-initial-mode = <0>;
+   };
+
+   vdda: ldo1 {
+   regulator-name = "vdda";
+   regulator-min-microvolt = <290>;
+   regulator-max-microvolt = <290>;
+   interrupts = ;
+   };
+
+   v2v8: ldo2 {
+   regulator-name = "v2v8";
+   regulator-min-microvolt = <280>;
+   regulator-max-microvolt = <280>;
+   interrupts = ;
+   };
+
+