Lines Matching refs:status

100 	u8			status[29];
118 /* for status readback */
119 struct spi_transfer status;
152 host->status.len = len;
160 u8 *cp = host->data->status;
164 int status;
167 status = mmc_spi_readbytes(host, n);
168 if (status < 0)
169 return status;
192 return mmc_spi_skip(host, timeout, sizeof(host->data->status), 0);
226 u8 *cp = host->data->status;
250 cp = host->data->status;
254 * status byte ... and we already scanned 2 bytes.
285 cp = host->data->status;
331 /* SPI R2 == R1 + second status byte; SEND_STATUS
340 cp = host->data->status;
363 cp = host->data->status;
376 /* SPI R1 == just one status byte */
414 u8 *cp = data->status;
415 int status;
431 memset(cp, 0xff, sizeof(data->status));
440 * - status byte (for all response types)
443 * + second status byte, for R2 responses
474 cp += 2; /* min(N(CR)) + status */
477 cp += 10; /* max(N(CR)) + status + min(N(RC),N(WR)) */
483 cp = data->status + sizeof(data->status);
495 t->tx_buf = t->rx_buf = data->status;
496 t->len = cp - data->status;
500 status = spi_sync_locked(host->spi, &host->m);
501 if (status < 0) {
502 dev_dbg(&host->spi->dev, " ... write returned %d\n", status);
503 cmd->error = status;
504 return status;
513 * a status transfer.
583 t->len = (direction == DMA_TO_DEVICE) ? sizeof(scratch->status) : 1;
585 t->rx_buf = scratch->status;
608 int status, i;
615 status = spi_sync_locked(spi, &host->m);
616 if (status != 0) {
617 dev_dbg(&spi->dev, "write error (%d)\n", status);
618 return status;
633 pattern = get_unaligned_be32(scratch->status);
646 status = 0;
650 status = -EILSEQ;
656 status = -EIO;
659 status = -EPROTO;
662 if (status != 0) {
664 scratch->status[0], status);
665 return status;
670 /* Return when not busy. If we didn't collect that status yet,
673 for (i = 4; i < sizeof(scratch->status); i++) {
675 if (scratch->status[i] & 0x01)
702 int status;
710 status = mmc_spi_readbytes(host, 1);
711 if (status < 0)
712 return status;
713 status = scratch->status[0];
714 if (status == 0xff || status == 0)
715 status = mmc_spi_readtoken(host, timeout);
717 if (status < 0) {
718 dev_dbg(&spi->dev, "read error %02x (%d)\n", status, status);
719 return status;
726 while (status & 0x80) {
727 status <<= 1;
730 leftover = status << 1;
732 status = spi_sync_locked(spi, &host->m);
733 if (status < 0) {
734 dev_dbg(&spi->dev, "read error %d\n", status);
735 return status;
811 int status = 0;
822 /* transfer each block, and update request status */
832 status = mmc_spi_writeblock(host, t, timeout);
834 status = mmc_spi_readblock(host, t, timeout);
835 if (status < 0)
850 if (status < 0) {
851 data->error = status;
852 dev_dbg(&spi->dev, "%s status %d\n",
854 status);
868 const unsigned statlen = sizeof(scratch->status);
875 * "not busy any longer" status, and leave chip selected.
881 memset(scratch->status, 0xff, statlen);
882 scratch->status[0] = SPI_TOKEN_STOP_TRAN;
894 /* Ideally we collected "not busy" status with one I/O,
899 if (scratch->status[tmp] != 0)
917 int status = -EINVAL;
954 status = mmc_spi_command_send(host, mrq, mrq->cmd, mrq->data != NULL);
955 if (status == 0 && mrq->data) {
969 status = mmc_spi_command_send(host, mrq, &stop, 0);
976 status = mmc_spi_command_send(host, mrq, mrq->stop, 0);
1014 * the card returns BUSY status, the clock must issue several cycles
1128 int status;
1131 status = spi_setup(host->spi);
1134 host->spi->max_speed_hz, status);
1167 int status;
1186 status = spi_setup(spi);
1187 if (status < 0) {
1190 status);
1191 return status;
1200 status = -ENOMEM;
1258 /* setup message for status/busy readback */
1261 spi_message_add_tail(&host->status, &host->readback);
1262 host->status.tx_buf = host->ones;
1263 host->status.rx_buf = &host->data->status;
1264 host->status.cs_change = 1;
1268 status = host->pdata->init(&spi->dev, mmc_spi_detect_irq, mmc);
1269 if (status != 0)
1279 status = mmc_add_host(mmc);
1280 if (status != 0)
1287 status = mmc_gpiod_request_cd(mmc, NULL, 0, false, 1000);
1288 if (status == -EPROBE_DEFER)
1290 if (!status) {
1302 status = mmc_gpiod_request_ro(mmc, NULL, 1, 0);
1303 if (status == -EPROBE_DEFER)
1305 if (!status)
1326 return status;