return MCI_DPSM_ENABLE | (host->data->blksz << 16);
}
+static void ux500_busy_clear_mask_done(struct mmci_host *host)
+{
+ void __iomem *base = host->base;
+
+ writel(host->variant->busy_detect_mask, base + MMCICLEAR);
+ writel(readl(base + MMCIMASK0) &
+ ~host->variant->busy_detect_mask, base + MMCIMASK0);
+ host->busy_state = MMCI_BUSY_DONE;
+ host->busy_status = 0;
+}
+
/*
* ux500_busy_complete() - this will wait until the busy status
* goes off, saving any status that occur in the meantime into
if (status & err_msk) {
/* Stop any ongoing busy detection if an error occurs */
- writel(host->variant->busy_detect_mask, base + MMCICLEAR);
- writel(readl(base + MMCIMASK0) &
- ~host->variant->busy_detect_mask, base + MMCIMASK0);
- host->busy_state = MMCI_BUSY_DONE;
- host->busy_status = 0;
+ ux500_busy_clear_mask_done(host);
goto out_ret_state;
}
retries--;
}
dev_dbg(mmc_dev(host->mmc), "no busy signalling in time\n");
- writel(host->variant->busy_detect_mask, base + MMCICLEAR);
- writel(readl(base + MMCIMASK0) &
- ~host->variant->busy_detect_mask, base + MMCIMASK0);
- host->busy_state = MMCI_BUSY_DONE;
+ ux500_busy_clear_mask_done(host);
break;
/*
} else {
dev_dbg(mmc_dev(host->mmc),
"lost busy status when waiting for busy start IRQ\n");
- writel(host->variant->busy_detect_mask, base + MMCICLEAR);
- writel(readl(base + MMCIMASK0) &
- ~host->variant->busy_detect_mask, base + MMCIMASK0);
- host->busy_state = MMCI_BUSY_DONE;
- host->busy_status = 0;
+ ux500_busy_clear_mask_done(host);
}
break;
case MMCI_BUSY_WAITING_FOR_END_IRQ:
if (!(status & host->variant->busy_detect_flag)) {
host->busy_status |= status & (MCI_CMDSENT | MCI_CMDRESPEND);
- host->busy_state = MMCI_BUSY_DONE;
+ writel(host->variant->busy_detect_mask, base + MMCICLEAR);
+ ux500_busy_clear_mask_done(host);
} else {
dev_dbg(mmc_dev(host->mmc),
"busy status still asserted when handling busy end IRQ - will keep waiting\n");