diff options
author | Peter Geis <pgwipeout@gmail.com> | 2022-03-06 00:58:34 +0300 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2022-03-07 14:56:38 +0300 |
commit | c4313e75001492f8a288d3ffd595544cbc880821 (patch) | |
tree | 9b639dd19ef6c6240e08b8802795af51d2d291ce /drivers/mmc/host/dw_mmc.c | |
parent | 0ffd498db172258fde312bb8671816f18b2f6d0c (diff) | |
download | linux-c4313e75001492f8a288d3ffd595544cbc880821.tar.xz |
mmc: dw_mmc: Support setting f_min from host drivers
Host drivers may not be able to support frequencies as low as dw-mmc
supports. Unfortunately f_min isn't available when the drv_data->init
function is called, as the mmc_host struct hasn't been set up yet.
Support the host drivers saving the requested minimum frequency, so we
can later set f_min when it is available.
Signed-off-by: Peter Geis <pgwipeout@gmail.com>
Link: https://lore.kernel.org/r/20220305215835.2210388-2-pgwipeout@gmail.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/host/dw_mmc.c')
-rw-r--r-- | drivers/mmc/host/dw_mmc.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 3420a7ad6098..06dc56cbada8 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -2898,7 +2898,12 @@ static int dw_mci_init_slot_caps(struct dw_mci_slot *slot) if (host->pdata->caps2) mmc->caps2 = host->pdata->caps2; - mmc->f_min = DW_MCI_FREQ_MIN; + /* if host has set a minimum_freq, we should respect it */ + if (host->minimum_speed) + mmc->f_min = host->minimum_speed; + else + mmc->f_min = DW_MCI_FREQ_MIN; + if (!mmc->f_max) mmc->f_max = DW_MCI_FREQ_MAX; |