linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] Fix mmc/sd card detect gpio dt definition
@ 2015-10-12  9:07 Mugunthan V N
       [not found] ` <1444640832-7396-1-git-send-email-mugunthanvnm-l0cyMroinI0@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Mugunthan V N @ 2015-10-12  9:07 UTC (permalink / raw)
  To: linux-omap-u79uwXL29TY76Z2rM5mHXA
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA, Tony Lindgren, Sekhar Nori,
	Mugunthan V N

The mmc/sd card detect gpio definition in DT is not defined as
per hardware design, the card detect gpio is an active low
signal.

As per MMC/SD device tree binding documentation, the card detect
signal should be an active low signal and when ever a hardware is
designed with an active high card detect gpio then "cd-inverted"
dt parameter should be used to detect the actual status for the
card.

This was not captured till now because gpio is used as interrupt
source and mmc_rescan task is scheduled. The value of the gpio
is not used to determine card presence.

Pushed a branch [1] for testing and tested this patch series on
am335x bone black [2], am437x-gp evm [3] and dra72x evm [4].

[1]: git://git.ti.com/~mugunthanvnm/ti-linux-kernel/linux.git mmc-cd-gpio-fix
[2]: http://pastebin.ubuntu.com/12762164/
[3]: http://pastebin.ubuntu.com/12762168/
[4]: http://pastebin.ubuntu.com/12762169/

Mugunthan V N (3):
  ARM: DTS: am335x: fix cd-gpios definition as per hardware design and
    dt binding docs
  ARM: DTS: am43xx: fix cd-gpios definition as per hardware design and
    dt binding docs
  ARM: DTS: dra7xx: am57xx: fix cd-gpios definition as per hardware
    design and dt binding docs

 arch/arm/boot/dts/am335x-bone-common.dtsi | 3 +--
 arch/arm/boot/dts/am335x-evm.dts          | 2 +-
 arch/arm/boot/dts/am335x-evmsk.dts        | 2 +-
 arch/arm/boot/dts/am437x-gp-evm.dts       | 2 +-
 arch/arm/boot/dts/am437x-idk-evm.dts      | 2 +-
 arch/arm/boot/dts/am437x-sk-evm.dts       | 2 +-
 arch/arm/boot/dts/am43x-epos-evm.dts      | 2 +-
 arch/arm/boot/dts/am57xx-beagle-x15.dts   | 2 +-
 arch/arm/boot/dts/dra7-evm.dts            | 2 +-
 arch/arm/boot/dts/dra72-evm.dts           | 2 +-
 10 files changed, 10 insertions(+), 11 deletions(-)

-- 
2.6.1.133.gf5b6079

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/3] ARM: DTS: am335x: fix cd-gpios definition as per hardware design and dt binding docs
       [not found] ` <1444640832-7396-1-git-send-email-mugunthanvnm-l0cyMroinI0@public.gmane.org>
@ 2015-10-12  9:07   ` Mugunthan V N
  2015-10-12  9:07   ` [PATCH 2/3] ARM: DTS: am43xx: " Mugunthan V N
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Mugunthan V N @ 2015-10-12  9:07 UTC (permalink / raw)
  To: linux-omap-u79uwXL29TY76Z2rM5mHXA
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA, Tony Lindgren, Sekhar Nori,
	Mugunthan V N

As per mmc device tree binding documentation card detect gpio has
to be active low signal. When a hardware is designed with active
high card detect, gpio polarity has to be changed with
cd-inverted dt property.

In AM335x the card detect gpio is designed as active low gpio.
So correcting the dt card detect gpio definition.

Signed-off-by: Mugunthan V N <mugunthanvnm-l0cyMroinI0@public.gmane.org>
---
 arch/arm/boot/dts/am335x-bone-common.dtsi | 3 +--
 arch/arm/boot/dts/am335x-evm.dts          | 2 +-
 arch/arm/boot/dts/am335x-evmsk.dts        | 2 +-
 3 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boot/dts/am335x-bone-common.dtsi b/arch/arm/boot/dts/am335x-bone-common.dtsi
index fec7834..5d370d5 100644
--- a/arch/arm/boot/dts/am335x-bone-common.dtsi
+++ b/arch/arm/boot/dts/am335x-bone-common.dtsi
@@ -383,8 +383,7 @@
 	bus-width = <0x4>;
 	pinctrl-names = "default";
 	pinctrl-0 = <&mmc1_pins>;
-	cd-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>;
-	cd-inverted;
+	cd-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
 };
 
 &aes {
diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts
index 1942a5c..d9d00ab 100644
--- a/arch/arm/boot/dts/am335x-evm.dts
+++ b/arch/arm/boot/dts/am335x-evm.dts
@@ -737,7 +737,7 @@
 	bus-width = <4>;
 	pinctrl-names = "default";
 	pinctrl-0 = <&mmc1_pins>;
-	cd-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>;
+	cd-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
 };
 
 &mmc3 {
diff --git a/arch/arm/boot/dts/am335x-evmsk.dts b/arch/arm/boot/dts/am335x-evmsk.dts
index 315bb02..89442e9 100644
--- a/arch/arm/boot/dts/am335x-evmsk.dts
+++ b/arch/arm/boot/dts/am335x-evmsk.dts
@@ -647,7 +647,7 @@
 	bus-width = <4>;
 	pinctrl-names = "default";
 	pinctrl-0 = <&mmc1_pins>;
-	cd-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>;
+	cd-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
 };
 
 &sham {
-- 
2.6.1.133.gf5b6079

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/3] ARM: DTS: am43xx: fix cd-gpios definition as per hardware design and dt binding docs
       [not found] ` <1444640832-7396-1-git-send-email-mugunthanvnm-l0cyMroinI0@public.gmane.org>
  2015-10-12  9:07   ` [PATCH 1/3] ARM: DTS: am335x: fix cd-gpios definition as per hardware design and dt binding docs Mugunthan V N
@ 2015-10-12  9:07   ` Mugunthan V N
  2015-10-12  9:07   ` [PATCH 3/3] ARM: DTS: dra7xx: am57xx: " Mugunthan V N
  2015-10-12 23:48   ` [PATCH 0/3] Fix mmc/sd card detect gpio dt definition Tony Lindgren
  3 siblings, 0 replies; 5+ messages in thread
From: Mugunthan V N @ 2015-10-12  9:07 UTC (permalink / raw)
  To: linux-omap-u79uwXL29TY76Z2rM5mHXA
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA, Tony Lindgren, Sekhar Nori,
	Mugunthan V N

As per mmc device tree binding documentation card detect gpio has
to be active low signal. When a hardware is designed with active
high card detect, gpio polarity has to be changed with
cd-inverted dt property.

In AM43xx the card detect gpio is designed as active low gpio.
So correcting the dt card detect gpio definition.

Signed-off-by: Mugunthan V N <mugunthanvnm-l0cyMroinI0@public.gmane.org>
---
 arch/arm/boot/dts/am437x-gp-evm.dts  | 2 +-
 arch/arm/boot/dts/am437x-idk-evm.dts | 2 +-
 arch/arm/boot/dts/am437x-sk-evm.dts  | 2 +-
 arch/arm/boot/dts/am43x-epos-evm.dts | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boot/dts/am437x-gp-evm.dts b/arch/arm/boot/dts/am437x-gp-evm.dts
index 22038f2..81de3a1 100644
--- a/arch/arm/boot/dts/am437x-gp-evm.dts
+++ b/arch/arm/boot/dts/am437x-gp-evm.dts
@@ -689,7 +689,7 @@
 	bus-width = <4>;
 	pinctrl-names = "default";
 	pinctrl-0 = <&mmc1_pins>;
-	cd-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>;
+	cd-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
 };
 
 /* eMMC sits on mmc2 */
diff --git a/arch/arm/boot/dts/am437x-idk-evm.dts b/arch/arm/boot/dts/am437x-idk-evm.dts
index af25801..337fb91 100644
--- a/arch/arm/boot/dts/am437x-idk-evm.dts
+++ b/arch/arm/boot/dts/am437x-idk-evm.dts
@@ -325,7 +325,7 @@
 	pinctrl-1 = <&mmc1_pins_sleep>;
 	vmmc-supply = <&v3_3d>;
 	bus-width = <4>;
-	cd-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>;
+	cd-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
 };
 
 &qspi {
diff --git a/arch/arm/boot/dts/am437x-sk-evm.dts b/arch/arm/boot/dts/am437x-sk-evm.dts
index 7da7c2d..1582fdb 100644
--- a/arch/arm/boot/dts/am437x-sk-evm.dts
+++ b/arch/arm/boot/dts/am437x-sk-evm.dts
@@ -563,7 +563,7 @@
 
 	vmmc-supply = <&dcdc4>;
 	bus-width = <4>;
-	cd-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>;
+	cd-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
 };
 
 &usb2_phy1 {
diff --git a/arch/arm/boot/dts/am43x-epos-evm.dts b/arch/arm/boot/dts/am43x-epos-evm.dts
index 86c2dfb..47954ed 100644
--- a/arch/arm/boot/dts/am43x-epos-evm.dts
+++ b/arch/arm/boot/dts/am43x-epos-evm.dts
@@ -376,7 +376,7 @@
 	bus-width = <4>;
 	pinctrl-names = "default";
 	pinctrl-0 = <&mmc1_pins>;
-	cd-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>;
+	cd-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
 };
 
 &mac {
-- 
2.6.1.133.gf5b6079

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/3] ARM: DTS: dra7xx: am57xx: fix cd-gpios definition as per hardware design and dt binding docs
       [not found] ` <1444640832-7396-1-git-send-email-mugunthanvnm-l0cyMroinI0@public.gmane.org>
  2015-10-12  9:07   ` [PATCH 1/3] ARM: DTS: am335x: fix cd-gpios definition as per hardware design and dt binding docs Mugunthan V N
  2015-10-12  9:07   ` [PATCH 2/3] ARM: DTS: am43xx: " Mugunthan V N
@ 2015-10-12  9:07   ` Mugunthan V N
  2015-10-12 23:48   ` [PATCH 0/3] Fix mmc/sd card detect gpio dt definition Tony Lindgren
  3 siblings, 0 replies; 5+ messages in thread
From: Mugunthan V N @ 2015-10-12  9:07 UTC (permalink / raw)
  To: linux-omap-u79uwXL29TY76Z2rM5mHXA
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA, Tony Lindgren, Sekhar Nori,
	Mugunthan V N

As per mmc device tree binding documentation card detect gpio has
to be active low signal. When a hardware is designed with active
high card detect, gpio polarity has to be changed with
cd-inverted dt property.

In DRA74x, DRA72x and AM57xx EVMs the card detect gpio is
designed as active low gpio. So correcting the dt card detect
gpio definition.

Signed-off-by: Mugunthan V N <mugunthanvnm-l0cyMroinI0@public.gmane.org>
---
 arch/arm/boot/dts/am57xx-beagle-x15.dts | 2 +-
 arch/arm/boot/dts/dra7-evm.dts          | 2 +-
 arch/arm/boot/dts/dra72-evm.dts         | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boot/dts/am57xx-beagle-x15.dts b/arch/arm/boot/dts/am57xx-beagle-x15.dts
index 568adf5..e554596 100644
--- a/arch/arm/boot/dts/am57xx-beagle-x15.dts
+++ b/arch/arm/boot/dts/am57xx-beagle-x15.dts
@@ -585,7 +585,7 @@
 
 	vmmc-supply = <&ldo1_reg>;
 	bus-width = <4>;
-	cd-gpios = <&gpio6 27 0>; /* gpio 219 */
+	cd-gpios = <&gpio6 27 GPIO_ACTIVE_LOW>; /* gpio 219 */
 };
 
 &mmc2 {
diff --git a/arch/arm/boot/dts/dra7-evm.dts b/arch/arm/boot/dts/dra7-evm.dts
index a6c82e5..4379277 100644
--- a/arch/arm/boot/dts/dra7-evm.dts
+++ b/arch/arm/boot/dts/dra7-evm.dts
@@ -479,7 +479,7 @@
 	 * SDCD signal is not being used here - using the fact that GPIO mode
 	 * is always hardwired.
 	 */
-	cd-gpios = <&gpio6 27 0>;
+	cd-gpios = <&gpio6 27 GPIO_ACTIVE_LOW>;
 };
 
 &mmc2 {
diff --git a/arch/arm/boot/dts/dra72-evm.dts b/arch/arm/boot/dts/dra72-evm.dts
index 6f6bd98..d4aca5a1 100644
--- a/arch/arm/boot/dts/dra72-evm.dts
+++ b/arch/arm/boot/dts/dra72-evm.dts
@@ -514,7 +514,7 @@
 	 * SDCD signal is not being used here - using the fact that GPIO mode
 	 * is a viable alternative
 	 */
-	cd-gpios = <&gpio6 27 0>;
+	cd-gpios = <&gpio6 27 GPIO_ACTIVE_LOW>;
 	max-frequency = <192000000>;
 };
 
-- 
2.6.1.133.gf5b6079

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/3] Fix mmc/sd card detect gpio dt definition
       [not found] ` <1444640832-7396-1-git-send-email-mugunthanvnm-l0cyMroinI0@public.gmane.org>
                     ` (2 preceding siblings ...)
  2015-10-12  9:07   ` [PATCH 3/3] ARM: DTS: dra7xx: am57xx: " Mugunthan V N
@ 2015-10-12 23:48   ` Tony Lindgren
  3 siblings, 0 replies; 5+ messages in thread
From: Tony Lindgren @ 2015-10-12 23:48 UTC (permalink / raw)
  To: Mugunthan V N
  Cc: linux-omap-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Sekhar Nori

* Mugunthan V N <mugunthanvnm-l0cyMroinI0@public.gmane.org> [151012 02:12]:
> The mmc/sd card detect gpio definition in DT is not defined as
> per hardware design, the card detect gpio is an active low
> signal.
> 
> As per MMC/SD device tree binding documentation, the card detect
> signal should be an active low signal and when ever a hardware is
> designed with an active high card detect gpio then "cd-inverted"
> dt parameter should be used to detect the actual status for the
> card.
> 
> This was not captured till now because gpio is used as interrupt
> source and mmc_rescan task is scheduled. The value of the gpio
> is not used to determine card presence.

OK applying into omap-for-v4.4/dt thanks.

Tony
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-10-12 23:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-12  9:07 [PATCH 0/3] Fix mmc/sd card detect gpio dt definition Mugunthan V N
     [not found] ` <1444640832-7396-1-git-send-email-mugunthanvnm-l0cyMroinI0@public.gmane.org>
2015-10-12  9:07   ` [PATCH 1/3] ARM: DTS: am335x: fix cd-gpios definition as per hardware design and dt binding docs Mugunthan V N
2015-10-12  9:07   ` [PATCH 2/3] ARM: DTS: am43xx: " Mugunthan V N
2015-10-12  9:07   ` [PATCH 3/3] ARM: DTS: dra7xx: am57xx: " Mugunthan V N
2015-10-12 23:48   ` [PATCH 0/3] Fix mmc/sd card detect gpio dt definition Tony Lindgren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).