arm64: dts: freescale: imx8mm-verdin: replace sleep-moci hog with regulator
authorStefan Eichenberger <stefan.eichenberger@toradex.com>
Fri, 5 Apr 2024 16:07:19 +0000 (18:07 +0200)
committerShawn Guo <shawnguo@kernel.org>
Mon, 22 Apr 2024 04:36:59 +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/imx8mm-verdin-dahlia.dtsi
arch/arm64/boot/dts/freescale/imx8mm-verdin-dev.dtsi
arch/arm64/boot/dts/freescale/imx8mm-verdin-yavia.dtsi
arch/arm64/boot/dts/freescale/imx8mm-verdin.dtsi

index 1cff0b829357ed56faf7ee77c5ab58dca09fe5eb..b64dac4f29c2383adc02fe1fd83c46b324c98593 100644 (file)
        status = "okay";
 };
 
+&gpio5 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_ctrl_sleep_moci>;
+};
+
 /* Current measurement into module VCC */
 &hwmon {
        status = "okay";
index 3c4b8ca125e3211b172b2656301e02ebbee5b0f1..95b7c9a03a23de2b5afbceb931c43f0613d74736 100644 (file)
        status = "okay";
 };
 
+&gpio5 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_ctrl_sleep_moci>;
+};
+
 &gpio_expander_21 {
        status = "okay";
 };
index 1e28c78e381fc9c6da4c983d3e432c157ea7208d..763f069e8405442f2af7491ff810b8b2375248f2 100644 (file)
        pinctrl-0 = <&pinctrl_gpios_ext_yavia>;
 };
 
+&gpio5 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_ctrl_sleep_moci>;
+};
+
 &hwmon_temp {
        status = "okay";
 };
index 6f0811587142d2725db959d100e7229c6ca82f02..4768b05fd7659ef348e958a6093198ccea6baebe 100644 (file)
                startup-delay-us = <200000>;
        };
 
+       /*
+        * 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 = <&gpio5 1 GPIO_ACTIVE_HIGH>;
+               regulator-always-on;
+               regulator-boot-on;
+               regulator-name = "CTRL_SLEEP_MOCI#";
+       };
+
        reg_usb_otg1_vbus: regulator-usb-otg1 {
                compatible = "regulator-fixed";
                enable-active-high;
                          "SODIMM_212",
                          "SODIMM_151",
                          "SODIMM_153";
-
-       ctrl-sleep-moci-hog {
-               gpio-hog;
-               /* Verdin CTRL_SLEEP_MOCI# (SODIMM 256) */
-               gpios = <1 GPIO_ACTIVE_HIGH>;
-               line-name = "CTRL_SLEEP_MOCI#";
-               output-high;
-               pinctrl-names = "default";
-               pinctrl-0 = <&pinctrl_ctrl_sleep_moci>;
-       };
 };
 
 /* On-module I2C */