All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/2] [media]: mx2_camera: Fix regression caused by clock conversion
@ 2012-10-05 21:53 ` Fabio Estevam
  0 siblings, 0 replies; 24+ messages in thread
From: Fabio Estevam @ 2012-10-05 21:53 UTC (permalink / raw)
  To: kernel
  Cc: g.liakhovetski, mchehab, linux-arm-kernel, linux-media,
	javier.martin, Fabio Estevam

Since mx27 transitioned to the commmon clock framework in 3.5, the correct way
to acquire the csi clock is to get csi_ahb and csi_per clocks separately.

By not doing so the camera sensor does not probe correctly:

soc-camera-pdrv soc-camera-pdrv.0: Probing soc-camera-pdrv.0
mx2-camera mx2-camera.0: Camera driver attached to camera 0
ov2640 0-0030: Product ID error fb:fb
mx2-camera mx2-camera.0: Camera driver detached from camera 0
mx2-camera mx2-camera.0: MX2 Camera (CSI) driver probed, clock frequency: 66500000

Adapt the mx2_camera driver to the new clock framework and make it functional
again.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 drivers/media/platform/soc_camera/mx2_camera.c |   42 ++++++++++++++++--------
 1 file changed, 29 insertions(+), 13 deletions(-)

diff --git a/drivers/media/platform/soc_camera/mx2_camera.c b/drivers/media/platform/soc_camera/mx2_camera.c
index 0c0dd74..2c67969 100644
--- a/drivers/media/platform/soc_camera/mx2_camera.c
+++ b/drivers/media/platform/soc_camera/mx2_camera.c
@@ -272,8 +272,9 @@ struct mx2_camera_dev {
 	struct device		*dev;
 	struct soc_camera_host	soc_host;
 	struct soc_camera_device *icd;
-	struct clk		*clk_csi, *clk_emma_ahb, *clk_emma_ipg;
-
+	struct clk		*clk_emma_ahb, *clk_emma_ipg;
+	struct clk		*clk_csi_ahb, *clk_csi_per;
+
 	unsigned int		irq_csi, irq_emma;
 	void __iomem		*base_csi, *base_emma;
 	unsigned long		base_dma;
@@ -435,7 +436,8 @@ static void mx2_camera_deactivate(struct mx2_camera_dev *pcdev)
 {
 	unsigned long flags;
 
-	clk_disable_unprepare(pcdev->clk_csi);
+	clk_disable_unprepare(pcdev->clk_csi_ahb);
+	clk_disable_unprepare(pcdev->clk_csi_per);
 	writel(0, pcdev->base_csi + CSICR1);
 	if (cpu_is_mx27()) {
 		writel(0, pcdev->base_emma + PRP_CNTL);
@@ -463,7 +465,11 @@ static int mx2_camera_add_device(struct soc_camera_device *icd)
 	if (pcdev->icd)
 		return -EBUSY;
 
-	ret = clk_prepare_enable(pcdev->clk_csi);
+	ret = clk_prepare_enable(pcdev->clk_csi_ahb);
+	if (ret < 0)
+		return ret;
+
+	ret = clk_prepare_enable(pcdev->clk_csi_per);
 	if (ret < 0)
 		return ret;
 
@@ -1736,13 +1742,21 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
 		goto exit;
 	}
 
-	pcdev->clk_csi = clk_get(&pdev->dev, "ahb");
-	if (IS_ERR(pcdev->clk_csi)) {
-		dev_err(&pdev->dev, "Could not get csi clock\n");
-		err = PTR_ERR(pcdev->clk_csi);
+	pcdev->clk_csi_ahb = clk_get(&pdev->dev, "ahb");
+	if (IS_ERR(pcdev->clk_csi_ahb)) {
+		dev_err(&pdev->dev, "Could not get csi ahb clock\n");
+		err = PTR_ERR(pcdev->clk_csi_ahb);
 		goto exit_kfree;
 	}
 
+	pcdev->clk_csi_per = clk_get(&pdev->dev, "per");
+	if (IS_ERR(pcdev->clk_csi_per)) {
+		dev_err(&pdev->dev, "Could not get csi per clock\n");
+		err = PTR_ERR(pcdev->clk_csi_per);
+		goto exit_kfree;
+	}
+
+
 	pcdev->res_csi = res_csi;
 	pcdev->pdata = pdev->dev.platform_data;
 	if (pcdev->pdata) {
@@ -1750,12 +1764,12 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
 
 		pcdev->platform_flags = pcdev->pdata->flags;
 
-		rate = clk_round_rate(pcdev->clk_csi, pcdev->pdata->clk * 2);
+		rate = clk_round_rate(pcdev->clk_csi_per, pcdev->pdata->clk * 2);
 		if (rate <= 0) {
 			err = -ENODEV;
 			goto exit_dma_free;
 		}
-		err = clk_set_rate(pcdev->clk_csi, rate);
+		err = clk_set_rate(pcdev->clk_csi_per, rate);
 		if (err < 0)
 			goto exit_dma_free;
 	}
@@ -1827,7 +1841,7 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
 		goto exit_free_emma;
 
 	dev_info(&pdev->dev, "MX2 Camera (CSI) driver probed, clock frequency: %ld\n",
-			clk_get_rate(pcdev->clk_csi));
+			clk_get_rate(pcdev->clk_csi_per));
 
 	return 0;
 
@@ -1851,7 +1865,8 @@ exit_iounmap:
 exit_release:
 	release_mem_region(res_csi->start, resource_size(res_csi));
 exit_dma_free:
-	clk_put(pcdev->clk_csi);
+	clk_put(pcdev->clk_csi_per);
+	clk_put(pcdev->clk_csi_ahb);
 exit_kfree:
 	kfree(pcdev);
 exit:
@@ -1865,7 +1880,8 @@ static int __devexit mx2_camera_remove(struct platform_device *pdev)
 			struct mx2_camera_dev, soc_host);
 	struct resource *res;
 
-	clk_put(pcdev->clk_csi);
+	clk_put(pcdev->clk_csi_per);
+	clk_put(pcdev->clk_csi_ahb);
 	if (cpu_is_mx25())
 		free_irq(pcdev->irq_csi, pcdev);
 	if (cpu_is_mx27())
-- 
1.7.9.5



^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 2/2] [media]: mx2_camera: Fix regression caused by clock conversion
@ 2012-10-05 21:53 ` Fabio Estevam
  0 siblings, 0 replies; 24+ messages in thread
From: Fabio Estevam @ 2012-10-05 21:53 UTC (permalink / raw)
  To: linux-arm-kernel

Since mx27 transitioned to the commmon clock framework in 3.5, the correct way
to acquire the csi clock is to get csi_ahb and csi_per clocks separately.

By not doing so the camera sensor does not probe correctly:

soc-camera-pdrv soc-camera-pdrv.0: Probing soc-camera-pdrv.0
mx2-camera mx2-camera.0: Camera driver attached to camera 0
ov2640 0-0030: Product ID error fb:fb
mx2-camera mx2-camera.0: Camera driver detached from camera 0
mx2-camera mx2-camera.0: MX2 Camera (CSI) driver probed, clock frequency: 66500000

Adapt the mx2_camera driver to the new clock framework and make it functional
again.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 drivers/media/platform/soc_camera/mx2_camera.c |   42 ++++++++++++++++--------
 1 file changed, 29 insertions(+), 13 deletions(-)

diff --git a/drivers/media/platform/soc_camera/mx2_camera.c b/drivers/media/platform/soc_camera/mx2_camera.c
index 0c0dd74..2c67969 100644
--- a/drivers/media/platform/soc_camera/mx2_camera.c
+++ b/drivers/media/platform/soc_camera/mx2_camera.c
@@ -272,8 +272,9 @@ struct mx2_camera_dev {
 	struct device		*dev;
 	struct soc_camera_host	soc_host;
 	struct soc_camera_device *icd;
-	struct clk		*clk_csi, *clk_emma_ahb, *clk_emma_ipg;
-
+	struct clk		*clk_emma_ahb, *clk_emma_ipg;
+	struct clk		*clk_csi_ahb, *clk_csi_per;
+
 	unsigned int		irq_csi, irq_emma;
 	void __iomem		*base_csi, *base_emma;
 	unsigned long		base_dma;
@@ -435,7 +436,8 @@ static void mx2_camera_deactivate(struct mx2_camera_dev *pcdev)
 {
 	unsigned long flags;
 
-	clk_disable_unprepare(pcdev->clk_csi);
+	clk_disable_unprepare(pcdev->clk_csi_ahb);
+	clk_disable_unprepare(pcdev->clk_csi_per);
 	writel(0, pcdev->base_csi + CSICR1);
 	if (cpu_is_mx27()) {
 		writel(0, pcdev->base_emma + PRP_CNTL);
@@ -463,7 +465,11 @@ static int mx2_camera_add_device(struct soc_camera_device *icd)
 	if (pcdev->icd)
 		return -EBUSY;
 
-	ret = clk_prepare_enable(pcdev->clk_csi);
+	ret = clk_prepare_enable(pcdev->clk_csi_ahb);
+	if (ret < 0)
+		return ret;
+
+	ret = clk_prepare_enable(pcdev->clk_csi_per);
 	if (ret < 0)
 		return ret;
 
@@ -1736,13 +1742,21 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
 		goto exit;
 	}
 
-	pcdev->clk_csi = clk_get(&pdev->dev, "ahb");
-	if (IS_ERR(pcdev->clk_csi)) {
-		dev_err(&pdev->dev, "Could not get csi clock\n");
-		err = PTR_ERR(pcdev->clk_csi);
+	pcdev->clk_csi_ahb = clk_get(&pdev->dev, "ahb");
+	if (IS_ERR(pcdev->clk_csi_ahb)) {
+		dev_err(&pdev->dev, "Could not get csi ahb clock\n");
+		err = PTR_ERR(pcdev->clk_csi_ahb);
 		goto exit_kfree;
 	}
 
+	pcdev->clk_csi_per = clk_get(&pdev->dev, "per");
+	if (IS_ERR(pcdev->clk_csi_per)) {
+		dev_err(&pdev->dev, "Could not get csi per clock\n");
+		err = PTR_ERR(pcdev->clk_csi_per);
+		goto exit_kfree;
+	}
+
+
 	pcdev->res_csi = res_csi;
 	pcdev->pdata = pdev->dev.platform_data;
 	if (pcdev->pdata) {
@@ -1750,12 +1764,12 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
 
 		pcdev->platform_flags = pcdev->pdata->flags;
 
-		rate = clk_round_rate(pcdev->clk_csi, pcdev->pdata->clk * 2);
+		rate = clk_round_rate(pcdev->clk_csi_per, pcdev->pdata->clk * 2);
 		if (rate <= 0) {
 			err = -ENODEV;
 			goto exit_dma_free;
 		}
-		err = clk_set_rate(pcdev->clk_csi, rate);
+		err = clk_set_rate(pcdev->clk_csi_per, rate);
 		if (err < 0)
 			goto exit_dma_free;
 	}
@@ -1827,7 +1841,7 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
 		goto exit_free_emma;
 
 	dev_info(&pdev->dev, "MX2 Camera (CSI) driver probed, clock frequency: %ld\n",
-			clk_get_rate(pcdev->clk_csi));
+			clk_get_rate(pcdev->clk_csi_per));
 
 	return 0;
 
@@ -1851,7 +1865,8 @@ exit_iounmap:
 exit_release:
 	release_mem_region(res_csi->start, resource_size(res_csi));
 exit_dma_free:
-	clk_put(pcdev->clk_csi);
+	clk_put(pcdev->clk_csi_per);
+	clk_put(pcdev->clk_csi_ahb);
 exit_kfree:
 	kfree(pcdev);
 exit:
@@ -1865,7 +1880,8 @@ static int __devexit mx2_camera_remove(struct platform_device *pdev)
 			struct mx2_camera_dev, soc_host);
 	struct resource *res;
 
-	clk_put(pcdev->clk_csi);
+	clk_put(pcdev->clk_csi_per);
+	clk_put(pcdev->clk_csi_ahb);
 	if (cpu_is_mx25())
 		free_irq(pcdev->irq_csi, pcdev);
 	if (cpu_is_mx27())
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 1/2] ARM: clk-imx27: Add missing clock for mx2-camera
  2012-10-05 21:53 ` Fabio Estevam
@ 2012-10-05 21:53   ` Fabio Estevam
  -1 siblings, 0 replies; 24+ messages in thread
From: Fabio Estevam @ 2012-10-05 21:53 UTC (permalink / raw)
  To: kernel
  Cc: g.liakhovetski, mchehab, linux-arm-kernel, linux-media,
	javier.martin, Fabio Estevam

During the clock conversion for mx27 the "per4_gate" clock was missed to get
registered as a dependency of mx2-camera driver.

In the old mx27 clock driver we used to have:

DEFINE_CLOCK1(csi_clk, 0, NULL, 0, parent, &csi_clk1, &per4_clk);

,so does the same in the new clock driver.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 arch/arm/mach-imx/clk-imx27.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-imx/clk-imx27.c b/arch/arm/mach-imx/clk-imx27.c
index 3b6b640..5ef0f08 100644
--- a/arch/arm/mach-imx/clk-imx27.c
+++ b/arch/arm/mach-imx/clk-imx27.c
@@ -224,6 +224,7 @@ int __init mx27_clocks_init(unsigned long fref)
 	clk_register_clkdev(clk[lcdc_ipg_gate], "ipg", "imx-fb.0");
 	clk_register_clkdev(clk[lcdc_ahb_gate], "ahb", "imx-fb.0");
 	clk_register_clkdev(clk[csi_ahb_gate], "ahb", "mx2-camera.0");
+	clk_register_clkdev(clk[per4_gate], "per", "mx2-camera.0");
 	clk_register_clkdev(clk[usb_div], "per", "fsl-usb2-udc");
 	clk_register_clkdev(clk[usb_ipg_gate], "ipg", "fsl-usb2-udc");
 	clk_register_clkdev(clk[usb_ahb_gate], "ahb", "fsl-usb2-udc");
-- 
1.7.9.5



^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 1/2] ARM: clk-imx27: Add missing clock for mx2-camera
@ 2012-10-05 21:53   ` Fabio Estevam
  0 siblings, 0 replies; 24+ messages in thread
From: Fabio Estevam @ 2012-10-05 21:53 UTC (permalink / raw)
  To: linux-arm-kernel

During the clock conversion for mx27 the "per4_gate" clock was missed to get
registered as a dependency of mx2-camera driver.

In the old mx27 clock driver we used to have:

DEFINE_CLOCK1(csi_clk, 0, NULL, 0, parent, &csi_clk1, &per4_clk);

,so does the same in the new clock driver.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 arch/arm/mach-imx/clk-imx27.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-imx/clk-imx27.c b/arch/arm/mach-imx/clk-imx27.c
index 3b6b640..5ef0f08 100644
--- a/arch/arm/mach-imx/clk-imx27.c
+++ b/arch/arm/mach-imx/clk-imx27.c
@@ -224,6 +224,7 @@ int __init mx27_clocks_init(unsigned long fref)
 	clk_register_clkdev(clk[lcdc_ipg_gate], "ipg", "imx-fb.0");
 	clk_register_clkdev(clk[lcdc_ahb_gate], "ahb", "imx-fb.0");
 	clk_register_clkdev(clk[csi_ahb_gate], "ahb", "mx2-camera.0");
+	clk_register_clkdev(clk[per4_gate], "per", "mx2-camera.0");
 	clk_register_clkdev(clk[usb_div], "per", "fsl-usb2-udc");
 	clk_register_clkdev(clk[usb_ipg_gate], "ipg", "fsl-usb2-udc");
 	clk_register_clkdev(clk[usb_ahb_gate], "ahb", "fsl-usb2-udc");
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* Re: [PATCH 2/2] [media]: mx2_camera: Fix regression caused by clock conversion
  2012-10-05 21:53 ` Fabio Estevam
@ 2012-10-08  9:09   ` Guennadi Liakhovetski
  -1 siblings, 0 replies; 24+ messages in thread
From: Guennadi Liakhovetski @ 2012-10-08  9:09 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: kernel, mchehab, linux-arm-kernel, linux-media, javier.martin

Hi Fabio

On Fri, 5 Oct 2012, Fabio Estevam wrote:

> Since mx27 transitioned to the commmon clock framework in 3.5, the correct way
> to acquire the csi clock is to get csi_ahb and csi_per clocks separately.
> 
> By not doing so the camera sensor does not probe correctly:
> 
> soc-camera-pdrv soc-camera-pdrv.0: Probing soc-camera-pdrv.0
> mx2-camera mx2-camera.0: Camera driver attached to camera 0
> ov2640 0-0030: Product ID error fb:fb
> mx2-camera mx2-camera.0: Camera driver detached from camera 0
> mx2-camera mx2-camera.0: MX2 Camera (CSI) driver probed, clock frequency: 66500000
> 
> Adapt the mx2_camera driver to the new clock framework and make it functional
> again.

Do I understand it right, that since the driver is currently broken, it 
doesn't matter any more in which order these two patches get applied, so, 
we can push them via different trees - ARM and media?

Thanks
Guennadi

> 
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
>  drivers/media/platform/soc_camera/mx2_camera.c |   42 ++++++++++++++++--------
>  1 file changed, 29 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/media/platform/soc_camera/mx2_camera.c b/drivers/media/platform/soc_camera/mx2_camera.c
> index 0c0dd74..2c67969 100644
> --- a/drivers/media/platform/soc_camera/mx2_camera.c
> +++ b/drivers/media/platform/soc_camera/mx2_camera.c
> @@ -272,8 +272,9 @@ struct mx2_camera_dev {
>  	struct device		*dev;
>  	struct soc_camera_host	soc_host;
>  	struct soc_camera_device *icd;
> -	struct clk		*clk_csi, *clk_emma_ahb, *clk_emma_ipg;
> -
> +	struct clk		*clk_emma_ahb, *clk_emma_ipg;
> +	struct clk		*clk_csi_ahb, *clk_csi_per;
> +
>  	unsigned int		irq_csi, irq_emma;
>  	void __iomem		*base_csi, *base_emma;
>  	unsigned long		base_dma;
> @@ -435,7 +436,8 @@ static void mx2_camera_deactivate(struct mx2_camera_dev *pcdev)
>  {
>  	unsigned long flags;
>  
> -	clk_disable_unprepare(pcdev->clk_csi);
> +	clk_disable_unprepare(pcdev->clk_csi_ahb);
> +	clk_disable_unprepare(pcdev->clk_csi_per);
>  	writel(0, pcdev->base_csi + CSICR1);
>  	if (cpu_is_mx27()) {
>  		writel(0, pcdev->base_emma + PRP_CNTL);
> @@ -463,7 +465,11 @@ static int mx2_camera_add_device(struct soc_camera_device *icd)
>  	if (pcdev->icd)
>  		return -EBUSY;
>  
> -	ret = clk_prepare_enable(pcdev->clk_csi);
> +	ret = clk_prepare_enable(pcdev->clk_csi_ahb);
> +	if (ret < 0)
> +		return ret;
> +
> +	ret = clk_prepare_enable(pcdev->clk_csi_per);
>  	if (ret < 0)
>  		return ret;
>  
> @@ -1736,13 +1742,21 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
>  		goto exit;
>  	}
>  
> -	pcdev->clk_csi = clk_get(&pdev->dev, "ahb");
> -	if (IS_ERR(pcdev->clk_csi)) {
> -		dev_err(&pdev->dev, "Could not get csi clock\n");
> -		err = PTR_ERR(pcdev->clk_csi);
> +	pcdev->clk_csi_ahb = clk_get(&pdev->dev, "ahb");
> +	if (IS_ERR(pcdev->clk_csi_ahb)) {
> +		dev_err(&pdev->dev, "Could not get csi ahb clock\n");
> +		err = PTR_ERR(pcdev->clk_csi_ahb);
>  		goto exit_kfree;
>  	}
>  
> +	pcdev->clk_csi_per = clk_get(&pdev->dev, "per");
> +	if (IS_ERR(pcdev->clk_csi_per)) {
> +		dev_err(&pdev->dev, "Could not get csi per clock\n");
> +		err = PTR_ERR(pcdev->clk_csi_per);
> +		goto exit_kfree;
> +	}
> +
> +
>  	pcdev->res_csi = res_csi;
>  	pcdev->pdata = pdev->dev.platform_data;
>  	if (pcdev->pdata) {
> @@ -1750,12 +1764,12 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
>  
>  		pcdev->platform_flags = pcdev->pdata->flags;
>  
> -		rate = clk_round_rate(pcdev->clk_csi, pcdev->pdata->clk * 2);
> +		rate = clk_round_rate(pcdev->clk_csi_per, pcdev->pdata->clk * 2);
>  		if (rate <= 0) {
>  			err = -ENODEV;
>  			goto exit_dma_free;
>  		}
> -		err = clk_set_rate(pcdev->clk_csi, rate);
> +		err = clk_set_rate(pcdev->clk_csi_per, rate);
>  		if (err < 0)
>  			goto exit_dma_free;
>  	}
> @@ -1827,7 +1841,7 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
>  		goto exit_free_emma;
>  
>  	dev_info(&pdev->dev, "MX2 Camera (CSI) driver probed, clock frequency: %ld\n",
> -			clk_get_rate(pcdev->clk_csi));
> +			clk_get_rate(pcdev->clk_csi_per));
>  
>  	return 0;
>  
> @@ -1851,7 +1865,8 @@ exit_iounmap:
>  exit_release:
>  	release_mem_region(res_csi->start, resource_size(res_csi));
>  exit_dma_free:
> -	clk_put(pcdev->clk_csi);
> +	clk_put(pcdev->clk_csi_per);
> +	clk_put(pcdev->clk_csi_ahb);
>  exit_kfree:
>  	kfree(pcdev);
>  exit:
> @@ -1865,7 +1880,8 @@ static int __devexit mx2_camera_remove(struct platform_device *pdev)
>  			struct mx2_camera_dev, soc_host);
>  	struct resource *res;
>  
> -	clk_put(pcdev->clk_csi);
> +	clk_put(pcdev->clk_csi_per);
> +	clk_put(pcdev->clk_csi_ahb);
>  	if (cpu_is_mx25())
>  		free_irq(pcdev->irq_csi, pcdev);
>  	if (cpu_is_mx27())
> -- 
> 1.7.9.5
> 
> 

---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH 2/2] [media]: mx2_camera: Fix regression caused by clock conversion
@ 2012-10-08  9:09   ` Guennadi Liakhovetski
  0 siblings, 0 replies; 24+ messages in thread
From: Guennadi Liakhovetski @ 2012-10-08  9:09 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Fabio

On Fri, 5 Oct 2012, Fabio Estevam wrote:

> Since mx27 transitioned to the commmon clock framework in 3.5, the correct way
> to acquire the csi clock is to get csi_ahb and csi_per clocks separately.
> 
> By not doing so the camera sensor does not probe correctly:
> 
> soc-camera-pdrv soc-camera-pdrv.0: Probing soc-camera-pdrv.0
> mx2-camera mx2-camera.0: Camera driver attached to camera 0
> ov2640 0-0030: Product ID error fb:fb
> mx2-camera mx2-camera.0: Camera driver detached from camera 0
> mx2-camera mx2-camera.0: MX2 Camera (CSI) driver probed, clock frequency: 66500000
> 
> Adapt the mx2_camera driver to the new clock framework and make it functional
> again.

Do I understand it right, that since the driver is currently broken, it 
doesn't matter any more in which order these two patches get applied, so, 
we can push them via different trees - ARM and media?

Thanks
Guennadi

> 
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
>  drivers/media/platform/soc_camera/mx2_camera.c |   42 ++++++++++++++++--------
>  1 file changed, 29 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/media/platform/soc_camera/mx2_camera.c b/drivers/media/platform/soc_camera/mx2_camera.c
> index 0c0dd74..2c67969 100644
> --- a/drivers/media/platform/soc_camera/mx2_camera.c
> +++ b/drivers/media/platform/soc_camera/mx2_camera.c
> @@ -272,8 +272,9 @@ struct mx2_camera_dev {
>  	struct device		*dev;
>  	struct soc_camera_host	soc_host;
>  	struct soc_camera_device *icd;
> -	struct clk		*clk_csi, *clk_emma_ahb, *clk_emma_ipg;
> -
> +	struct clk		*clk_emma_ahb, *clk_emma_ipg;
> +	struct clk		*clk_csi_ahb, *clk_csi_per;
> +
>  	unsigned int		irq_csi, irq_emma;
>  	void __iomem		*base_csi, *base_emma;
>  	unsigned long		base_dma;
> @@ -435,7 +436,8 @@ static void mx2_camera_deactivate(struct mx2_camera_dev *pcdev)
>  {
>  	unsigned long flags;
>  
> -	clk_disable_unprepare(pcdev->clk_csi);
> +	clk_disable_unprepare(pcdev->clk_csi_ahb);
> +	clk_disable_unprepare(pcdev->clk_csi_per);
>  	writel(0, pcdev->base_csi + CSICR1);
>  	if (cpu_is_mx27()) {
>  		writel(0, pcdev->base_emma + PRP_CNTL);
> @@ -463,7 +465,11 @@ static int mx2_camera_add_device(struct soc_camera_device *icd)
>  	if (pcdev->icd)
>  		return -EBUSY;
>  
> -	ret = clk_prepare_enable(pcdev->clk_csi);
> +	ret = clk_prepare_enable(pcdev->clk_csi_ahb);
> +	if (ret < 0)
> +		return ret;
> +
> +	ret = clk_prepare_enable(pcdev->clk_csi_per);
>  	if (ret < 0)
>  		return ret;
>  
> @@ -1736,13 +1742,21 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
>  		goto exit;
>  	}
>  
> -	pcdev->clk_csi = clk_get(&pdev->dev, "ahb");
> -	if (IS_ERR(pcdev->clk_csi)) {
> -		dev_err(&pdev->dev, "Could not get csi clock\n");
> -		err = PTR_ERR(pcdev->clk_csi);
> +	pcdev->clk_csi_ahb = clk_get(&pdev->dev, "ahb");
> +	if (IS_ERR(pcdev->clk_csi_ahb)) {
> +		dev_err(&pdev->dev, "Could not get csi ahb clock\n");
> +		err = PTR_ERR(pcdev->clk_csi_ahb);
>  		goto exit_kfree;
>  	}
>  
> +	pcdev->clk_csi_per = clk_get(&pdev->dev, "per");
> +	if (IS_ERR(pcdev->clk_csi_per)) {
> +		dev_err(&pdev->dev, "Could not get csi per clock\n");
> +		err = PTR_ERR(pcdev->clk_csi_per);
> +		goto exit_kfree;
> +	}
> +
> +
>  	pcdev->res_csi = res_csi;
>  	pcdev->pdata = pdev->dev.platform_data;
>  	if (pcdev->pdata) {
> @@ -1750,12 +1764,12 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
>  
>  		pcdev->platform_flags = pcdev->pdata->flags;
>  
> -		rate = clk_round_rate(pcdev->clk_csi, pcdev->pdata->clk * 2);
> +		rate = clk_round_rate(pcdev->clk_csi_per, pcdev->pdata->clk * 2);
>  		if (rate <= 0) {
>  			err = -ENODEV;
>  			goto exit_dma_free;
>  		}
> -		err = clk_set_rate(pcdev->clk_csi, rate);
> +		err = clk_set_rate(pcdev->clk_csi_per, rate);
>  		if (err < 0)
>  			goto exit_dma_free;
>  	}
> @@ -1827,7 +1841,7 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
>  		goto exit_free_emma;
>  
>  	dev_info(&pdev->dev, "MX2 Camera (CSI) driver probed, clock frequency: %ld\n",
> -			clk_get_rate(pcdev->clk_csi));
> +			clk_get_rate(pcdev->clk_csi_per));
>  
>  	return 0;
>  
> @@ -1851,7 +1865,8 @@ exit_iounmap:
>  exit_release:
>  	release_mem_region(res_csi->start, resource_size(res_csi));
>  exit_dma_free:
> -	clk_put(pcdev->clk_csi);
> +	clk_put(pcdev->clk_csi_per);
> +	clk_put(pcdev->clk_csi_ahb);
>  exit_kfree:
>  	kfree(pcdev);
>  exit:
> @@ -1865,7 +1880,8 @@ static int __devexit mx2_camera_remove(struct platform_device *pdev)
>  			struct mx2_camera_dev, soc_host);
>  	struct resource *res;
>  
> -	clk_put(pcdev->clk_csi);
> +	clk_put(pcdev->clk_csi_per);
> +	clk_put(pcdev->clk_csi_ahb);
>  	if (cpu_is_mx25())
>  		free_irq(pcdev->irq_csi, pcdev);
>  	if (cpu_is_mx27())
> -- 
> 1.7.9.5
> 
> 

---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 2/2] [media]: mx2_camera: Fix regression caused by clock conversion
  2012-10-08  9:09   ` Guennadi Liakhovetski
@ 2012-10-08  9:18     ` javier Martin
  -1 siblings, 0 replies; 24+ messages in thread
From: javier Martin @ 2012-10-08  9:18 UTC (permalink / raw)
  To: Guennadi Liakhovetski
  Cc: Fabio Estevam, kernel, mchehab, linux-arm-kernel, linux-media

On 8 October 2012 11:09, Guennadi Liakhovetski <g.liakhovetski@gmx.de> wrote:
> Hi Fabio
>
> On Fri, 5 Oct 2012, Fabio Estevam wrote:
>
>> Since mx27 transitioned to the commmon clock framework in 3.5, the correct way
>> to acquire the csi clock is to get csi_ahb and csi_per clocks separately.
>>
>> By not doing so the camera sensor does not probe correctly:
>>
>> soc-camera-pdrv soc-camera-pdrv.0: Probing soc-camera-pdrv.0
>> mx2-camera mx2-camera.0: Camera driver attached to camera 0
>> ov2640 0-0030: Product ID error fb:fb
>> mx2-camera mx2-camera.0: Camera driver detached from camera 0
>> mx2-camera mx2-camera.0: MX2 Camera (CSI) driver probed, clock frequency: 66500000
>>
>> Adapt the mx2_camera driver to the new clock framework and make it functional
>> again.
>
> Do I understand it right, that since the driver is currently broken, it
> doesn't matter any more in which order these two patches get applied, so,
> we can push them via different trees - ARM and media?
>
> Thanks
> Guennadi
>

Please,
hold on a couple of days before merging this one.

This driver is currently working in our Visstrim M10 platform without
this patch and I need to test it to confirm whether it breaks
something or not.

Regards.
-- 
Javier Martin
Vista Silicon S.L.
CDTUC - FASE C - Oficina S-345
Avda de los Castros s/n
39005- Santander. Cantabria. Spain
+34 942 25 32 60
www.vista-silicon.com

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH 2/2] [media]: mx2_camera: Fix regression caused by clock conversion
@ 2012-10-08  9:18     ` javier Martin
  0 siblings, 0 replies; 24+ messages in thread
From: javier Martin @ 2012-10-08  9:18 UTC (permalink / raw)
  To: linux-arm-kernel

On 8 October 2012 11:09, Guennadi Liakhovetski <g.liakhovetski@gmx.de> wrote:
> Hi Fabio
>
> On Fri, 5 Oct 2012, Fabio Estevam wrote:
>
>> Since mx27 transitioned to the commmon clock framework in 3.5, the correct way
>> to acquire the csi clock is to get csi_ahb and csi_per clocks separately.
>>
>> By not doing so the camera sensor does not probe correctly:
>>
>> soc-camera-pdrv soc-camera-pdrv.0: Probing soc-camera-pdrv.0
>> mx2-camera mx2-camera.0: Camera driver attached to camera 0
>> ov2640 0-0030: Product ID error fb:fb
>> mx2-camera mx2-camera.0: Camera driver detached from camera 0
>> mx2-camera mx2-camera.0: MX2 Camera (CSI) driver probed, clock frequency: 66500000
>>
>> Adapt the mx2_camera driver to the new clock framework and make it functional
>> again.
>
> Do I understand it right, that since the driver is currently broken, it
> doesn't matter any more in which order these two patches get applied, so,
> we can push them via different trees - ARM and media?
>
> Thanks
> Guennadi
>

Please,
hold on a couple of days before merging this one.

This driver is currently working in our Visstrim M10 platform without
this patch and I need to test it to confirm whether it breaks
something or not.

Regards.
-- 
Javier Martin
Vista Silicon S.L.
CDTUC - FASE C - Oficina S-345
Avda de los Castros s/n
39005- Santander. Cantabria. Spain
+34 942 25 32 60
www.vista-silicon.com

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 2/2] [media]: mx2_camera: Fix regression caused by clock conversion
  2012-10-05 21:53 ` Fabio Estevam
@ 2012-10-08 10:04   ` Gaëtan Carlier
  -1 siblings, 0 replies; 24+ messages in thread
From: Gaëtan Carlier @ 2012-10-08 10:04 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: kernel, g.liakhovetski, mchehab, linux-arm-kernel, linux-media,
	javier.martin

Hi,
On 10/05/2012 11:53 PM, Fabio Estevam wrote:
> Since mx27 transitioned to the commmon clock framework in 3.5, the correct way
> to acquire the csi clock is to get csi_ahb and csi_per clocks separately.
>
> By not doing so the camera sensor does not probe correctly:
>
> soc-camera-pdrv soc-camera-pdrv.0: Probing soc-camera-pdrv.0
> mx2-camera mx2-camera.0: Camera driver attached to camera 0
> ov2640 0-0030: Product ID error fb:fb
> mx2-camera mx2-camera.0: Camera driver detached from camera 0
> mx2-camera mx2-camera.0: MX2 Camera (CSI) driver probed, clock frequency: 66500000
>
> Adapt the mx2_camera driver to the new clock framework and make it functional
> again.
>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
>   drivers/media/platform/soc_camera/mx2_camera.c |   42 ++++++++++++++++--------
>   1 file changed, 29 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/media/platform/soc_camera/mx2_camera.c b/drivers/media/platform/soc_camera/mx2_camera.c
> index 0c0dd74..2c67969 100644
> --- a/drivers/media/platform/soc_camera/mx2_camera.c
> +++ b/drivers/media/platform/soc_camera/mx2_camera.c
> @@ -272,8 +272,9 @@ struct mx2_camera_dev {
>   	struct device		*dev;
>   	struct soc_camera_host	soc_host;
>   	struct soc_camera_device *icd;
> -	struct clk		*clk_csi, *clk_emma_ahb, *clk_emma_ipg;
> -
> +	struct clk		*clk_emma_ahb, *clk_emma_ipg;
> +	struct clk		*clk_csi_ahb, *clk_csi_per;
> +
>   	unsigned int		irq_csi, irq_emma;
>   	void __iomem		*base_csi, *base_emma;
>   	unsigned long		base_dma;
> @@ -435,7 +436,8 @@ static void mx2_camera_deactivate(struct mx2_camera_dev *pcdev)
>   {
>   	unsigned long flags;
>
> -	clk_disable_unprepare(pcdev->clk_csi);
> +	clk_disable_unprepare(pcdev->clk_csi_ahb);
> +	clk_disable_unprepare(pcdev->clk_csi_per);
>   	writel(0, pcdev->base_csi + CSICR1);
>   	if (cpu_is_mx27()) {
>   		writel(0, pcdev->base_emma + PRP_CNTL);
> @@ -463,7 +465,11 @@ static int mx2_camera_add_device(struct soc_camera_device *icd)
>   	if (pcdev->icd)
>   		return -EBUSY;
>
> -	ret = clk_prepare_enable(pcdev->clk_csi);
> +	ret = clk_prepare_enable(pcdev->clk_csi_ahb);
> +	if (ret < 0)
> +		return ret;
> +
> +	ret = clk_prepare_enable(pcdev->clk_csi_per);
>   	if (ret < 0)
>   		return ret;
>
> @@ -1736,13 +1742,21 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
>   		goto exit;
>   	}
>
> -	pcdev->clk_csi = clk_get(&pdev->dev, "ahb");
> -	if (IS_ERR(pcdev->clk_csi)) {
> -		dev_err(&pdev->dev, "Could not get csi clock\n");
> -		err = PTR_ERR(pcdev->clk_csi);
> +	pcdev->clk_csi_ahb = clk_get(&pdev->dev, "ahb");
> +	if (IS_ERR(pcdev->clk_csi_ahb)) {
> +		dev_err(&pdev->dev, "Could not get csi ahb clock\n");
> +		err = PTR_ERR(pcdev->clk_csi_ahb);
>   		goto exit_kfree;
>   	}
>
> +	pcdev->clk_csi_per = clk_get(&pdev->dev, "per");
> +	if (IS_ERR(pcdev->clk_csi_per)) {
> +		dev_err(&pdev->dev, "Could not get csi per clock\n");
> +		err = PTR_ERR(pcdev->clk_csi_per);
> +		goto exit_kfree;
> +	}
> +
> +
>   	pcdev->res_csi = res_csi;
>   	pcdev->pdata = pdev->dev.platform_data;
>   	if (pcdev->pdata) {
> @@ -1750,12 +1764,12 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
>
>   		pcdev->platform_flags = pcdev->pdata->flags;
>
> -		rate = clk_round_rate(pcdev->clk_csi, pcdev->pdata->clk * 2);
> +		rate = clk_round_rate(pcdev->clk_csi_per, pcdev->pdata->clk * 2);
>   		if (rate <= 0) {
>   			err = -ENODEV;
>   			goto exit_dma_free;
>   		}
> -		err = clk_set_rate(pcdev->clk_csi, rate);
> +		err = clk_set_rate(pcdev->clk_csi_per, rate);
>   		if (err < 0)
>   			goto exit_dma_free;
>   	}
> @@ -1827,7 +1841,7 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
>   		goto exit_free_emma;
>
>   	dev_info(&pdev->dev, "MX2 Camera (CSI) driver probed, clock frequency: %ld\n",
> -			clk_get_rate(pcdev->clk_csi));
> +			clk_get_rate(pcdev->clk_csi_per));
>
>   	return 0;
>
> @@ -1851,7 +1865,8 @@ exit_iounmap:
>   exit_release:
>   	release_mem_region(res_csi->start, resource_size(res_csi));
>   exit_dma_free:
> -	clk_put(pcdev->clk_csi);
> +	clk_put(pcdev->clk_csi_per);
> +	clk_put(pcdev->clk_csi_ahb);
>   exit_kfree:
>   	kfree(pcdev);
>   exit:
> @@ -1865,7 +1880,8 @@ static int __devexit mx2_camera_remove(struct platform_device *pdev)
>   			struct mx2_camera_dev, soc_host);
>   	struct resource *res;
>
> -	clk_put(pcdev->clk_csi);
> +	clk_put(pcdev->clk_csi_per);
> +	clk_put(pcdev->clk_csi_ahb);
>   	if (cpu_is_mx25())
>   		free_irq(pcdev->irq_csi, pcdev);
>   	if (cpu_is_mx27())
>

This patch does not apply on linux-next-20121008. I suppose that 
linux-media development branch is needed. How can I put linux-media 
branch on top of linux-next using git ?
Is the linux-media branch is always compatible with linux-next ?
Thanks a lot,
Gaëtan Carlier.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH 2/2] [media]: mx2_camera: Fix regression caused by clock conversion
@ 2012-10-08 10:04   ` Gaëtan Carlier
  0 siblings, 0 replies; 24+ messages in thread
From: Gaëtan Carlier @ 2012-10-08 10:04 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,
On 10/05/2012 11:53 PM, Fabio Estevam wrote:
> Since mx27 transitioned to the commmon clock framework in 3.5, the correct way
> to acquire the csi clock is to get csi_ahb and csi_per clocks separately.
>
> By not doing so the camera sensor does not probe correctly:
>
> soc-camera-pdrv soc-camera-pdrv.0: Probing soc-camera-pdrv.0
> mx2-camera mx2-camera.0: Camera driver attached to camera 0
> ov2640 0-0030: Product ID error fb:fb
> mx2-camera mx2-camera.0: Camera driver detached from camera 0
> mx2-camera mx2-camera.0: MX2 Camera (CSI) driver probed, clock frequency: 66500000
>
> Adapt the mx2_camera driver to the new clock framework and make it functional
> again.
>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
>   drivers/media/platform/soc_camera/mx2_camera.c |   42 ++++++++++++++++--------
>   1 file changed, 29 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/media/platform/soc_camera/mx2_camera.c b/drivers/media/platform/soc_camera/mx2_camera.c
> index 0c0dd74..2c67969 100644
> --- a/drivers/media/platform/soc_camera/mx2_camera.c
> +++ b/drivers/media/platform/soc_camera/mx2_camera.c
> @@ -272,8 +272,9 @@ struct mx2_camera_dev {
>   	struct device		*dev;
>   	struct soc_camera_host	soc_host;
>   	struct soc_camera_device *icd;
> -	struct clk		*clk_csi, *clk_emma_ahb, *clk_emma_ipg;
> -
> +	struct clk		*clk_emma_ahb, *clk_emma_ipg;
> +	struct clk		*clk_csi_ahb, *clk_csi_per;
> +
>   	unsigned int		irq_csi, irq_emma;
>   	void __iomem		*base_csi, *base_emma;
>   	unsigned long		base_dma;
> @@ -435,7 +436,8 @@ static void mx2_camera_deactivate(struct mx2_camera_dev *pcdev)
>   {
>   	unsigned long flags;
>
> -	clk_disable_unprepare(pcdev->clk_csi);
> +	clk_disable_unprepare(pcdev->clk_csi_ahb);
> +	clk_disable_unprepare(pcdev->clk_csi_per);
>   	writel(0, pcdev->base_csi + CSICR1);
>   	if (cpu_is_mx27()) {
>   		writel(0, pcdev->base_emma + PRP_CNTL);
> @@ -463,7 +465,11 @@ static int mx2_camera_add_device(struct soc_camera_device *icd)
>   	if (pcdev->icd)
>   		return -EBUSY;
>
> -	ret = clk_prepare_enable(pcdev->clk_csi);
> +	ret = clk_prepare_enable(pcdev->clk_csi_ahb);
> +	if (ret < 0)
> +		return ret;
> +
> +	ret = clk_prepare_enable(pcdev->clk_csi_per);
>   	if (ret < 0)
>   		return ret;
>
> @@ -1736,13 +1742,21 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
>   		goto exit;
>   	}
>
> -	pcdev->clk_csi = clk_get(&pdev->dev, "ahb");
> -	if (IS_ERR(pcdev->clk_csi)) {
> -		dev_err(&pdev->dev, "Could not get csi clock\n");
> -		err = PTR_ERR(pcdev->clk_csi);
> +	pcdev->clk_csi_ahb = clk_get(&pdev->dev, "ahb");
> +	if (IS_ERR(pcdev->clk_csi_ahb)) {
> +		dev_err(&pdev->dev, "Could not get csi ahb clock\n");
> +		err = PTR_ERR(pcdev->clk_csi_ahb);
>   		goto exit_kfree;
>   	}
>
> +	pcdev->clk_csi_per = clk_get(&pdev->dev, "per");
> +	if (IS_ERR(pcdev->clk_csi_per)) {
> +		dev_err(&pdev->dev, "Could not get csi per clock\n");
> +		err = PTR_ERR(pcdev->clk_csi_per);
> +		goto exit_kfree;
> +	}
> +
> +
>   	pcdev->res_csi = res_csi;
>   	pcdev->pdata = pdev->dev.platform_data;
>   	if (pcdev->pdata) {
> @@ -1750,12 +1764,12 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
>
>   		pcdev->platform_flags = pcdev->pdata->flags;
>
> -		rate = clk_round_rate(pcdev->clk_csi, pcdev->pdata->clk * 2);
> +		rate = clk_round_rate(pcdev->clk_csi_per, pcdev->pdata->clk * 2);
>   		if (rate <= 0) {
>   			err = -ENODEV;
>   			goto exit_dma_free;
>   		}
> -		err = clk_set_rate(pcdev->clk_csi, rate);
> +		err = clk_set_rate(pcdev->clk_csi_per, rate);
>   		if (err < 0)
>   			goto exit_dma_free;
>   	}
> @@ -1827,7 +1841,7 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
>   		goto exit_free_emma;
>
>   	dev_info(&pdev->dev, "MX2 Camera (CSI) driver probed, clock frequency: %ld\n",
> -			clk_get_rate(pcdev->clk_csi));
> +			clk_get_rate(pcdev->clk_csi_per));
>
>   	return 0;
>
> @@ -1851,7 +1865,8 @@ exit_iounmap:
>   exit_release:
>   	release_mem_region(res_csi->start, resource_size(res_csi));
>   exit_dma_free:
> -	clk_put(pcdev->clk_csi);
> +	clk_put(pcdev->clk_csi_per);
> +	clk_put(pcdev->clk_csi_ahb);
>   exit_kfree:
>   	kfree(pcdev);
>   exit:
> @@ -1865,7 +1880,8 @@ static int __devexit mx2_camera_remove(struct platform_device *pdev)
>   			struct mx2_camera_dev, soc_host);
>   	struct resource *res;
>
> -	clk_put(pcdev->clk_csi);
> +	clk_put(pcdev->clk_csi_per);
> +	clk_put(pcdev->clk_csi_ahb);
>   	if (cpu_is_mx25())
>   		free_irq(pcdev->irq_csi, pcdev);
>   	if (cpu_is_mx27())
>

This patch does not apply on linux-next-20121008. I suppose that 
linux-media development branch is needed. How can I put linux-media 
branch on top of linux-next using git ?
Is the linux-media branch is always compatible with linux-next ?
Thanks a lot,
Ga?tan Carlier.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 2/2] [media]: mx2_camera: Fix regression caused by clock conversion
  2012-10-08 10:04   ` Gaëtan Carlier
@ 2012-10-08 15:12     ` Fabio Estevam
  -1 siblings, 0 replies; 24+ messages in thread
From: Fabio Estevam @ 2012-10-08 15:12 UTC (permalink / raw)
  To: Gaëtan Carlier
  Cc: Fabio Estevam, kernel, g.liakhovetski, mchehab, linux-arm-kernel,
	linux-media, javier.martin

On Mon, Oct 8, 2012 at 7:04 AM, Gaëtan Carlier <gcembed@gmail.com> wrote:
>
> This patch does not apply on linux-next-20121008. I suppose that linux-media
> development branch is needed. How can I put linux-media branch on top of

Ok, I have just rebased it against linux-next-20121008. See below.

It allows ov2640 to probe correctly. However, it does not work with
Gstreamer anymore (Friday's linux-next allowed to get the Gstreamer
pipeline to work).

$ gst-launch v4l2src  ! fbdevsink
Setting pipeline to PAUSED ...mx2-camera mx2-camera.0: Camera driver
attached to camera 0

mx2-camera mx2-camera.0: Camera driver detached from camera 0
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Failed
to query norm on device '/dev/video0'.
Additional debug info:
v4l2_calls.c(213): gst_v4l2_fill_lists ():
/GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
Failed to get attributes for norm 0 on devide '/dev/video0'. (61 - No
data available)
Setting pipeline to NULL ...
Freeing pipeline ...

Does anyone have any ideas?

Thanks,

Fabio Estevam

---
 drivers/media/platform/soc_camera/mx2_camera.c |   47 +++++++++++++++++-------
 1 file changed, 34 insertions(+), 13 deletions(-)

diff --git a/drivers/media/platform/soc_camera/mx2_camera.c
b/drivers/media/platform/soc_camera/mx2_camera.c
index 403d7f1..9f8c5f0 100644
--- a/drivers/media/platform/soc_camera/mx2_camera.c
+++ b/drivers/media/platform/soc_camera/mx2_camera.c
@@ -272,7 +272,8 @@ struct mx2_camera_dev {
 	struct device		*dev;
 	struct soc_camera_host	soc_host;
 	struct soc_camera_device *icd;
-	struct clk		*clk_csi, *clk_emma_ahb, *clk_emma_ipg;
+	struct clk		*clk_emma_ahb, *clk_emma_ipg;
+	struct clk		*clk_csi_ahb, *clk_csi_per;

 	void __iomem		*base_csi, *base_emma;

@@ -432,7 +433,8 @@ static void mx2_camera_deactivate(struct
mx2_camera_dev *pcdev)
 {
 	unsigned long flags;

-	clk_disable_unprepare(pcdev->clk_csi);
+	clk_disable_unprepare(pcdev->clk_csi_ahb);
+	clk_disable_unprepare(pcdev->clk_csi_per);
 	writel(0, pcdev->base_csi + CSICR1);
 	if (cpu_is_mx27()) {
 		writel(0, pcdev->base_emma + PRP_CNTL);
@@ -460,7 +462,11 @@ static int mx2_camera_add_device(struct
soc_camera_device *icd)
 	if (pcdev->icd)
 		return -EBUSY;

-	ret = clk_prepare_enable(pcdev->clk_csi);
+	ret = clk_prepare_enable(pcdev->clk_csi_ahb);
+	if (ret < 0)
+		return ret;
+
+	ret = clk_prepare_enable(pcdev->clk_csi_per);
 	if (ret < 0)
 		return ret;

@@ -1725,11 +1731,18 @@ static int __devinit mx2_camera_probe(struct
platform_device *pdev)
 		goto exit;
 	}

-	pcdev->clk_csi = devm_clk_get(&pdev->dev, "ahb");
-	if (IS_ERR(pcdev->clk_csi)) {
-		dev_err(&pdev->dev, "Could not get csi clock\n");
-		err = PTR_ERR(pcdev->clk_csi);
-		goto exit;
+	pcdev->clk_csi_ahb = devm_clk_get(&pdev->dev, "ahb");
+	if (IS_ERR(pcdev->clk_csi_ahb)) {
+		dev_err(&pdev->dev, "Could not get csi ahb clock\n");
+		err = PTR_ERR(pcdev->clk_csi_ahb);
+ 		goto exit;
+ 	}
+
+	pcdev->clk_csi_per = devm_clk_get(&pdev->dev, "per");
+	if (IS_ERR(pcdev->clk_csi_per)) {
+		dev_err(&pdev->dev, "Could not get csi per clock\n");
+		err = PTR_ERR(pcdev->clk_csi_per);
+		goto exit_csi_ahb;
 	}

 	pcdev->pdata = pdev->dev.platform_data;
@@ -1738,14 +1751,15 @@ static int __devinit mx2_camera_probe(struct
platform_device *pdev)

 		pcdev->platform_flags = pcdev->pdata->flags;

-		rate = clk_round_rate(pcdev->clk_csi, pcdev->pdata->clk * 2);
+		rate = clk_round_rate(pcdev->clk_csi_per,
+						pcdev->pdata->clk * 2);
 		if (rate <= 0) {
 			err = -ENODEV;
-			goto exit;
+			goto exit_csi_per;
 		}
-		err = clk_set_rate(pcdev->clk_csi, rate);
+		err = clk_set_rate(pcdev->clk_csi_per, rate);
 		if (err < 0)
-			goto exit;
+			goto exit_csi_per;
 	}

 	INIT_LIST_HEAD(&pcdev->capture);
@@ -1801,7 +1815,7 @@ static int __devinit mx2_camera_probe(struct
platform_device *pdev)
 		goto exit_free_emma;

 	dev_info(&pdev->dev, "MX2 Camera (CSI) driver probed, clock frequency: %ld\n",
-			clk_get_rate(pcdev->clk_csi));
+			clk_get_rate(pcdev->clk_csi_per));

 	return 0;

@@ -1812,6 +1826,10 @@ eallocctx:
 		clk_disable_unprepare(pcdev->clk_emma_ipg);
 		clk_disable_unprepare(pcdev->clk_emma_ahb);
 	}
+exit_csi_per:
+	clk_disable_unprepare(pcdev->clk_csi_per);
+exit_csi_ahb:
+	clk_disable_unprepare(pcdev->clk_csi_ahb);
 exit:
 	return err;
 }
@@ -1831,6 +1849,9 @@ static int __devexit mx2_camera_remove(struct
platform_device *pdev)
 		clk_disable_unprepare(pcdev->clk_emma_ahb);
 	}

+	clk_disable_unprepare(pcdev->clk_csi_per);
+	clk_disable_unprepare(pcdev->clk_csi_ahb);
+
 	dev_info(&pdev->dev, "MX2 Camera driver unloaded\n");

 	return 0;
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 2/2] [media]: mx2_camera: Fix regression caused by clock conversion
@ 2012-10-08 15:12     ` Fabio Estevam
  0 siblings, 0 replies; 24+ messages in thread
From: Fabio Estevam @ 2012-10-08 15:12 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Oct 8, 2012 at 7:04 AM, Ga?tan Carlier <gcembed@gmail.com> wrote:
>
> This patch does not apply on linux-next-20121008. I suppose that linux-media
> development branch is needed. How can I put linux-media branch on top of

Ok, I have just rebased it against linux-next-20121008. See below.

It allows ov2640 to probe correctly. However, it does not work with
Gstreamer anymore (Friday's linux-next allowed to get the Gstreamer
pipeline to work).

$ gst-launch v4l2src  ! fbdevsink
Setting pipeline to PAUSED ...mx2-camera mx2-camera.0: Camera driver
attached to camera 0

mx2-camera mx2-camera.0: Camera driver detached from camera 0
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Failed
to query norm on device '/dev/video0'.
Additional debug info:
v4l2_calls.c(213): gst_v4l2_fill_lists ():
/GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
Failed to get attributes for norm 0 on devide '/dev/video0'. (61 - No
data available)
Setting pipeline to NULL ...
Freeing pipeline ...

Does anyone have any ideas?

Thanks,

Fabio Estevam

---
 drivers/media/platform/soc_camera/mx2_camera.c |   47 +++++++++++++++++-------
 1 file changed, 34 insertions(+), 13 deletions(-)

diff --git a/drivers/media/platform/soc_camera/mx2_camera.c
b/drivers/media/platform/soc_camera/mx2_camera.c
index 403d7f1..9f8c5f0 100644
--- a/drivers/media/platform/soc_camera/mx2_camera.c
+++ b/drivers/media/platform/soc_camera/mx2_camera.c
@@ -272,7 +272,8 @@ struct mx2_camera_dev {
 	struct device		*dev;
 	struct soc_camera_host	soc_host;
 	struct soc_camera_device *icd;
-	struct clk		*clk_csi, *clk_emma_ahb, *clk_emma_ipg;
+	struct clk		*clk_emma_ahb, *clk_emma_ipg;
+	struct clk		*clk_csi_ahb, *clk_csi_per;

 	void __iomem		*base_csi, *base_emma;

@@ -432,7 +433,8 @@ static void mx2_camera_deactivate(struct
mx2_camera_dev *pcdev)
 {
 	unsigned long flags;

-	clk_disable_unprepare(pcdev->clk_csi);
+	clk_disable_unprepare(pcdev->clk_csi_ahb);
+	clk_disable_unprepare(pcdev->clk_csi_per);
 	writel(0, pcdev->base_csi + CSICR1);
 	if (cpu_is_mx27()) {
 		writel(0, pcdev->base_emma + PRP_CNTL);
@@ -460,7 +462,11 @@ static int mx2_camera_add_device(struct
soc_camera_device *icd)
 	if (pcdev->icd)
 		return -EBUSY;

-	ret = clk_prepare_enable(pcdev->clk_csi);
+	ret = clk_prepare_enable(pcdev->clk_csi_ahb);
+	if (ret < 0)
+		return ret;
+
+	ret = clk_prepare_enable(pcdev->clk_csi_per);
 	if (ret < 0)
 		return ret;

@@ -1725,11 +1731,18 @@ static int __devinit mx2_camera_probe(struct
platform_device *pdev)
 		goto exit;
 	}

-	pcdev->clk_csi = devm_clk_get(&pdev->dev, "ahb");
-	if (IS_ERR(pcdev->clk_csi)) {
-		dev_err(&pdev->dev, "Could not get csi clock\n");
-		err = PTR_ERR(pcdev->clk_csi);
-		goto exit;
+	pcdev->clk_csi_ahb = devm_clk_get(&pdev->dev, "ahb");
+	if (IS_ERR(pcdev->clk_csi_ahb)) {
+		dev_err(&pdev->dev, "Could not get csi ahb clock\n");
+		err = PTR_ERR(pcdev->clk_csi_ahb);
+ 		goto exit;
+ 	}
+
+	pcdev->clk_csi_per = devm_clk_get(&pdev->dev, "per");
+	if (IS_ERR(pcdev->clk_csi_per)) {
+		dev_err(&pdev->dev, "Could not get csi per clock\n");
+		err = PTR_ERR(pcdev->clk_csi_per);
+		goto exit_csi_ahb;
 	}

 	pcdev->pdata = pdev->dev.platform_data;
@@ -1738,14 +1751,15 @@ static int __devinit mx2_camera_probe(struct
platform_device *pdev)

 		pcdev->platform_flags = pcdev->pdata->flags;

-		rate = clk_round_rate(pcdev->clk_csi, pcdev->pdata->clk * 2);
+		rate = clk_round_rate(pcdev->clk_csi_per,
+						pcdev->pdata->clk * 2);
 		if (rate <= 0) {
 			err = -ENODEV;
-			goto exit;
+			goto exit_csi_per;
 		}
-		err = clk_set_rate(pcdev->clk_csi, rate);
+		err = clk_set_rate(pcdev->clk_csi_per, rate);
 		if (err < 0)
-			goto exit;
+			goto exit_csi_per;
 	}

 	INIT_LIST_HEAD(&pcdev->capture);
@@ -1801,7 +1815,7 @@ static int __devinit mx2_camera_probe(struct
platform_device *pdev)
 		goto exit_free_emma;

 	dev_info(&pdev->dev, "MX2 Camera (CSI) driver probed, clock frequency: %ld\n",
-			clk_get_rate(pcdev->clk_csi));
+			clk_get_rate(pcdev->clk_csi_per));

 	return 0;

@@ -1812,6 +1826,10 @@ eallocctx:
 		clk_disable_unprepare(pcdev->clk_emma_ipg);
 		clk_disable_unprepare(pcdev->clk_emma_ahb);
 	}
+exit_csi_per:
+	clk_disable_unprepare(pcdev->clk_csi_per);
+exit_csi_ahb:
+	clk_disable_unprepare(pcdev->clk_csi_ahb);
 exit:
 	return err;
 }
@@ -1831,6 +1849,9 @@ static int __devexit mx2_camera_remove(struct
platform_device *pdev)
 		clk_disable_unprepare(pcdev->clk_emma_ahb);
 	}

+	clk_disable_unprepare(pcdev->clk_csi_per);
+	clk_disable_unprepare(pcdev->clk_csi_ahb);
+
 	dev_info(&pdev->dev, "MX2 Camera driver unloaded\n");

 	return 0;
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* Re: [PATCH 1/2] ARM: clk-imx27: Add missing clock for mx2-camera
  2012-10-05 21:53   ` Fabio Estevam
@ 2012-10-09 12:53     ` javier Martin
  -1 siblings, 0 replies; 24+ messages in thread
From: javier Martin @ 2012-10-09 12:53 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: kernel, g.liakhovetski, mchehab, linux-arm-kernel, linux-media

On 5 October 2012 23:53, Fabio Estevam <fabio.estevam@freescale.com> wrote:
> During the clock conversion for mx27 the "per4_gate" clock was missed to get
> registered as a dependency of mx2-camera driver.
>
> In the old mx27 clock driver we used to have:
>
> DEFINE_CLOCK1(csi_clk, 0, NULL, 0, parent, &csi_clk1, &per4_clk);
>
> ,so does the same in the new clock driver.
>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
>  arch/arm/mach-imx/clk-imx27.c |    1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/arch/arm/mach-imx/clk-imx27.c b/arch/arm/mach-imx/clk-imx27.c
> index 3b6b640..5ef0f08 100644
> --- a/arch/arm/mach-imx/clk-imx27.c
> +++ b/arch/arm/mach-imx/clk-imx27.c
> @@ -224,6 +224,7 @@ int __init mx27_clocks_init(unsigned long fref)
>         clk_register_clkdev(clk[lcdc_ipg_gate], "ipg", "imx-fb.0");
>         clk_register_clkdev(clk[lcdc_ahb_gate], "ahb", "imx-fb.0");
>         clk_register_clkdev(clk[csi_ahb_gate], "ahb", "mx2-camera.0");
> +       clk_register_clkdev(clk[per4_gate], "per", "mx2-camera.0");
>         clk_register_clkdev(clk[usb_div], "per", "fsl-usb2-udc");
>         clk_register_clkdev(clk[usb_ipg_gate], "ipg", "fsl-usb2-udc");
>         clk_register_clkdev(clk[usb_ahb_gate], "ahb", "fsl-usb2-udc");
> --
> 1.7.9.5
>
>

Tested-by: Javier Martin <javier.martin@vista-silicon.com>

-- 
Javier Martin
Vista Silicon S.L.
CDTUC - FASE C - Oficina S-345
Avda de los Castros s/n
39005- Santander. Cantabria. Spain
+34 942 25 32 60
www.vista-silicon.com

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH 1/2] ARM: clk-imx27: Add missing clock for mx2-camera
@ 2012-10-09 12:53     ` javier Martin
  0 siblings, 0 replies; 24+ messages in thread
From: javier Martin @ 2012-10-09 12:53 UTC (permalink / raw)
  To: linux-arm-kernel

On 5 October 2012 23:53, Fabio Estevam <fabio.estevam@freescale.com> wrote:
> During the clock conversion for mx27 the "per4_gate" clock was missed to get
> registered as a dependency of mx2-camera driver.
>
> In the old mx27 clock driver we used to have:
>
> DEFINE_CLOCK1(csi_clk, 0, NULL, 0, parent, &csi_clk1, &per4_clk);
>
> ,so does the same in the new clock driver.
>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
>  arch/arm/mach-imx/clk-imx27.c |    1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/arch/arm/mach-imx/clk-imx27.c b/arch/arm/mach-imx/clk-imx27.c
> index 3b6b640..5ef0f08 100644
> --- a/arch/arm/mach-imx/clk-imx27.c
> +++ b/arch/arm/mach-imx/clk-imx27.c
> @@ -224,6 +224,7 @@ int __init mx27_clocks_init(unsigned long fref)
>         clk_register_clkdev(clk[lcdc_ipg_gate], "ipg", "imx-fb.0");
>         clk_register_clkdev(clk[lcdc_ahb_gate], "ahb", "imx-fb.0");
>         clk_register_clkdev(clk[csi_ahb_gate], "ahb", "mx2-camera.0");
> +       clk_register_clkdev(clk[per4_gate], "per", "mx2-camera.0");
>         clk_register_clkdev(clk[usb_div], "per", "fsl-usb2-udc");
>         clk_register_clkdev(clk[usb_ipg_gate], "ipg", "fsl-usb2-udc");
>         clk_register_clkdev(clk[usb_ahb_gate], "ahb", "fsl-usb2-udc");
> --
> 1.7.9.5
>
>

Tested-by: Javier Martin <javier.martin@vista-silicon.com>

-- 
Javier Martin
Vista Silicon S.L.
CDTUC - FASE C - Oficina S-345
Avda de los Castros s/n
39005- Santander. Cantabria. Spain
+34 942 25 32 60
www.vista-silicon.com

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 1/2] ARM: clk-imx27: Add missing clock for mx2-camera
  2012-10-05 21:53   ` Fabio Estevam
@ 2012-10-09 13:04     ` Gaëtan Carlier
  -1 siblings, 0 replies; 24+ messages in thread
From: Gaëtan Carlier @ 2012-10-09 13:04 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: kernel, g.liakhovetski, mchehab, linux-arm-kernel, linux-media,
	javier.martin

Hi,
On 10/05/2012 11:53 PM, Fabio Estevam wrote:
> During the clock conversion for mx27 the "per4_gate" clock was missed to get
> registered as a dependency of mx2-camera driver.
>
> In the old mx27 clock driver we used to have:
>
> DEFINE_CLOCK1(csi_clk, 0, NULL, 0, parent, &csi_clk1, &per4_clk);
>
> ,so does the same in the new clock driver.
>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
>   arch/arm/mach-imx/clk-imx27.c |    1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/arch/arm/mach-imx/clk-imx27.c b/arch/arm/mach-imx/clk-imx27.c
> index 3b6b640..5ef0f08 100644
> --- a/arch/arm/mach-imx/clk-imx27.c
> +++ b/arch/arm/mach-imx/clk-imx27.c
> @@ -224,6 +224,7 @@ int __init mx27_clocks_init(unsigned long fref)
>   	clk_register_clkdev(clk[lcdc_ipg_gate], "ipg", "imx-fb.0");
>   	clk_register_clkdev(clk[lcdc_ahb_gate], "ahb", "imx-fb.0");
>   	clk_register_clkdev(clk[csi_ahb_gate], "ahb", "mx2-camera.0");
> +	clk_register_clkdev(clk[per4_gate], "per", "mx2-camera.0");
>   	clk_register_clkdev(clk[usb_div], "per", "fsl-usb2-udc");
>   	clk_register_clkdev(clk[usb_ipg_gate], "ipg", "fsl-usb2-udc");
>   	clk_register_clkdev(clk[usb_ahb_gate], "ahb", "fsl-usb2-udc");
>
I only test detection at kernel boot not streaming using Gstreamer due 
to lack of time.

On imx27_3ds board with ov2640 sensor:
ov2640 0-0030: ov2640 Product ID 26:42 Manufacturer ID 7f:a2
mx2-camera mx2-camera.0: MX2 Camera (CSI) driver probed, clock 
frequency: 44333333

On clone imx27_3ds board with mt9v111 sensor (draft driver):
mt9v111 0-0048: Detected a MT9V111 chip ID 823a
mx2-camera mx2-camera.0: MX2 Camera (CSI) driver probed, clock 
frequency: 44333333

Tested-by: Gaëtan Carlier <gcembed@gmail.com>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH 1/2] ARM: clk-imx27: Add missing clock for mx2-camera
@ 2012-10-09 13:04     ` Gaëtan Carlier
  0 siblings, 0 replies; 24+ messages in thread
From: Gaëtan Carlier @ 2012-10-09 13:04 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,
On 10/05/2012 11:53 PM, Fabio Estevam wrote:
> During the clock conversion for mx27 the "per4_gate" clock was missed to get
> registered as a dependency of mx2-camera driver.
>
> In the old mx27 clock driver we used to have:
>
> DEFINE_CLOCK1(csi_clk, 0, NULL, 0, parent, &csi_clk1, &per4_clk);
>
> ,so does the same in the new clock driver.
>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
>   arch/arm/mach-imx/clk-imx27.c |    1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/arch/arm/mach-imx/clk-imx27.c b/arch/arm/mach-imx/clk-imx27.c
> index 3b6b640..5ef0f08 100644
> --- a/arch/arm/mach-imx/clk-imx27.c
> +++ b/arch/arm/mach-imx/clk-imx27.c
> @@ -224,6 +224,7 @@ int __init mx27_clocks_init(unsigned long fref)
>   	clk_register_clkdev(clk[lcdc_ipg_gate], "ipg", "imx-fb.0");
>   	clk_register_clkdev(clk[lcdc_ahb_gate], "ahb", "imx-fb.0");
>   	clk_register_clkdev(clk[csi_ahb_gate], "ahb", "mx2-camera.0");
> +	clk_register_clkdev(clk[per4_gate], "per", "mx2-camera.0");
>   	clk_register_clkdev(clk[usb_div], "per", "fsl-usb2-udc");
>   	clk_register_clkdev(clk[usb_ipg_gate], "ipg", "fsl-usb2-udc");
>   	clk_register_clkdev(clk[usb_ahb_gate], "ahb", "fsl-usb2-udc");
>
I only test detection at kernel boot not streaming using Gstreamer due 
to lack of time.

On imx27_3ds board with ov2640 sensor:
ov2640 0-0030: ov2640 Product ID 26:42 Manufacturer ID 7f:a2
mx2-camera mx2-camera.0: MX2 Camera (CSI) driver probed, clock 
frequency: 44333333

On clone imx27_3ds board with mt9v111 sensor (draft driver):
mt9v111 0-0048: Detected a MT9V111 chip ID 823a
mx2-camera mx2-camera.0: MX2 Camera (CSI) driver probed, clock 
frequency: 44333333

Tested-by: Ga?tan Carlier <gcembed@gmail.com>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 1/2] ARM: clk-imx27: Add missing clock for mx2-camera
  2012-10-05 21:53   ` Fabio Estevam
@ 2012-10-25 13:38     ` Mauro Carvalho Chehab
  -1 siblings, 0 replies; 24+ messages in thread
From: Mauro Carvalho Chehab @ 2012-10-25 13:38 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: kernel, g.liakhovetski, linux-arm-kernel, linux-media, javier.martin

Hi Fábio,

Em Fri, 5 Oct 2012 18:53:01 -0300
Fabio Estevam <fabio.estevam@freescale.com> escreveu:

> During the clock conversion for mx27 the "per4_gate" clock was missed to get
> registered as a dependency of mx2-camera driver.
> 
> In the old mx27 clock driver we used to have:
> 
> DEFINE_CLOCK1(csi_clk, 0, NULL, 0, parent, &csi_clk1, &per4_clk);
> 
> ,so does the same in the new clock driver.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
>  arch/arm/mach-imx/clk-imx27.c |    1 +

As this patch is for arch/arm, I'm understanding that it will be merged
via arm tree. So,

Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>

>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/arm/mach-imx/clk-imx27.c b/arch/arm/mach-imx/clk-imx27.c
> index 3b6b640..5ef0f08 100644
> --- a/arch/arm/mach-imx/clk-imx27.c
> +++ b/arch/arm/mach-imx/clk-imx27.c
> @@ -224,6 +224,7 @@ int __init mx27_clocks_init(unsigned long fref)
>  	clk_register_clkdev(clk[lcdc_ipg_gate], "ipg", "imx-fb.0");
>  	clk_register_clkdev(clk[lcdc_ahb_gate], "ahb", "imx-fb.0");
>  	clk_register_clkdev(clk[csi_ahb_gate], "ahb", "mx2-camera.0");
> +	clk_register_clkdev(clk[per4_gate], "per", "mx2-camera.0");
>  	clk_register_clkdev(clk[usb_div], "per", "fsl-usb2-udc");
>  	clk_register_clkdev(clk[usb_ipg_gate], "ipg", "fsl-usb2-udc");
>  	clk_register_clkdev(clk[usb_ahb_gate], "ahb", "fsl-usb2-udc");


-- 
Regards,
Mauro

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH 1/2] ARM: clk-imx27: Add missing clock for mx2-camera
@ 2012-10-25 13:38     ` Mauro Carvalho Chehab
  0 siblings, 0 replies; 24+ messages in thread
From: Mauro Carvalho Chehab @ 2012-10-25 13:38 UTC (permalink / raw)
  To: linux-arm-kernel

Hi F?bio,

Em Fri, 5 Oct 2012 18:53:01 -0300
Fabio Estevam <fabio.estevam@freescale.com> escreveu:

> During the clock conversion for mx27 the "per4_gate" clock was missed to get
> registered as a dependency of mx2-camera driver.
> 
> In the old mx27 clock driver we used to have:
> 
> DEFINE_CLOCK1(csi_clk, 0, NULL, 0, parent, &csi_clk1, &per4_clk);
> 
> ,so does the same in the new clock driver.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
>  arch/arm/mach-imx/clk-imx27.c |    1 +

As this patch is for arch/arm, I'm understanding that it will be merged
via arm tree. So,

Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>

>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/arm/mach-imx/clk-imx27.c b/arch/arm/mach-imx/clk-imx27.c
> index 3b6b640..5ef0f08 100644
> --- a/arch/arm/mach-imx/clk-imx27.c
> +++ b/arch/arm/mach-imx/clk-imx27.c
> @@ -224,6 +224,7 @@ int __init mx27_clocks_init(unsigned long fref)
>  	clk_register_clkdev(clk[lcdc_ipg_gate], "ipg", "imx-fb.0");
>  	clk_register_clkdev(clk[lcdc_ahb_gate], "ahb", "imx-fb.0");
>  	clk_register_clkdev(clk[csi_ahb_gate], "ahb", "mx2-camera.0");
> +	clk_register_clkdev(clk[per4_gate], "per", "mx2-camera.0");
>  	clk_register_clkdev(clk[usb_div], "per", "fsl-usb2-udc");
>  	clk_register_clkdev(clk[usb_ipg_gate], "ipg", "fsl-usb2-udc");
>  	clk_register_clkdev(clk[usb_ahb_gate], "ahb", "fsl-usb2-udc");


-- 
Regards,
Mauro

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 1/2] ARM: clk-imx27: Add missing clock for mx2-camera
  2012-10-25 13:38     ` Mauro Carvalho Chehab
@ 2012-10-25 13:46       ` Mauro Carvalho Chehab
  -1 siblings, 0 replies; 24+ messages in thread
From: Mauro Carvalho Chehab @ 2012-10-25 13:46 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: Fabio Estevam, kernel, g.liakhovetski, linux-arm-kernel,
	linux-media, javier.martin

Em Thu, 25 Oct 2012 11:38:41 -0200
Mauro Carvalho Chehab <mchehab@redhat.com> escreveu:

> Hi Fábio,
> 
> Em Fri, 5 Oct 2012 18:53:01 -0300
> Fabio Estevam <fabio.estevam@freescale.com> escreveu:
> 
> > During the clock conversion for mx27 the "per4_gate" clock was missed to get
> > registered as a dependency of mx2-camera driver.
> > 
> > In the old mx27 clock driver we used to have:
> > 
> > DEFINE_CLOCK1(csi_clk, 0, NULL, 0, parent, &csi_clk1, &per4_clk);
> > 
> > ,so does the same in the new clock driver.
> > 
> > Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> > ---
> >  arch/arm/mach-imx/clk-imx27.c |    1 +
> 
> As this patch is for arch/arm, I'm understanding that it will be merged
> via arm tree. So,
> 
> Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>

Forgot to comment: as patch 2 relies on this change, the better, IMHO, is
to send both via the same tree. If you decide to do so, please get arm
maintainer's ack, instead, and we can merge both via my tree.

> 
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/arch/arm/mach-imx/clk-imx27.c b/arch/arm/mach-imx/clk-imx27.c
> > index 3b6b640..5ef0f08 100644
> > --- a/arch/arm/mach-imx/clk-imx27.c
> > +++ b/arch/arm/mach-imx/clk-imx27.c
> > @@ -224,6 +224,7 @@ int __init mx27_clocks_init(unsigned long fref)
> >  	clk_register_clkdev(clk[lcdc_ipg_gate], "ipg", "imx-fb.0");
> >  	clk_register_clkdev(clk[lcdc_ahb_gate], "ahb", "imx-fb.0");
> >  	clk_register_clkdev(clk[csi_ahb_gate], "ahb", "mx2-camera.0");
> > +	clk_register_clkdev(clk[per4_gate], "per", "mx2-camera.0");
> >  	clk_register_clkdev(clk[usb_div], "per", "fsl-usb2-udc");
> >  	clk_register_clkdev(clk[usb_ipg_gate], "ipg", "fsl-usb2-udc");
> >  	clk_register_clkdev(clk[usb_ahb_gate], "ahb", "fsl-usb2-udc");
> 
> 


-- 
Regards,
Mauro

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH 1/2] ARM: clk-imx27: Add missing clock for mx2-camera
@ 2012-10-25 13:46       ` Mauro Carvalho Chehab
  0 siblings, 0 replies; 24+ messages in thread
From: Mauro Carvalho Chehab @ 2012-10-25 13:46 UTC (permalink / raw)
  To: linux-arm-kernel

Em Thu, 25 Oct 2012 11:38:41 -0200
Mauro Carvalho Chehab <mchehab@redhat.com> escreveu:

> Hi F?bio,
> 
> Em Fri, 5 Oct 2012 18:53:01 -0300
> Fabio Estevam <fabio.estevam@freescale.com> escreveu:
> 
> > During the clock conversion for mx27 the "per4_gate" clock was missed to get
> > registered as a dependency of mx2-camera driver.
> > 
> > In the old mx27 clock driver we used to have:
> > 
> > DEFINE_CLOCK1(csi_clk, 0, NULL, 0, parent, &csi_clk1, &per4_clk);
> > 
> > ,so does the same in the new clock driver.
> > 
> > Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> > ---
> >  arch/arm/mach-imx/clk-imx27.c |    1 +
> 
> As this patch is for arch/arm, I'm understanding that it will be merged
> via arm tree. So,
> 
> Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>

Forgot to comment: as patch 2 relies on this change, the better, IMHO, is
to send both via the same tree. If you decide to do so, please get arm
maintainer's ack, instead, and we can merge both via my tree.

> 
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/arch/arm/mach-imx/clk-imx27.c b/arch/arm/mach-imx/clk-imx27.c
> > index 3b6b640..5ef0f08 100644
> > --- a/arch/arm/mach-imx/clk-imx27.c
> > +++ b/arch/arm/mach-imx/clk-imx27.c
> > @@ -224,6 +224,7 @@ int __init mx27_clocks_init(unsigned long fref)
> >  	clk_register_clkdev(clk[lcdc_ipg_gate], "ipg", "imx-fb.0");
> >  	clk_register_clkdev(clk[lcdc_ahb_gate], "ahb", "imx-fb.0");
> >  	clk_register_clkdev(clk[csi_ahb_gate], "ahb", "mx2-camera.0");
> > +	clk_register_clkdev(clk[per4_gate], "per", "mx2-camera.0");
> >  	clk_register_clkdev(clk[usb_div], "per", "fsl-usb2-udc");
> >  	clk_register_clkdev(clk[usb_ipg_gate], "ipg", "fsl-usb2-udc");
> >  	clk_register_clkdev(clk[usb_ahb_gate], "ahb", "fsl-usb2-udc");
> 
> 


-- 
Regards,
Mauro

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 1/2] ARM: clk-imx27: Add missing clock for mx2-camera
  2012-10-25 13:46       ` Mauro Carvalho Chehab
@ 2012-10-25 14:19         ` Fabio Estevam
  -1 siblings, 0 replies; 24+ messages in thread
From: Fabio Estevam @ 2012-10-25 14:19 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Sascha Hauer
  Cc: Fabio Estevam, kernel, g.liakhovetski, linux-arm-kernel,
	linux-media, javier.martin

Hi Sascha,

On Thu, Oct 25, 2012 at 11:46 AM, Mauro Carvalho Chehab
<mchehab@redhat.com> wrote:

>> As this patch is for arch/arm, I'm understanding that it will be merged
>> via arm tree. So,
>>
>> Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
>
> Forgot to comment: as patch 2 relies on this change, the better, IMHO, is
> to send both via the same tree. If you decide to do so, please get arm
> maintainer's ack, instead, and we can merge both via my tree.

Can you please send your Ack to this series so that Mauro can merge it
via his tree?

Thanks,

Fabio Estevam

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH 1/2] ARM: clk-imx27: Add missing clock for mx2-camera
@ 2012-10-25 14:19         ` Fabio Estevam
  0 siblings, 0 replies; 24+ messages in thread
From: Fabio Estevam @ 2012-10-25 14:19 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Sascha,

On Thu, Oct 25, 2012 at 11:46 AM, Mauro Carvalho Chehab
<mchehab@redhat.com> wrote:

>> As this patch is for arch/arm, I'm understanding that it will be merged
>> via arm tree. So,
>>
>> Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
>
> Forgot to comment: as patch 2 relies on this change, the better, IMHO, is
> to send both via the same tree. If you decide to do so, please get arm
> maintainer's ack, instead, and we can merge both via my tree.

Can you please send your Ack to this series so that Mauro can merge it
via his tree?

Thanks,

Fabio Estevam

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 1/2] ARM: clk-imx27: Add missing clock for mx2-camera
  2012-10-05 21:53   ` Fabio Estevam
@ 2012-10-25 15:45     ` Sascha Hauer
  -1 siblings, 0 replies; 24+ messages in thread
From: Sascha Hauer @ 2012-10-25 15:45 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: kernel, g.liakhovetski, mchehab, linux-arm-kernel, linux-media,
	javier.martin

On Fri, Oct 05, 2012 at 06:53:01PM -0300, Fabio Estevam wrote:
> During the clock conversion for mx27 the "per4_gate" clock was missed to get
> registered as a dependency of mx2-camera driver.
> 
> In the old mx27 clock driver we used to have:
> 
> DEFINE_CLOCK1(csi_clk, 0, NULL, 0, parent, &csi_clk1, &per4_clk);
> 
> ,so does the same in the new clock driver.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>

I'm fine with merging this through the media tree.

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

Sascha

> ---
>  arch/arm/mach-imx/clk-imx27.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/arm/mach-imx/clk-imx27.c b/arch/arm/mach-imx/clk-imx27.c
> index 3b6b640..5ef0f08 100644
> --- a/arch/arm/mach-imx/clk-imx27.c
> +++ b/arch/arm/mach-imx/clk-imx27.c
> @@ -224,6 +224,7 @@ int __init mx27_clocks_init(unsigned long fref)
>  	clk_register_clkdev(clk[lcdc_ipg_gate], "ipg", "imx-fb.0");
>  	clk_register_clkdev(clk[lcdc_ahb_gate], "ahb", "imx-fb.0");
>  	clk_register_clkdev(clk[csi_ahb_gate], "ahb", "mx2-camera.0");
> +	clk_register_clkdev(clk[per4_gate], "per", "mx2-camera.0");
>  	clk_register_clkdev(clk[usb_div], "per", "fsl-usb2-udc");
>  	clk_register_clkdev(clk[usb_ipg_gate], "ipg", "fsl-usb2-udc");
>  	clk_register_clkdev(clk[usb_ahb_gate], "ahb", "fsl-usb2-udc");
> -- 
> 1.7.9.5
> 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH 1/2] ARM: clk-imx27: Add missing clock for mx2-camera
@ 2012-10-25 15:45     ` Sascha Hauer
  0 siblings, 0 replies; 24+ messages in thread
From: Sascha Hauer @ 2012-10-25 15:45 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Oct 05, 2012 at 06:53:01PM -0300, Fabio Estevam wrote:
> During the clock conversion for mx27 the "per4_gate" clock was missed to get
> registered as a dependency of mx2-camera driver.
> 
> In the old mx27 clock driver we used to have:
> 
> DEFINE_CLOCK1(csi_clk, 0, NULL, 0, parent, &csi_clk1, &per4_clk);
> 
> ,so does the same in the new clock driver.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>

I'm fine with merging this through the media tree.

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

Sascha

> ---
>  arch/arm/mach-imx/clk-imx27.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/arm/mach-imx/clk-imx27.c b/arch/arm/mach-imx/clk-imx27.c
> index 3b6b640..5ef0f08 100644
> --- a/arch/arm/mach-imx/clk-imx27.c
> +++ b/arch/arm/mach-imx/clk-imx27.c
> @@ -224,6 +224,7 @@ int __init mx27_clocks_init(unsigned long fref)
>  	clk_register_clkdev(clk[lcdc_ipg_gate], "ipg", "imx-fb.0");
>  	clk_register_clkdev(clk[lcdc_ahb_gate], "ahb", "imx-fb.0");
>  	clk_register_clkdev(clk[csi_ahb_gate], "ahb", "mx2-camera.0");
> +	clk_register_clkdev(clk[per4_gate], "per", "mx2-camera.0");
>  	clk_register_clkdev(clk[usb_div], "per", "fsl-usb2-udc");
>  	clk_register_clkdev(clk[usb_ipg_gate], "ipg", "fsl-usb2-udc");
>  	clk_register_clkdev(clk[usb_ahb_gate], "ahb", "fsl-usb2-udc");
> -- 
> 1.7.9.5
> 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2012-10-25 15:45 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-05 21:53 [PATCH 2/2] [media]: mx2_camera: Fix regression caused by clock conversion Fabio Estevam
2012-10-05 21:53 ` Fabio Estevam
2012-10-05 21:53 ` [PATCH 1/2] ARM: clk-imx27: Add missing clock for mx2-camera Fabio Estevam
2012-10-05 21:53   ` Fabio Estevam
2012-10-09 12:53   ` javier Martin
2012-10-09 12:53     ` javier Martin
2012-10-09 13:04   ` Gaëtan Carlier
2012-10-09 13:04     ` Gaëtan Carlier
2012-10-25 13:38   ` Mauro Carvalho Chehab
2012-10-25 13:38     ` Mauro Carvalho Chehab
2012-10-25 13:46     ` Mauro Carvalho Chehab
2012-10-25 13:46       ` Mauro Carvalho Chehab
2012-10-25 14:19       ` Fabio Estevam
2012-10-25 14:19         ` Fabio Estevam
2012-10-25 15:45   ` Sascha Hauer
2012-10-25 15:45     ` Sascha Hauer
2012-10-08  9:09 ` [PATCH 2/2] [media]: mx2_camera: Fix regression caused by clock conversion Guennadi Liakhovetski
2012-10-08  9:09   ` Guennadi Liakhovetski
2012-10-08  9:18   ` javier Martin
2012-10-08  9:18     ` javier Martin
2012-10-08 10:04 ` Gaëtan Carlier
2012-10-08 10:04   ` Gaëtan Carlier
2012-10-08 15:12   ` Fabio Estevam
2012-10-08 15:12     ` Fabio Estevam

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.