diff mbox series

[2/6] arm64: dts: imx8mm-kontron: Use the VSELECT signal to switch SD card IO voltage

Message ID 20220713074118.14733-3-frieder@fris.de (mailing list archive)
State New, archived
Headers show
Series arm64: dts: imx8mm-kontron: Improvements and OSM board support | expand

Commit Message

Frieder Schrempf July 13, 2022, 7:41 a.m. UTC
From: Frieder Schrempf <frieder.schrempf@kontron.de>

It turns out that it is not necessary to declare the VSELECT signal as
GPIO and let the PMIC driver set it to a fixed high level. This switches
the voltage between 3.3V and 1.8V by setting the PMIC register for LDO5
accordingly.

Instead we can do it like other boards already do and simply mux the
VSELECT signal of the USDHC interface to the pin. This makes sure that
the correct voltage is selected by setting the PMIC's SD_VSEL input
to high or low accordingly.

Reported-by: Heiko Thiery <heiko.thiery@gmail.com>
Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
---
 arch/arm64/boot/dts/freescale/imx8mm-kontron-n801x-s.dts    | 3 +++
 arch/arm64/boot/dts/freescale/imx8mm-kontron-n801x-som.dtsi | 2 --
 2 files changed, 3 insertions(+), 2 deletions(-)

Comments

Heiko Thiery July 14, 2022, 2:53 p.m. UTC | #1
Hi,

Am Mi., 13. Juli 2022 um 09:41 Uhr schrieb Frieder Schrempf <frieder@fris.de>:
>
> From: Frieder Schrempf <frieder.schrempf@kontron.de>
>
> It turns out that it is not necessary to declare the VSELECT signal as
> GPIO and let the PMIC driver set it to a fixed high level. This switches
> the voltage between 3.3V and 1.8V by setting the PMIC register for LDO5
> accordingly.
>
> Instead we can do it like other boards already do and simply mux the
> VSELECT signal of the USDHC interface to the pin. This makes sure that
> the correct voltage is selected by setting the PMIC's SD_VSEL input
> to high or low accordingly.
>
> Reported-by: Heiko Thiery <heiko.thiery@gmail.com>
> Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>

Reviewed-by: Heiko Thiery <heiko.thiery@gmail.com>

> ---
>  arch/arm64/boot/dts/freescale/imx8mm-kontron-n801x-s.dts    | 3 +++
>  arch/arm64/boot/dts/freescale/imx8mm-kontron-n801x-som.dtsi | 2 --
>  2 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm64/boot/dts/freescale/imx8mm-kontron-n801x-s.dts b/arch/arm64/boot/dts/freescale/imx8mm-kontron-n801x-s.dts
> index cb8102bb8db5..bc46426ad8f6 100644
> --- a/arch/arm64/boot/dts/freescale/imx8mm-kontron-n801x-s.dts
> +++ b/arch/arm64/boot/dts/freescale/imx8mm-kontron-n801x-s.dts
> @@ -321,6 +321,7 @@ MX8MM_IOMUXC_SD2_DATA1_USDHC2_DATA1         0x1d0
>                         MX8MM_IOMUXC_SD2_DATA2_USDHC2_DATA2             0x1d0
>                         MX8MM_IOMUXC_SD2_DATA3_USDHC2_DATA3             0x1d0
>                         MX8MM_IOMUXC_SD2_CD_B_GPIO2_IO12                0x019
> +                       MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT          0x1d0
>                 >;
>         };
>
> @@ -333,6 +334,7 @@ MX8MM_IOMUXC_SD2_DATA1_USDHC2_DATA1         0x1d4
>                         MX8MM_IOMUXC_SD2_DATA2_USDHC2_DATA2             0x1d4
>                         MX8MM_IOMUXC_SD2_DATA3_USDHC2_DATA3             0x1d4
>                         MX8MM_IOMUXC_SD2_CD_B_GPIO2_IO12                0x019
> +                       MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT          0x1d0
>                 >;
>         };
>
> @@ -345,6 +347,7 @@ MX8MM_IOMUXC_SD2_DATA1_USDHC2_DATA1         0x1d6
>                         MX8MM_IOMUXC_SD2_DATA2_USDHC2_DATA2             0x1d6
>                         MX8MM_IOMUXC_SD2_DATA3_USDHC2_DATA3             0x1d6
>                         MX8MM_IOMUXC_SD2_CD_B_GPIO2_IO12                0x019
> +                       MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT          0x1d0
>                 >;
>         };
>  };
> diff --git a/arch/arm64/boot/dts/freescale/imx8mm-kontron-n801x-som.dtsi b/arch/arm64/boot/dts/freescale/imx8mm-kontron-n801x-som.dtsi
> index b6d90d646a5f..77c074b491a6 100644
> --- a/arch/arm64/boot/dts/freescale/imx8mm-kontron-n801x-som.dtsi
> +++ b/arch/arm64/boot/dts/freescale/imx8mm-kontron-n801x-som.dtsi
> @@ -86,7 +86,6 @@ pca9450: pmic@25 {
>                 pinctrl-0 = <&pinctrl_pmic>;
>                 interrupt-parent = <&gpio1>;
>                 interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
> -               sd-vsel-gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>;
>
>                 regulators {
>                         reg_vdd_soc: BUCK1 {
> @@ -229,7 +228,6 @@ MX8MM_IOMUXC_I2C1_SDA_I2C1_SDA                      0x400001c3
>         pinctrl_pmic: pmicgrp {
>                 fsl,pins = <
>                         MX8MM_IOMUXC_GPIO1_IO00_GPIO1_IO0               0x141
> -                       MX8MM_IOMUXC_GPIO1_IO04_GPIO1_IO4               0x141
>                 >;
>         };
>
> --
> 2.37.0
>
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/freescale/imx8mm-kontron-n801x-s.dts b/arch/arm64/boot/dts/freescale/imx8mm-kontron-n801x-s.dts
index cb8102bb8db5..bc46426ad8f6 100644
--- a/arch/arm64/boot/dts/freescale/imx8mm-kontron-n801x-s.dts
+++ b/arch/arm64/boot/dts/freescale/imx8mm-kontron-n801x-s.dts
@@ -321,6 +321,7 @@  MX8MM_IOMUXC_SD2_DATA1_USDHC2_DATA1		0x1d0
 			MX8MM_IOMUXC_SD2_DATA2_USDHC2_DATA2		0x1d0
 			MX8MM_IOMUXC_SD2_DATA3_USDHC2_DATA3		0x1d0
 			MX8MM_IOMUXC_SD2_CD_B_GPIO2_IO12		0x019
+			MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT		0x1d0
 		>;
 	};
 
@@ -333,6 +334,7 @@  MX8MM_IOMUXC_SD2_DATA1_USDHC2_DATA1		0x1d4
 			MX8MM_IOMUXC_SD2_DATA2_USDHC2_DATA2		0x1d4
 			MX8MM_IOMUXC_SD2_DATA3_USDHC2_DATA3		0x1d4
 			MX8MM_IOMUXC_SD2_CD_B_GPIO2_IO12		0x019
+			MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT		0x1d0
 		>;
 	};
 
@@ -345,6 +347,7 @@  MX8MM_IOMUXC_SD2_DATA1_USDHC2_DATA1		0x1d6
 			MX8MM_IOMUXC_SD2_DATA2_USDHC2_DATA2		0x1d6
 			MX8MM_IOMUXC_SD2_DATA3_USDHC2_DATA3		0x1d6
 			MX8MM_IOMUXC_SD2_CD_B_GPIO2_IO12		0x019
+			MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT		0x1d0
 		>;
 	};
 };
diff --git a/arch/arm64/boot/dts/freescale/imx8mm-kontron-n801x-som.dtsi b/arch/arm64/boot/dts/freescale/imx8mm-kontron-n801x-som.dtsi
index b6d90d646a5f..77c074b491a6 100644
--- a/arch/arm64/boot/dts/freescale/imx8mm-kontron-n801x-som.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mm-kontron-n801x-som.dtsi
@@ -86,7 +86,6 @@  pca9450: pmic@25 {
 		pinctrl-0 = <&pinctrl_pmic>;
 		interrupt-parent = <&gpio1>;
 		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
-		sd-vsel-gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>;
 
 		regulators {
 			reg_vdd_soc: BUCK1 {
@@ -229,7 +228,6 @@  MX8MM_IOMUXC_I2C1_SDA_I2C1_SDA			0x400001c3
 	pinctrl_pmic: pmicgrp {
 		fsl,pins = <
 			MX8MM_IOMUXC_GPIO1_IO00_GPIO1_IO0		0x141
-			MX8MM_IOMUXC_GPIO1_IO04_GPIO1_IO4		0x141
 		>;
 	};