Skip to contentSkip to conversation

s5p-fimc: Use clk_prepare_enable and clk_disable_unprepare

PATCH Applied Sachin Kamat 3 participants 20 messages Oct 17, 2012 – Oct 20, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/8 s5p-fimc: Use clk_prepare_enable and clk_disable_unprepare

Replace clk_enable/clk_disable with clk_prepare_enable/clk_disable_unprepare as required by the common clock framework.

---
 drivers/media/platform/s5p-fimc/fimc-core.c    |   10 +++++-----
 drivers/media/platform/s5p-fimc/fimc-lite.c    |    4 ++--
 drivers/media/platform/s5p-fimc/fimc-mdevice.c |    4 ++--
 drivers/media/platform/s5p-fimc/mipi-csis.c    |   10 +++++-----
 4 files changed, 14 insertions(+), 14 deletions(-)
drivers/media/platform/s5p-fimc/fimc-core.c +5 -5
index 8d0d2b9..92308ba 100644
@@ -827,7 +827,7 @@ static int fimc_clk_get(struct fimc_dev *fimc)
 		fimc->clock[i] = clk_get(&fimc->pdev->dev, fimc_clocks[i]);
 		if (IS_ERR(fimc->clock[i]))
 			goto err;
-		ret = clk_prepare(fimc->clock[i]);
+		ret = clk_prepare_enable(fimc->clock[i]);
 		if (ret < 0) {
 			clk_put(fimc->clock[i]);
 			fimc->clock[i] = NULL;
@@ -925,7 +925,7 @@ static int fimc_probe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 	clk_set_rate(fimc->clock[CLK_BUS], drv_data->lclk_frequency);
-	clk_enable(fimc->clock[CLK_BUS]);
+	clk_prepare_enable(fimc->clock[CLK_BUS]);
 
 	ret = devm_request_irq(&pdev->dev, res->start, fimc_irq_handler,
 			       0, dev_name(&pdev->dev), fimc);
@@ -970,7 +970,7 @@ static int fimc_runtime_resume(struct device *dev)
 	dbg("fimc%d: state: 0x%lx", fimc->id, fimc->state);
 
 	/* Enable clocks and perform basic initalization */
-	clk_enable(fimc->clock[CLK_GATE]);
+	clk_prepare_enable(fimc->clock[CLK_GATE]);
 	fimc_hw_reset(fimc);
 
 	/* Resume the capture or mem-to-mem device */
@@ -990,7 +990,7 @@ static int fimc_runtime_suspend(struct device *dev)
 	else
 		ret = fimc_m2m_suspend(fimc);
 	if (!ret)
-		clk_disable(fimc->clock[CLK_GATE]);
+		clk_disable_unprepare(fimc->clock[CLK_GATE]);
 
 	dbg("fimc%d: state: 0x%lx", fimc->id, fimc->state);
 	return ret;
@@ -1045,7 +1045,7 @@ static int __devexit fimc_remove(struct platform_device *pdev)
 	fimc_unregister_capture_subdev(fimc);
 	vb2_dma_contig_cleanup_ctx(fimc->alloc_ctx);
 
-	clk_disable(fimc->clock[CLK_BUS]);
+	clk_disable_unprepare(fimc->clock[CLK_BUS]);
 	fimc_clk_put(fimc);
 
 	dev_info(&pdev->dev, "driver unloaded\n");
drivers/media/platform/s5p-fimc/fimc-lite.c +2 -2
index 70bcf39..4a12847 100644
@@ -1479,7 +1479,7 @@ static int fimc_lite_runtime_resume(struct device *dev)
 {
 	struct fimc_lite *fimc = dev_get_drvdata(dev);
 
-	clk_enable(fimc->clock);
+	clk_prepare_enable(fimc->clock);
 	return 0;
 }
 
@@ -1487,7 +1487,7 @@ static int fimc_lite_runtime_suspend(struct device *dev)
 {
 	struct fimc_lite *fimc = dev_get_drvdata(dev);
 
-	clk_disable(fimc->clock);
+	clk_disable_unprepare(fimc->clock);
 	return 0;
 }
 
drivers/media/platform/s5p-fimc/fimc-mdevice.c +2 -2
index 61fab00..e1f7cbe 100644
@@ -779,7 +779,7 @@ static int __fimc_md_set_camclk(struct fimc_md *fmd,
 		if (camclk->use_count++ == 0) {
 			clk_set_rate(camclk->clock, pdata->clk_frequency);
 			camclk->frequency = pdata->clk_frequency;
-			ret = clk_enable(camclk->clock);
+			ret = clk_prepare_enable(camclk->clock);
 			dbg("Enabled camclk %d: f: %lu", pdata->clk_id,
 			    clk_get_rate(camclk->clock));
 		}
@@ -790,7 +790,7 @@ static int __fimc_md_set_camclk(struct fimc_md *fmd,
 		return 0;
 
 	if (--camclk->use_count == 0) {
-		clk_disable(camclk->clock);
+		clk_disable_unprepare(camclk->clock);
 		dbg("Disabled camclk %d", pdata->clk_id);
 	}
 	return ret;
drivers/media/platform/s5p-fimc/mipi-csis.c +5 -5
index 4c961b1..f02c95b 100644
@@ -710,7 +710,7 @@ static int __devinit s5pcsis_probe(struct platform_device *pdev)
 	if (ret)
 		goto e_clkput;
 
-	clk_enable(state->clock[CSIS_CLK_MUX]);
+	clk_prepare_enable(state->clock[CSIS_CLK_MUX]);
 	if (pdata->clk_rate)
 		clk_set_rate(state->clock[CSIS_CLK_MUX], pdata->clk_rate);
 	else
@@ -754,7 +754,7 @@ static int __devinit s5pcsis_probe(struct platform_device *pdev)
 e_regput:
 	regulator_bulk_free(CSIS_NUM_SUPPLIES, state->supplies);
 e_clkput:
-	clk_disable(state->clock[CSIS_CLK_MUX]);
+	clk_disable_unprepare(state->clock[CSIS_CLK_MUX]);
 	s5pcsis_clk_put(state);
 	return ret;
 }
@@ -779,7 +779,7 @@ static int s5pcsis_pm_suspend(struct device *dev, bool runtime)
 					     state->supplies);
 		if (ret)
 			goto unlock;
-		clk_disable(state->clock[CSIS_CLK_GATE]);
+		clk_disable_unprepare(state->clock[CSIS_CLK_GATE]);
 		state->flags &= ~ST_POWERED;
 		if (!runtime)
 			state->flags |= ST_SUSPENDED;
@@ -816,7 +816,7 @@ static int s5pcsis_pm_resume(struct device *dev, bool runtime)
 					       state->supplies);
 			goto unlock;
 		}
-		clk_enable(state->clock[CSIS_CLK_GATE]);
+		clk_prepare_enable(state->clock[CSIS_CLK_GATE]);
 	}
 	if (state->flags & ST_STREAMING)
 		s5pcsis_start_stream(state);
@@ -858,7 +858,7 @@ static int __devexit s5pcsis_remove(struct platform_device *pdev)
 
 	pm_runtime_disable(&pdev->dev);
 	s5pcsis_pm_suspend(&pdev->dev, false);
-	clk_disable(state->clock[CSIS_CLK_MUX]);
+	clk_disable_unprepare(state->clock[CSIS_CLK_MUX]);
 	pm_runtime_set_suspended(&pdev->dev);
 	s5pcsis_clk_put(state);
 	regulator_bulk_free(CSIS_NUM_SUPPLIES, state->supplies);
Signature · 1 line
1.7.4.1
#1 lore raw

PATCH 2/8 s5p-g2d: Use clk_prepare_enable and clk_disable_unprepare

Replace clk_enable/clk_disable with clk_prepare_enable/clk_disable_unprepare as required by the common clock framework.

---
 drivers/media/platform/s5p-g2d/g2d.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/media/platform/s5p-g2d/g2d.c +2 -2
index 1bfbc32..adecd25 100644
@@ -589,7 +589,7 @@ static void device_run(void *prv)
 	src = v4l2_m2m_next_src_buf(ctx->m2m_ctx);
 	dst = v4l2_m2m_next_dst_buf(ctx->m2m_ctx);
 
-	clk_enable(dev->gate);
+	clk_prepare_enable(dev->gate);
 	g2d_reset(dev);
 
 	spin_lock_irqsave(&dev->ctrl_lock, flags);
@@ -619,7 +619,7 @@ static irqreturn_t g2d_isr(int irq, void *prv)
 	struct vb2_buffer *src, *dst;
 
 	g2d_clear_int(dev);
-	clk_disable(dev->gate);
+	clk_disable_unprepare(dev->gate);
 
 	BUG_ON(ctx == NULL);
 
Signature · 1 line
1.7.4.1
#2 lore raw

Re: [PATCH 2/8] [media] s5p-g2d: Use clk_prepare_enable and clk_disable_unprepare

Hi Sachin,

Quoted 5 lines · Sachin Kamat

Replace clk_enable/clk_disable with clk_prepare_enable/clk_disable_unprepare as required by the common clock framework.

As we discussed previously, this patch is not needed. clk_prepare/unprepare are done in this driver's probe() and remove() callbacks.

Thanks,
Sylwester

#3 lore raw

PATCH 3/8 s5p-mfc: Use clk_prepare_enable and clk_disable_unprepare

In reply to Sachin Kamat

Replace clk_enable/clk_disable with clk_prepare_enable/clk_disable_unprepare as required by the common clock framework.

---
 drivers/media/platform/s5p-mfc/s5p_mfc_pm.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/media/platform/s5p-mfc/s5p_mfc_pm.c +2 -2
index 367db75..f7c5c5a 100644
@@ -100,7 +100,7 @@ int s5p_mfc_clock_on(void)
 	atomic_inc(&clk_ref);
 	mfc_debug(3, "+ %d", atomic_read(&clk_ref));
 #endif
-	ret = clk_enable(pm->clock_gate);
+	ret = clk_prepare_enable(pm->clock_gate);
 	return ret;
 }
 
@@ -110,7 +110,7 @@ void s5p_mfc_clock_off(void)
 	atomic_dec(&clk_ref);
 	mfc_debug(3, "- %d", atomic_read(&clk_ref));
 #endif
-	clk_disable(pm->clock_gate);
+	clk_disable_unprepare(pm->clock_gate);
 }
 
 int s5p_mfc_power_on(void)
Signature · 1 line
1.7.4.1
#4 lore raw

Re: [PATCH 3/8] [media] s5p-mfc: Use clk_prepare_enable and clk_disable_unprepare

Quoted 2 lines · Sachin Kamat

Replace clk_enable/clk_disable with clk_prepare_enable/clk_disable_unprepare as required by the common clock framework.

Similarly as in case of s5p-g2d driver, there is no need for this change.

#5 lore raw

Re: [PATCH 3/8] [media] s5p-mfc: Use clk_prepare_enable and clk_disable_unprepare

In reply to Sachin Kamat
Quoted 2 lines · Sachin Kamat

Replace clk_enable/clk_disable with clk_prepare_enable/clk_disable_unprepare as required by the common clock framework.

Similarly as in case of s5p-g2d driver, there is no need for this change.

#6 lore raw

PATCH 4/8 s5p-tv: Use clk_prepare_enable and clk_disable_unprepare

In reply to Sachin Kamat

Replace clk_enable/clk_disable with clk_prepare_enable/clk_disable_unprepare as required by the common clock framework.

Cc Tomasz Stanislawski <[email protected]>
---
 drivers/media/platform/s5p-tv/hdmi_drv.c  |   20 ++++++++++----------
 drivers/media/platform/s5p-tv/mixer_drv.c |   12 ++++++------
 drivers/media/platform/s5p-tv/sdo_drv.c   |   12 ++++++------
 3 files changed, 22 insertions(+), 22 deletions(-)
drivers/media/platform/s5p-tv/hdmi_drv.c +10 -10
index 8a9cf43..497e8ab 100644
@@ -542,9 +542,9 @@ static int hdmi_streamon(struct hdmi_device *hdev)
 	}
 
 	/* hdmiphy clock is used for HDMI in streaming mode */
-	clk_disable(res->sclk_hdmi);
+	clk_disable_unprepare(res->sclk_hdmi);
 	clk_set_parent(res->sclk_hdmi, res->sclk_hdmiphy);
-	clk_enable(res->sclk_hdmi);
+	clk_prepare_enable(res->sclk_hdmi);
 
 	/* enable HDMI and timing generator */
 	hdmi_write_mask(hdev, HDMI_CON_0, ~0, HDMI_EN);
@@ -564,9 +564,9 @@ static int hdmi_streamoff(struct hdmi_device *hdev)
 	hdmi_write_mask(hdev, HDMI_TG_CMD, 0, HDMI_TG_EN);
 
 	/* pixel(vpll) clock is used for HDMI in config mode */
-	clk_disable(res->sclk_hdmi);
+	clk_disable_unprepare(res->sclk_hdmi);
 	clk_set_parent(res->sclk_hdmi, res->sclk_pixel);
-	clk_enable(res->sclk_hdmi);
+	clk_prepare_enable(res->sclk_hdmi);
 
 	v4l2_subdev_call(hdev->mhl_sd, video, s_stream, 0);
 	v4l2_subdev_call(hdev->phy_sd, video, s_stream, 0);
@@ -591,19 +591,19 @@ static void hdmi_resource_poweron(struct hdmi_resources *res)
 	/* turn HDMI power on */
 	regulator_bulk_enable(res->regul_count, res->regul_bulk);
 	/* power-on hdmi physical interface */
-	clk_enable(res->hdmiphy);
+	clk_prepare_enable(res->hdmiphy);
 	/* use VPP as parent clock; HDMIPHY is not working yet */
 	clk_set_parent(res->sclk_hdmi, res->sclk_pixel);
 	/* turn clocks on */
-	clk_enable(res->sclk_hdmi);
+	clk_prepare_enable(res->sclk_hdmi);
 }
 
 static void hdmi_resource_poweroff(struct hdmi_resources *res)
 {
 	/* turn clocks off */
-	clk_disable(res->sclk_hdmi);
+	clk_disable_unprepare(res->sclk_hdmi);
 	/* power-off hdmiphy */
-	clk_disable(res->hdmiphy);
+	clk_disable_unprepare(res->hdmiphy);
 	/* turn HDMI power off */
 	regulator_bulk_disable(res->regul_count, res->regul_bulk);
 }
@@ -947,7 +947,7 @@ static int __devinit hdmi_probe(struct platform_device *pdev)
 		}
 	}
 
-	clk_enable(hdmi_dev->res.hdmi);
+	clk_prepare_enable(hdmi_dev->res.hdmi);
 
 	pm_runtime_enable(dev);
 
@@ -986,7 +986,7 @@ static int __devexit hdmi_remove(struct platform_device *pdev)
 	struct hdmi_device *hdmi_dev = sd_to_hdmi_dev(sd);
 
 	pm_runtime_disable(dev);
-	clk_disable(hdmi_dev->res.hdmi);
+	clk_disable_unprepare(hdmi_dev->res.hdmi);
 	v4l2_device_unregister(&hdmi_dev->v4l2_dev);
 	disable_irq(hdmi_dev->irq);
 	hdmi_resources_cleanup(hdmi_dev);
drivers/media/platform/s5p-tv/mixer_drv.c +6 -6
index ca0f297..dea0520 100644
@@ -339,9 +339,9 @@ static int mxr_runtime_resume(struct device *dev)
 	mxr_dbg(mdev, "resume - start\n");
 	mutex_lock(&mdev->mutex);
 	/* turn clocks on */
-	clk_enable(res->mixer);
-	clk_enable(res->vp);
-	clk_enable(res->sclk_mixer);
+	clk_prepare_enable(res->mixer);
+	clk_prepare_enable(res->vp);
+	clk_prepare_enable(res->sclk_mixer);
 	/* apply default configuration */
 	mxr_reg_reset(mdev);
 	mxr_dbg(mdev, "resume - finished\n");
@@ -357,9 +357,9 @@ static int mxr_runtime_suspend(struct device *dev)
 	mxr_dbg(mdev, "suspend - start\n");
 	mutex_lock(&mdev->mutex);
 	/* turn clocks off */
-	clk_disable(res->sclk_mixer);
-	clk_disable(res->vp);
-	clk_disable(res->mixer);
+	clk_disable_unprepare(res->sclk_mixer);
+	clk_disable_unprepare(res->vp);
+	clk_disable_unprepare(res->mixer);
 	mutex_unlock(&mdev->mutex);
 	mxr_dbg(mdev, "suspend - finished\n");
 	return 0;
drivers/media/platform/s5p-tv/sdo_drv.c +6 -6
index ad68bbe..21d213a 100644
@@ -199,7 +199,7 @@ static int sdo_streamon(struct sdo_device *sdev)
 	clk_get_rate(sdev->fout_vpll));
 	/* enable clock in SDO */
 	sdo_write_mask(sdev, SDO_CLKCON, ~0, SDO_TVOUT_CLOCK_ON);
-	clk_enable(sdev->dacphy);
+	clk_prepare_enable(sdev->dacphy);
 	/* enable DAC */
 	sdo_write_mask(sdev, SDO_DAC, ~0, SDO_POWER_ON_DAC);
 	sdo_reg_debug(sdev);
@@ -211,7 +211,7 @@ static int sdo_streamoff(struct sdo_device *sdev)
 	int tries;
 
 	sdo_write_mask(sdev, SDO_DAC, 0, SDO_POWER_ON_DAC);
-	clk_disable(sdev->dacphy);
+	clk_disable_unprepare(sdev->dacphy);
 	sdo_write_mask(sdev, SDO_CLKCON, 0, SDO_TVOUT_CLOCK_ON);
 	for (tries = 100; tries; --tries) {
 		if (sdo_read(sdev, SDO_CLKCON) & SDO_TVOUT_CLOCK_READY)
@@ -254,7 +254,7 @@ static int sdo_runtime_suspend(struct device *dev)
 	dev_info(dev, "suspend\n");
 	regulator_disable(sdev->vdet);
 	regulator_disable(sdev->vdac);
-	clk_disable(sdev->sclk_dac);
+	clk_disable_unprepare(sdev->sclk_dac);
 	return 0;
 }
 
@@ -264,7 +264,7 @@ static int sdo_runtime_resume(struct device *dev)
 	struct sdo_device *sdev = sd_to_sdev(sd);
 
 	dev_info(dev, "resume\n");
-	clk_enable(sdev->sclk_dac);
+	clk_prepare_enable(sdev->sclk_dac);
 	regulator_enable(sdev->vdac);
 	regulator_enable(sdev->vdet);
 
@@ -386,7 +386,7 @@ static int __devinit sdo_probe(struct platform_device *pdev)
 	}
 
 	/* enable gate for dac clock, because mixer uses it */
-	clk_enable(sdev->dac);
+	clk_prepare_enable(sdev->dac);
 
 	/* configure power management */
 	pm_runtime_enable(dev);
@@ -425,7 +425,7 @@ static int __devexit sdo_remove(struct platform_device *pdev)
 	struct sdo_device *sdev = sd_to_sdev(sd);
 
 	pm_runtime_disable(&pdev->dev);
-	clk_disable(sdev->dac);
+	clk_disable_unprepare(sdev->dac);
 	clk_put(sdev->fout_vpll);
 	clk_put(sdev->dacphy);
 	clk_put(sdev->dac);
Signature · 1 line
1.7.4.1
#7 lore raw

Re: [PATCH 4/8] [media] s5p-tv: Use clk_prepare_enable and clk_disable_unprepare

Quoted 5 lines · Sachin Kamat

Replace clk_enable/clk_disable with clk_prepare_enable/clk_disable_unprepare as required by the common clock framework.

Cc Tomasz Stanislawski<[email protected]>

Could you add clocks (un)prepare calls at the functions where the clocks are acquired/released instead ? I think it results in slightly less overhead this way.

--
Thanks,
Sylwester

#8 lore raw

PATCH 5/8 exynos-gsc: Use clk_prepare_enable and clk_disable_unprepare

In reply to Sachin Kamat

Replace clk_enable/clk_disable with clk_prepare_enable/clk_disable_unprepare as required by the common clock framework.

---
 drivers/media/platform/exynos-gsc/gsc-core.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/media/platform/exynos-gsc/gsc-core.c +2 -2
index bfec9e6..d11668b 100644
@@ -1009,7 +1009,7 @@ static int gsc_clk_get(struct gsc_dev *gsc)
 	if (IS_ERR(gsc->clock))
 		goto err_print;
 
-	ret = clk_prepare(gsc->clock);
+	ret = clk_prepare_enable(gsc->clock);
 	if (ret < 0) {
 		clk_put(gsc->clock);
 		gsc->clock = NULL;
@@ -1186,7 +1186,7 @@ static int gsc_runtime_suspend(struct device *dev)
 
 	ret = gsc_m2m_suspend(gsc);
 	if (!ret)
-		clk_disable(gsc->clock);
+		clk_disable_unprepare(gsc->clock);
 
 	pr_debug("gsc%d: state: 0x%lx", gsc->id, gsc->state);
 	return ret;
Signature · 1 line
1.7.4.1
#9 lore raw

Re: [PATCH 5/8] [media] exynos-gsc: Use clk_prepare_enable and clk_disable_unprepare

Quoted 13 lines · Sachin Kamat

Replace clk_enable/clk_disable with clk_prepare_enable/clk_disable_unprepare as required by the common clock framework.

---
  drivers/media/platform/exynos-gsc/gsc-core.c |    4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)
drivers/media/platform/exynos-gsc/gsc-core.c +0 -0
index bfec9e6..d11668b 100644

drivers/media/platform/exynos-gsc/gsc-core.c static int gsc_clk_get(struct gsc_dev *gsc) · line 1012

Quoted 5 lines
drivers/media/platform/exynos-gsc/gsc-core.c +1 -1
@@ -1009,7 +1009,7 @@ static int gsc_clk_get(struct gsc_dev *gsc)
  	if (IS_ERR(gsc->clock))
  		goto err_print;
 
-	ret = clk_prepare(gsc->clock);
+	ret = clk_prepare_enable(gsc->clock);

This is not right, gsc->clock is being enabled somewhere else. And as you can see this driver has already taken care of preparing/ unpreparing the clock.

drivers/media/platform/exynos-gsc/gsc-core.c static int gsc_runtime_suspend(struct device *dev) · line 1189

Quoted 9 lines
drivers/media/platform/exynos-gsc/gsc-core.c +1 -1
  	if (ret<  0) {
  		clk_put(gsc->clock);
  		gsc->clock = NULL;
@@ -1186,7 +1186,7 @@ static int gsc_runtime_suspend(struct device *dev)
 
  	ret = gsc_m2m_suspend(gsc);
  	if (!ret)
-		clk_disable(gsc->clock);
+		clk_disable_unprepare(gsc->clock);

No, that will result in unbalanced clk_prepare/unprepare. Please don't do that.

drivers/media/platform/exynos-gsc/gsc-core.c static int gsc_runtime_suspend(struct device *dev) · line 1192

Quoted 3 lines
drivers/media/platform/exynos-gsc/gsc-core.c +0 -0
  	pr_debug("gsc%d: state: 0x%lx", gsc->id, gsc->state);
  	return ret;

This driver should already inter-work fine with the common clock framework, just look how it handles the clock:

# git grep -n -7 clk_ -- exynos-gsc

exynos-gsc/gsc-core.c:993:static void gsc_clk_put(struct gsc_dev *gsc) exynos-gsc/gsc-core.c-994-{
exynos-gsc/gsc-core.c-995- if (IS_ERR_OR_NULL(gsc->clock))
exynos-gsc/gsc-core.c-996- return;
exynos-gsc/gsc-core.c-997-
exynos-gsc/gsc-core.c:998: clk_unprepare(gsc->clock);
exynos-gsc/gsc-core.c:999: clk_put(gsc->clock);
exynos-gsc/gsc-core.c-1000- gsc->clock = NULL;
exynos-gsc/gsc-core.c-1001-}
exynos-gsc/gsc-core.c-1002-
exynos-gsc/gsc-core.c:1003:static int gsc_clk_get(struct gsc_dev *gsc) exynos-gsc/gsc-core.c-1004-{
exynos-gsc/gsc-core.c-1005- int ret;
exynos-gsc/gsc-core.c-1006-
exynos-gsc/gsc-core.c:1007: dev_dbg(&gsc->pdev->dev, "gsc_clk_get Called\n");
exynos-gsc/gsc-core.c-1008-
exynos-gsc/gsc-core.c:1009: gsc->clock = clk_get(&gsc->pdev->dev, GSC_CLOCK_GATE_NAME);
exynos-gsc/gsc-core.c-1010- if (IS_ERR(gsc->clock))
exynos-gsc/gsc-core.c-1011- goto err_print;
exynos-gsc/gsc-core.c-1012-
exynos-gsc/gsc-core.c:1013: ret = clk_prepare(gsc->clock);
exynos-gsc/gsc-core.c-1014- if (ret < 0) {
exynos-gsc/gsc-core.c:1015: clk_put(gsc->clock);
exynos-gsc/gsc-core.c-1016- gsc->clock = NULL;
exynos-gsc/gsc-core.c-1017- goto err;
exynos-gsc/gsc-core.c-1018- }
exynos-gsc/gsc-core.c-1019-
exynos-gsc/gsc-core.c-1020- return 0;
exynos-gsc/gsc-core.c-1021-
exynos-gsc/gsc-core.c-1022-err:
exynos-gsc/gsc-core.c-1023- dev_err(&gsc->pdev->dev, "clock prepare failed for clock: %s\n",
exynos-gsc/gsc-core.c-1024- GSC_CLOCK_GATE_NAME);
exynos-gsc/gsc-core.c:1025: gsc_clk_put(gsc);
exynos-gsc/gsc-core.c-1026-err_print:
exynos-gsc/gsc-core.c-1027- dev_err(&gsc->pdev->dev, "failed to get clock~~~: %s\n",
exynos-gsc/gsc-core.c-1028- GSC_CLOCK_GATE_NAME);
exynos-gsc/gsc-core.c-1029- return -ENXIO;
exynos-gsc/gsc-core.c-1030-}
--
exynos-gsc/gsc-core.c-1105-
exynos-gsc/gsc-core.c-1106- res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
exynos-gsc/gsc-core.c-1107- if (!res) {
exynos-gsc/gsc-core.c-1108- dev_err(dev, "failed to get IRQ resource\n");
exynos-gsc/gsc-core.c-1109- return -ENXIO;
exynos-gsc/gsc-core.c-1110- }
exynos-gsc/gsc-core.c-1111-
exynos-gsc/gsc-core.c:1112: ret = gsc_clk_get(gsc);
exynos-gsc/gsc-core.c-1113- if (ret)
exynos-gsc/gsc-core.c-1114- return ret;
--
exynos-gsc/gsc-core.c-1142- pm_runtime_put(dev);
exynos-gsc/gsc-core.c-1143- return 0;
exynos-gsc/gsc-core.c-1144-err_pm:
exynos-gsc/gsc-core.c-1145- pm_runtime_put(dev);
exynos-gsc/gsc-core.c-1146-err_m2m:
exynos-gsc/gsc-core.c-1147- gsc_unregister_m2m_device(gsc);
exynos-gsc/gsc-core.c-1148-err_clk:
exynos-gsc/gsc-core.c:1149: gsc_clk_put(gsc);
exynos-gsc/gsc-core.c-1150- return ret;
exynos-gsc/gsc-core.c-1151-}
--
exynos-gsc/gsc-core.c-1166-static int gsc_runtime_resume(struct device *dev) exynos-gsc/gsc-core.c-1167-{
exynos-gsc/gsc-core.c-1168- struct gsc_dev *gsc = dev_get_drvdata(dev);
exynos-gsc/gsc-core.c-1169- int ret = 0;
exynos-gsc/gsc-core.c-1170-
exynos-gsc/gsc-core.c-1171- pr_debug("gsc%d: state: 0x%lx", gsc->id, gsc->state);
exynos-gsc/gsc-core.c-1172-
exynos-gsc/gsc-core.c:1173: ret = clk_enable(gsc->clock);
exynos-gsc/gsc-core.c-1174- if (ret)
exynos-gsc/gsc-core.c-1175- return ret;
exynos-gsc/gsc-core.c-1176-
exynos-gsc/gsc-core.c-1177- gsc_hw_set_sw_reset(gsc);
exynos-gsc/gsc-core.c-1178- gsc_wait_reset(gsc);
exynos-gsc/gsc-core.c-1179-
exynos-gsc/gsc-core.c-1180- return gsc_m2m_resume(gsc);
--
exynos-gsc/gsc-core.c-1183-static int gsc_runtime_suspend(struct device *dev) exynos-gsc/gsc-core.c-1184-{
exynos-gsc/gsc-core.c-1185- struct gsc_dev *gsc = dev_get_drvdata(dev);
exynos-gsc/gsc-core.c-1186- int ret = 0;
exynos-gsc/gsc-core.c-1187-
exynos-gsc/gsc-core.c-1188- ret = gsc_m2m_suspend(gsc);
exynos-gsc/gsc-core.c-1189- if (!ret)
exynos-gsc/gsc-core.c:1190: clk_disable(gsc->clock);
exynos-gsc/gsc-core.c-1191-
exynos-gsc/gsc-core.c-1192- pr_debug("gsc%d: state: 0x%lx", gsc->id, gsc->state);
exynos-gsc/gsc-core.c-1193- return ret;
exynos-gsc/gsc-core.c-1194-}

--
Regards,
Sylwester

#10 lore raw

PATCH 6/8 exynos-gsc: Fix compilation warning

In reply to Sachin Kamat

Used type casting to avoid the following compilation warning:

drivers/media/platform/exynos-gsc/gsc-core.c:983:37: warning:
incorrect type in assignment (different modifiers) drivers/media/platform/exynos-gsc/gsc-core.c:983:37:
expected struct gsc_driverdata *driver_data drivers/media/platform/exynos-gsc/gsc-core.c:983:37:
got void const *data

---
 drivers/media/platform/exynos-gsc/gsc-core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/media/platform/exynos-gsc/gsc-core.c +1 -1
index d11668b..9b86ef6 100644
@@ -980,7 +980,7 @@ static void *gsc_get_drv_data(struct platform_device *pdev)
 		match = of_match_node(of_match_ptr(exynos_gsc_match),
 					pdev->dev.of_node);
 		if (match)
-			driver_data =  match->data;
+			driver_data = (struct gsc_driverdata *)match->data;
 	} else {
 		driver_data = (struct gsc_driverdata *)
 			platform_get_device_id(pdev)->driver_data;
Signature · 1 line
1.7.4.1
#11 lore raw

Re: [PATCH 6/8] [media] exynos-gsc: Fix compilation warning

Quoted 8 lines · Sachin Kamat

Used type casting to avoid the following compilation warning:

drivers/media/platform/exynos-gsc/gsc-core.c:983:37: warning:
incorrect type in assignment (different modifiers) drivers/media/platform/exynos-gsc/gsc-core.c:983:37:
expected struct gsc_driverdata *driver_data drivers/media/platform/exynos-gsc/gsc-core.c:983:37:
got void const *data

Applied to my tree, thanks.

#12 lore raw

PATCH 7/8 s5p-mfc: Make 'clk_ref' static in s5p_mfc_pm.c

In reply to Sachin Kamat

Fixes the following sparse warning:
drivers/media/platform/s5p-mfc/s5p_mfc_pm.c:31:10: warning:
symbol 'clk_ref' was not declared. Should it be static?

---
 drivers/media/platform/s5p-mfc/s5p_mfc_pm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/media/platform/s5p-mfc/s5p_mfc_pm.c +1 -1
index f7c5c5a..19c46fb 100644
@@ -28,7 +28,7 @@ static struct s5p_mfc_pm *pm;
 static struct s5p_mfc_dev *p_dev;
 
 #ifdef CLK_DEBUG
-atomic_t clk_ref;
+static atomic_t clk_ref;
 #endif
 
 int s5p_mfc_init_pm(struct s5p_mfc_dev *dev)
Signature · 1 line
1.7.4.1
#13 lore raw

Re: [PATCH 7/8] [media] s5p-mfc: Make 'clk_ref' static in s5p_mfc_pm.c

Quoted 3 lines · Sachin Kamat

Fixes the following sparse warning:
drivers/media/platform/s5p-mfc/s5p_mfc_pm.c:31:10: warning:
symbol 'clk_ref' was not declared. Should it be static?

Applied, thanks.

#14 lore raw

PATCH 8/8 s5p-fimc: Make 'fimc_pipeline_s_stream' function static

In reply to Sachin Kamat

Fixes the following sparse warning:
drivers/media/platform/s5p-fimc/fimc-mdevice.c:216:5: warning:
symbol 'fimc_pipeline_s_stream' was not declared. Should it be static?

---
 drivers/media/platform/s5p-fimc/fimc-mdevice.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/media/platform/s5p-fimc/fimc-mdevice.c +1 -1
index e1f7cbe..0cd05b2 100644
@@ -213,7 +213,7 @@ static int fimc_pipeline_close(struct fimc_pipeline *p)
  * @pipeline: video pipeline structure
  * @on: passed as the s_stream call argument
  */
-int fimc_pipeline_s_stream(struct fimc_pipeline *p, bool on)
+static int fimc_pipeline_s_stream(struct fimc_pipeline *p, bool on)
 {
 	int i, ret;
 
Signature · 1 line
1.7.4.1
#15 lore raw

Re: [PATCH 8/8] [media] s5p-fimc: Make 'fimc_pipeline_s_stream' function static

Quoted 3 lines · Sachin Kamat

Fixes the following sparse warning:
drivers/media/platform/s5p-fimc/fimc-mdevice.c:216:5: warning:
symbol 'fimc_pipeline_s_stream' was not declared. Should it be static?

Thanks Sachin, I've add it to my tree.

#16 lore raw

PATCH 1/8 s5p-fimc: Use clk_prepare_enable and clk_disable_unprepare

In reply to Sachin Kamat

Hi Sachin,

Quoted 2 lines · Sachin Kamat

Replace clk_enable/clk_disable with clk_prepare_enable/clk_disable_unprepare as required by the common clock framework.

I think this statement is misleading. In my understanding it is not the common clock framework requirement to use clk_{enable/disable}_prepare in place of clk_enable/disable. The requirement is to call clk_prepare before first clk_enable call and to call clk_unprepare after clk_disable and before clk_put.

You need to be careful with those replacements, since the clk *_(un)prepare functions may sleep, i.e. they must not be called from atomic context.

Most of the s5p-* drivers have already added support for clk_(un)prepare. Thus most of your changes in this patch are not needed. I seem to have only missed fimc-mdevice.c, other modules are already reworked

$ git grep -5  clk_prepare  -- drivers/media/platform/s5p-fimc
drivers/media/platform/s5p-fimc/fimc-core.c-
drivers/media/platform/s5p-fimc/fimc-core.c-    for (i = 0; i < MAX_FIMC_CLOCKS; i++) {
drivers/media/platform/s5p-fimc/fimc-core.c-            fimc->clock[i] = clk_get(&fimc->pdev->dev, fimc_clocks[i]);
drivers/media/platform/s5p-fimc/fimc-core.c-            if (IS_ERR(fimc->clock[i]))
drivers/media/platform/s5p-fimc/fimc-core.c-                    goto err;
drivers/media/platform/s5p-fimc/fimc-core.c:            ret = clk_prepare(fimc->clock[i]);
drivers/media/platform/s5p-fimc/fimc-core.c-            if (ret < 0) {
drivers/media/platform/s5p-fimc/fimc-core.c-                    clk_put(fimc->clock[i]);
drivers/media/platform/s5p-fimc/fimc-core.c-                    fimc->clock[i] = NULL;
drivers/media/platform/s5p-fimc/fimc-core.c-                    goto err;
drivers/media/platform/s5p-fimc/fimc-core.c-            }
--
drivers/media/platform/s5p-fimc/fimc-lite.c-
drivers/media/platform/s5p-fimc/fimc-lite.c-    fimc->clock = clk_get(&fimc->pdev->dev, FLITE_CLK_NAME);
drivers/media/platform/s5p-fimc/fimc-lite.c-    if (IS_ERR(fimc->clock))
drivers/media/platform/s5p-fimc/fimc-lite.c-            return PTR_ERR(fimc->clock);
drivers/media/platform/s5p-fimc/fimc-lite.c-
drivers/media/platform/s5p-fimc/fimc-lite.c:    ret = clk_prepare(fimc->clock);
drivers/media/platform/s5p-fimc/fimc-lite.c-    if (ret < 0) {
drivers/media/platform/s5p-fimc/fimc-lite.c-            clk_put(fimc->clock);
drivers/media/platform/s5p-fimc/fimc-lite.c-            fimc->clock = NULL;
drivers/media/platform/s5p-fimc/fimc-lite.c-    }
drivers/media/platform/s5p-fimc/fimc-lite.c-    return ret;
--
drivers/media/platform/s5p-fimc/mipi-csis.c-
drivers/media/platform/s5p-fimc/mipi-csis.c-    for (i = 0; i < NUM_CSIS_CLOCKS; i++) {
drivers/media/platform/s5p-fimc/mipi-csis.c-            state->clock[i] = clk_get(dev, csi_clock_name[i]);
drivers/media/platform/s5p-fimc/mipi-csis.c-            if (IS_ERR(state->clock[i]))
drivers/media/platform/s5p-fimc/mipi-csis.c-                    goto err;
drivers/media/platform/s5p-fimc/mipi-csis.c:            ret = clk_prepare(state->clock[i]);
drivers/media/platform/s5p-fimc/mipi-csis.c-            if (ret < 0) {
drivers/media/platform/s5p-fimc/mipi-csis.c-                    clk_put(state->clock[i]);
drivers/media/platform/s5p-fimc/mipi-csis.c-                    state->clock[i] = NULL;
drivers/media/platform/s5p-fimc/mipi-csis.c-                    goto err;
drivers/media/platform/s5p-fimc/mipi-csis.c-            }

I would prefer you have added the required changes at fimc_md_get_clocks() and fimc_md_put_clocks() functions.

Please make sure you don't add those clk_(un)prepare calls where it is net needed.

$ git grep "clk_prepare\|clk_unprepare"  -- drivers/media/platform/s5p-*
drivers/media/platform/s5p-fimc/fimc-core.c:            clk_unprepare(fimc->clock[i]);
drivers/media/platform/s5p-fimc/fimc-core.c:            ret = clk_prepare(fimc->clock[i]);
drivers/media/platform/s5p-fimc/fimc-lite.c:    clk_unprepare(fimc->clock);
drivers/media/platform/s5p-fimc/fimc-lite.c:    ret = clk_prepare(fimc->clock);
drivers/media/platform/s5p-fimc/mipi-csis.c:            clk_unprepare(state->clock[i]);
drivers/media/platform/s5p-fimc/mipi-csis.c:            ret = clk_prepare(state->clock[i]);
drivers/media/platform/s5p-g2d/g2d.c:   ret = clk_prepare(dev->clk);
drivers/media/platform/s5p-g2d/g2d.c:   ret = clk_prepare(dev->gate);
drivers/media/platform/s5p-g2d/g2d.c:   clk_unprepare(dev->gate);
drivers/media/platform/s5p-g2d/g2d.c:   clk_unprepare(dev->clk);
drivers/media/platform/s5p-g2d/g2d.c:   clk_unprepare(dev->gate);
drivers/media/platform/s5p-g2d/g2d.c:   clk_unprepare(dev->clk);
drivers/media/platform/s5p-jpeg/jpeg-core.c:    clk_prepare_enable(jpeg->clk);
drivers/media/platform/s5p-mfc/s5p_mfc_pm.c:    ret = clk_prepare(pm->clock_gate);
drivers/media/platform/s5p-mfc/s5p_mfc_pm.c:    ret = clk_prepare(pm->clock);
drivers/media/platform/s5p-mfc/s5p_mfc_pm.c:    clk_unprepare(pm->clock_gate);
drivers/media/platform/s5p-mfc/s5p_mfc_pm.c:    clk_unprepare(pm->clock_gate);
drivers/media/platform/s5p-mfc/s5p_mfc_pm.c:    clk_unprepare(pm->clock);
Quoted 143 lines
---
 drivers/media/platform/s5p-fimc/fimc-core.c    |   10 +++++-----
 drivers/media/platform/s5p-fimc/fimc-lite.c    |    4 ++--
 drivers/media/platform/s5p-fimc/fimc-mdevice.c |    4 ++--
 drivers/media/platform/s5p-fimc/mipi-csis.c    |   10 +++++-----
 4 files changed, 14 insertions(+), 14 deletions(-)
drivers/media/platform/s5p-fimc/fimc-core.c +5 -5
index 8d0d2b9..92308ba 100644
@@ -827,7 +827,7 @@ static int fimc_clk_get(struct fimc_dev *fimc)
 		fimc->clock[i] = clk_get(&fimc->pdev->dev, fimc_clocks[i]);
 		if (IS_ERR(fimc->clock[i]))
 			goto err;
-		ret = clk_prepare(fimc->clock[i]);
+		ret = clk_prepare_enable(fimc->clock[i]);
 		if (ret < 0) {
 			clk_put(fimc->clock[i]);
 			fimc->clock[i] = NULL;
@@ -925,7 +925,7 @@ static int fimc_probe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 	clk_set_rate(fimc->clock[CLK_BUS], drv_data->lclk_frequency);
-	clk_enable(fimc->clock[CLK_BUS]);
+	clk_prepare_enable(fimc->clock[CLK_BUS]);
 
 	ret = devm_request_irq(&pdev->dev, res->start, fimc_irq_handler,
 			       0, dev_name(&pdev->dev), fimc);
@@ -970,7 +970,7 @@ static int fimc_runtime_resume(struct device *dev)
 	dbg("fimc%d: state: 0x%lx", fimc->id, fimc->state);
 
 	/* Enable clocks and perform basic initalization */
-	clk_enable(fimc->clock[CLK_GATE]);
+	clk_prepare_enable(fimc->clock[CLK_GATE]);
 	fimc_hw_reset(fimc);
 
 	/* Resume the capture or mem-to-mem device */
@@ -990,7 +990,7 @@ static int fimc_runtime_suspend(struct device *dev)
 	else
 		ret = fimc_m2m_suspend(fimc);
 	if (!ret)
-		clk_disable(fimc->clock[CLK_GATE]);
+		clk_disable_unprepare(fimc->clock[CLK_GATE]);
 
 	dbg("fimc%d: state: 0x%lx", fimc->id, fimc->state);
 	return ret;
@@ -1045,7 +1045,7 @@ static int __devexit fimc_remove(struct platform_device *pdev)
 	fimc_unregister_capture_subdev(fimc);
 	vb2_dma_contig_cleanup_ctx(fimc->alloc_ctx);
 
-	clk_disable(fimc->clock[CLK_BUS]);
+	clk_disable_unprepare(fimc->clock[CLK_BUS]);
 	fimc_clk_put(fimc);
 
 	dev_info(&pdev->dev, "driver unloaded\n");
drivers/media/platform/s5p-fimc/fimc-lite.c +2 -2
index 70bcf39..4a12847 100644
@@ -1479,7 +1479,7 @@ static int fimc_lite_runtime_resume(struct device *dev)
 {
 	struct fimc_lite *fimc = dev_get_drvdata(dev);
 
-	clk_enable(fimc->clock);
+	clk_prepare_enable(fimc->clock);
 	return 0;
 }
 
@@ -1487,7 +1487,7 @@ static int fimc_lite_runtime_suspend(struct device *dev)
 {
 	struct fimc_lite *fimc = dev_get_drvdata(dev);
 
-	clk_disable(fimc->clock);
+	clk_disable_unprepare(fimc->clock);
 	return 0;
 }
 
drivers/media/platform/s5p-fimc/fimc-mdevice.c +2 -2
index 61fab00..e1f7cbe 100644
@@ -779,7 +779,7 @@ static int __fimc_md_set_camclk(struct fimc_md *fmd,
 		if (camclk->use_count++ == 0) {
 			clk_set_rate(camclk->clock, pdata->clk_frequency);
 			camclk->frequency = pdata->clk_frequency;
-			ret = clk_enable(camclk->clock);
+			ret = clk_prepare_enable(camclk->clock);
 			dbg("Enabled camclk %d: f: %lu", pdata->clk_id,
 			    clk_get_rate(camclk->clock));
 		}
@@ -790,7 +790,7 @@ static int __fimc_md_set_camclk(struct fimc_md *fmd,
 		return 0;
 
 	if (--camclk->use_count == 0) {
-		clk_disable(camclk->clock);
+		clk_disable_unprepare(camclk->clock);
 		dbg("Disabled camclk %d", pdata->clk_id);
 	}
 	return ret;
drivers/media/platform/s5p-fimc/mipi-csis.c +4 -4
index 4c961b1..f02c95b 100644
@@ -710,7 +710,7 @@ static int __devinit s5pcsis_probe(struct platform_device *pdev)
 	if (ret)
 		goto e_clkput;
 
-	clk_enable(state->clock[CSIS_CLK_MUX]);
+	clk_prepare_enable(state->clock[CSIS_CLK_MUX]);
 	if (pdata->clk_rate)
 		clk_set_rate(state->clock[CSIS_CLK_MUX], pdata->clk_rate);
 	else
@@ -754,7 +754,7 @@ static int __devinit s5pcsis_probe(struct platform_device *pdev)
 e_regput:
 	regulator_bulk_free(CSIS_NUM_SUPPLIES, state->supplies);
 e_clkput:
-	clk_disable(state->clock[CSIS_CLK_MUX]);
+	clk_disable_unprepare(state->clock[CSIS_CLK_MUX]);
 	s5pcsis_clk_put(state);
 	return ret;
 }
@@ -779,7 +779,7 @@ static int s5pcsis_pm_suspend(struct device *dev, bool runtime)
 					     state->supplies);
 		if (ret)
 			goto unlock;
-		clk_disable(state->clock[CSIS_CLK_GATE]);
+		clk_disable_unprepare(state->clock[CSIS_CLK_GATE]);
 		state->flags &= ~ST_POWERED;
 		if (!runtime)
 			state->flags |= ST_SUSPENDED;
@@ -816,7 +816,7 @@ static int s5pcsis_pm_resume(struct device *dev, bool runtime)
 					       state->supplies);
 			goto unlock;
 		}
-		clk_enable(state->clock[CSIS_CLK_GATE]);
+		clk_prepare_enable(state->clock[CSIS_CLK_GATE]);
 	}
 	if (state->flags & ST_STREAMING)
 		s5pcsis_start_stream(state);

drivers/media/platform/s5p-fimc/mipi-csis.c static int __devexit s5pcsis_remove(struct platform_device *pdev) · line 864

Quoted 8 lines
drivers/media/platform/s5p-fimc/mipi-csis.c +1 -1
@@ -858,7 +858,7 @@ static int __devexit s5pcsis_remove(struct platform_device *pdev)
 
 	pm_runtime_disable(&pdev->dev);
 	s5pcsis_pm_suspend(&pdev->dev, false);
-	clk_disable(state->clock[CSIS_CLK_MUX]);
+	clk_disable_unprepare(state->clock[CSIS_CLK_MUX]);
 	pm_runtime_set_suspended(&pdev->dev);
 	s5pcsis_clk_put(state);
 	regulator_bulk_free(CSIS_NUM_SUPPLIES, state->supplies);

--
Thanks,
Sylwester

#17 lore raw

PATCH 1/8 s5p-fimc: Use clk_prepare_enable and clk_disable_unprepare

Hi Sylwester,

Thanks for the review.

Quoted 9 lines · Sylwester Nawrocki

Hi Sachin,

Quoted 2 lines · Sachin Kamat

Replace clk_enable/clk_disable with clk_prepare_enable/clk_disable_unprepare as required by the common clock framework.

You need to be careful with those replacements, since the clk *_(un)prepare functions may sleep, i.e. they must not be called from atomic context.

OK.

Quoted 4 lines

Most of the s5p-* drivers have already added support for clk_(un)prepare. Thus most of your changes in this patch are not needed. I seem to have only missed fimc-mdevice.c, other modules are already reworked

I did not find these changes in your tree. Please let me know the branch where these changes are available.

Quoted 9 lines
$ git grep -5  clk_prepare  -- drivers/media/platform/s5p-fimc
drivers/media/platform/s5p-fimc/fimc-core.c-
drivers/media/platform/s5p-fimc/fimc-core.c-    for (i = 0; i < MAX_FIMC_CLOCKS; i++) {
drivers/media/platform/s5p-fimc/fimc-core.c-            fimc->clock[i] = clk_get(&fimc->pdev->dev, fimc_clocks[i]);
drivers/media/platform/s5p-fimc/fimc-core.c-            if (IS_ERR(fimc->clock[i]))
Quoted 1 line

I would prefer you have added the required changes at fimc_md_get_clocks()

and fimc_md_put_clocks() functions.

Ok. I will check this.

Quoted 1 line
Signature · 2 lines
With warm regards,
Sachin
#18 lore raw

PATCH 1/8 s5p-fimc: Use clk_prepare_enable and clk_disable_unprepare

Quoted 6 lines · Sachin Kamat
Quoted 3 lines

Most of the s5p-* drivers have already added support for clk_(un)prepare. Thus most of your changes in this patch are not needed. I seem to have only missed fimc-mdevice.c, other modules are already reworked

I did not find these changes in your tree. Please let me know the branch where these changes are available.

Are in Linus' tree, for quite long already, commits:

11a37c709797cc56f48905e68a3099b79cf08850
[media] s5p-g2d: Added support for clk_prepare

bd7d8888e99d67f778f4ee272346322c0b9cb378
[media] s5p-fimc: convert to clk_prepare()/clk_unprepare()

eb732518e0db585376f95256b18b2149240e3ad3
[media] s5p-mfc: Added support for clk_prepare

Please note there was the media drivers reorganization recently, e.g. drivers/media/video/s5p-* changed to drivers/media/platform/s5p-*.

Quoted 10 lines
Quoted 8 lines
$ git grep -5  clk_prepare  -- drivers/media/platform/s5p-fimc
drivers/media/platform/s5p-fimc/fimc-core.c-
drivers/media/platform/s5p-fimc/fimc-core.c-    for (i = 0; i < MAX_FIMC_CLOCKS; i++) {
drivers/media/platform/s5p-fimc/fimc-core.c-            fimc->clock[i] = clk_get(&fimc->pdev->dev, fimc_clocks[i]);
drivers/media/platform/s5p-fimc/fimc-core.c-            if (IS_ERR(fimc->clock[i]))
Quoted 1 line

I would prefer you have added the required changes at fimc_md_get_clocks()

and fimc_md_put_clocks() functions.

Ok. I will check this.

Thanks.

--
Regards,
Sylwester

#19 lore raw

PATCH 1/8 s5p-fimc: Use clk_prepare_enable and clk_disable_unprepare

Quoted 10 lines · Sylwester Nawrocki
Quoted 6 lines · Sachin Kamat
Quoted 3 lines

Most of the s5p-* drivers have already added support for clk_(un)prepare. Thus most of your changes in this patch are not needed. I seem to have only missed fimc-mdevice.c, other modules are already reworked

I did not find these changes in your tree. Please let me know the branch where these changes are available.

Are in Linus' tree, for quite long already, commits:

Quoted 8 lines

11a37c709797cc56f48905e68a3099b79cf08850
[media] s5p-g2d: Added support for clk_prepare

bd7d8888e99d67f778f4ee272346322c0b9cb378
[media] s5p-fimc: convert to clk_prepare()/clk_unprepare()

eb732518e0db585376f95256b18b2149240e3ad3
[media] s5p-mfc: Added support for clk_prepare

Oh I see.. I dunno how i missed to notice this..

Quoted 3 lines

Please note there was the media drivers reorganization recently, e.g. drivers/media/video/s5p-* changed to drivers/media/platform/s5p-*.

Right. I am aware of that.

Quoted 10 lines
Quoted 10 lines
Quoted 9 lines
$ git grep -5  clk_prepare  -- drivers/media/platform/s5p-fimc
drivers/media/platform/s5p-fimc/fimc-core.c-
drivers/media/platform/s5p-fimc/fimc-core.c-    for (i = 0; i < MAX_FIMC_CLOCKS; i++) {
drivers/media/platform/s5p-fimc/fimc-core.c-            fimc->clock[i] = clk_get(&fimc->pdev->dev, fimc_clocks[i]);
drivers/media/platform/s5p-fimc/fimc-core.c-            if (IS_ERR(fimc->clock[i]))
Quoted 1 line

I would prefer you have added the required changes at fimc_md_get_clocks()

and fimc_md_put_clocks() functions.

Quoted 7 lines
Quoted 1 line

Ok. I will check this.

Thanks.

--
Regards,
Sylwester

Thanks Sylwester.

Signature · 2 lines
With warm regards,
Sachin