diff options
| -rw-r--r-- | drivers/mmc/host/sdhci-esdhc-imx.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c index de2655e0db20..d7e9d365a32c 100644 --- a/drivers/mmc/host/sdhci-esdhc-imx.c +++ b/drivers/mmc/host/sdhci-esdhc-imx.c | |||
| @@ -576,19 +576,17 @@ static unsigned int esdhc_pltfm_get_max_clock(struct sdhci_host *host) | |||
| 576 | struct pltfm_imx_data *imx_data = pltfm_host->priv; | 576 | struct pltfm_imx_data *imx_data = pltfm_host->priv; |
| 577 | struct esdhc_platform_data *boarddata = &imx_data->boarddata; | 577 | struct esdhc_platform_data *boarddata = &imx_data->boarddata; |
| 578 | 578 | ||
| 579 | u32 f_host = clk_get_rate(pltfm_host->clk); | 579 | if (boarddata->f_max && (boarddata->f_max < pltfm_host->clock)) |
| 580 | |||
| 581 | if (boarddata->f_max && (boarddata->f_max < f_host)) | ||
| 582 | return boarddata->f_max; | 580 | return boarddata->f_max; |
| 583 | else | 581 | else |
| 584 | return f_host; | 582 | return pltfm_host->clock; |
| 585 | } | 583 | } |
| 586 | 584 | ||
| 587 | static unsigned int esdhc_pltfm_get_min_clock(struct sdhci_host *host) | 585 | static unsigned int esdhc_pltfm_get_min_clock(struct sdhci_host *host) |
| 588 | { | 586 | { |
| 589 | struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); | 587 | struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); |
| 590 | 588 | ||
| 591 | return clk_get_rate(pltfm_host->clk) / 256 / 16; | 589 | return pltfm_host->clock / 256 / 16; |
| 592 | } | 590 | } |
| 593 | 591 | ||
| 594 | static inline void esdhc_pltfm_set_clock(struct sdhci_host *host, | 592 | static inline void esdhc_pltfm_set_clock(struct sdhci_host *host, |
| @@ -596,7 +594,7 @@ static inline void esdhc_pltfm_set_clock(struct sdhci_host *host, | |||
| 596 | { | 594 | { |
| 597 | struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); | 595 | struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); |
| 598 | struct pltfm_imx_data *imx_data = pltfm_host->priv; | 596 | struct pltfm_imx_data *imx_data = pltfm_host->priv; |
| 599 | unsigned int host_clock = clk_get_rate(pltfm_host->clk); | 597 | unsigned int host_clock = pltfm_host->clock; |
| 600 | int pre_div = 2; | 598 | int pre_div = 2; |
| 601 | int div = 1; | 599 | int div = 1; |
| 602 | u32 temp, val; | 600 | u32 temp, val; |
| @@ -997,7 +995,7 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev) | |||
| 997 | } | 995 | } |
| 998 | 996 | ||
| 999 | pltfm_host->clk = imx_data->clk_per; | 997 | pltfm_host->clk = imx_data->clk_per; |
| 1000 | 998 | pltfm_host->clock = clk_get_rate(pltfm_host->clk); | |
| 1001 | clk_prepare_enable(imx_data->clk_per); | 999 | clk_prepare_enable(imx_data->clk_per); |
| 1002 | clk_prepare_enable(imx_data->clk_ipg); | 1000 | clk_prepare_enable(imx_data->clk_ipg); |
| 1003 | clk_prepare_enable(imx_data->clk_ahb); | 1001 | clk_prepare_enable(imx_data->clk_ahb); |
