Go to the documentation of this file.
8 #ifndef LINUX_MMC_CORE_H
9 #define LINUX_MMC_CORE_H
23 #define MMC_RSP_PRESENT (1 << 0)
24 #define MMC_RSP_136 (1 << 1)
25 #define MMC_RSP_CRC (1 << 2)
26 #define MMC_RSP_BUSY (1 << 3)
27 #define MMC_RSP_OPCODE (1 << 4)
29 #define MMC_CMD_MASK (3 << 5)
30 #define MMC_CMD_AC (0 << 5)
31 #define MMC_CMD_ADTC (1 << 5)
32 #define MMC_CMD_BC (2 << 5)
33 #define MMC_CMD_BCR (3 << 5)
35 #define MMC_RSP_SPI_S1 (1 << 7)
36 #define MMC_RSP_SPI_S2 (1 << 8)
37 #define MMC_RSP_SPI_B4 (1 << 9)
38 #define MMC_RSP_SPI_BUSY (1 << 10)
45 #define MMC_RSP_NONE (0)
46 #define MMC_RSP_R1 (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE)
47 #define MMC_RSP_R1B (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE|MMC_RSP_BUSY)
48 #define MMC_RSP_R2 (MMC_RSP_PRESENT|MMC_RSP_136|MMC_RSP_CRC)
49 #define MMC_RSP_R3 (MMC_RSP_PRESENT)
50 #define MMC_RSP_R4 (MMC_RSP_PRESENT)
51 #define MMC_RSP_R5 (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE)
52 #define MMC_RSP_R6 (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE)
53 #define MMC_RSP_R7 (MMC_RSP_PRESENT|MMC_RSP_CRC|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))
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)
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))
76 #define mmc_cmd_type(cmd) ((cmd)->flags & MMC_CMD_MASK)
109 #define MMC_DATA_WRITE (1 << 8)
110 #define MMC_DATA_READ (1 << 9)
111 #define MMC_DATA_STREAM (1 << 10)
151 #define MMC_ERASE_ARG 0x00000000
152 #define MMC_SECURE_ERASE_ARG 0x80000000
153 #define MMC_TRIM_ARG 0x00000001
154 #define MMC_DISCARD_ARG 0x00000003
155 #define MMC_SECURE_TRIM1_ARG 0x80000001
156 #define MMC_SECURE_TRIM2_ARG 0x80008000
158 #define MMC_SECURE_ARGS 0x80000000
159 #define MMC_TRIM_ARGS 0x00008001
194 static inline void mmc_claim_host(
struct mmc_host *
host)