diff options
author | Dmitry Shmidt <dimitrysh@google.com> | 2008-11-11 11:22:38 -0800 |
---|---|---|
committer | Nitin Garg <nitin.garg@freescale.com> | 2014-04-21 22:34:39 -0500 |
commit | 1c59ceb5cd000cbe33d6b3d4dea8fdfb3bba4933 (patch) | |
tree | bf159199b1af80a01e60e57895c1ea618532de31 | |
parent | 799ca70c1c70de7c1d52b9e30f1d18f8b8aeeee9 (diff) |
trout: Add functions for WiFi
-rwxr-xr-x[-rw-r--r--] | drivers/mmc/core/sdio_io.c | 33 | ||||
-rwxr-xr-x[-rw-r--r--] | include/linux/mmc/sdio_func.h | 2 |
2 files changed, 35 insertions, 0 deletions
diff --git a/drivers/mmc/core/sdio_io.c b/drivers/mmc/core/sdio_io.c index 78cb4d5d9d58..8fdeb07723a6 100644..100755 --- 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 diff --git a/include/linux/mmc/sdio_func.h b/include/linux/mmc/sdio_func.h index 54600e927b06..dc680c4b50d4 100644..100755 --- a/include/linux/mmc/sdio_func.h +++ b/include/linux/mmc/sdio_func.h @@ -138,6 +138,8 @@ extern int sdio_release_irq(struct sdio_func *func); extern unsigned int sdio_align_size(struct sdio_func *func, unsigned int sz); extern u8 sdio_readb(struct sdio_func *func, unsigned int addr, int *err_ret); +extern u8 sdio_readb_ext(struct sdio_func *func, unsigned int addr, int *err_ret, + unsigned in); extern u16 sdio_readw(struct sdio_func *func, unsigned int addr, int *err_ret); extern u32 sdio_readl(struct sdio_func *func, unsigned int addr, int *err_ret); |