SDMMC_INT_RESP_ERR | SDMMC_INT_HLE)
#define DW_MCI_ERROR_FLAGS (DW_MCI_DATA_ERROR_FLAGS | \
DW_MCI_CMD_ERROR_FLAGS)
-#define DW_MCI_SEND_STATUS 1
-#define DW_MCI_RECV_STATUS 2
#define DW_MCI_DMA_THRESHOLD 16
#define DW_MCI_FREQ_MAX 200000000 /* unit: HZ */
host->data = data;
if (data->flags & MMC_DATA_READ)
- host->dir_status = DW_MCI_RECV_STATUS;
+ host->dir_status = MMC_DATA_READ;
else
- host->dir_status = DW_MCI_SEND_STATUS;
+ host->dir_status = MMC_DATA_WRITE;
dw_mci_ctrl_thld(host, data);
data->error = -EILSEQ;
} else if (status & SDMMC_INT_EBE) {
if (host->dir_status ==
- DW_MCI_SEND_STATUS) {
+ MMC_DATA_WRITE) {
/*
* No data CRC status was returned.
* The number of bytes transferred
data->bytes_xfered = 0;
data->error = -ETIMEDOUT;
} else if (host->dir_status ==
- DW_MCI_RECV_STATUS) {
+ MMC_DATA_READ) {
data->error = -EILSEQ;
}
} else {
* avoids races and keeps things simple.
*/
if (err != -ETIMEDOUT &&
- host->dir_status == DW_MCI_RECV_STATUS) {
+ host->dir_status == MMC_DATA_READ) {
state = STATE_SENDING_DATA;
continue;
}
* If all data-related interrupts don't come
* within the given time in reading data state.
*/
- if (host->dir_status == DW_MCI_RECV_STATUS)
+ if (host->dir_status == MMC_DATA_READ)
dw_mci_set_drto(host);
break;
}
* interrupt doesn't come within the given time.
* in reading data state.
*/
- if (host->dir_status == DW_MCI_RECV_STATUS)
+ if (host->dir_status == MMC_DATA_READ)
dw_mci_set_drto(host);
break;
}
if (!host->data_status)
host->data_status = pending;
smp_wmb(); /* drain writebuffer */
- if (host->dir_status == DW_MCI_RECV_STATUS) {
+ if (host->dir_status == MMC_DATA_READ) {
if (host->sg != NULL)
dw_mci_read_data_pio(host, true);
}
if (pending & SDMMC_INT_RXDR) {
mci_writel(host, RINTSTS, SDMMC_INT_RXDR);
- if (host->dir_status == DW_MCI_RECV_STATUS && host->sg)
+ if (host->dir_status == MMC_DATA_READ && host->sg)
dw_mci_read_data_pio(host, false);
}
if (pending & SDMMC_INT_TXDR) {
mci_writel(host, RINTSTS, SDMMC_INT_TXDR);
- if (host->dir_status == DW_MCI_SEND_STATUS && host->sg)
+ if (host->dir_status == MMC_DATA_WRITE && host->sg)
dw_mci_write_data_pio(host);
}