@@ -2364,9 +2364,12 @@ int sdhci_add_host(struct sdhci_host *host)
*/
mmc->ops = &sdhci_ops;
mmc->f_max = host->max_clk;
- if (host->ops->get_min_clock)
- mmc->f_min = host->ops->get_min_clock(host);
- else if (host->version >= SDHCI_SPEC_300) {
+ if (host->ops->get_min_clock || host->ops->get_f_max_clock) {
+ if (host->ops->get_min_clock)
+ mmc->f_min = host->ops->get_min_clock(host);
+ if (host->ops->get_f_max_clock)
+ mmc->f_max = host->ops->get_f_max_clock(host);
+ } else if (host->version >= SDHCI_SPEC_300) {
if (host->clk_mul) {
mmc->f_min = (host->max_clk * host->clk_mul) / 1024;
mmc->f_max = host->max_clk * host->clk_mul;
@@ -264,6 +264,7 @@ struct sdhci_ops {
void (*platform_reset_enter)(struct sdhci_host *host, u8 mask);
void (*platform_reset_exit)(struct sdhci_host *host, u8 mask);
int (*set_uhs_signaling)(struct sdhci_host *host, unsigned int uhs);
+ unsigned int (*get_f_max_clock)(struct sdhci_host *host);
};
We currently have callbacks for max_clk, f_min but are missing the callback for f_max. Signed-off-by: Philip Rakity <prakity@marvell.com> --- drivers/mmc/host/sdhci.c | 9 ++++++--- drivers/mmc/host/sdhci.h | 1 + 2 files changed, 7 insertions(+), 3 deletions(-)