提交 9f667bff 编写于 作者: T Thomas Abraham 提交者: Mark Brown

spi/s3c64xx: use clk_prepare_enable and clk_disable_unprepare

Convert clk_enable/clk_disable to clk_prepare_enable/clk_disable_unprepare
calls as required by common clock framework.
Signed-off-by: NThomas Abraham <thomas.abraham@linaro.org>
Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
上级 ddffeb8c
...@@ -516,7 +516,7 @@ static void s3c64xx_spi_config(struct s3c64xx_spi_driver_data *sdd) ...@@ -516,7 +516,7 @@ static void s3c64xx_spi_config(struct s3c64xx_spi_driver_data *sdd)
/* Disable Clock */ /* Disable Clock */
if (sdd->port_conf->clk_from_cmu) { if (sdd->port_conf->clk_from_cmu) {
clk_disable(sdd->src_clk); clk_disable_unprepare(sdd->src_clk);
} else { } else {
val = readl(regs + S3C64XX_SPI_CLK_CFG); val = readl(regs + S3C64XX_SPI_CLK_CFG);
val &= ~S3C64XX_SPI_ENCLK_ENABLE; val &= ~S3C64XX_SPI_ENCLK_ENABLE;
...@@ -564,7 +564,7 @@ static void s3c64xx_spi_config(struct s3c64xx_spi_driver_data *sdd) ...@@ -564,7 +564,7 @@ static void s3c64xx_spi_config(struct s3c64xx_spi_driver_data *sdd)
/* There is half-multiplier before the SPI */ /* There is half-multiplier before the SPI */
clk_set_rate(sdd->src_clk, sdd->cur_speed * 2); clk_set_rate(sdd->src_clk, sdd->cur_speed * 2);
/* Enable Clock */ /* Enable Clock */
clk_enable(sdd->src_clk); clk_prepare_enable(sdd->src_clk);
} else { } else {
/* Configure Clock */ /* Configure Clock */
val = readl(regs + S3C64XX_SPI_CLK_CFG); val = readl(regs + S3C64XX_SPI_CLK_CFG);
...@@ -1302,7 +1302,7 @@ static int __init s3c64xx_spi_probe(struct platform_device *pdev) ...@@ -1302,7 +1302,7 @@ static int __init s3c64xx_spi_probe(struct platform_device *pdev)
goto err3; goto err3;
} }
if (clk_enable(sdd->clk)) { if (clk_prepare_enable(sdd->clk)) {
dev_err(&pdev->dev, "Couldn't enable clock 'spi'\n"); dev_err(&pdev->dev, "Couldn't enable clock 'spi'\n");
ret = -EBUSY; ret = -EBUSY;
goto err4; goto err4;
...@@ -1317,7 +1317,7 @@ static int __init s3c64xx_spi_probe(struct platform_device *pdev) ...@@ -1317,7 +1317,7 @@ static int __init s3c64xx_spi_probe(struct platform_device *pdev)
goto err5; goto err5;
} }
if (clk_enable(sdd->src_clk)) { if (clk_prepare_enable(sdd->src_clk)) {
dev_err(&pdev->dev, "Couldn't enable clock '%s'\n", clk_name); dev_err(&pdev->dev, "Couldn't enable clock '%s'\n", clk_name);
ret = -EBUSY; ret = -EBUSY;
goto err6; goto err6;
...@@ -1361,11 +1361,11 @@ static int __init s3c64xx_spi_probe(struct platform_device *pdev) ...@@ -1361,11 +1361,11 @@ static int __init s3c64xx_spi_probe(struct platform_device *pdev)
err8: err8:
free_irq(irq, sdd); free_irq(irq, sdd);
err7: err7:
clk_disable(sdd->src_clk); clk_disable_unprepare(sdd->src_clk);
err6: err6:
clk_put(sdd->src_clk); clk_put(sdd->src_clk);
err5: err5:
clk_disable(sdd->clk); clk_disable_unprepare(sdd->clk);
err4: err4:
clk_put(sdd->clk); clk_put(sdd->clk);
err3: err3:
...@@ -1393,10 +1393,10 @@ static int s3c64xx_spi_remove(struct platform_device *pdev) ...@@ -1393,10 +1393,10 @@ static int s3c64xx_spi_remove(struct platform_device *pdev)
free_irq(platform_get_irq(pdev, 0), sdd); free_irq(platform_get_irq(pdev, 0), sdd);
clk_disable(sdd->src_clk); clk_disable_unprepare(sdd->src_clk);
clk_put(sdd->src_clk); clk_put(sdd->src_clk);
clk_disable(sdd->clk); clk_disable_unprepare(sdd->clk);
clk_put(sdd->clk); clk_put(sdd->clk);
if (!sdd->cntrlr_info->cfg_gpio && pdev->dev.of_node) if (!sdd->cntrlr_info->cfg_gpio && pdev->dev.of_node)
...@@ -1417,8 +1417,8 @@ static int s3c64xx_spi_suspend(struct device *dev) ...@@ -1417,8 +1417,8 @@ static int s3c64xx_spi_suspend(struct device *dev)
spi_master_suspend(master); spi_master_suspend(master);
/* Disable the clock */ /* Disable the clock */
clk_disable(sdd->src_clk); clk_disable_unprepare(sdd->src_clk);
clk_disable(sdd->clk); clk_disable_unprepare(sdd->clk);
if (!sdd->cntrlr_info->cfg_gpio && dev->of_node) if (!sdd->cntrlr_info->cfg_gpio && dev->of_node)
s3c64xx_spi_dt_gpio_free(sdd); s3c64xx_spi_dt_gpio_free(sdd);
...@@ -1440,8 +1440,8 @@ static int s3c64xx_spi_resume(struct device *dev) ...@@ -1440,8 +1440,8 @@ static int s3c64xx_spi_resume(struct device *dev)
sci->cfg_gpio(); sci->cfg_gpio();
/* Enable the clock */ /* Enable the clock */
clk_enable(sdd->src_clk); clk_prepare_enable(sdd->src_clk);
clk_enable(sdd->clk); clk_prepare_enable(sdd->clk);
s3c64xx_spi_hwinit(sdd, sdd->port_id); s3c64xx_spi_hwinit(sdd, sdd->port_id);
...@@ -1457,8 +1457,8 @@ static int s3c64xx_spi_runtime_suspend(struct device *dev) ...@@ -1457,8 +1457,8 @@ static int s3c64xx_spi_runtime_suspend(struct device *dev)
struct spi_master *master = dev_get_drvdata(dev); struct spi_master *master = dev_get_drvdata(dev);
struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(master); struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(master);
clk_disable(sdd->clk); clk_disable_unprepare(sdd->clk);
clk_disable(sdd->src_clk); clk_disable_unprepare(sdd->src_clk);
return 0; return 0;
} }
...@@ -1468,8 +1468,8 @@ static int s3c64xx_spi_runtime_resume(struct device *dev) ...@@ -1468,8 +1468,8 @@ static int s3c64xx_spi_runtime_resume(struct device *dev)
struct spi_master *master = dev_get_drvdata(dev); struct spi_master *master = dev_get_drvdata(dev);
struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(master); struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(master);
clk_enable(sdd->src_clk); clk_prepare_enable(sdd->src_clk);
clk_enable(sdd->clk); clk_prepare_enable(sdd->clk);
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册