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

2019-04-08 Thread Linus Walleij
On Mon, Apr 8, 2019 at 2:26 PM Pascal PAILLET-LME  wrote:

> > I hope you are not trying to work around a bug in the driver by
> > stripping out DMA configuration from the device tree, because then
> > it is probably a better idea to fix the bug.

> This is not a workaround. The PMIC can use the DMA over I2C bus.
> Our goal is to avoid using a DMA channel for a consumer that generates a
> very few traffic. Dma channels may lack for other use cases.
>
> If you agree, you can add the to the commit message.

OK I understand, then also write it directly in the dts as a comment,
so people understand why it is being removed when they just look
in the device tree.

Yours,
Linus Walleij


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

2019-04-08 Thread Pascal PAILLET-LME
Hello!

Le 04/08/2019 02:05 PM, Linus Walleij a écrit :
> On Wed, Apr 3, 2019 at 3:41 PM 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.
>>
>> Signed-off-by: Pascal Paillet 
> OK
>
>> +   /delete-property/dmas;
>> +   /delete-property/dma-names;
> Maybe you can add a comment both to the commit message and the
> DTS file as to why you are doing this?
>
> I hope you are not trying to work around a bug in the driver by
> stripping out DMA configuration from the device tree, because then
> it is probably a better idea to fix the bug.
This is not a workaround. The PMIC can use the DMA over I2C bus.
Our goal is to avoid using a DMA channel for a consumer that generates a
very few traffic. Dma channels may lack for other use cases.

If you agree, you can add the to the commit message.
> Yours,
> Linus Walleij
>

thank you,
Best Regards,
Pascal


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

2019-04-08 Thread Linus Walleij
On Wed, Apr 3, 2019 at 3:41 PM 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.
>
> Signed-off-by: Pascal Paillet 

OK

> +   /delete-property/dmas;
> +   /delete-property/dma-names;

Maybe you can add a comment both to the commit message and the
DTS file as to why you are doing this?

I hope you are not trying to work around a bug in the driver by
stripping out DMA configuration from the device tree, because then
it is probably a better idea to fix the bug.

Yours,
Linus Walleij


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

2019-04-03 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.

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

diff --git a/arch/arm/boot/dts/stm32mp157c-ed1.dts 
b/arch/arm/boot/dts/stm32mp157c-ed1.dts
index 9fd7943..678b0f1 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,144 @@
i2c-scl-rising-time-ns = <185>;
i2c-scl-falling-time-ns = <20>;
status = "okay";
+   /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 = ;
+   };
+
+   vtt_ddr: ldo3 {
+   regulator-name = "vtt_ddr";
+   regulator-min-microvolt