From: Anton Vorontsov <avorontsov@ru.mvista.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Ben Dooks <ben@fluff.org>,
sdhci-devel@lists.ossman.eu, linux-kernel@vger.kernel.org,
linuxppc-dev@ozlabs.org, Pierre Ossman <pierre@ossman.eu>,
David Vrabel <david.vrabel@csr.com>
Subject: [PATCH 5/7] sdhci-of: Don't hard-code inverted write-protect quirk
Date: Fri, 7 Aug 2009 23:58:11 +0400 [thread overview]
Message-ID: <20090807195811.GE2735@oksana.dev.rtsoft.ru> (raw)
In-Reply-To: <20090807195724.GA24020@oksana.dev.rtsoft.ru>
MPC85xx SOCs have normal write-protect state reporting, so we shouldn't
hard-code the quirk.
Instead, look for "sdhci,wp-inverted" property, plus check for
mpc837x_{rdb,mds} machines since older device trees don't specify the
new property.
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
---
drivers/mmc/host/sdhci-of.c | 14 +++++++++++++-
1 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/drivers/mmc/host/sdhci-of.c b/drivers/mmc/host/sdhci-of.c
index 004f24d..87aaf4b 100644
--- a/drivers/mmc/host/sdhci-of.c
+++ b/drivers/mmc/host/sdhci-of.c
@@ -21,6 +21,7 @@
#include <linux/of.h>
#include <linux/of_platform.h>
#include <linux/mmc/host.h>
+#include <asm/machdep.h>
#include "sdhci.h"
struct sdhci_of_data {
@@ -175,7 +176,6 @@ static unsigned int esdhc_get_min_clock(struct sdhci_host *host)
static struct sdhci_of_data sdhci_esdhc = {
.quirks = SDHCI_QUIRK_FORCE_BLK_SZ_2048 |
SDHCI_QUIRK_BROKEN_CARD_DETECTION |
- SDHCI_QUIRK_INVERTED_WRITE_PROTECT |
SDHCI_QUIRK_NO_BUSY_IRQ |
SDHCI_QUIRK_NONSTANDARD_CLOCK |
SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK |
@@ -219,6 +219,15 @@ static int sdhci_of_resume(struct of_device *ofdev)
#endif
+static bool __devinit sdhci_of_wp_inverted(struct device_node *np)
+{
+ if (of_get_property(np, "sdhci,wp-inverted", NULL))
+ return true;
+
+ /* Old device trees don't have the wp-inverted property. */
+ return machine_is(mpc837x_rdb) || machine_is(mpc837x_mds);
+}
+
static int __devinit sdhci_of_probe(struct of_device *ofdev,
const struct of_device_id *match)
{
@@ -261,6 +270,9 @@ static int __devinit sdhci_of_probe(struct of_device *ofdev,
if (of_get_property(np, "sdhci,1-bit-only", NULL))
host->quirks |= SDHCI_QUIRK_FORCE_1_BIT_DATA;
+ if (sdhci_of_wp_inverted(np))
+ host->quirks |= SDHCI_QUIRK_INVERTED_WRITE_PROTECT;
+
clk = of_get_property(np, "clock-frequency", &size);
if (clk && size == sizeof(*clk) && *clk)
of_host->clock = *clk;
--
1.6.3.3
WARNING: multiple messages have this Message-ID (diff)
From: Anton Vorontsov <avorontsov@ru.mvista.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Pierre Ossman <pierre@ossman.eu>,
Kumar Gala <galak@kernel.crashing.org>,
David Vrabel <david.vrabel@csr.com>, Ben Dooks <ben@fluff.org>,
Sascha Hauer <s.hauer@pengutronix.de>,
linux-kernel@vger.kernel.org, sdhci-devel@lists.ossman.eu,
linuxppc-dev@ozlabs.org
Subject: [PATCH 5/7] sdhci-of: Don't hard-code inverted write-protect quirk
Date: Fri, 7 Aug 2009 23:58:11 +0400 [thread overview]
Message-ID: <20090807195811.GE2735@oksana.dev.rtsoft.ru> (raw)
In-Reply-To: <20090807195724.GA24020@oksana.dev.rtsoft.ru>
MPC85xx SOCs have normal write-protect state reporting, so we shouldn't
hard-code the quirk.
Instead, look for "sdhci,wp-inverted" property, plus check for
mpc837x_{rdb,mds} machines since older device trees don't specify the
new property.
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
---
drivers/mmc/host/sdhci-of.c | 14 +++++++++++++-
1 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/drivers/mmc/host/sdhci-of.c b/drivers/mmc/host/sdhci-of.c
index 004f24d..87aaf4b 100644
--- a/drivers/mmc/host/sdhci-of.c
+++ b/drivers/mmc/host/sdhci-of.c
@@ -21,6 +21,7 @@
#include <linux/of.h>
#include <linux/of_platform.h>
#include <linux/mmc/host.h>
+#include <asm/machdep.h>
#include "sdhci.h"
struct sdhci_of_data {
@@ -175,7 +176,6 @@ static unsigned int esdhc_get_min_clock(struct sdhci_host *host)
static struct sdhci_of_data sdhci_esdhc = {
.quirks = SDHCI_QUIRK_FORCE_BLK_SZ_2048 |
SDHCI_QUIRK_BROKEN_CARD_DETECTION |
- SDHCI_QUIRK_INVERTED_WRITE_PROTECT |
SDHCI_QUIRK_NO_BUSY_IRQ |
SDHCI_QUIRK_NONSTANDARD_CLOCK |
SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK |
@@ -219,6 +219,15 @@ static int sdhci_of_resume(struct of_device *ofdev)
#endif
+static bool __devinit sdhci_of_wp_inverted(struct device_node *np)
+{
+ if (of_get_property(np, "sdhci,wp-inverted", NULL))
+ return true;
+
+ /* Old device trees don't have the wp-inverted property. */
+ return machine_is(mpc837x_rdb) || machine_is(mpc837x_mds);
+}
+
static int __devinit sdhci_of_probe(struct of_device *ofdev,
const struct of_device_id *match)
{
@@ -261,6 +270,9 @@ static int __devinit sdhci_of_probe(struct of_device *ofdev,
if (of_get_property(np, "sdhci,1-bit-only", NULL))
host->quirks |= SDHCI_QUIRK_FORCE_1_BIT_DATA;
+ if (sdhci_of_wp_inverted(np))
+ host->quirks |= SDHCI_QUIRK_INVERTED_WRITE_PROTECT;
+
clk = of_get_property(np, "clock-frequency", &size);
if (clk && size == sizeof(*clk) && *clk)
of_host->clock = *clk;
--
1.6.3.3
next prev parent reply other threads:[~2009-08-07 19:58 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-07 19:57 [PATCH v2 0/7] sdhci-of: Some fixes for high-speed and 4-bit SD cards Anton Vorontsov
2009-08-07 19:57 ` Anton Vorontsov
2009-08-07 19:58 ` [PATCH 1/7] sdhci-of: Fix SD clock calculation Anton Vorontsov
2009-08-07 19:58 ` Anton Vorontsov
2009-08-07 19:58 ` [PATCH 2/7] sdhci-of: Avoid writing reserved bits into host control register Anton Vorontsov
2009-08-07 19:58 ` Anton Vorontsov
2009-08-07 19:58 ` [PATCH 3/7] sdhci-of: Fix high-speed cards recognition Anton Vorontsov
2009-08-07 19:58 ` Anton Vorontsov
2009-08-07 19:58 ` [PATCH 4/7] powerpc: Introduce and document sdhci,wp-inverted property for eSDHC Anton Vorontsov
2009-08-07 19:58 ` Anton Vorontsov
2009-08-07 19:58 ` Anton Vorontsov [this message]
2009-08-07 19:58 ` [PATCH 5/7] sdhci-of: Don't hard-code inverted write-protect quirk Anton Vorontsov
2009-08-07 19:58 ` [PATCH 6/7] sdhci-of: Cleanup eSDHC's set_clock() a little bit Anton Vorontsov
2009-08-07 19:58 ` Anton Vorontsov
2009-08-07 19:58 ` [PATCH 7/7] powerpc/85xx: Add eSDHC support for MPC8536DS boards Anton Vorontsov
2009-08-07 19:58 ` Anton Vorontsov
2009-08-11 13:48 ` Kumar Gala
2009-08-11 13:48 ` Kumar Gala
2009-08-18 23:38 ` [PATCH v2] " Anton Vorontsov
2009-08-18 23:38 ` Anton Vorontsov
2009-08-19 1:24 ` Kumar Gala
2009-08-19 1:24 ` Kumar Gala
2009-08-19 1:51 ` Anton Vorontsov
2009-08-19 1:51 ` Anton Vorontsov
2009-08-28 11:02 ` Hu Mingkai-B21284
2009-08-28 11:02 ` Hu Mingkai-B21284
2009-08-28 15:19 ` Anton Vorontsov
2009-08-28 15:19 ` Anton Vorontsov
2009-08-31 7:51 ` Hu Mingkai-B21284
2009-08-31 7:51 ` Hu Mingkai-B21284
2009-08-25 14:44 ` Kumar Gala
2009-08-25 14:44 ` Kumar Gala
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090807195811.GE2735@oksana.dev.rtsoft.ru \
--to=avorontsov@ru.mvista.com \
--cc=akpm@linux-foundation.org \
--cc=ben@fluff.org \
--cc=david.vrabel@csr.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=pierre@ossman.eu \
--cc=sdhci-devel@lists.ossman.eu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.