Commit 1685a03e authored by Jan Nikitenko's avatar Jan Nikitenko Committed by Pierre Ossman

mmc_spi: put signals to low power off fix

The original intention was to write a zero byte to mmc to force spi
signals to low when doing power off. Somehow the spi_w8r8 call got there
so a read followed the write of single zero byte. This patch changes
that to simple write of zero byte without the following read.
This way the power off is more reliable and completely sufficient.
Signed-off-by: default avatarJan Nikitenko <jan.nikitenko@gmail.com>
Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: default avatarPierre Ossman <drzeus@drzeus.cx>
parent 20b7997e
...@@ -1076,6 +1076,7 @@ static void mmc_spi_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) ...@@ -1076,6 +1076,7 @@ static void mmc_spi_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
*/ */
if (canpower && ios->power_mode == MMC_POWER_OFF) { if (canpower && ios->power_mode == MMC_POWER_OFF) {
int mres; int mres;
u8 nullbyte = 0;
host->spi->mode &= ~(SPI_CPOL|SPI_CPHA); host->spi->mode &= ~(SPI_CPOL|SPI_CPHA);
mres = spi_setup(host->spi); mres = spi_setup(host->spi);
...@@ -1083,7 +1084,7 @@ static void mmc_spi_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) ...@@ -1083,7 +1084,7 @@ static void mmc_spi_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
dev_dbg(&host->spi->dev, dev_dbg(&host->spi->dev,
"switch to SPI mode 0 failed\n"); "switch to SPI mode 0 failed\n");
if (spi_w8r8(host->spi, 0x00) < 0) if (spi_write(host->spi, &nullbyte, 1) < 0)
dev_dbg(&host->spi->dev, dev_dbg(&host->spi->dev,
"put spi signals to low failed\n"); "put spi signals to low failed\n");
......
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