Lines Matching full:variant

335 /* Busy detection for the ST Micro variant */
343 if (readl(host->base + MMCISTATUS) & host->variant->busy_detect_flag) in mmci_card_busy()
393 datactrl |= host->datactrl_reg & host->variant->busy_dpsm_flag; in mmci_write_datactrlreg()
406 struct variant_data *variant = host->variant; in mmci_set_clkreg() local
407 u32 clk = variant->clkreg; in mmci_set_clkreg()
413 if (variant->explicit_mclk_control) { in mmci_set_clkreg()
417 if (variant->st_clkdiv) in mmci_set_clkreg()
420 } else if (variant->st_clkdiv) { in mmci_set_clkreg()
442 clk |= variant->clkreg_enable; in mmci_set_clkreg()
454 clk |= variant->clkreg_8bit_bus_enable; in mmci_set_clkreg()
458 clk |= variant->clkreg_neg_edge_enable; in mmci_set_clkreg()
491 struct variant_data *variant = host->variant; in mmci_validate_data() local
495 if (!is_power_of_2(data->blksz) && !variant->datactrl_any_blocksz) { in mmci_validate_data()
611 struct variant_data *variant = host->variant; in mmci_set_mask1() local
616 mask0 &= ~variant->irq_pio_mask; in mmci_set_mask1()
622 if (variant->mmcimask1) in mmci_set_mask1()
675 (readl(base + MMCISTATUS) & host->variant->busy_detect_flag)) { in ux500_busy_complete()
677 host->variant->busy_detect_mask, in ux500_busy_complete()
696 (status & host->variant->busy_detect_flag)) { in ux500_busy_complete()
697 writel(host->variant->busy_detect_mask, base + MMCICLEAR); in ux500_busy_complete()
708 writel(host->variant->busy_detect_mask, base + MMCICLEAR); in ux500_busy_complete()
711 ~host->variant->busy_detect_mask, base + MMCIMASK0); in ux500_busy_complete()
908 struct variant_data *variant = host->variant; in _mmci_dmae_prep_data() local
914 .src_maxburst = variant->fifohalfsize >> 2, /* # of words */ in _mmci_dmae_prep_data()
915 .dst_maxburst = variant->fifohalfsize >> 2, /* # of words */ in _mmci_dmae_prep_data()
937 if (data->blksz * data->blocks <= variant->fifosize) in _mmci_dmae_prep_data()
949 if (host->variant->dma_power_of_2 && !is_power_of_2(data->blksz)) in _mmci_dmae_prep_data()
958 if (host->variant->qcom_dml) in _mmci_dmae_prep_data()
1131 struct variant_data *variant = host->variant; in mmci_start_data() local
1158 datactrl |= variant->datactrl_mask_sdio; in mmci_start_data()
1161 * The ST Micro variant for SDIO small write transfers in mmci_start_data()
1166 if (variant->st_sdio && data->flags & MMC_DATA_WRITE && in mmci_start_data()
1169 clk = host->clk_reg & ~variant->clkreg_enable; in mmci_start_data()
1171 clk = host->clk_reg | variant->clkreg_enable; in mmci_start_data()
1178 datactrl |= variant->datactrl_mask_ddrmode; in mmci_start_data()
1198 if (host->size < variant->fifohalfsize) in mmci_start_data()
1222 if (readl(base + MMCICOMMAND) & host->variant->cmdreg_cpsm_enable) { in mmci_start_command()
1227 if (host->variant->cmdreg_stop && in mmci_start_command()
1229 c |= host->variant->cmdreg_stop; in mmci_start_command()
1231 c |= cmd->opcode | host->variant->cmdreg_cpsm_enable; in mmci_start_command()
1234 c |= host->variant->cmdreg_lrsp_crc; in mmci_start_command()
1236 c |= host->variant->cmdreg_srsp_crc; in mmci_start_command()
1238 c |= host->variant->cmdreg_srsp; in mmci_start_command()
1241 if (host->variant->busy_timeout && cmd->flags & MMC_RSP_BUSY) { in mmci_start_command()
1261 c |= host->variant->data_cmd_enable; in mmci_start_command()
1286 status_err = status & (host->variant->start_err | in mmci_data_irq()
1303 if (!host->variant->datacnt_useless) { in mmci_data_irq()
1323 if (success > host->variant->fifosize) in mmci_data_irq()
1324 success -= host->variant->fifosize; in mmci_data_irq()
1345 if (host->variant->cmdreg_stop && data->error) in mmci_data_irq()
1376 if (host->variant->busy_timeout && busy_resp) in mmci_cmd_irq()
1383 /* Handle busy detection on DAT0 if the variant supports it. */ in mmci_cmd_irq()
1384 if (busy_resp && host->variant->busy_detect) in mmci_cmd_irq()
1394 } else if (host->variant->busy_timeout && busy_resp && in mmci_cmd_irq()
1415 if (host->variant->cmdreg_stop && cmd->error) { in mmci_cmd_irq()
1426 } else if (!host->variant->datactrl_first && in mmci_cmd_irq()
1444 return host->variant->fifohalfsize; in mmci_qcom_get_rx_fifocnt()
1501 struct variant_data *variant = host->variant; in mmci_pio_write() local
1509 variant->fifosize : variant->fifohalfsize; in mmci_pio_write()
1541 struct variant_data *variant = host->variant; in mmci_pio_irq() local
1592 if (status & MCI_RXACTIVE && host->size < variant->fifohalfsize) in mmci_pio_irq()
1629 status &= ~host->variant->irq_pio_mask; in mmci_irq()
1637 if (host->variant->busy_detect) in mmci_irq()
1638 writel(status & ~host->variant->busy_detect_mask, in mmci_irq()
1645 if (host->variant->reversed_irq_handling) { in mmci_irq()
1657 if (host->variant->busy_detect_flag) in mmci_irq()
1658 status &= ~host->variant->busy_detect_flag; in mmci_irq()
1687 writel(MCI_IRQENABLE | host->variant->start_err, in mmci_irq_thread()
1718 (host->variant->datactrl_first || mrq->data->flags & MMC_DATA_READ)) in mmci_request()
1734 if (!host->variant->busy_detect) in mmci_set_max_busy_timeout()
1737 if (host->variant->busy_timeout && mmc->actual_clock) in mmci_set_max_busy_timeout()
1746 struct variant_data *variant = host->variant; in mmci_set_ios() local
1767 * The ST Micro variant doesn't have the PL180s MCI_PWR_UP in mmci_set_ios()
1769 * configured in the variant data. in mmci_set_ios()
1771 pwr |= variant->pwrreg_powerup; in mmci_set_ios()
1788 if (variant->signal_direction && ios->power_mode != MMC_POWER_OFF) { in mmci_set_ios()
1790 * The ST Micro variant has some additional bits in mmci_set_ios()
1804 if (variant->opendrain) { in mmci_set_ios()
1806 pwr |= variant->opendrain; in mmci_set_ios()
1809 * If the variant cannot configure the pads by its own, then we in mmci_set_ios()
1819 * If clock = 0 and the variant requires the MMCIPOWER to be used for in mmci_set_ios()
1822 if (!ios->clock && variant->pwrreg_clkgate) in mmci_set_ios()
1825 if (host->variant->explicit_mclk_control && in mmci_set_ios()
1997 struct variant_data *variant = id->data; in mmci_probe() local
2028 * Some variant (STM32) doesn't have opendrain bit, nevertheless in mmci_probe()
2031 if (!variant->opendrain) { in mmci_probe()
2063 if (variant->qcom_fifo) in mmci_probe()
2069 host->variant = variant; in mmci_probe()
2076 if (host->mclk > variant->f_max) { in mmci_probe()
2077 ret = clk_set_rate(host->clk, variant->f_max); in mmci_probe()
2092 if (variant->init) in mmci_probe()
2093 variant->init(host); in mmci_probe()
2101 if (variant->st_clkdiv) in mmci_probe()
2103 else if (variant->stm32_clkdiv) in mmci_probe()
2105 else if (variant->explicit_mclk_control) in mmci_probe()
2116 mmc->f_max = variant->explicit_mclk_control ? in mmci_probe()
2117 min(variant->f_max, mmc->f_max) : in mmci_probe()
2120 mmc->f_max = variant->explicit_mclk_control ? in mmci_probe()
2151 if (variant->busy_detect) { in mmci_probe()
2157 if (variant->busy_dpsm_flag) in mmci_probe()
2159 host->variant->busy_dpsm_flag); in mmci_probe()
2164 if (variant->busy_timeout) in mmci_probe()
2185 mmc->max_req_size = (1 << variant->datalength_bits) - 1; in mmci_probe()
2196 mmc->max_blk_size = 1 << variant->datactrl_blocksz; in mmci_probe()
2202 mmc->max_blk_count = mmc->max_req_size >> variant->datactrl_blocksz; in mmci_probe()
2208 if (variant->mmcimask1) in mmci_probe()
2245 writel(MCI_IRQENABLE | variant->start_err, host->base + MMCIMASK0); in mmci_probe()
2277 struct variant_data *variant = host->variant; in mmci_remove() local
2289 if (variant->mmcimask1) in mmci_remove()
2309 if (host->variant->pwrreg_nopower) { in mmci_save()
2325 if (host->variant->pwrreg_nopower) { in mmci_restore()
2330 writel(MCI_IRQENABLE | host->variant->start_err, in mmci_restore()