[06/15] video: mx1_camera: Use clk_prepare_enable/clk_disable_unprepare

Message ID 1337987696-31728-6-git-send-email-festevam@gmail.com (mailing list archive)
State Accepted, archived
Headers

Commit Message

Fabio Estevam May 25, 2012, 11:14 p.m. UTC
  From: Fabio Estevam <fabio.estevam@freescale.com>

Prepare the clock before enabling it.

Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: <linux-media@vger.kernel.org>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 drivers/media/video/mx1_camera.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
  

Comments

Sascha Hauer May 29, 2012, 9:20 a.m. UTC | #1
On Fri, May 25, 2012 at 08:14:47PM -0300, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
> 
> Prepare the clock before enabling it.
> 
> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> Cc: <linux-media@vger.kernel.org>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>

Acked-by: Sascha Hauer <s.hauer@pengutronix.de>


> ---
>  drivers/media/video/mx1_camera.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/video/mx1_camera.c b/drivers/media/video/mx1_camera.c
> index 4296a83..dc58084 100644
> --- a/drivers/media/video/mx1_camera.c
> +++ b/drivers/media/video/mx1_camera.c
> @@ -402,7 +402,7 @@ static void mx1_camera_activate(struct mx1_camera_dev *pcdev)
>  
>  	dev_dbg(pcdev->icd->parent, "Activate device\n");
>  
> -	clk_enable(pcdev->clk);
> +	clk_prepare_enable(pcdev->clk);
>  
>  	/* enable CSI before doing anything else */
>  	__raw_writel(csicr1, pcdev->base + CSICR1);
> @@ -421,7 +421,7 @@ static void mx1_camera_deactivate(struct mx1_camera_dev *pcdev)
>  	/* Disable all CSI interface */
>  	__raw_writel(0x00, pcdev->base + CSICR1);
>  
> -	clk_disable(pcdev->clk);
> +	clk_disable_unprepare(pcdev->clk);
>  }
>  
>  /*
> -- 
> 1.7.1
> 
>
  
Fabio Estevam June 6, 2012, 3:43 a.m. UTC | #2
Guennadi,

On Tue, May 29, 2012 at 6:20 AM, Sascha Hauer <s.hauer@pengutronix.de> wrote:
> On Fri, May 25, 2012 at 08:14:47PM -0300, Fabio Estevam wrote:
>> From: Fabio Estevam <fabio.estevam@freescale.com>
>>
>> Prepare the clock before enabling it.
>>
>> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
>> Cc: <linux-media@vger.kernel.org>
>> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
>
> Acked-by: Sascha Hauer <s.hauer@pengutronix.de>

Can patches 6, 7 and 8 be applied?
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
  
Guennadi Liakhovetski June 6, 2012, 4:04 p.m. UTC | #3
On Wed, 6 Jun 2012, Fabio Estevam wrote:

> Guennadi,
> 
> On Tue, May 29, 2012 at 6:20 AM, Sascha Hauer <s.hauer@pengutronix.de> wrote:
> > On Fri, May 25, 2012 at 08:14:47PM -0300, Fabio Estevam wrote:
> >> From: Fabio Estevam <fabio.estevam@freescale.com>
> >>
> >> Prepare the clock before enabling it.
> >>
> >> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> >> Cc: <linux-media@vger.kernel.org>
> >> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> >
> > Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
> 
> Can patches 6, 7 and 8 be applied?

Yes, I'll pick up #6 and 7. #8 is not for me - mx2_emmaprp is not an 
soc-camera driver, I'm not maintaining it. I understand, these patches are 
not really bug-fixes (is clk_prepare() a NOP on mx*?) and can wait until 
3.6? Or should they be considered correctness fixes and go into 3.5?

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
  
Fabio Estevam June 6, 2012, 4:37 p.m. UTC | #4
Hi Guennadi,

On Wed, Jun 6, 2012 at 1:04 PM, Guennadi Liakhovetski
<g.liakhovetski@gmx.de> wrote:

> Yes, I'll pick up #6 and 7. #8 is not for me - mx2_emmaprp is not an
> soc-camera driver, I'm not maintaining it. I understand, these patches are
> not really bug-fixes (is clk_prepare() a NOP on mx*?) and can wait until
> 3.6? Or should they be considered correctness fixes and go into 3.5?

On i.MX we have transitioned to the common clock framework and my
understanding is that we need the
clk_prepare_enable/clk_disable_unprepare changes now. I experienced
some kernel oops in some drivers that were not converted, so this
patch series aim to address the clock conversion for the remaining imx
drivers.

I think this is 3.5 material.

Sascha, would you agree?

Thanks,

Fabio Estevam
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
  

Patch

diff --git a/drivers/media/video/mx1_camera.c b/drivers/media/video/mx1_camera.c
index 4296a83..dc58084 100644
--- a/drivers/media/video/mx1_camera.c
+++ b/drivers/media/video/mx1_camera.c
@@ -402,7 +402,7 @@  static void mx1_camera_activate(struct mx1_camera_dev *pcdev)
 
 	dev_dbg(pcdev->icd->parent, "Activate device\n");
 
-	clk_enable(pcdev->clk);
+	clk_prepare_enable(pcdev->clk);
 
 	/* enable CSI before doing anything else */
 	__raw_writel(csicr1, pcdev->base + CSICR1);
@@ -421,7 +421,7 @@  static void mx1_camera_deactivate(struct mx1_camera_dev *pcdev)
 	/* Disable all CSI interface */
 	__raw_writel(0x00, pcdev->base + CSICR1);
 
-	clk_disable(pcdev->clk);
+	clk_disable_unprepare(pcdev->clk);
 }
 
 /*