Commit 20348d19 authored by Ulf Hansson's avatar Ulf Hansson

mmc: core: Make mmc_switch_status() available for mmc core

Following changes needs mmc_switch_status() to be available both from mmc.c
and mmc_ops.c. Allow that by moving its implementation to mmc_ops.c and
make it available via mmc_ops.h.

Moving mmc_switch_status() to mmc_ops.c, also enables us to turn
mmc_switch_status_error() into static function. So let's take the
opportunity to change this as well.
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
Acked-by: default avatarJaehoon Chung <jh80.chung@samsung.com>
Tested-by: default avatarJaehoon Chung <jh80.chung@samsung.com>
parent 67e6db11
...@@ -1003,19 +1003,6 @@ static int mmc_select_bus_width(struct mmc_card *card) ...@@ -1003,19 +1003,6 @@ static int mmc_select_bus_width(struct mmc_card *card)
return err; return err;
} }
/* Caller must hold re-tuning */
static int mmc_switch_status(struct mmc_card *card)
{
u32 status;
int err;
err = mmc_send_status(card, &status);
if (err)
return err;
return mmc_switch_status_error(card->host, status);
}
/* /*
* Switch to the high-speed mode * Switch to the high-speed mode
*/ */
......
...@@ -440,7 +440,7 @@ int mmc_spi_set_crc(struct mmc_host *host, int use_crc) ...@@ -440,7 +440,7 @@ int mmc_spi_set_crc(struct mmc_host *host, int use_crc)
return err; return err;
} }
int mmc_switch_status_error(struct mmc_host *host, u32 status) static int mmc_switch_status_error(struct mmc_host *host, u32 status)
{ {
if (mmc_host_is_spi(host)) { if (mmc_host_is_spi(host)) {
if (status & R1_SPI_ILLEGAL_COMMAND) if (status & R1_SPI_ILLEGAL_COMMAND)
...@@ -455,6 +455,19 @@ int mmc_switch_status_error(struct mmc_host *host, u32 status) ...@@ -455,6 +455,19 @@ int mmc_switch_status_error(struct mmc_host *host, u32 status)
return 0; return 0;
} }
/* Caller must hold re-tuning */
int mmc_switch_status(struct mmc_card *card)
{
u32 status;
int err;
err = mmc_send_status(card, &status);
if (err)
return err;
return mmc_switch_status_error(card->host, status);
}
/** /**
* __mmc_switch - modify EXT_CSD register * __mmc_switch - modify EXT_CSD register
* @card: the MMC card associated with the data transfer * @card: the MMC card associated with the data transfer
......
...@@ -27,7 +27,7 @@ int mmc_spi_set_crc(struct mmc_host *host, int use_crc); ...@@ -27,7 +27,7 @@ int mmc_spi_set_crc(struct mmc_host *host, int use_crc);
int mmc_bus_test(struct mmc_card *card, u8 bus_width); int mmc_bus_test(struct mmc_card *card, u8 bus_width);
int mmc_send_hpi_cmd(struct mmc_card *card, u32 *status); int mmc_send_hpi_cmd(struct mmc_card *card, u32 *status);
int mmc_can_ext_csd(struct mmc_card *card); int mmc_can_ext_csd(struct mmc_card *card);
int mmc_switch_status_error(struct mmc_host *host, u32 status); int mmc_switch_status(struct mmc_card *card);
int __mmc_switch(struct mmc_card *card, u8 set, u8 index, u8 value, int __mmc_switch(struct mmc_card *card, u8 set, u8 index, u8 value,
unsigned int timeout_ms, bool use_busy_signal, bool send_status, unsigned int timeout_ms, bool use_busy_signal, bool send_status,
bool ignore_crc); bool ignore_crc);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment