[PATCH 00/12] Prepare various SH/R Mobile/Car drivers for CCF migration

STALE4624d

7 messages, 4 authors, 2013-11-11 · open the first message on its own page

[PATCH 00/12] Prepare various SH/R Mobile/Car drivers for CCF migration

From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Date: 2013-10-28 22:49:14

Hello,

This patch series, based on v3.12-rc7, prepares various Renesas SH-Mobile,
R-Mobile and R-Car drivers for migration to CCF by adding clock prepare and
unprepare support.

The patches are pretty straightforward. Most of the drivers called
clk_enable and clk_disable in sleepable context, I've thus just converted them
to clk_prepare_enable and clk_disable_unprepare.

The clocksource drivers were slightly more complex to handle as clk_enable and
clk_disable were called in non-sleepable context. As the clocksource framework
architecture doesn't provide any sleepable callback in which clocks could be
prepared and unprepared, I've added clk_prepare and clk_unprepare calls in the
probe and suspend/resume handlers (clocksources can't be removed so the remove
handler doesn't need a clk_unprepare call).

I'd like to get all these patches merged in v3.14. As they will need to go
through their respective subsystems' trees, I would appreciate if all
maintainers involved could notify me when they merge patches from this series
in their tree to help me tracking the merge status. I don't plan to send pull
requests individually for these patches, and I will repost patches
individually if changes are requested during review.

Cc: Daniel Lezcano <redacted>
Cc: linux-kernel@vger.kernel.org
Cc: Tejun Heo <tj@kernel.org>
Cc: linux-ide@vger.kernel.org
Cc: David Airlie <redacted>
Cc: dri-devel@lists.freedesktop.org
Cc: Wolfram Sang <redacted>
Cc: linux-i2c@vger.kernel.org
Cc: Chris Ball <redacted>
Cc: Guennadi Liakhovetski <redacted>
Cc: linux-mmc@vger.kernel.org
Cc: Felipe Balbi <redacted>
Cc: linux-usb@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Cc: Jean-Christophe Plagniol-Villard <redacted>
Cc: Tomi Valkeinen <redacted>
Cc: linux-fbdev@vger.kernel.org

Laurent Pinchart (12):
  clocksource: sh_cmt: Add clk_prepare/unprepare support
  clocksource: sh_mtu2: Add clk_prepare/unprepare support
  clocksource: sh_tmu: Add clk_prepare/unprepare support
  sata_rcar: Convert to clk_prepare/unprepare
  drm: shmob_drm: Convert to clk_prepare/unprepare
  i2c: sh_mobile: Convert to clk_prepare/unprepare
  mmc: sh_mmcif: Convert to clk_prepare/unprepare
  mmc: sh_mobile_sdhi: Convert to clk_prepare/unprepare
  usb: gadget: r8a66597-udc: Convert to clk_prepare/unprepare
  usb: r8a66597-hcd: Convert to clk_prepare/unprepare
  fbdev: shmobile-hdmi: Convert to clk_prepare/unprepare
  fbdev: shmobile-lcdcfb: Convert to clk_prepare/unprepare

 drivers/ata/sata_rcar.c                   | 10 +++++-----
 drivers/clocksource/sh_cmt.c              | 20 ++++++++++++++++----
 drivers/clocksource/sh_mtu2.c             | 16 ++++++++++++++--
 drivers/clocksource/sh_tmu.c              | 20 +++++++++++++++++---
 drivers/gpu/drm/shmobile/shmob_drm_crtc.c |  4 ++--
 drivers/i2c/busses/i2c-sh_mobile.c        |  8 ++++----
 drivers/mmc/host/sh_mmcif.c               | 12 ++++++------
 drivers/mmc/host/sh_mobile_sdhi.c         |  4 ++--
 drivers/usb/gadget/r8a66597-udc.c         |  6 +++---
 drivers/usb/host/r8a66597-hcd.c           |  4 ++--
 drivers/video/sh_mobile_hdmi.c            |  6 +++---
 drivers/video/sh_mobile_lcdcfb.c          |  4 ++--
 12 files changed, 76 insertions(+), 38 deletions(-)

-- 
Regards,

Laurent Pinchart

[PATCH 11/12] fbdev: shmobile-hdmi: Convert to clk_prepare/unprepare

From: laurent.pinchart+renesas@ideasonboard.com (Laurent Pinchart)
Date: 2013-10-28 22:49:28

Turn clk_enable() and clk_disable() calls into clk_prepare_enable() and
clk_disable_unprepare() to get ready for the migration to the common
clock framework.

Cc: Jean-Christophe Plagniol-Villard <redacted>
Cc: Tomi Valkeinen <redacted>
Cc: linux-fbdev@vger.kernel.org
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
 drivers/video/sh_mobile_hdmi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/video/sh_mobile_hdmi.c b/drivers/video/sh_mobile_hdmi.c
index bfe4728..190145e 100644
--- a/drivers/video/sh_mobile_hdmi.c
+++ b/drivers/video/sh_mobile_hdmi.c
@@ -1326,7 +1326,7 @@ static int __init sh_hdmi_probe(struct platform_device *pdev)
 		goto erate;
 	}
 
-	ret = clk_enable(hdmi->hdmi_clk);
+	ret = clk_prepare_enable(hdmi->hdmi_clk);
 	if (ret < 0) {
 		dev_err(hdmi->dev, "Cannot enable clock: %d\n", ret);
 		goto erate;
@@ -1404,7 +1404,7 @@ emap_htop1:
 emap:
 	release_mem_region(res->start, resource_size(res));
 ereqreg:
-	clk_disable(hdmi->hdmi_clk);
+	clk_disable_unprepare(hdmi->hdmi_clk);
 erate:
 	clk_put(hdmi->hdmi_clk);
 egetclk:
@@ -1427,7 +1427,7 @@ static int __exit sh_hdmi_remove(struct platform_device *pdev)
 	cancel_delayed_work_sync(&hdmi->edid_work);
 	pm_runtime_put(&pdev->dev);
 	pm_runtime_disable(&pdev->dev);
-	clk_disable(hdmi->hdmi_clk);
+	clk_disable_unprepare(hdmi->hdmi_clk);
 	clk_put(hdmi->hdmi_clk);
 	if (hdmi->htop1)
 		iounmap(hdmi->htop1);
-- 
1.8.1.5

[PATCH 12/12] fbdev: shmobile-lcdcfb: Convert to clk_prepare/unprepare

From: laurent.pinchart+renesas@ideasonboard.com (Laurent Pinchart)
Date: 2013-10-28 22:49:29

Turn clk_enable() and clk_disable() calls into clk_prepare_enable() and
clk_disable_unprepare() to get ready for the migration to the common
clock framework.

Cc: Jean-Christophe Plagniol-Villard <redacted>
Cc: Tomi Valkeinen <redacted>
Cc: linux-fbdev@vger.kernel.org
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
 drivers/video/sh_mobile_lcdcfb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
index 0264704..eaeae0f 100644
--- a/drivers/video/sh_mobile_lcdcfb.c
+++ b/drivers/video/sh_mobile_lcdcfb.c
@@ -344,7 +344,7 @@ static void sh_mobile_lcdc_clk_on(struct sh_mobile_lcdc_priv *priv)
 {
 	if (atomic_inc_and_test(&priv->hw_usecnt)) {
 		if (priv->dot_clk)
-			clk_enable(priv->dot_clk);
+			clk_prepare_enable(priv->dot_clk);
 		pm_runtime_get_sync(priv->dev);
 		if (priv->meram_dev && priv->meram_dev->pdev)
 			pm_runtime_get_sync(&priv->meram_dev->pdev->dev);
@@ -358,7 +358,7 @@ static void sh_mobile_lcdc_clk_off(struct sh_mobile_lcdc_priv *priv)
 			pm_runtime_put_sync(&priv->meram_dev->pdev->dev);
 		pm_runtime_put(priv->dev);
 		if (priv->dot_clk)
-			clk_disable(priv->dot_clk);
+			clk_disable_unprepare(priv->dot_clk);
 	}
 }
 
-- 
1.8.1.5

[PATCH 12/12] fbdev: shmobile-lcdcfb: Convert to clk_prepare/unprepare

From: Jean-Christophe PLAGNIOL-VILLARD <hidden>
Date: 2013-10-31 10:47:40

On 23:49 Mon 28 Oct     , Laurent Pinchart wrote:
Turn clk_enable() and clk_disable() calls into clk_prepare_enable() and
clk_disable_unprepare() to get ready for the migration to the common
clock framework.

Cc: Jean-Christophe Plagniol-Villard <redacted>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <redacted>

Best Regards,
J.
quoted hunk
Cc: Tomi Valkeinen <redacted>
Cc: linux-fbdev@vger.kernel.org
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
 drivers/video/sh_mobile_lcdcfb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
index 0264704..eaeae0f 100644
--- a/drivers/video/sh_mobile_lcdcfb.c
+++ b/drivers/video/sh_mobile_lcdcfb.c
@@ -344,7 +344,7 @@ static void sh_mobile_lcdc_clk_on(struct sh_mobile_lcdc_priv *priv)
 {
 	if (atomic_inc_and_test(&priv->hw_usecnt)) {
 		if (priv->dot_clk)
-			clk_enable(priv->dot_clk);
+			clk_prepare_enable(priv->dot_clk);
 		pm_runtime_get_sync(priv->dev);
 		if (priv->meram_dev && priv->meram_dev->pdev)
 			pm_runtime_get_sync(&priv->meram_dev->pdev->dev);
@@ -358,7 +358,7 @@ static void sh_mobile_lcdc_clk_off(struct sh_mobile_lcdc_priv *priv)
 			pm_runtime_put_sync(&priv->meram_dev->pdev->dev);
 		pm_runtime_put(priv->dev);
 		if (priv->dot_clk)
-			clk_disable(priv->dot_clk);
+			clk_disable_unprepare(priv->dot_clk);
 	}
 }
 
-- 
1.8.1.5

[PATCH 11/12] fbdev: shmobile-hdmi: Convert to clk_prepare/unprepare

From: Jean-Christophe PLAGNIOL-VILLARD <hidden>
Date: 2013-10-31 10:48:09

On 23:49 Mon 28 Oct     , Laurent Pinchart wrote:
Turn clk_enable() and clk_disable() calls into clk_prepare_enable() and
clk_disable_unprepare() to get ready for the migration to the common
clock framework.

Cc: Jean-Christophe Plagniol-Villard <redacted>
Cc: Tomi Valkeinen <redacted>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <redacted>

Bset Regards,
J.
quoted hunk
Cc: linux-fbdev@vger.kernel.org
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
 drivers/video/sh_mobile_hdmi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/video/sh_mobile_hdmi.c b/drivers/video/sh_mobile_hdmi.c
index bfe4728..190145e 100644
--- a/drivers/video/sh_mobile_hdmi.c
+++ b/drivers/video/sh_mobile_hdmi.c
@@ -1326,7 +1326,7 @@ static int __init sh_hdmi_probe(struct platform_device *pdev)
 		goto erate;
 	}
 
-	ret = clk_enable(hdmi->hdmi_clk);
+	ret = clk_prepare_enable(hdmi->hdmi_clk);
 	if (ret < 0) {
 		dev_err(hdmi->dev, "Cannot enable clock: %d\n", ret);
 		goto erate;
@@ -1404,7 +1404,7 @@ emap_htop1:
 emap:
 	release_mem_region(res->start, resource_size(res));
 ereqreg:
-	clk_disable(hdmi->hdmi_clk);
+	clk_disable_unprepare(hdmi->hdmi_clk);
 erate:
 	clk_put(hdmi->hdmi_clk);
 egetclk:
@@ -1427,7 +1427,7 @@ static int __exit sh_hdmi_remove(struct platform_device *pdev)
 	cancel_delayed_work_sync(&hdmi->edid_work);
 	pm_runtime_put(&pdev->dev);
 	pm_runtime_disable(&pdev->dev);
-	clk_disable(hdmi->hdmi_clk);
+	clk_disable_unprepare(hdmi->hdmi_clk);
 	clk_put(hdmi->hdmi_clk);
 	if (hdmi->htop1)
 		iounmap(hdmi->htop1);
-- 
1.8.1.5

[PATCH 11/12] fbdev: shmobile-hdmi: Convert to clk_prepare/unprepare

From: laurent.pinchart@ideasonboard.com (Laurent Pinchart)
Date: 2013-11-09 14:13:28

Hi Jean-Christophe,

On Thursday 31 October 2013 11:48:09 Jean-Christophe PLAGNIOL-VILLARD wrote:
On 23:49 Mon 28 Oct     , Laurent Pinchart wrote:
quoted
Turn clk_enable() and clk_disable() calls into clk_prepare_enable() and
clk_disable_unprepare() to get ready for the migration to the common
clock framework.

Cc: Jean-Christophe Plagniol-Villard <redacted>
Cc: Tomi Valkeinen <redacted>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <redacted>
Thank you. Could you please pick patches 11/12 and 12/12 up for v3.13 or v3.14 
?
quoted
Cc: linux-fbdev@vger.kernel.org
Signed-off-by: Laurent Pinchart
[off-list ref]
---

 drivers/video/sh_mobile_hdmi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/video/sh_mobile_hdmi.c
b/drivers/video/sh_mobile_hdmi.c index bfe4728..190145e 100644
--- a/drivers/video/sh_mobile_hdmi.c
+++ b/drivers/video/sh_mobile_hdmi.c
@@ -1326,7 +1326,7 @@ static int __init sh_hdmi_probe(struct
platform_device *pdev)> 
 		goto erate;
 	
 	}

-	ret = clk_enable(hdmi->hdmi_clk);
+	ret = clk_prepare_enable(hdmi->hdmi_clk);

 	if (ret < 0) {
 	
 		dev_err(hdmi->dev, "Cannot enable clock: %d\n", ret);
 		goto erate;
@@ -1404,7 +1404,7 @@ emap_htop1:
 emap:
 	release_mem_region(res->start, resource_size(res));
 
 ereqreg:
-	clk_disable(hdmi->hdmi_clk);
+	clk_disable_unprepare(hdmi->hdmi_clk);

 erate:
 	clk_put(hdmi->hdmi_clk);
 
 egetclk:
@@ -1427,7 +1427,7 @@ static int __exit sh_hdmi_remove(struct
platform_device *pdev)> 
 	cancel_delayed_work_sync(&hdmi->edid_work);
 	pm_runtime_put(&pdev->dev);
 	pm_runtime_disable(&pdev->dev);

-	clk_disable(hdmi->hdmi_clk);
+	clk_disable_unprepare(hdmi->hdmi_clk);

 	clk_put(hdmi->hdmi_clk);
 	if (hdmi->htop1)
 	
 		iounmap(hdmi->htop1);
-- 
Regards,

Laurent Pinchart

[PATCH 11/12] fbdev: shmobile-hdmi: Convert to clk_prepare/unprepare

From: Tomi Valkeinen <hidden>
Date: 2013-11-11 13:34:02

On 2013-11-09 16:13, Laurent Pinchart wrote:
Hi Jean-Christophe,

On Thursday 31 October 2013 11:48:09 Jean-Christophe PLAGNIOL-VILLARD wrote:
quoted
On 23:49 Mon 28 Oct     , Laurent Pinchart wrote:
quoted
Turn clk_enable() and clk_disable() calls into clk_prepare_enable() and
clk_disable_unprepare() to get ready for the migration to the common
clock framework.

Cc: Jean-Christophe Plagniol-Villard <redacted>
Cc: Tomi Valkeinen <redacted>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <redacted>
Thank you. Could you please pick patches 11/12 and 12/12 up for v3.13 or v3.14 
?
Thanks, picked both for 3.13.

 Tomi

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help