diff mbox series

[1/3] ARM: dts: meson8b: odroidc1: mark the SD card detection GPIO active-low

Message ID 20181229125711.5205-2-martin.blumenstingl@googlemail.com (mailing list archive)
State New, archived
Headers show
Series ARM: dts: meson: fix SD card cd-gpio (pre v4.21-rc) | expand

Commit Message

Martin Blumenstingl Dec. 29, 2018, 12:57 p.m. UTC
After commit 89a5e15bcba87d ("gpio/mmc/of: Respect polarity in the device
tree") SD cards are not detected anymore.

The CD GPIO is "active low" on Odroid-C1. The MMC dt-bindings specify:
"[...] using the "cd-inverted" property means, that the CD line is active
high, i.e. it is high, when a card is inserted".

Fix the description of the SD card by marking it as GPIO_ACTIVE_LOW and
drop the "cd-inverted" property. This makes the definition consistent
with the existing dt-bindings and fixes the check whether an SD card is
inserted.

Fixes: e03efbce6bebf5 ("ARM: dts: meson8b-odroidc1: add microSD support")
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
---
 arch/arm/boot/dts/meson8b-odroidc1.dts | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Linus Walleij Dec. 30, 2018, 7:54 p.m. UTC | #1
On Sat, Dec 29, 2018 at 1:57 PM Martin Blumenstingl
<martin.blumenstingl@googlemail.com> wrote:

> After commit 89a5e15bcba87d ("gpio/mmc/of: Respect polarity in the device
> tree") SD cards are not detected anymore.
>
> The CD GPIO is "active low" on Odroid-C1. The MMC dt-bindings specify:
> "[...] using the "cd-inverted" property means, that the CD line is active
> high, i.e. it is high, when a card is inserted".
>
> Fix the description of the SD card by marking it as GPIO_ACTIVE_LOW and
> drop the "cd-inverted" property. This makes the definition consistent
> with the existing dt-bindings and fixes the check whether an SD card is
> inserted.
>
> Fixes: e03efbce6bebf5 ("ARM: dts: meson8b-odroidc1: add microSD support")
> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

This is definately a better way to do it (we should insert some text into the
nindings about doing it this way).

We also need to fix it for existing device trees using "cd-inverted"
though.

Yours,
Linus Walleij
Anand Moon Jan. 7, 2019, 8:51 a.m. UTC | #2
Hi Martin,

On Sat, 29 Dec 2018 at 18:28, Martin Blumenstingl
<martin.blumenstingl@googlemail.com> wrote:
>
> After commit 89a5e15bcba87d ("gpio/mmc/of: Respect polarity in the device
> tree") SD cards are not detected anymore.
>
> The CD GPIO is "active low" on Odroid-C1. The MMC dt-bindings specify:
> "[...] using the "cd-inverted" property means, that the CD line is active
> high, i.e. it is high, when a card is inserted".
>
> Fix the description of the SD card by marking it as GPIO_ACTIVE_LOW and
> drop the "cd-inverted" property. This makes the definition consistent
> with the existing dt-bindings and fixes the check whether an SD card is
> inserted.
>
> Fixes: e03efbce6bebf5 ("ARM: dts: meson8b-odroidc1: add microSD support")
> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> ---
>  arch/arm/boot/dts/meson8b-odroidc1.dts | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/arch/arm/boot/dts/meson8b-odroidc1.dts b/arch/arm/boot/dts/meson8b-odroidc1.dts
> index 58669abda259..070d69889f3e 100644
> --- a/arch/arm/boot/dts/meson8b-odroidc1.dts
> +++ b/arch/arm/boot/dts/meson8b-odroidc1.dts
> @@ -273,8 +273,7 @@
>                 cap-sd-highspeed;
>                 disable-wp;
>
> -               cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_HIGH>;
> -               cd-inverted;
> +               cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_LOW>;
>
>                 vmmc-supply = <&tflash_vdd>;
>                 vqmmc-supply = <&tf_io>;
> --
> 2.20.1
>

Please add my on my Odroid c1+

Tested-by: Anand Moon <linux.amoon@gmail.com>

My Odroid C2 is also fails to bootup with out these changes.
Can you send patch to fix them as well.

Best Regards

-Anand

>
> _______________________________________________
> linux-amlogic mailing list
> linux-amlogic@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-amlogic
Martin Blumenstingl Jan. 8, 2019, 10:02 p.m. UTC | #3
Hi Anand,

On Mon, Jan 7, 2019 at 9:51 AM Anand Moon <linux.amoon@gmail.com> wrote:
>
> Hi Martin,
>
> On Sat, 29 Dec 2018 at 18:28, Martin Blumenstingl
> <martin.blumenstingl@googlemail.com> wrote:
> >
> > After commit 89a5e15bcba87d ("gpio/mmc/of: Respect polarity in the device
> > tree") SD cards are not detected anymore.
> >
> > The CD GPIO is "active low" on Odroid-C1. The MMC dt-bindings specify:
> > "[...] using the "cd-inverted" property means, that the CD line is active
> > high, i.e. it is high, when a card is inserted".
> >
> > Fix the description of the SD card by marking it as GPIO_ACTIVE_LOW and
> > drop the "cd-inverted" property. This makes the definition consistent
> > with the existing dt-bindings and fixes the check whether an SD card is
> > inserted.
> >
> > Fixes: e03efbce6bebf5 ("ARM: dts: meson8b-odroidc1: add microSD support")
> > Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> > ---
> >  arch/arm/boot/dts/meson8b-odroidc1.dts | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/arch/arm/boot/dts/meson8b-odroidc1.dts b/arch/arm/boot/dts/meson8b-odroidc1.dts
> > index 58669abda259..070d69889f3e 100644
> > --- a/arch/arm/boot/dts/meson8b-odroidc1.dts
> > +++ b/arch/arm/boot/dts/meson8b-odroidc1.dts
> > @@ -273,8 +273,7 @@
> >                 cap-sd-highspeed;
> >                 disable-wp;
> >
> > -               cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_HIGH>;
> > -               cd-inverted;
> > +               cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_LOW>;
> >
> >                 vmmc-supply = <&tflash_vdd>;
> >                 vqmmc-supply = <&tf_io>;
> > --
> > 2.20.1
> >
>
> Please add my on my Odroid c1+
>
> Tested-by: Anand Moon <linux.amoon@gmail.com>
thank you for testing this!

> My Odroid C2 is also fails to bootup with out these changes.
> Can you send patch to fix them as well.
I sent a more generic patch (after a discussion with Linus) which will
fix all boards with the "cd-inverted" property even if we don't fix
the .dts files: [0]
(that doesn't mean that this patch is obsolete, but it means that we
restore compatibility with .dts which use the "cd-inverted" property)

it would be great if you could test that on your Odroid-C2 and give
your Tested-by on that as well!


Regards
Martin


[0] https://patchwork.kernel.org/patch/10745961/
diff mbox series

Patch

diff --git a/arch/arm/boot/dts/meson8b-odroidc1.dts b/arch/arm/boot/dts/meson8b-odroidc1.dts
index 58669abda259..070d69889f3e 100644
--- a/arch/arm/boot/dts/meson8b-odroidc1.dts
+++ b/arch/arm/boot/dts/meson8b-odroidc1.dts
@@ -273,8 +273,7 @@ 
 		cap-sd-highspeed;
 		disable-wp;
 
-		cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_HIGH>;
-		cd-inverted;
+		cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_LOW>;
 
 		vmmc-supply = <&tflash_vdd>;
 		vqmmc-supply = <&tf_io>;