diff options
author | Mark Brown <broonie@kernel.org> | 2016-03-18 09:50:49 +0000 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-03-18 09:50:49 +0000 |
commit | 0f221533bae04ea913dc8ebe18cb876a916ff690 (patch) | |
tree | 77e668f0080e2ca245bd6150f5046370e8fa9f4b /drivers/mmc/core/sdio_io.c | |
parent | 917a9133a6b3c6cc2b6b5649d28c617a4ccac3e6 (diff) | |
parent | 127f7fb4c452328fa24f4c29eb403a97c5f7ea8c (diff) |
Merge remote-tracking branch 'lsk/linux-linaro-lsk-v4.4-android' into linux-linaro-lsk-v4.4-androidlsk-v4.4-16.03-android
Diffstat (limited to 'drivers/mmc/core/sdio_io.c')
-rw-r--r-- | drivers/mmc/core/sdio_io.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/drivers/mmc/core/sdio_io.c b/drivers/mmc/core/sdio_io.c index 78cb4d5d9d58..8fdeb07723a6 100644 --- a/drivers/mmc/core/sdio_io.c +++ b/drivers/mmc/core/sdio_io.c @@ -384,6 +384,39 @@ u8 sdio_readb(struct sdio_func *func, unsigned int addr, int *err_ret) EXPORT_SYMBOL_GPL(sdio_readb); /** + * sdio_readb_ext - read a single byte from a SDIO function + * @func: SDIO function to access + * @addr: address to read + * @err_ret: optional status value from transfer + * @in: value to add to argument + * + * Reads a single byte from the address space of a given SDIO + * function. If there is a problem reading the address, 0xff + * is returned and @err_ret will contain the error code. + */ +unsigned char sdio_readb_ext(struct sdio_func *func, unsigned int addr, + int *err_ret, unsigned in) +{ + int ret; + unsigned char val; + + BUG_ON(!func); + + if (err_ret) + *err_ret = 0; + + ret = mmc_io_rw_direct(func->card, 0, func->num, addr, (u8)in, &val); + if (ret) { + if (err_ret) + *err_ret = ret; + return 0xFF; + } + + return val; +} +EXPORT_SYMBOL_GPL(sdio_readb_ext); + +/** * sdio_writeb - write a single byte to a SDIO function * @func: SDIO function to access * @b: byte to write |