public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: Tony Lindgren <tony@atomide.com>, Ulf Hansson <ulf.hansson@linaro.org>
Cc: Andreas Fenkart <afenkart@gmail.com>,
	linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org,
	GTA04 owners <gta04-owner@goldelico.com>,
	NeilBrown <neil@brown.name>,
	linux-omap@vger.kernel.org
Subject: [PATCH 2/3] mmc: core: export functions for setting bus width.
Date: Wed, 28 Jan 2015 10:35:24 +1100	[thread overview]
Message-ID: <20150127233524.32160.48364.stgit@notabene.brown> (raw)
In-Reply-To: <20150127233118.32160.11899.stgit@notabene.brown>

It is not safe for a host to turn off clocks while
expecting an SD card interrupt unless it first places
the bus in 1-bit mode.

To allow hosts to do this, export functions necessary for changing bus
width.

Signed-off-by: NeilBrown <neil@brown.name>
---
 drivers/mmc/core/core.c  |    1 +
 drivers/mmc/core/sdio.c  |    8 ++++----
 include/linux/mmc/host.h |    4 ++++
 3 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 7162ada24a24..418dd8ec36f8 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -1099,6 +1099,7 @@ void mmc_set_bus_width(struct mmc_host *host, unsigned int width)
 	mmc_set_ios(host);
 	mmc_host_clk_release(host);
 }
+EXPORT_SYMBOL(mmc_set_bus_width);
 
 /*
  * Set initial state after a power cycle or a hw_reset.
diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index fd0750b5a634..128bbf10ae98 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -257,7 +257,7 @@ static int sdio_disable_cd(struct mmc_card *card)
  * Devices that remain active during a system suspend are
  * put back into 1-bit mode.
  */
-static int sdio_disable_wide(struct mmc_card *card)
+int sdio_disable_wide(struct mmc_card *card)
 {
 	int ret;
 	u8 ctrl;
@@ -286,9 +286,9 @@ static int sdio_disable_wide(struct mmc_card *card)
 
 	return 0;
 }
+EXPORT_SYMBOL(sdio_disable_wide);
 
-
-static int sdio_enable_4bit_bus(struct mmc_card *card)
+int sdio_enable_4bit_bus(struct mmc_card *card)
 {
 	int err;
 
@@ -309,7 +309,7 @@ static int sdio_enable_4bit_bus(struct mmc_card *card)
 
 	return err;
 }
-
+EXPORT_SYMBOL(sdio_enable_4bit_bus);
 
 /*
  * Test if the card supports high-speed mode and, if so, switch to it.
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index b6bf718c3498..822a02528c91 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -517,4 +517,8 @@ static inline bool mmc_card_hs400(struct mmc_card *card)
 	return card->host->ios.timing == MMC_TIMING_MMC_HS400;
 }
 
+int sdio_disable_wide(struct mmc_card *card);
+int sdio_enable_4bit_bus(struct mmc_card *card);
+void mmc_set_bus_width(struct mmc_host *host, unsigned int width);
+
 #endif /* LINUX_MMC_HOST_H */

  reply	other threads:[~2015-01-27 23:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-27 23:35 [PATCH-RFC 0/3] mmc: switch to 1-bit mode which stopping clocks NeilBrown
2015-01-27 23:35 ` NeilBrown [this message]
2015-01-27 23:35 ` [PATCH 1/3] mmc: core: allow non-blocking form of mmc_claim_host NeilBrown
2015-01-27 23:35 ` [PATCH 3/3] mmc: omap_hsmmc: switch to 1-bit before turning off clocks if interrupts expected NeilBrown
2015-01-28 20:18   ` Ulf Hansson
2015-01-28 21:08     ` NeilBrown

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=20150127233524.32160.48364.stgit@notabene.brown \
    --to=neilb@suse.de \
    --cc=afenkart@gmail.com \
    --cc=gta04-owner@goldelico.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=neil@brown.name \
    --cc=tony@atomide.com \
    --cc=ulf.hansson@linaro.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox