[patch 1/3] sdio: add SDIO_FBR_BASE(f) macro

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



-- 
David Vrabel, Software Engineer, Drivers group  Tel: +44 (0)1223 692562
CSR plc, Churchill House, Cambridge Business Park, Cowley Road, CB4 0WZ


.
sdio: add SDIO_FBR_BASE(f) macro

Signed-off-by: David Vrabel <[email protected]>
---
Index: mmc/drivers/mmc/core/sdio.c
===================================================================
--- mmc.orig/drivers/mmc/core/sdio.c	2007-08-06 14:37:30.000000000 +0100
+++ mmc/drivers/mmc/core/sdio.c	2007-08-06 17:30:14.000000000 +0100
@@ -30,7 +30,7 @@
 	unsigned char data;
 
 	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)
 		goto out;
 
@@ -38,7 +38,7 @@
 
 	if (data == 0x0f) {
 		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)
 			goto out;
 	}
Index: mmc/drivers/mmc/core/sdio_cis.c
===================================================================
--- mmc.orig/drivers/mmc/core/sdio_cis.c	2007-08-06 14:37:30.000000000 +0100
+++ mmc/drivers/mmc/core/sdio_cis.c	2007-08-06 17:31:02.000000000 +0100
@@ -250,7 +250,7 @@
 			fn = 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)
 			return ret;
 		ptr |= x << (i * 8);
Index: mmc/include/linux/mmc/sdio.h
===================================================================
--- mmc.orig/include/linux/mmc/sdio.h	2007-08-06 14:37:35.000000000 +0100
+++ mmc/include/linux/mmc/sdio.h	2007-08-06 17:29:21.000000000 +0100
@@ -132,6 +132,8 @@
  * 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_SUPPORTS_CSA	0x40	/* supports Code Storage Area */

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux