12 #include <linux/slab.h>
13 #include <linux/export.h>
14 #include <linux/types.h>
52 return _mmc_select_card(card->
host, card);
57 return _mmc_select_card(host,
NULL);
142 for (i = 100;
i; i--) {
201 cmd.
arg = card->
rca << 16;
239 u32 opcode,
void *
buf,
unsigned len)
248 is_on_stack = object_is_on_stack(buf);
294 memcpy(buf, data_buf, len);
312 return mmc_send_cxd_native(card->
host, card->
rca << 16,
323 for (i = 0;i < 4;i++)
339 return mmc_send_cxd_native(host, host->
card->rca << 16,
351 for (i = 0;i < 4;i++)
371 cmd.
arg = highcap ? (1 << 30) : 0;
408 unsigned int timeout_ms,
bool use_busy_signal)
436 if (!use_busy_signal)
454 if (status & 0xFDFFA000)
468 return __mmc_switch(card,
set, index, value, timeout_ms,
true);
482 cmd.
arg = card->
rca << 16;
493 *status = cmd.
resp[0];
509 static u8 testdata_8bit[8] = { 0x55, 0xaa, 0, 0, 0, 0, 0, 0 };
510 static u8 testdata_4bit[4] = { 0x5a, 0, 0, 0 };
520 test_buf = testdata_8bit;
522 test_buf = testdata_4bit;
524 pr_err(
"%s: Invalid bus_width %d\n",
531 memcpy(data_buf, test_buf, len);
558 for (i = 0; i < len / 4; i++)
559 if ((test_buf[i] ^ data_buf[i]) != 0xff) {
603 pr_warning(
"%s: Card didn't support HPI command\n",
608 opcode = card->
ext_csd.hpi_cmd;
615 cmd.
arg = card->
rca << 16 | 1;
619 pr_warn(
"%s: error %d interrupting operation. "
625 *status = cmd.
resp[0];