1 /**************************************************************************** 2 **************************************************************************** 3 *** 4 *** This header was automatically generated from a Linux kernel header 5 *** of the same name, to make information necessary for userspace to 6 *** call into the kernel available to libc. It contains only constants, 7 *** structures, and macros generated from the original header, and thus, 8 *** contains no copyrightable information. 9 *** 10 *** To edit the content of this header, modify the corresponding 11 *** source file (e.g. under external/kernel-headers/original/) then 12 *** run bionic/libc/kernel/tools/update_all.py 13 *** 14 *** Any manual change here will be lost the next time this script will 15 *** be run. You've been warned! 16 *** 17 **************************************************************************** 18 ****************************************************************************/ 19 #ifndef MMC_H 20 #define MMC_H 21 #include <linux/list.h> 22 #include <linux/interrupt.h> 23 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 24 #include <linux/device.h> 25 struct request; 26 struct mmc_data; 27 struct mmc_request; 28 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 29 struct mmc_command { 30 u32 opcode; 31 u32 arg; 32 u32 resp[4]; 33 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 34 unsigned int flags; 35 #define MMC_RSP_PRESENT (1 << 0) 36 #define MMC_RSP_136 (1 << 1) 37 #define MMC_RSP_CRC (1 << 2) 38 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 39 #define MMC_RSP_BUSY (1 << 3) 40 #define MMC_RSP_OPCODE (1 << 4) 41 #define MMC_CMD_MASK (3 << 5) 42 #define MMC_CMD_AC (0 << 5) 43 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 44 #define MMC_CMD_ADTC (1 << 5) 45 #define MMC_CMD_BC (2 << 5) 46 #define MMC_CMD_BCR (3 << 5) 47 #define MMC_RSP_NONE (0) 48 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 49 #define MMC_RSP_R1 (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE) 50 #define MMC_RSP_R1B (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE|MMC_RSP_BUSY) 51 #define MMC_RSP_R2 (MMC_RSP_PRESENT|MMC_RSP_136|MMC_RSP_CRC) 52 #define MMC_RSP_R3 (MMC_RSP_PRESENT) 53 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 54 #define MMC_RSP_R6 (MMC_RSP_PRESENT|MMC_RSP_CRC) 55 #define mmc_resp_type(cmd) ((cmd)->flags & (MMC_RSP_PRESENT|MMC_RSP_136|MMC_RSP_CRC|MMC_RSP_BUSY|MMC_RSP_OPCODE)) 56 #define mmc_cmd_type(cmd) ((cmd)->flags & MMC_CMD_MASK) 57 unsigned int retries; 58 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 59 unsigned int error; 60 #define MMC_ERR_NONE 0 61 #define MMC_ERR_TIMEOUT 1 62 #define MMC_ERR_BADCRC 2 63 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 64 #define MMC_ERR_FIFO 3 65 #define MMC_ERR_FAILED 4 66 #define MMC_ERR_INVALID 5 67 struct mmc_data *data; 68 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 69 struct mmc_request *mrq; 70 }; 71 struct mmc_data { 72 unsigned int timeout_ns; 73 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 74 unsigned int timeout_clks; 75 unsigned int blksz_bits; 76 unsigned int blksz; 77 unsigned int blocks; 78 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 79 unsigned int error; 80 unsigned int flags; 81 #define MMC_DATA_WRITE (1 << 8) 82 #define MMC_DATA_READ (1 << 9) 83 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 84 #define MMC_DATA_STREAM (1 << 10) 85 #define MMC_DATA_MULTI (1 << 11) 86 unsigned int bytes_xfered; 87 struct mmc_command *stop; 88 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 89 struct mmc_request *mrq; 90 unsigned int sg_len; 91 struct scatterlist *sg; 92 }; 93 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 94 struct mmc_request { 95 struct mmc_command *cmd; 96 struct mmc_data *data; 97 struct mmc_command *stop; 98 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 99 void *done_data; 100 void (*done)(struct mmc_request *); 101 }; 102 struct mmc_host; 103 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 104 struct mmc_card; 105 #endif 106