Lines Matching refs:cmd

28 	struct mmc_command cmd = {0};  in mmc_app_cmd()  local
33 cmd.opcode = MMC_APP_CMD; in mmc_app_cmd()
36 cmd.arg = card->rca << 16; in mmc_app_cmd()
37 cmd.flags = MMC_RSP_SPI_R1 | MMC_RSP_R1 | MMC_CMD_AC; in mmc_app_cmd()
39 cmd.arg = 0; in mmc_app_cmd()
40 cmd.flags = MMC_RSP_SPI_R1 | MMC_RSP_R1 | MMC_CMD_BCR; in mmc_app_cmd()
43 err = mmc_wait_for_cmd(host, &cmd, 0); in mmc_app_cmd()
48 if (!mmc_host_is_spi(host) && !(cmd.resp[0] & R1_APP_CMD)) in mmc_app_cmd()
69 struct mmc_command *cmd, int retries) in mmc_wait_for_app_cmd() argument
75 BUG_ON(!cmd); in mmc_wait_for_app_cmd()
89 if (cmd->resp[0] & R1_SPI_ILLEGAL_COMMAND) in mmc_wait_for_app_cmd()
97 memset(cmd->resp, 0, sizeof(cmd->resp)); in mmc_wait_for_app_cmd()
98 cmd->retries = 0; in mmc_wait_for_app_cmd()
100 mrq.cmd = cmd; in mmc_wait_for_app_cmd()
101 cmd->data = NULL; in mmc_wait_for_app_cmd()
105 err = cmd->error; in mmc_wait_for_app_cmd()
106 if (!cmd->error) in mmc_wait_for_app_cmd()
111 if (cmd->resp[0] & R1_SPI_ILLEGAL_COMMAND) in mmc_wait_for_app_cmd()
124 struct mmc_command cmd = {0}; in mmc_app_set_bus_width() local
129 cmd.opcode = SD_APP_SET_BUS_WIDTH; in mmc_app_set_bus_width()
130 cmd.flags = MMC_RSP_R1 | MMC_CMD_AC; in mmc_app_set_bus_width()
134 cmd.arg = SD_BUS_WIDTH_1; in mmc_app_set_bus_width()
137 cmd.arg = SD_BUS_WIDTH_4; in mmc_app_set_bus_width()
143 err = mmc_wait_for_app_cmd(card->host, card, &cmd, MMC_CMD_RETRIES); in mmc_app_set_bus_width()
152 struct mmc_command cmd = {0}; in mmc_send_app_op_cond() local
157 cmd.opcode = SD_APP_OP_COND; in mmc_send_app_op_cond()
159 cmd.arg = ocr & (1 << 30); /* SPI only defines one bit */ in mmc_send_app_op_cond()
161 cmd.arg = ocr; in mmc_send_app_op_cond()
162 cmd.flags = MMC_RSP_SPI_R1 | MMC_RSP_R3 | MMC_CMD_BCR; in mmc_send_app_op_cond()
165 err = mmc_wait_for_app_cmd(host, NULL, &cmd, MMC_CMD_RETRIES); in mmc_send_app_op_cond()
175 if (!(cmd.resp[0] & R1_SPI_IDLE)) in mmc_send_app_op_cond()
178 if (cmd.resp[0] & MMC_CARD_BUSY) in mmc_send_app_op_cond()
188 *rocr = cmd.resp[0]; in mmc_send_app_op_cond()
195 struct mmc_command cmd = {0}; in mmc_send_if_cond() local
205 cmd.opcode = SD_SEND_IF_COND; in mmc_send_if_cond()
206 cmd.arg = ((ocr & 0xFF8000) != 0) << 8 | test_pattern; in mmc_send_if_cond()
207 cmd.flags = MMC_RSP_SPI_R7 | MMC_RSP_R7 | MMC_CMD_BCR; in mmc_send_if_cond()
209 err = mmc_wait_for_cmd(host, &cmd, 0); in mmc_send_if_cond()
214 result_pattern = cmd.resp[1] & 0xFF; in mmc_send_if_cond()
216 result_pattern = cmd.resp[0] & 0xFF; in mmc_send_if_cond()
227 struct mmc_command cmd = {0}; in mmc_send_relative_addr() local
232 cmd.opcode = SD_SEND_RELATIVE_ADDR; in mmc_send_relative_addr()
233 cmd.arg = 0; in mmc_send_relative_addr()
234 cmd.flags = MMC_RSP_R6 | MMC_CMD_BCR; in mmc_send_relative_addr()
236 err = mmc_wait_for_cmd(host, &cmd, MMC_CMD_RETRIES); in mmc_send_relative_addr()
240 *rca = cmd.resp[0] >> 16; in mmc_send_relative_addr()
249 struct mmc_command cmd = {0}; in mmc_app_send_scr() local
271 mrq.cmd = &cmd; in mmc_app_send_scr()
274 cmd.opcode = SD_APP_SEND_SCR; in mmc_app_send_scr()
275 cmd.arg = 0; in mmc_app_send_scr()
276 cmd.flags = MMC_RSP_SPI_R1 | MMC_RSP_R1 | MMC_CMD_ADTC; in mmc_app_send_scr()
293 if (cmd.error) in mmc_app_send_scr()
294 return cmd.error; in mmc_app_send_scr()
308 struct mmc_command cmd = {0}; in mmc_sd_switch() local
320 mrq.cmd = &cmd; in mmc_sd_switch()
323 cmd.opcode = SD_SWITCH; in mmc_sd_switch()
324 cmd.arg = mode << 31 | 0x00FFFFFF; in mmc_sd_switch()
325 cmd.arg &= ~(0xF << (group * 4)); in mmc_sd_switch()
326 cmd.arg |= value << (group * 4); in mmc_sd_switch()
327 cmd.flags = MMC_RSP_SPI_R1 | MMC_RSP_R1 | MMC_CMD_ADTC; in mmc_sd_switch()
341 if (cmd.error) in mmc_sd_switch()
342 return cmd.error; in mmc_sd_switch()
353 struct mmc_command cmd = {0}; in mmc_app_sd_status() local
367 mrq.cmd = &cmd; in mmc_app_sd_status()
370 cmd.opcode = SD_APP_SD_STATUS; in mmc_app_sd_status()
371 cmd.arg = 0; in mmc_app_sd_status()
372 cmd.flags = MMC_RSP_SPI_R2 | MMC_RSP_R1 | MMC_CMD_ADTC; in mmc_app_sd_status()
386 if (cmd.error) in mmc_app_sd_status()
387 return cmd.error; in mmc_app_sd_status()