Message ID | 20220402112004.129886-1-jmkrzyszt@gmail.com |
---|---|
State | New |
Headers | show |
Series | mmc: omap: Make it CCF clk API compatible | expand |
On Sat, 2 Apr 2022 at 13:20, Janusz Krzysztofik <jmkrzyszt@gmail.com> wrote: > > The driver, OMAP specific, now omits clk_prepare/unprepare() steps, not > supported by OMAP custom implementation of clock API. However, non-CCF > stubs of those functions exist for use on such platforms until converted > to CCF. > > Update the driver to be compatible with CCF implementation of clock API. > > Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com> Applied for next, thanks! Kind regards Uffe > --- > drivers/mmc/host/omap.c | 23 ++++++++++++++--------- > 1 file changed, 14 insertions(+), 9 deletions(-) > > diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c > index 5e5af34090f1..57d39283924d 100644 > --- a/drivers/mmc/host/omap.c > +++ b/drivers/mmc/host/omap.c > @@ -1374,7 +1374,7 @@ static int mmc_omap_probe(struct platform_device *pdev) > host->iclk = clk_get(&pdev->dev, "ick"); > if (IS_ERR(host->iclk)) > return PTR_ERR(host->iclk); > - clk_enable(host->iclk); > + clk_prepare_enable(host->iclk); > > host->fclk = clk_get(&pdev->dev, "fck"); > if (IS_ERR(host->fclk)) { > @@ -1382,16 +1382,18 @@ static int mmc_omap_probe(struct platform_device *pdev) > goto err_free_iclk; > } > > + ret = clk_prepare(host->fclk); > + if (ret) > + goto err_put_fclk; > + > host->dma_tx_burst = -1; > host->dma_rx_burst = -1; > > host->dma_tx = dma_request_chan(&pdev->dev, "tx"); > if (IS_ERR(host->dma_tx)) { > ret = PTR_ERR(host->dma_tx); > - if (ret == -EPROBE_DEFER) { > - clk_put(host->fclk); > - goto err_free_iclk; > - } > + if (ret == -EPROBE_DEFER) > + goto err_free_fclk; > > host->dma_tx = NULL; > dev_warn(host->dev, "TX DMA channel request failed\n"); > @@ -1403,8 +1405,7 @@ static int mmc_omap_probe(struct platform_device *pdev) > if (ret == -EPROBE_DEFER) { > if (host->dma_tx) > dma_release_channel(host->dma_tx); > - clk_put(host->fclk); > - goto err_free_iclk; > + goto err_free_fclk; > } > > host->dma_rx = NULL; > @@ -1454,9 +1455,12 @@ static int mmc_omap_probe(struct platform_device *pdev) > dma_release_channel(host->dma_tx); > if (host->dma_rx) > dma_release_channel(host->dma_rx); > +err_free_fclk: > + clk_unprepare(host->fclk); > +err_put_fclk: > clk_put(host->fclk); > err_free_iclk: > - clk_disable(host->iclk); > + clk_disable_unprepare(host->iclk); > clk_put(host->iclk); > return ret; > } > @@ -1476,8 +1480,9 @@ static int mmc_omap_remove(struct platform_device *pdev) > > mmc_omap_fclk_enable(host, 0); > free_irq(host->irq, host); > + clk_unprepare(host->fclk); > clk_put(host->fclk); > - clk_disable(host->iclk); > + clk_disable_unprepare(host->iclk); > clk_put(host->iclk); > > if (host->dma_tx) > -- > 2.35.1 >
diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c index 5e5af34090f1..57d39283924d 100644 --- a/drivers/mmc/host/omap.c +++ b/drivers/mmc/host/omap.c @@ -1374,7 +1374,7 @@ static int mmc_omap_probe(struct platform_device *pdev) host->iclk = clk_get(&pdev->dev, "ick"); if (IS_ERR(host->iclk)) return PTR_ERR(host->iclk); - clk_enable(host->iclk); + clk_prepare_enable(host->iclk); host->fclk = clk_get(&pdev->dev, "fck"); if (IS_ERR(host->fclk)) { @@ -1382,16 +1382,18 @@ static int mmc_omap_probe(struct platform_device *pdev) goto err_free_iclk; } + ret = clk_prepare(host->fclk); + if (ret) + goto err_put_fclk; + host->dma_tx_burst = -1; host->dma_rx_burst = -1; host->dma_tx = dma_request_chan(&pdev->dev, "tx"); if (IS_ERR(host->dma_tx)) { ret = PTR_ERR(host->dma_tx); - if (ret == -EPROBE_DEFER) { - clk_put(host->fclk); - goto err_free_iclk; - } + if (ret == -EPROBE_DEFER) + goto err_free_fclk; host->dma_tx = NULL; dev_warn(host->dev, "TX DMA channel request failed\n"); @@ -1403,8 +1405,7 @@ static int mmc_omap_probe(struct platform_device *pdev) if (ret == -EPROBE_DEFER) { if (host->dma_tx) dma_release_channel(host->dma_tx); - clk_put(host->fclk); - goto err_free_iclk; + goto err_free_fclk; } host->dma_rx = NULL; @@ -1454,9 +1455,12 @@ static int mmc_omap_probe(struct platform_device *pdev) dma_release_channel(host->dma_tx); if (host->dma_rx) dma_release_channel(host->dma_rx); +err_free_fclk: + clk_unprepare(host->fclk); +err_put_fclk: clk_put(host->fclk); err_free_iclk: - clk_disable(host->iclk); + clk_disable_unprepare(host->iclk); clk_put(host->iclk); return ret; } @@ -1476,8 +1480,9 @@ static int mmc_omap_remove(struct platform_device *pdev) mmc_omap_fclk_enable(host, 0); free_irq(host->irq, host); + clk_unprepare(host->fclk); clk_put(host->fclk); - clk_disable(host->iclk); + clk_disable_unprepare(host->iclk); clk_put(host->iclk); if (host->dma_tx)
The driver, OMAP specific, now omits clk_prepare/unprepare() steps, not supported by OMAP custom implementation of clock API. However, non-CCF stubs of those functions exist for use on such platforms until converted to CCF. Update the driver to be compatible with CCF implementation of clock API. Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com> --- drivers/mmc/host/omap.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-)