Commit 7616ee95 authored by David Vrabel's avatar David Vrabel Committed by Pierre Ossman

sdio: add SDIO_FBR_BASE(f) macro

Signed-off-by: default avatarDavid Vrabel <david.vrabel@csr.com>
Signed-off-by: default avatarPierre Ossman <drzeus@drzeus.cx>
parent e6f918bf
...@@ -30,7 +30,7 @@ static int sdio_read_fbr(struct sdio_func *func) ...@@ -30,7 +30,7 @@ static int sdio_read_fbr(struct sdio_func *func)
unsigned char data; unsigned char data;
ret = mmc_io_rw_direct(func->card, 0, 0, ret = mmc_io_rw_direct(func->card, 0, 0,
func->num * 0x100 + SDIO_FBR_STD_IF, 0, &data); SDIO_FBR_BASE(func->num) + SDIO_FBR_STD_IF, 0, &data);
if (ret) if (ret)
goto out; goto out;
...@@ -38,7 +38,7 @@ static int sdio_read_fbr(struct sdio_func *func) ...@@ -38,7 +38,7 @@ static int sdio_read_fbr(struct sdio_func *func)
if (data == 0x0f) { if (data == 0x0f) {
ret = mmc_io_rw_direct(func->card, 0, 0, ret = mmc_io_rw_direct(func->card, 0, 0,
func->num * 0x100 + SDIO_FBR_STD_IF_EXT, 0, &data); SDIO_FBR_BASE(func->num) + SDIO_FBR_STD_IF_EXT, 0, &data);
if (ret) if (ret)
goto out; goto out;
} }
......
...@@ -145,7 +145,7 @@ static int sdio_read_cis(struct mmc_card *card, struct sdio_func *func) ...@@ -145,7 +145,7 @@ static int sdio_read_cis(struct mmc_card *card, struct sdio_func *func)
fn = 0; fn = 0;
ret = mmc_io_rw_direct(card, 0, 0, ret = mmc_io_rw_direct(card, 0, 0,
fn * 0x100 + SDIO_FBR_CIS + i, 0, &x); SDIO_FBR_BASE(fn) + SDIO_FBR_CIS + i, 0, &x);
if (ret) if (ret)
return ret; return ret;
ptr |= x << (i * 8); ptr |= x << (i * 8);
......
...@@ -132,6 +132,8 @@ ...@@ -132,6 +132,8 @@
* Function Basic Registers (FBR) * Function Basic Registers (FBR)
*/ */
#define SDIO_FBR_BASE(f) ((f) * 0x100) /* base of function f's FBRs */
#define SDIO_FBR_STD_IF 0x00 #define SDIO_FBR_STD_IF 0x00
#define SDIO_FBR_SUPPORTS_CSA 0x40 /* supports Code Storage Area */ #define SDIO_FBR_SUPPORTS_CSA 0x40 /* supports Code Storage Area */
......
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