Lines Matching refs:cmd
25 struct mmc_command cmd = {}; in mmc_app_cmd() local
30 cmd.opcode = MMC_APP_CMD; in mmc_app_cmd()
33 cmd.arg = card->rca << 16; in mmc_app_cmd()
34 cmd.flags = MMC_RSP_SPI_R1 | MMC_RSP_R1 | MMC_CMD_AC; in mmc_app_cmd()
36 cmd.arg = 0; in mmc_app_cmd()
37 cmd.flags = MMC_RSP_SPI_R1 | MMC_RSP_R1 | MMC_CMD_BCR; in mmc_app_cmd()
40 err = mmc_wait_for_cmd(host, &cmd, 0); in mmc_app_cmd()
45 if (!mmc_host_is_spi(host) && !(cmd.resp[0] & R1_APP_CMD)) in mmc_app_cmd()
53 struct mmc_command *cmd) in mmc_wait_for_app_cmd() argument
67 if (cmd->resp[0] & R1_SPI_ILLEGAL_COMMAND) in mmc_wait_for_app_cmd()
75 memset(cmd->resp, 0, sizeof(cmd->resp)); in mmc_wait_for_app_cmd()
76 cmd->retries = 0; in mmc_wait_for_app_cmd()
78 mrq.cmd = cmd; in mmc_wait_for_app_cmd()
79 cmd->data = NULL; in mmc_wait_for_app_cmd()
83 err = cmd->error; in mmc_wait_for_app_cmd()
84 if (!cmd->error) in mmc_wait_for_app_cmd()
89 if (cmd->resp[0] & R1_SPI_ILLEGAL_COMMAND) in mmc_wait_for_app_cmd()
99 struct mmc_command cmd = {}; in mmc_app_set_bus_width() local
101 cmd.opcode = SD_APP_SET_BUS_WIDTH; in mmc_app_set_bus_width()
102 cmd.flags = MMC_RSP_R1 | MMC_CMD_AC; in mmc_app_set_bus_width()
106 cmd.arg = SD_BUS_WIDTH_1; in mmc_app_set_bus_width()
109 cmd.arg = SD_BUS_WIDTH_4; in mmc_app_set_bus_width()
115 return mmc_wait_for_app_cmd(card->host, card, &cmd); in mmc_app_set_bus_width()
120 struct mmc_command cmd = {}; in mmc_send_app_op_cond() local
123 cmd.opcode = SD_APP_OP_COND; in mmc_send_app_op_cond()
125 cmd.arg = ocr & (1 << 30); /* SPI only defines one bit */ in mmc_send_app_op_cond()
127 cmd.arg = ocr; in mmc_send_app_op_cond()
128 cmd.flags = MMC_RSP_SPI_R1 | MMC_RSP_R3 | MMC_CMD_BCR; in mmc_send_app_op_cond()
131 err = mmc_wait_for_app_cmd(host, NULL, &cmd); in mmc_send_app_op_cond()
141 if (!(cmd.resp[0] & R1_SPI_IDLE)) in mmc_send_app_op_cond()
144 if (cmd.resp[0] & MMC_CARD_BUSY) in mmc_send_app_op_cond()
157 *rocr = cmd.resp[0]; in mmc_send_app_op_cond()
165 struct mmc_command cmd = {}; in __mmc_send_if_cond() local
175 cmd.opcode = SD_SEND_IF_COND; in __mmc_send_if_cond()
176 cmd.arg = ((ocr & 0xFF8000) != 0) << 8 | pcie_bits << 8 | test_pattern; in __mmc_send_if_cond()
177 cmd.flags = MMC_RSP_SPI_R7 | MMC_RSP_R7 | MMC_CMD_BCR; in __mmc_send_if_cond()
179 err = mmc_wait_for_cmd(host, &cmd, 0); in __mmc_send_if_cond()
184 result_pattern = cmd.resp[1] & 0xFF; in __mmc_send_if_cond()
186 result_pattern = cmd.resp[0] & 0xFF; in __mmc_send_if_cond()
192 *resp = cmd.resp[0]; in __mmc_send_if_cond()
241 struct mmc_command cmd = {}; in mmc_send_relative_addr() local
243 cmd.opcode = SD_SEND_RELATIVE_ADDR; in mmc_send_relative_addr()
244 cmd.arg = 0; in mmc_send_relative_addr()
245 cmd.flags = MMC_RSP_R6 | MMC_CMD_BCR; in mmc_send_relative_addr()
247 err = mmc_wait_for_cmd(host, &cmd, MMC_CMD_RETRIES); in mmc_send_relative_addr()
251 *rca = cmd.resp[0] >> 16; in mmc_send_relative_addr()
260 struct mmc_command cmd = {}; in mmc_app_send_scr() local
278 mrq.cmd = &cmd; in mmc_app_send_scr()
281 cmd.opcode = SD_APP_SEND_SCR; in mmc_app_send_scr()
282 cmd.arg = 0; in mmc_app_send_scr()
283 cmd.flags = MMC_RSP_SPI_R1 | MMC_RSP_R1 | MMC_CMD_ADTC; in mmc_app_send_scr()
302 if (cmd.error) in mmc_app_send_scr()
303 return cmd.error; in mmc_app_send_scr()
332 struct mmc_command cmd = {}; in mmc_app_sd_status() local
342 mrq.cmd = &cmd; in mmc_app_sd_status()
345 cmd.opcode = SD_APP_SD_STATUS; in mmc_app_sd_status()
346 cmd.arg = 0; in mmc_app_sd_status()
347 cmd.flags = MMC_RSP_SPI_R2 | MMC_RSP_R1 | MMC_CMD_ADTC; in mmc_app_sd_status()
361 if (cmd.error) in mmc_app_sd_status()
362 return cmd.error; in mmc_app_sd_status()