arm64: dts: freescale: imx8mp-verdin: replace sleep-moci hog with regulator
authorStefan Eichenberger <stefan.eichenberger@toradex.com>
Fri, 5 Apr 2024 16:07:17 +0000 (18:07 +0200)
committerShawn Guo <shawnguo@kernel.org>
Mon, 22 Apr 2024 04:36:39 +0000 (12:36 +0800)
The Verdin family has a signal called sleep-moci which can be used to
turn off peripherals on the carrier board when the SoM goes into
suspend. So far we have hogged this signal, which means the peripherals
are always on and it is not possible to add peripherals that depend on
the sleep-moci to be on. With this change, we replace the hog with a
regulator so that peripherals can add their own regulators that use the
same gpio. Carrier boards that allow peripherals to be powered off in
suspend can disable this regulator and implement their own regulator to
control the sleep-moci.

Signed-off-by: Stefan Eichenberger <stefan.eichenberger@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
arch/arm64/boot/dts/freescale/imx8mp-verdin-dahlia.dtsi
arch/arm64/boot/dts/freescale/imx8mp-verdin-dev.dtsi
arch/arm64/boot/dts/freescale/imx8mp-verdin-yavia.dtsi
arch/arm64/boot/dts/freescale/imx8mp-verdin.dtsi

index 8d954259085ff4a252f1049f077543c571cc4199..718004fe983f0ea3352b248b031df01b075253c3 100644 (file)
        status = "okay";
 };
 
+&gpio4 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_ctrl_sleep_moci>;
+};
+
 /* Current measurement into module VCC */
 &hwmon {
        status = "okay";
index e5400140e5c6edacd4ae385edeae07bd1a18ce16..c2721e9f579780ca462b39558c466472f9e10e69 100644 (file)
        status = "okay";
 };
 
+&gpio4 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_ctrl_sleep_moci>;
+};
+
 &gpio_expander_21 {
        status = "okay";
        vcc-supply = <&reg_1p8v>;
index 3a8542266d85c0815a90a7f8d014e1f1ab229dd0..a7b261ff3e4cd8f03a7e6c2c4d41da4284c081d6 100644 (file)
        status = "okay";
 };
 
+&gpio4 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_ctrl_sleep_moci>;
+};
+
 &hwmon_temp {
        status = "okay";
 };
index f033d4310305fef3dab1d3c59684b300fa102f0e..aef4bef4bccddb68af23f626065d2940253564ae 100644 (file)
                vin-supply = <&reg_vdd_3v3>;
        };
 
+       /*
+        * By default we enable CTRL_SLEEP_MOCI#, this is required to have
+        * peripherals on the carrier board powered.
+        * If more granularity or power saving is required this can be disabled
+        * in the carrier board device tree files.
+        */
+       reg_force_sleep_moci: regulator-force-sleep-moci {
+               compatible = "regulator-fixed";
+               enable-active-high;
+               /* Verdin CTRL_SLEEP_MOCI# (SODIMM 256) */
+               gpio = <&gpio4 29 GPIO_ACTIVE_HIGH>;
+               regulator-always-on;
+               regulator-boot-on;
+               regulator-name = "CTRL_SLEEP_MOCI#";
+       };
+
        reg_usb1_vbus: regulator-usb1-vbus {
                compatible = "regulator-fixed";
                enable-active-high;
                          "SODIMM_256",
                          "SODIMM_48",
                          "SODIMM_44";
-
-       ctrl-sleep-moci-hog {
-               gpio-hog;
-               /* Verdin CTRL_SLEEP_MOCI# (SODIMM 256) */
-               gpios = <29 GPIO_ACTIVE_HIGH>;
-               line-name = "CTRL_SLEEP_MOCI#";
-               output-high;
-               pinctrl-names = "default";
-               pinctrl-0 = <&pinctrl_ctrl_sleep_moci>;
-       };
 };
 
 /* On-module I2C */