diff options
author | David Brownell <david-b@pacbell.net> | 2007-08-08 12:09:01 -0400 |
---|---|---|
committer | Pierre Ossman <drzeus@drzeus.cx> | 2007-09-23 15:37:51 -0400 |
commit | 97018580c40c8a31dd7ae744da3378c787a2066d (patch) | |
tree | f5d4b4ddc8be32f9763a9c14c405cbb8b0466866 /include/linux/mmc/core.h | |
parent | 759bdc7af450404382e937c76722ae8736daef92 (diff) |
MMC headers learn about SPI
Teach the MMC/SD/SDIO system headers that some hosts use SPI mode
- New host capabilities and status bits
* MMC_CAP_SPI, with mmc_host_is_spi() test
* mmc_host.use_spi_crc flag
- SPI-specific declarations:
* Response types, MMC_RSP_SPI_R*
* Two SPI-only commands
* Status bits used native to SPI: R1_SPI_*, R2_SPI_*
- Fix a few (unrelated) whitespace bugs in the headers.
- Reorder a few mmc_host fields, removing several bytes of padding
None of these changes affect current code.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Diffstat (limited to 'include/linux/mmc/core.h')
-rw-r--r-- | include/linux/mmc/core.h | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h index 8945da9b54f..d0c3abed74c 100644 --- a/include/linux/mmc/core.h +++ b/include/linux/mmc/core.h | |||
@@ -25,14 +25,20 @@ struct mmc_command { | |||
25 | #define MMC_RSP_CRC (1 << 2) /* expect valid crc */ | 25 | #define MMC_RSP_CRC (1 << 2) /* expect valid crc */ |
26 | #define MMC_RSP_BUSY (1 << 3) /* card may send busy */ | 26 | #define MMC_RSP_BUSY (1 << 3) /* card may send busy */ |
27 | #define MMC_RSP_OPCODE (1 << 4) /* response contains opcode */ | 27 | #define MMC_RSP_OPCODE (1 << 4) /* response contains opcode */ |
28 | #define MMC_CMD_MASK (3 << 5) /* command type */ | 28 | |
29 | #define MMC_CMD_MASK (3 << 5) /* non-SPI command type */ | ||
29 | #define MMC_CMD_AC (0 << 5) | 30 | #define MMC_CMD_AC (0 << 5) |
30 | #define MMC_CMD_ADTC (1 << 5) | 31 | #define MMC_CMD_ADTC (1 << 5) |
31 | #define MMC_CMD_BC (2 << 5) | 32 | #define MMC_CMD_BC (2 << 5) |
32 | #define MMC_CMD_BCR (3 << 5) | 33 | #define MMC_CMD_BCR (3 << 5) |
33 | 34 | ||
35 | #define MMC_RSP_SPI_S1 (1 << 7) /* one status byte */ | ||
36 | #define MMC_RSP_SPI_S2 (1 << 8) /* second byte */ | ||
37 | #define MMC_RSP_SPI_B4 (1 << 9) /* four data bytes */ | ||
38 | #define MMC_RSP_SPI_BUSY (1 << 10) /* card may send busy */ | ||
39 | |||
34 | /* | 40 | /* |
35 | * These are the response types, and correspond to valid bit | 41 | * These are the native response types, and correspond to valid bit |
36 | * patterns of the above flags. One additional valid pattern | 42 | * patterns of the above flags. One additional valid pattern |
37 | * is all zeros, which means we don't expect a response. | 43 | * is all zeros, which means we don't expect a response. |
38 | */ | 44 | */ |
@@ -49,6 +55,22 @@ struct mmc_command { | |||
49 | #define mmc_resp_type(cmd) ((cmd)->flags & (MMC_RSP_PRESENT|MMC_RSP_136|MMC_RSP_CRC|MMC_RSP_BUSY|MMC_RSP_OPCODE)) | 55 | #define mmc_resp_type(cmd) ((cmd)->flags & (MMC_RSP_PRESENT|MMC_RSP_136|MMC_RSP_CRC|MMC_RSP_BUSY|MMC_RSP_OPCODE)) |
50 | 56 | ||
51 | /* | 57 | /* |
58 | * These are the SPI response types for MMC, SD, and SDIO cards. | ||
59 | * Commands return R1, with maybe more info. Zero is an error type; | ||
60 | * callers must always provide the appropriate MMC_RSP_SPI_Rx flags. | ||
61 | */ | ||
62 | #define MMC_RSP_SPI_R1 (MMC_RSP_SPI_S1) | ||
63 | #define MMC_RSP_SPI_R1B (MMC_RSP_SPI_S1|MMC_RSP_SPI_BUSY) | ||
64 | #define MMC_RSP_SPI_R2 (MMC_RSP_SPI_S1|MMC_RSP_SPI_S2) | ||
65 | #define MMC_RSP_SPI_R3 (MMC_RSP_SPI_S1|MMC_RSP_SPI_B4) | ||
66 | #define MMC_RSP_SPI_R4 (MMC_RSP_SPI_S1|MMC_RSP_SPI_B4) | ||
67 | #define MMC_RSP_SPI_R5 (MMC_RSP_SPI_S1|MMC_RSP_SPI_S2) | ||
68 | #define MMC_RSP_SPI_R7 (MMC_RSP_SPI_S1|MMC_RSP_SPI_B4) | ||
69 | |||
70 | #define mmc_spi_resp_type(cmd) ((cmd)->flags & \ | ||
71 | (MMC_RSP_SPI_S1|MMC_RSP_SPI_BUSY|MMC_RSP_SPI_S2|MMC_RSP_SPI_B4)) | ||
72 | |||
73 | /* | ||
52 | * These are the command types. | 74 | * These are the command types. |
53 | */ | 75 | */ |
54 | #define mmc_cmd_type(cmd) ((cmd)->flags & MMC_CMD_MASK) | 76 | #define mmc_cmd_type(cmd) ((cmd)->flags & MMC_CMD_MASK) |