summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRussell King - ARM Linux <linux@arm.linux.org.uk>2011-06-20 20:10:08 +0100
committerRobert Marklund <robert.marklund@stericsson.com>2011-10-05 12:56:39 +0200
commit70ee98f6882ca0685aab7a5ca5f213909905c6af (patch)
treeac20e99a558ccc432ce70676674dc47930146b3c /include
parentef5ae8ca3e6bc02d80eca24d3e57eb041a3ace4f (diff)
mmc: block: allow get_card_status() to return error status
If the MMC_SEND_STATUS command is not successful, we should not return a zero status word, but instead allow the caller to know positively that an error occurred. Convert the open-coded get_card_status() to use the helper function, and provide definitions for the card state field. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Linus Walleij <linus.walleij@linaro.org> Tested-by: Pawel Moll <pawel.moll@arm.com> Signed-off-by: Chris Ball <cjb@laptop.org> Change-Id: I188a24aa1f206ea33712c0c6ca32249fe4ee6606 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/30592 Reviewed-by: Ulf HANSSON <ulf.hansson@stericsson.com> Tested-by: Ulf HANSSON <ulf.hansson@stericsson.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/mmc/mmc.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h
index ac26a685cca..8e425ab761f 100644
--- a/include/linux/mmc/mmc.h
+++ b/include/linux/mmc/mmc.h
@@ -140,6 +140,16 @@ static inline bool mmc_op_multi(u32 opcode)
#define R1_SWITCH_ERROR (1 << 7) /* sx, c */
#define R1_APP_CMD (1 << 5) /* sr, c */
+#define R1_STATE_IDLE 0
+#define R1_STATE_READY 1
+#define R1_STATE_IDENT 2
+#define R1_STATE_STBY 3
+#define R1_STATE_TRAN 4
+#define R1_STATE_DATA 5
+#define R1_STATE_RCV 6
+#define R1_STATE_PRG 7
+#define R1_STATE_DIS 8
+
/*
* MMC/SD in SPI mode reports R1 status always, and R2 for SEND_STATUS
* R1 is the low order byte; R2 is the next highest byte, when present.