From 3f2da751beb84861ba0a999aaea09e73f578022a Mon Sep 17 00:00:00 2001 From: Andrew Gabbasov Date: Thu, 19 Mar 2015 07:44:02 -0500 Subject: mmc: Fix typo in MMC type checking macro The version flag constant name used in IS_MMC macro is incorrect/undefined. Signed-off-by: Andrew Gabbasov --- include/mmc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/mmc.h b/include/mmc.h index 2ad0f191c3..a251531aed 100644 --- a/include/mmc.h +++ b/include/mmc.h @@ -61,7 +61,7 @@ #define SD_DATA_4BIT 0x00040000 #define IS_SD(x) ((x)->version & SD_VERSION_SD) -#define IS_MMC(x) ((x)->version & SD_VERSION_MMC) +#define IS_MMC(x) ((x)->version & MMC_VERSION_MMC) #define MMC_DATA_READ 1 #define MMC_DATA_WRITE 2 -- cgit From a626c8d418d5fd1f8429294e7efe3fa2e4ca90fe Mon Sep 17 00:00:00 2001 From: Andrew Gabbasov Date: Thu, 19 Mar 2015 07:44:03 -0500 Subject: mmc: Avoid extra duplicate entry in mmc device structure The 'op_cond_response' field in mmc structure contains the response from the last SEND_OP_COND MMC command while making iterational polling of the card. Later it is copied to 'ocr' field, designed to contain the OCR register value, which is actually the same response from the same command. So, these fields have actually the same data, just in different time periods. It's easier to use the same 'ocr' field in both cases at once, without temporary using of the 'op_cond_response' field. Signed-off-by: Andrew Gabbasov --- include/mmc.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/mmc.h b/include/mmc.h index a251531aed..644e3fa1e1 100644 --- a/include/mmc.h +++ b/include/mmc.h @@ -356,7 +356,6 @@ struct mmc { char op_cond_pending; /* 1 if we are waiting on an op_cond command */ char init_in_progress; /* 1 if we have done mmc_start_init() */ char preinit; /* start init as early as possible */ - uint op_cond_response; /* the response byte from the last op_cond */ int ddr_mode; }; -- cgit From bd47c13583f2c4bbd29914063d2bf3a98fcdf5cb Mon Sep 17 00:00:00 2001 From: Andrew Gabbasov Date: Thu, 19 Mar 2015 07:44:07 -0500 Subject: mmc: Fix splitting device initialization Starting part of device initialization sets the init_in_progress flag only if the MMC card did not yet come to ready state and needs to continue polling. If the card is SD or if the MMC card became ready quickly, the flag is not set and (if using pre-initialization) the starting phase will be re-executed from mmc_init function. Set the init_in_progress flag in all non-error cases. Also, move flags setting statements around so that the flags are not set in error paths. Also, IN_PROGRESS return status becomes unnecessary, so get rid of it. Signed-off-by: Andrew Gabbasov --- include/mmc.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'include') diff --git a/include/mmc.h b/include/mmc.h index 644e3fa1e1..fbcbe35a79 100644 --- a/include/mmc.h +++ b/include/mmc.h @@ -70,8 +70,7 @@ #define UNUSABLE_ERR -17 /* Unusable Card */ #define COMM_ERR -18 /* Communications Error */ #define TIMEOUT -19 -#define IN_PROGRESS -20 /* operation is in progress */ -#define SWITCH_ERR -21 /* Card reports failure to switch mode */ +#define SWITCH_ERR -20 /* Card reports failure to switch mode */ #define MMC_CMD_GO_IDLE_STATE 0 #define MMC_CMD_SEND_OP_COND 1 -- cgit From 5a20397b007e9c1482997cf4418639e9ba3df5fe Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Mon, 23 Mar 2015 17:56:59 -0500 Subject: mmc: remove the MMC_MODE_HC flag High capacity support is not a host capability, but a device capability that is queried via the OCR. The flag in the operating conditions request argument can just be set unconditionally. This matches the Linux implementation. [panto] Hand merged and renumbering MMC_MODE_DDR_52MHz. Signed-off-by: Rob Herring Signed-off-by: Pantelis Antoniou Cc: Pantelis Antoniou --- include/mmc.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'include') diff --git a/include/mmc.h b/include/mmc.h index fbcbe35a79..dd98b3b8ac 100644 --- a/include/mmc.h +++ b/include/mmc.h @@ -55,8 +55,7 @@ #define MMC_MODE_4BIT (1 << 2) #define MMC_MODE_8BIT (1 << 3) #define MMC_MODE_SPI (1 << 4) -#define MMC_MODE_HC (1 << 5) -#define MMC_MODE_DDR_52MHz (1 << 6) +#define MMC_MODE_DDR_52MHz (1 << 5) #define SD_DATA_4BIT 0x00040000 -- cgit