Skip to content

Commit 7616ee9

Browse files
David VrabelPierre Ossman
authored andcommitted
sdio: add SDIO_FBR_BASE(f) macro
Signed-off-by: David Vrabel <david.vrabel@csr.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
1 parent e6f918b commit 7616ee9

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

‎drivers/mmc/core/sdio.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ static int sdio_read_fbr(struct sdio_func *func)
3030
unsigned char data;
3131

3232
ret = mmc_io_rw_direct(func->card, 0, 0,
33-
func->num * 0x100 + SDIO_FBR_STD_IF, 0, &data);
33+
SDIO_FBR_BASE(func->num) + SDIO_FBR_STD_IF, 0, &data);
3434
if (ret)
3535
goto out;
3636

3737
data &= 0x0f;
3838

3939
if (data == 0x0f) {
4040
ret = mmc_io_rw_direct(func->card, 0, 0,
41-
func->num * 0x100 + SDIO_FBR_STD_IF_EXT, 0, &data);
41+
SDIO_FBR_BASE(func->num) + SDIO_FBR_STD_IF_EXT, 0, &data);
4242
if (ret)
4343
goto out;
4444
}

‎drivers/mmc/core/sdio_cis.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ static int sdio_read_cis(struct mmc_card *card, struct sdio_func *func)
145145
fn = 0;
146146

147147
ret = mmc_io_rw_direct(card, 0, 0,
148-
fn * 0x100 + SDIO_FBR_CIS + i, 0, &x);
148+
SDIO_FBR_BASE(fn) + SDIO_FBR_CIS + i, 0, &x);
149149
if (ret)
150150
return ret;
151151
ptr |= x << (i * 8);

‎include/linux/mmc/sdio.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@
132132
* Function Basic Registers (FBR)
133133
*/
134134

135+
#define SDIO_FBR_BASE(f) ((f) * 0x100) /* base of function f's FBRs */
136+
135137
#define SDIO_FBR_STD_IF 0x00
136138

137139
#define SDIO_FBR_SUPPORTS_CSA 0x40 /* supports Code Storage Area */

0 commit comments

Comments
 (0)