Linux Framebuffer Layer development
 help / color / mirror / Atom feed
* Re: [PATCH 1/5] drivers/video/bf537-lq035.c: use devm_ functions
From: Florian Tobias Schandinat @ 2012-08-23 20:36 UTC (permalink / raw)
  To: Damien Cassou; +Cc: kernel-janitors, linux-fbdev, linux-kernel
In-Reply-To: <1343742860-16213-6-git-send-email-damien.cassou@lifl.fr>

On 07/31/2012 01:54 PM, Damien Cassou wrote:
> From: Damien Cassou <damien.cassou@lifl.fr>
> 
> The various devm_ functions allocate memory that is released when a driver
> detaches.  This patch uses these functions for data that is allocated in
> the probe function of a platform device and is only freed in the remove
> function.
> 
> Signed-off-by: Damien Cassou <damien.cassou@lifl.fr>

Applied.


Thanks,

Florian Tobias Schandinat

> 
> ---
>  drivers/video/bf537-lq035.c |   12 +++++-------
>  1 file changed, 5 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/video/bf537-lq035.c b/drivers/video/bf537-lq035.c
> index befbc80..7347aa1 100644
> --- a/drivers/video/bf537-lq035.c
> +++ b/drivers/video/bf537-lq035.c
> @@ -760,18 +760,20 @@ static int __devinit bfin_lq035_probe(struct platform_device *pdev)
>  	bfin_lq035_fb.flags = FBINFO_DEFAULT;
>  
>  
> -	bfin_lq035_fb.pseudo_palette = kzalloc(sizeof(u32) * 16, GFP_KERNEL);
> +	bfin_lq035_fb.pseudo_palette = devm_kzalloc(&pdev->dev,
> +						    sizeof(u32) * 16,
> +						    GFP_KERNEL);
>  	if (bfin_lq035_fb.pseudo_palette = NULL) {
>  		pr_err("failed to allocate pseudo_palette\n");
>  		ret = -ENOMEM;
> -		goto out_palette;
> +		goto out_table;
>  	}
>  
>  	if (fb_alloc_cmap(&bfin_lq035_fb.cmap, NBR_PALETTE, 0) < 0) {
>  		pr_err("failed to allocate colormap (%d entries)\n",
>  			NBR_PALETTE);
>  		ret = -EFAULT;
> -		goto out_cmap;
> +		goto out_table;
>  	}
>  
>  	if (register_framebuffer(&bfin_lq035_fb) < 0) {
> @@ -804,9 +806,6 @@ out_lcd:
>  	unregister_framebuffer(&bfin_lq035_fb);
>  out_reg:
>  	fb_dealloc_cmap(&bfin_lq035_fb.cmap);
> -out_cmap:
> -	kfree(bfin_lq035_fb.pseudo_palette);
> -out_palette:
>  out_table:
>  	dma_free_coherent(NULL, TOTAL_VIDEO_MEM_SIZE, fb_buffer, 0);
>  	fb_buffer = NULL;
> @@ -834,7 +833,6 @@ static int __devexit bfin_lq035_remove(struct platform_device *pdev)
>  	free_dma(CH_PPI);
>  
>  
> -	kfree(bfin_lq035_fb.pseudo_palette);
>  	fb_dealloc_cmap(&bfin_lq035_fb.cmap);
>  
>  
> 
> 


^ permalink raw reply

* Re: [PATCH 3/5] drivers/video/mbx/mbxfb.c: use devm_ functions
From: Florian Tobias Schandinat @ 2012-08-23 20:37 UTC (permalink / raw)
  To: Damien Cassou; +Cc: kernel-janitors, linux-fbdev, linux-kernel
In-Reply-To: <1343752762-16861-2-git-send-email-damien.cassou@lifl.fr>

On 07/31/2012 04:39 PM, Damien Cassou wrote:
> From: Damien Cassou <damien.cassou@lifl.fr>
> 
> The various devm_ functions allocate memory that is released when a driver
> detaches.  This patch uses these functions for data that is allocated in
> the probe function of a platform device and is only freed in the remove
> function.
> 
> Signed-off-by: Damien Cassou <damien.cassou@lifl.fr>

Applied.


Thanks,

Florian Tobias Schandinat

> 
> ---
>  drivers/video/mbx/mbxfb.c |   22 ++++++++--------------
>  1 file changed, 8 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/video/mbx/mbxfb.c b/drivers/video/mbx/mbxfb.c
> index 85e4f44..9229acf 100644
> --- a/drivers/video/mbx/mbxfb.c
> +++ b/drivers/video/mbx/mbxfb.c
> @@ -939,8 +939,9 @@ static int __devinit mbxfb_probe(struct platform_device *dev)
>  	}
>  	mfbi->reg_phys_addr = mfbi->reg_res->start;
>  
> -	mfbi->reg_virt_addr = ioremap_nocache(mfbi->reg_phys_addr,
> -					      res_size(mfbi->reg_req));
> +	mfbi->reg_virt_addr = devm_ioremap_nocache(&dev->dev,
> +						   mfbi->reg_phys_addr,
> +						   res_size(mfbi->reg_req));
>  	if (!mfbi->reg_virt_addr) {
>  		dev_err(&dev->dev, "failed to ioremap Marathon registers\n");
>  		ret = -EINVAL;
> @@ -948,12 +949,12 @@ static int __devinit mbxfb_probe(struct platform_device *dev)
>  	}
>  	virt_base_2700 = mfbi->reg_virt_addr;
>  
> -	mfbi->fb_virt_addr = ioremap_nocache(mfbi->fb_phys_addr,
> -					     res_size(mfbi->fb_req));
> +	mfbi->fb_virt_addr = devm_ioremap_nocache(&dev->dev, mfbi->fb_phys_addr,
> +						  res_size(mfbi->fb_req));
>  	if (!mfbi->fb_virt_addr) {
>  		dev_err(&dev->dev, "failed to ioremap frame buffer\n");
>  		ret = -EINVAL;
> -		goto err4;
> +		goto err3;
>  	}
>  
>  	fbi->screen_base = (char __iomem *)(mfbi->fb_virt_addr + 0x60000);
> @@ -971,7 +972,7 @@ static int __devinit mbxfb_probe(struct platform_device *dev)
>  	if (ret < 0) {
>  		dev_err(&dev->dev, "fb_alloc_cmap failed\n");
>  		ret = -EINVAL;
> -		goto err5;
> +		goto err3;
>  	}
>  
>  	platform_set_drvdata(dev, fbi);
> @@ -996,10 +997,6 @@ static int __devinit mbxfb_probe(struct platform_device *dev)
>  
>  err6:
>  	fb_dealloc_cmap(&fbi->cmap);
> -err5:
> -	iounmap(mfbi->fb_virt_addr);
> -err4:
> -	iounmap(mfbi->reg_virt_addr);
>  err3:
>  	release_mem_region(mfbi->reg_res->start, res_size(mfbi->reg_res));
>  err2:
> @@ -1026,10 +1023,7 @@ static int __devexit mbxfb_remove(struct platform_device *dev)
>  			if (mfbi->platform_remove)
>  				mfbi->platform_remove(fbi);
>  
> -			if (mfbi->fb_virt_addr)
> -				iounmap(mfbi->fb_virt_addr);
> -			if (mfbi->reg_virt_addr)
> -				iounmap(mfbi->reg_virt_addr);
> +
>  			if (mfbi->reg_req)
>  				release_mem_region(mfbi->reg_req->start,
>  						   res_size(mfbi->reg_req));
> 
> 


^ permalink raw reply

* Re: [PATCH 2/5] drivers/video/gbefb.c: use devm_ functions
From: Florian Tobias Schandinat @ 2012-08-23 20:37 UTC (permalink / raw)
  To: Damien Cassou; +Cc: kernel-janitors, linux-fbdev, linux-kernel
In-Reply-To: <1343752762-16861-3-git-send-email-damien.cassou@lifl.fr>

On 07/31/2012 04:39 PM, Damien Cassou wrote:
> From: Damien Cassou <damien.cassou@lifl.fr>
> 
> The various devm_ functions allocate memory that is released when a driver
> detaches.  This patch uses these functions for data that is allocated in
> the probe function of a platform device and is only freed in the remove
> function.
> 
> Signed-off-by: Damien Cassou <damien.cassou@lifl.fr>

Applied.


Thanks,

Florian Tobias Schandinat

> 
> ---
>  drivers/video/gbefb.c |   15 +++++----------
>  1 file changed, 5 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/video/gbefb.c b/drivers/video/gbefb.c
> index 7e7b7a9..9b79d38 100644
> --- a/drivers/video/gbefb.c
> +++ b/drivers/video/gbefb.c
> @@ -1156,7 +1156,8 @@ static int __devinit gbefb_probe(struct platform_device *p_dev)
>  		goto out_release_framebuffer;
>  	}
>  
> -	gbe = (struct sgi_gbe *) ioremap(GBE_BASE, sizeof(struct sgi_gbe));
> +	gbe = (struct sgi_gbe *) devm_ioremap(&p_dev->dev, GBE_BASE,
> +					      sizeof(struct sgi_gbe));
>  	if (!gbe) {
>  		printk(KERN_ERR "gbefb: couldn't map mmio region\n");
>  		ret = -ENXIO;
> @@ -1170,12 +1171,13 @@ static int __devinit gbefb_probe(struct platform_device *p_dev)
>  	if (!gbe_tiles.cpu) {
>  		printk(KERN_ERR "gbefb: couldn't allocate tiles table\n");
>  		ret = -ENOMEM;
> -		goto out_unmap;
> +		goto out_release_mem_region;
>  	}
>  
>  	if (gbe_mem_phys) {
>  		/* memory was allocated at boot time */
> -		gbe_mem = ioremap_nocache(gbe_mem_phys, gbe_mem_size);
> +		gbe_mem = devm_ioremap_nocache(&p_dev->dev, gbe_mem_phys,
> +					       gbe_mem_size);
>  		if (!gbe_mem) {
>  			printk(KERN_ERR "gbefb: couldn't map framebuffer\n");
>  			ret = -ENOMEM;
> @@ -1241,13 +1243,9 @@ static int __devinit gbefb_probe(struct platform_device *p_dev)
>  out_gbe_unmap:
>  	if (gbe_dma_addr)
>  		dma_free_coherent(NULL, gbe_mem_size, gbe_mem, gbe_mem_phys);
> -	else
> -		iounmap(gbe_mem);
>  out_tiles_free:
>  	dma_free_coherent(NULL, GBE_TLB_SIZE * sizeof(uint16_t),
>  			  (void *)gbe_tiles.cpu, gbe_tiles.dma);
> -out_unmap:
> -	iounmap(gbe);
>  out_release_mem_region:
>  	release_mem_region(GBE_BASE, sizeof(struct sgi_gbe));
>  out_release_framebuffer:
> @@ -1264,12 +1262,9 @@ static int __devexit gbefb_remove(struct platform_device* p_dev)
>  	gbe_turn_off();
>  	if (gbe_dma_addr)
>  		dma_free_coherent(NULL, gbe_mem_size, gbe_mem, gbe_mem_phys);
> -	else
> -		iounmap(gbe_mem);
>  	dma_free_coherent(NULL, GBE_TLB_SIZE * sizeof(uint16_t),
>  			  (void *)gbe_tiles.cpu, gbe_tiles.dma);
>  	release_mem_region(GBE_BASE, sizeof(struct sgi_gbe));
> -	iounmap(gbe);
>  	gbefb_remove_sysfs(&p_dev->dev);
>  	framebuffer_release(info);
>  
> 
> 


^ permalink raw reply

* Re: [PATCH 1/5] drivers/video/fsl-diu-fb.c: use devm_ functions
From: Florian Tobias Schandinat @ 2012-08-23 20:38 UTC (permalink / raw)
  To: Damien Cassou; +Cc: kernel-janitors, linux-fbdev, linux-kernel
In-Reply-To: <1343752762-16861-4-git-send-email-damien.cassou@lifl.fr>

On 07/31/2012 04:39 PM, Damien Cassou wrote:
> From: Damien Cassou <damien.cassou@lifl.fr>
> 
> The various devm_ functions allocate memory that is released when a driver
> detaches.  This patch uses these functions for data that is allocated in
> the probe function of a platform device and is only freed in the remove
> function.
> 
> Signed-off-by: Damien Cassou <damien.cassou@lifl.fr>

Applied.


Thanks,

Florian Tobias Schandinat

> 
> ---
>  drivers/video/fsl-diu-fb.c |   11 ++---------
>  1 file changed, 2 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/video/fsl-diu-fb.c b/drivers/video/fsl-diu-fb.c
> index 458c006..19194c5 100644
> --- a/drivers/video/fsl-diu-fb.c
> +++ b/drivers/video/fsl-diu-fb.c
> @@ -1501,8 +1501,8 @@ static int __devinit fsl_diu_probe(struct platform_device *pdev)
>  	unsigned int i;
>  	int ret;
> 
> -	data = dma_alloc_coherent(&pdev->dev, sizeof(struct fsl_diu_data),
> -				  &dma_addr, GFP_DMA | __GFP_ZERO);
> +	data = dmam_alloc_coherent(&pdev->dev, sizeof(struct fsl_diu_data),
> +				   &dma_addr, GFP_DMA | __GFP_ZERO);
>  	if (!data)
>  		return -ENOMEM;
>  	data->dma_addr = dma_addr;
> @@ -1628,9 +1628,6 @@ error:
> 
>  	iounmap(data->diu_reg);
> 
> -	dma_free_coherent(&pdev->dev, sizeof(struct fsl_diu_data), data,
> -			  data->dma_addr);
> -
>  	return ret;
>  }
> 
> @@ -1648,9 +1645,6 @@ static int fsl_diu_remove(struct platform_device *pdev)
> 
>  	iounmap(data->diu_reg);
> 
> -	dma_free_coherent(&pdev->dev, sizeof(struct fsl_diu_data), data,
> -			  data->dma_addr);
> -
>  	return 0;
>  }
> 


^ permalink raw reply

* Re: [PATCH v2] video: exynos_dp: use devm_clk_get function
From: Florian Tobias Schandinat @ 2012-08-23 20:38 UTC (permalink / raw)
  To: Damien Cassou; +Cc: Jingoo Han, linux-fbdev, linux-kernel, Sachin Kamat
In-Reply-To: <877gti1t48.fsf@gmail.com>

On 08/01/2012 04:20 PM, Damien Cassou wrote:
> From: Damien Cassou <damien.cassou@lifl.fr>
> 
> The devm_clk_get function allocates memory that is released when a driver
> detaches. This patch uses this function for data that is allocated in the probe
> function of a platform device and is only freed in the remove function.
> 
> Additionally, this patch removes a null check after platform_get_resource that
> is redundant with the one done by devm_request_and_ioremap.
> 
> Signed-off-by: Damien Cassou <damien.cassou@lifl.fr>

Applied.


Thanks,

Florian Tobias Schandinat

> 
> ---
> Changed subject line and description
>  drivers/video/exynos/exynos_dp_core.c |   27 +++++++--------------------
>  1 file changed, 7 insertions(+), 20 deletions(-)
> 
> diff --git a/drivers/video/exynos/exynos_dp_core.c b/drivers/video/exynos/exynos_dp_core.c
> index c6c016a..00fe4f0 100644
> --- a/drivers/video/exynos/exynos_dp_core.c
> +++ b/drivers/video/exynos/exynos_dp_core.c
> @@ -872,7 +872,7 @@ static int __devinit exynos_dp_probe(struct platform_device *pdev)
>  
>  	dp->dev = &pdev->dev;
>  
> -	dp->clock = clk_get(&pdev->dev, "dp");
> +	dp->clock = devm_clk_get(&pdev->dev, "dp");
>  	if (IS_ERR(dp->clock)) {
>  		dev_err(&pdev->dev, "failed to get clock\n");
>  		return PTR_ERR(dp->clock);
> @@ -881,31 +881,24 @@ static int __devinit exynos_dp_probe(struct platform_device *pdev)
>  	clk_enable(dp->clock);
>  
>  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	if (!res) {
> -		dev_err(&pdev->dev, "failed to get registers\n");
> -		ret = -EINVAL;
> -		goto err_clock;
> -	}
>  
>  	dp->reg_base = devm_request_and_ioremap(&pdev->dev, res);
>  	if (!dp->reg_base) {
>  		dev_err(&pdev->dev, "failed to ioremap\n");
> -		ret = -ENOMEM;
> -		goto err_clock;
> +		return -ENOMEM;
>  	}
>  
>  	dp->irq = platform_get_irq(pdev, 0);
>  	if (!dp->irq) {
>  		dev_err(&pdev->dev, "failed to get irq\n");
> -		ret = -ENODEV;
> -		goto err_clock;
> +		return -ENODEV;
>  	}
>  
>  	ret = devm_request_irq(&pdev->dev, dp->irq, exynos_dp_irq_handler, 0,
>  				"exynos-dp", dp);
>  	if (ret) {
>  		dev_err(&pdev->dev, "failed to request irq\n");
> -		goto err_clock;
> +		return ret;
>  	}
>  
>  	dp->video_info = pdata->video_info;
> @@ -917,7 +910,7 @@ static int __devinit exynos_dp_probe(struct platform_device *pdev)
>  	ret = exynos_dp_detect_hpd(dp);
>  	if (ret) {
>  		dev_err(&pdev->dev, "unable to detect hpd\n");
> -		goto err_clock;
> +		return ret;
>  	}
>  
>  	exynos_dp_handle_edid(dp);
> @@ -926,7 +919,7 @@ static int __devinit exynos_dp_probe(struct platform_device *pdev)
>  				dp->video_info->link_rate);
>  	if (ret) {
>  		dev_err(&pdev->dev, "unable to do link train\n");
> -		goto err_clock;
> +		return ret;
>  	}
>  
>  	exynos_dp_enable_scramble(dp, 1);
> @@ -940,17 +933,12 @@ static int __devinit exynos_dp_probe(struct platform_device *pdev)
>  	ret = exynos_dp_config_video(dp, dp->video_info);
>  	if (ret) {
>  		dev_err(&pdev->dev, "unable to config video\n");
> -		goto err_clock;
> +		return ret;
>  	}
>  
>  	platform_set_drvdata(pdev, dp);
>  
>  	return 0;
> -
> -err_clock:
> -	clk_put(dp->clock);
> -
> -	return ret;
>  }
>  
>  static int __devexit exynos_dp_remove(struct platform_device *pdev)
> @@ -962,7 +950,6 @@ static int __devexit exynos_dp_remove(struct platform_device *pdev)
>  		pdata->phy_exit();
>  
>  	clk_disable(dp->clock);
> -	clk_put(dp->clock);
>  
>  	return 0;
>  }
> 
> 


^ permalink raw reply

* Re: [PATCH] video: exynos-mipi-dsi: Add missing static storage class specifiers
From: Florian Tobias Schandinat @ 2012-08-23 20:39 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <1343888051-406-1-git-send-email-sachin.kamat@linaro.org>

On 08/02/2012 06:14 AM, Sachin Kamat wrote:
> Fixes the following sparse warnings:
> drivers/video/exynos/exynos_mipi_dsi.c:208:22: warning:
> symbol 'exynos_mipi_dsi_find_lcd_device' was not declared. Should it be static?
> drivers/video/exynos/exynos_mipi_dsi.c:268:22: warning:
> symbol 'exynos_mipi_dsi_bind_lcd_ddi' was not declared. Should it be static?
> 
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>

Applied.


Thanks,

Florian Tobias Schandinat

> ---
>  drivers/video/exynos/exynos_mipi_dsi.c |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/video/exynos/exynos_mipi_dsi.c b/drivers/video/exynos/exynos_mipi_dsi.c
> index 4bc2b8a..ef68228 100644
> --- a/drivers/video/exynos/exynos_mipi_dsi.c
> +++ b/drivers/video/exynos/exynos_mipi_dsi.c
> @@ -205,7 +205,8 @@ int exynos_mipi_dsi_register_lcd_device(struct mipi_dsim_lcd_device *lcd_dev)
>  	return 0;
>  }
>  
> -struct mipi_dsim_ddi *exynos_mipi_dsi_find_lcd_device(struct mipi_dsim_lcd_driver *lcd_drv)
> +static struct mipi_dsim_ddi *exynos_mipi_dsi_find_lcd_device(
> +					struct mipi_dsim_lcd_driver *lcd_drv)
>  {
>  	struct mipi_dsim_ddi *dsim_ddi, *next;
>  	struct mipi_dsim_lcd_device *lcd_dev;
> @@ -265,7 +266,8 @@ int exynos_mipi_dsi_register_lcd_driver(struct mipi_dsim_lcd_driver *lcd_drv)
>  
>  }
>  
> -struct mipi_dsim_ddi *exynos_mipi_dsi_bind_lcd_ddi(struct mipi_dsim_device *dsim,
> +static struct mipi_dsim_ddi *exynos_mipi_dsi_bind_lcd_ddi(
> +						struct mipi_dsim_device *dsim,
>  						const char *name)
>  {
>  	struct mipi_dsim_ddi *dsim_ddi, *next;


^ permalink raw reply

* Re: [PATCH] video: s3c-fb: use devm_clk_get()
From: Florian Tobias Schandinat @ 2012-08-23 20:40 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <000101cd707c$4e574450$eb05ccf0$%han@samsung.com>

On 08/02/2012 06:59 AM, Jingoo Han wrote:
> The devm_ functions allocate memory that is released when a driver
> detaches. This patch uses devm_clk_get() for these functions.
> 
> Signed-off-by: Jingoo Han <jg1.han@samsung.com>

Applied.


Thanks,

Florian Tobias Schandinat

> ---
>  drivers/video/s3c-fb.c |   24 +++++-------------------
>  1 files changed, 5 insertions(+), 19 deletions(-)
> 
> diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c
> index 69bf9d0..6c95126 100644
> --- a/drivers/video/s3c-fb.c
> +++ b/drivers/video/s3c-fb.c
> @@ -1398,17 +1398,16 @@ static int __devinit s3c_fb_probe(struct platform_device *pdev)
>  
>  	spin_lock_init(&sfb->slock);
>  
> -	sfb->bus_clk = clk_get(dev, "lcd");
> +	sfb->bus_clk = devm_clk_get(dev, "lcd");
>  	if (IS_ERR(sfb->bus_clk)) {
>  		dev_err(dev, "failed to get bus clock\n");
> -		ret = PTR_ERR(sfb->bus_clk);
> -		goto err_sfb;
> +		return PTR_ERR(sfb->bus_clk);
>  	}
>  
>  	clk_enable(sfb->bus_clk);
>  
>  	if (!sfb->variant.has_clksel) {
> -		sfb->lcd_clk = clk_get(dev, "sclk_fimd");
> +		sfb->lcd_clk = devm_clk_get(dev, "sclk_fimd");
>  		if (IS_ERR(sfb->lcd_clk)) {
>  			dev_err(dev, "failed to get lcd clock\n");
>  			ret = PTR_ERR(sfb->lcd_clk);
> @@ -1421,12 +1420,6 @@ static int __devinit s3c_fb_probe(struct platform_device *pdev)
>  	pm_runtime_enable(sfb->dev);
>  
>  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	if (!res) {
> -		dev_err(dev, "failed to find registers\n");
> -		ret = -ENOENT;
> -		goto err_lcd_clk;
> -	}
> -
>  	sfb->regs = devm_request_and_ioremap(dev, res);
>  	if (!sfb->regs) {
>  		dev_err(dev, "failed to map registers\n");
> @@ -1510,16 +1503,12 @@ err_pm_runtime:
>  err_lcd_clk:
>  	pm_runtime_disable(sfb->dev);
>  
> -	if (!sfb->variant.has_clksel) {
> +	if (!sfb->variant.has_clksel)
>  		clk_disable(sfb->lcd_clk);
> -		clk_put(sfb->lcd_clk);
> -	}
>  
>  err_bus_clk:
>  	clk_disable(sfb->bus_clk);
> -	clk_put(sfb->bus_clk);
>  
> -err_sfb:
>  	return ret;
>  }
>  
> @@ -1541,13 +1530,10 @@ static int __devexit s3c_fb_remove(struct platform_device *pdev)
>  		if (sfb->windows[win])
>  			s3c_fb_release_win(sfb, sfb->windows[win]);
>  
> -	if (!sfb->variant.has_clksel) {
> +	if (!sfb->variant.has_clksel)
>  		clk_disable(sfb->lcd_clk);
> -		clk_put(sfb->lcd_clk);
> -	}
>  
>  	clk_disable(sfb->bus_clk);
> -	clk_put(sfb->bus_clk);
>  
>  	pm_runtime_put_sync(sfb->dev);
>  	pm_runtime_disable(sfb->dev);


^ permalink raw reply

* Re: [PATCH 1/5] drivers/video/epson1355fb.c: use devm_ functions
From: Florian Tobias Schandinat @ 2012-08-23 20:40 UTC (permalink / raw)
  To: Damien Cassou
  Cc: Christopher Hoover, kernel-janitors, linux-fbdev, linux-kernel
In-Reply-To: <1344008414-2894-2-git-send-email-damien.cassou@lifl.fr>

On 08/03/2012 03:40 PM, Damien Cassou wrote:
> From: Damien Cassou <damien.cassou@lifl.fr>
> 
> The various devm_ functions allocate memory that is released when a driver
> detaches. This patch uses these functions for data that is allocated in the
> probe function of a platform device and is only freed in the remove function.
> 
> Signed-off-by: Damien Cassou <damien.cassou@lifl.fr>

Applied.


Thanks,

Florian Tobias Schandinat

> 
> ---
>  drivers/video/epson1355fb.c |   16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/video/epson1355fb.c b/drivers/video/epson1355fb.c
> index 68b9b51..246da1e 100644
> --- a/drivers/video/epson1355fb.c
> +++ b/drivers/video/epson1355fb.c
> @@ -592,12 +592,8 @@ static int epson1355fb_remove(struct platform_device *dev)
> 
>  	if (info) {
>  		fb_dealloc_cmap(&info->cmap);
> -		if (info->screen_base)
> -			iounmap(info->screen_base);
>  		framebuffer_release(info);
>  	}
> -	release_mem_region(EPSON1355FB_FB_PHYS, EPSON1355FB_FB_LEN);
> -	release_mem_region(EPSON1355FB_REGS_PHYS, EPSON1355FB_REGS_LEN);
>  	return 0;
>  }
> 
> @@ -608,15 +604,18 @@ static int __devinit epson1355fb_probe(struct platform_device *dev)
>  	u8 revision;
>  	int rc = 0;
> 
> -	if (!request_mem_region(EPSON1355FB_REGS_PHYS, EPSON1355FB_REGS_LEN, "S1D13505 registers")) {
> +	if (!devm_request_mem_region(&dev->dev, EPSON1355FB_REGS_PHYS,
> +				     EPSON1355FB_REGS_LEN,
> +				     "S1D13505 registers")) {
>  		printk(KERN_ERR "epson1355fb: unable to reserve "
>  		       "registers at 0x%0x\n", EPSON1355FB_REGS_PHYS);
>  		rc = -EBUSY;
>  		goto bail;
>  	}
> 
> -	if (!request_mem_region(EPSON1355FB_FB_PHYS, EPSON1355FB_FB_LEN,
> -				"S1D13505 framebuffer")) {
> +	if (!devm_request_mem_region(&dev->dev, EPSON1355FB_FB_PHYS,
> +				     EPSON1355FB_FB_LEN,
> +				     "S1D13505 framebuffer")) {
>  		printk(KERN_ERR "epson1355fb: unable to reserve "
>  		       "framebuffer at 0x%0x\n", EPSON1355FB_FB_PHYS);
>  		rc = -EBUSY;
> @@ -638,7 +637,8 @@ static int __devinit epson1355fb_probe(struct platform_device *dev)
>  	}
>  	info->pseudo_palette = default_par->pseudo_palette;
> 
> -	info->screen_base = ioremap(EPSON1355FB_FB_PHYS, EPSON1355FB_FB_LEN);
> +	info->screen_base = devm_ioremap(&dev->dev, EPSON1355FB_FB_PHYS,
> +					 EPSON1355FB_FB_LEN);
>  	if (!info->screen_base) {
>  		printk(KERN_ERR "epson1355fb: unable to map framebuffer\n");
>  		rc = -ENOMEM;
> 


^ permalink raw reply

* Re: [PATCH 3/5] drivers/video/jz4740_fb.c: use devm_ functions
From: Florian Tobias Schandinat @ 2012-08-23 20:41 UTC (permalink / raw)
  To: Damien Cassou; +Cc: kernel-janitors, linux-fbdev, linux-kernel
In-Reply-To: <1344008414-2894-3-git-send-email-damien.cassou@lifl.fr>

On 08/03/2012 03:40 PM, Damien Cassou wrote:
> From: Damien Cassou <damien.cassou@lifl.fr>
> 
> The various devm_ functions allocate memory that is released when a driver
> detaches. This patch uses these functions for data that is allocated in the
> probe function of a platform device and is only freed in the remove function.
> 
> Signed-off-by: Damien Cassou <damien.cassou@lifl.fr>

Applied.


Thanks,

Florian Tobias Schandinat

> 
> ---
>  drivers/video/jz4740_fb.c |   22 ++++++----------------
>  1 file changed, 6 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/video/jz4740_fb.c b/drivers/video/jz4740_fb.c
> index de36693..7669770 100644
> --- a/drivers/video/jz4740_fb.c
> +++ b/drivers/video/jz4740_fb.c
> @@ -659,25 +659,25 @@ static int __devinit jzfb_probe(struct platform_device *pdev)
>  	jzfb->pdata = pdata;
>  	jzfb->mem = mem;
> 
> -	jzfb->ldclk = clk_get(&pdev->dev, "lcd");
> +	jzfb->ldclk = devm_clk_get(&pdev->dev, "lcd");
>  	if (IS_ERR(jzfb->ldclk)) {
>  		ret = PTR_ERR(jzfb->ldclk);
>  		dev_err(&pdev->dev, "Failed to get lcd clock: %d\n", ret);
>  		goto err_framebuffer_release;
>  	}
> 
> -	jzfb->lpclk = clk_get(&pdev->dev, "lcd_pclk");
> +	jzfb->lpclk = devm_clk_get(&pdev->dev, "lcd_pclk");
>  	if (IS_ERR(jzfb->lpclk)) {
>  		ret = PTR_ERR(jzfb->lpclk);
>  		dev_err(&pdev->dev, "Failed to get lcd pixel clock: %d\n", ret);
> -		goto err_put_ldclk;
> +		goto err_framebuffer_release;
>  	}
> 
> -	jzfb->base = ioremap(mem->start, resource_size(mem));
> +	jzfb->base = devm_ioremap(&pdev->dev, mem->start, resource_size(mem));
>  	if (!jzfb->base) {
>  		dev_err(&pdev->dev, "Failed to ioremap register memory region\n");
>  		ret = -EBUSY;
> -		goto err_put_lpclk;
> +		goto err_framebuffer_release;
>  	}
> 
>  	platform_set_drvdata(pdev, jzfb);
> @@ -693,7 +693,7 @@ static int __devinit jzfb_probe(struct platform_device *pdev)
>  	ret = jzfb_alloc_devmem(jzfb);
>  	if (ret) {
>  		dev_err(&pdev->dev, "Failed to allocate video memory\n");
> -		goto err_iounmap;
> +		goto err_framebuffer_release;
>  	}
> 
>  	fb->fix = jzfb_fix;
> @@ -734,12 +734,6 @@ err_free_devmem:
> 
>  	fb_dealloc_cmap(&fb->cmap);
>  	jzfb_free_devmem(jzfb);
> -err_iounmap:
> -	iounmap(jzfb->base);
> -err_put_lpclk:
> -	clk_put(jzfb->lpclk);
> -err_put_ldclk:
> -	clk_put(jzfb->ldclk);
>  err_framebuffer_release:
>  	framebuffer_release(fb);
>  err_release_mem_region:
> @@ -756,7 +750,6 @@ static int __devexit jzfb_remove(struct platform_device *pdev)
>  	jz_gpio_bulk_free(jz_lcd_ctrl_pins, jzfb_num_ctrl_pins(jzfb));
>  	jz_gpio_bulk_free(jz_lcd_data_pins, jzfb_num_data_pins(jzfb));
> 
> -	iounmap(jzfb->base);
>  	release_mem_region(jzfb->mem->start, resource_size(jzfb->mem));
> 
>  	fb_dealloc_cmap(&jzfb->fb->cmap);
> @@ -764,9 +757,6 @@ static int __devexit jzfb_remove(struct platform_device *pdev)
> 
>  	platform_set_drvdata(pdev, NULL);
> 
> -	clk_put(jzfb->lpclk);
> -	clk_put(jzfb->ldclk);
> -
>  	framebuffer_release(jzfb->fb);
> 
>  	return 0;
> 


^ permalink raw reply

* Re: [PATCH 2/5] drivers/video/bf54x-lq043fb.c: use devm_ functions
From: Florian Tobias Schandinat @ 2012-08-23 20:41 UTC (permalink / raw)
  To: Damien Cassou; +Cc: kernel-janitors, linux-fbdev, linux-kernel
In-Reply-To: <1344008414-2894-4-git-send-email-damien.cassou@lifl.fr>

On 08/03/2012 03:40 PM, Damien Cassou wrote:
> From: Damien Cassou <damien.cassou@lifl.fr>
> 
> The various devm_ functions allocate memory that is released when a driver
> detaches. This patch replaces the use of kzalloc by devm_kzalloc.
> 
> Signed-off-by: Damien Cassou <damien.cassou@lifl.fr>

Applied.


Thanks,

Florian Tobias Schandinat

> 
> ---
>  drivers/video/bf54x-lq043fb.c |    8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/video/bf54x-lq043fb.c b/drivers/video/bf54x-lq043fb.c
> index dc2f004..47702ee 100644
> --- a/drivers/video/bf54x-lq043fb.c
> +++ b/drivers/video/bf54x-lq043fb.c
> @@ -601,7 +601,8 @@ static int __devinit bfin_bf54x_probe(struct platform_device *pdev)
> 
>  	fbinfo->fbops = &bfin_bf54x_fb_ops;
> 
> -	fbinfo->pseudo_palette = kzalloc(sizeof(u32) * 16, GFP_KERNEL);
> +	fbinfo->pseudo_palette = devm_kzalloc(&pdev->dev, sizeof(u32) * 16,
> +					      GFP_KERNEL);
>  	if (!fbinfo->pseudo_palette) {
>  		printk(KERN_ERR DRIVER_NAME
>  		       "Fail to allocate pseudo_palette\n");
> @@ -616,7 +617,7 @@ static int __devinit bfin_bf54x_probe(struct platform_device *pdev)
>  		       "Fail to allocate colormap (%d entries)\n",
>  		       BFIN_LCD_NBR_PALETTE_ENTRIES);
>  		ret = -EFAULT;
> -		goto out5;
> +		goto out4;
>  	}
> 
>  	if (request_ports(info)) {
> @@ -671,8 +672,6 @@ out7:
>  	free_ports(info);
>  out6:
>  	fb_dealloc_cmap(&fbinfo->cmap);
> -out5:
> -	kfree(fbinfo->pseudo_palette);
>  out4:
>  	dma_free_coherent(NULL, fbinfo->fix.smem_len, info->fb_buffer,
>  			  info->dma_handle);
> @@ -699,7 +698,6 @@ static int __devexit bfin_bf54x_remove(struct platform_device *pdev)
>  		dma_free_coherent(NULL, fbinfo->fix.smem_len, info->fb_buffer,
>  				  info->dma_handle);
> 
> -	kfree(fbinfo->pseudo_palette);
>  	fb_dealloc_cmap(&fbinfo->cmap);
> 
>  #ifndef NO_BL_SUPPORT
> 


^ permalink raw reply

* Re: [PATCH 5/5] drivers/video/msm/mddi_client_nt35399.c: use devm_ functions
From: Florian Tobias Schandinat @ 2012-08-23 20:42 UTC (permalink / raw)
  To: Damien Cassou
  Cc: David Brown, kernel-janitors, Daniel Walker, Bryan Huntsman,
	linux-arm-msm, linux-fbdev, linux-kernel
In-Reply-To: <1344008414-2894-5-git-send-email-damien.cassou@lifl.fr>

On 08/03/2012 03:40 PM, Damien Cassou wrote:
> From: Damien Cassou <damien.cassou@lifl.fr>
> 
> The various devm_ functions allocate memory that is released when a driver
> detaches. This patch replaces the use of kzalloc by devm_kzalloc.
> 
> Additionally, this patch fixes a memory leak: some memory was allocated for
> 'panel' but not released when the subsequent call to setup_vsync fails.
> 
> Signed-off-by: Damien Cassou <damien.cassou@lifl.fr>

Applied.


Thanks,

Florian Tobias Schandinat

> 
> ---
>  drivers/video/msm/mddi_client_nt35399.c |    6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/video/msm/mddi_client_nt35399.c b/drivers/video/msm/mddi_client_nt35399.c
> index 7fcd67e..66b314e 100644
> --- a/drivers/video/msm/mddi_client_nt35399.c
> +++ b/drivers/video/msm/mddi_client_nt35399.c
> @@ -189,8 +189,9 @@ static int mddi_nt35399_probe(struct platform_device *pdev)
> 
>  	int ret;
> 
> -	struct panel_info *panel = kzalloc(sizeof(struct panel_info),
> -					   GFP_KERNEL);
> +	struct panel_info *panel = devm_kzalloc(&pdev->dev,
> +						sizeof(struct panel_info),
> +						GFP_KERNEL);
> 
>  	printk(KERN_DEBUG "%s: enter.\n", __func__);
> 
> @@ -233,7 +234,6 @@ static int mddi_nt35399_remove(struct platform_device *pdev)
>  	struct panel_info *panel = platform_get_drvdata(pdev);
> 
>  	setup_vsync(panel, 0);
> -	kfree(panel);
>  	return 0;
>  }
> 


^ permalink raw reply

* Re: [PATCH] video: exynos_dp: check time loop for RPLY_RECEIV
From: Florian Tobias Schandinat @ 2012-08-23 20:42 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <003901cd7502$abac1ba0$030452e0$%han@samsung.com>

On 08/08/2012 01:10 AM, Jingoo Han wrote:
> This patch checks time loop for RPLY_RECEIV which means that
> AUX channel command reply is received.
> 
> Signed-off-by: Jingoo Han <jg1.han@samsung.com>

Applied.


Thanks,

Florian Tobias Schandinat

> ---
>  drivers/video/exynos/exynos_dp_reg.c |   10 +++++++++-
>  1 files changed, 9 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/video/exynos/exynos_dp_reg.c b/drivers/video/exynos/exynos_dp_reg.c
> index 2db5b9a..174c445 100644
> --- a/drivers/video/exynos/exynos_dp_reg.c
> +++ b/drivers/video/exynos/exynos_dp_reg.c
> @@ -401,6 +401,7 @@ int exynos_dp_start_aux_transaction(struct exynos_dp_device *dp)
>  {
>  	int reg;
>  	int retval = 0;
> +	int timeout_loop = 0;
>  
>  	/* Enable AUX CH operation */
>  	reg = readl(dp->reg_base + EXYNOS_DP_AUX_CH_CTL_2);
> @@ -409,8 +410,15 @@ int exynos_dp_start_aux_transaction(struct exynos_dp_device *dp)
>  
>  	/* Is AUX CH command reply received? */
>  	reg = readl(dp->reg_base + EXYNOS_DP_INT_STA);
> -	while (!(reg & RPLY_RECEIV))
> +	while (!(reg & RPLY_RECEIV)) {
> +		timeout_loop++;
> +		if (DP_TIMEOUT_LOOP_COUNT < timeout_loop) {
> +			dev_err(dp->dev, "AUX CH command reply failed!\n");
> +			return -ETIMEDOUT;
> +		}
>  		reg = readl(dp->reg_base + EXYNOS_DP_INT_STA);
> +		usleep_range(10, 11);
> +	}
>  
>  	/* Clear interrupt source for AUX CH command reply */
>  	writel(RPLY_RECEIV, dp->reg_base + EXYNOS_DP_INT_STA);


^ permalink raw reply

* Re: [PATCH] video:uvesafb: check the return value of kzalloc
From: Florian Tobias Schandinat @ 2012-08-23 20:43 UTC (permalink / raw)
  To: Wang YanQing, linux-fbdev, linux-kernel, spock
In-Reply-To: <20120813100232.GA16363@udknight>

On 08/13/2012 10:02 AM, Wang YanQing wrote:
> 
> Michal maybe forgot it merely, we should add code
> to check the return value of kzalloc to make the
> code more robust.
> 
> Signed-off-by: Wang YanQing <udknight@gmail.com>

Applied.


Thanks,

Florian Tobias Schandinat

> ---
>  drivers/video/uvesafb.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/video/uvesafb.c b/drivers/video/uvesafb.c
> index b0e2a42..2f8f82d 100644
> --- a/drivers/video/uvesafb.c
> +++ b/drivers/video/uvesafb.c
> @@ -659,6 +659,8 @@ static int __devinit uvesafb_vbe_getedid(struct uvesafb_ktask *task,
>  	task->t.flags = TF_BUF_RET | TF_BUF_ESDI;
>  	task->t.buf_len = EDID_LENGTH;
>  	task->buf = kzalloc(EDID_LENGTH, GFP_KERNEL);
> +	if (!task->buf)
> +		return -ENOMEM;
>  
>  	err = uvesafb_exec(task);
>  


^ permalink raw reply

* Re: [PATCH v5] da8xx-fb: add 24bpp LCD configuration support
From: Florian Tobias Schandinat @ 2012-08-23 20:47 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <1344950502-18835-1-git-send-email-prakash.pm@ti.com>

On 08/14/2012 01:21 PM, Manjunathappa, Prakash wrote:
> LCD controller on am335x supports 24bpp raster configuration in addition
> to ones on da850. LCDC also supports 24bpp in unpacked format having
> ARGB:8888 32bpp format data in DDR, but it doesn't interpret alpha
> component of the data.
> 
> Signed-off-by: Manjunathappa, Prakash <prakash.pm@ti.com>
> Cc: Anatolij Gustschin <agust@denx.de>

Applied, although I think it shouldn't set var->transp if the
transparency is not used. But as other drivers seem to do the same I
guess both is okay.


Thanks,

Florian Tobias Schandinat

> ---
> Applies on top of fbdev-next of Florian Tobias Schandinat's tree.
> Since v4:
> Re-define CNVT_TOHW macro.
> Since v3:
> Minor nit, declare pseudo_palette as u32 type.
> Since v2:
> Fixed additional configurations for 24bpp support.
> Since v1:
> Simplified calculation of pseudopalette for FB_VISUAL_TRUECOLOR type.
> 
>  drivers/video/da8xx-fb.c |  132 +++++++++++++++++++++++++++++++++------------
>  1 files changed, 97 insertions(+), 35 deletions(-)
> 
> diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c
> index cb696ff..5c6df7b 100644
> --- a/drivers/video/da8xx-fb.c
> +++ b/drivers/video/da8xx-fb.c
> @@ -87,6 +87,8 @@
>  #define LCD_V2_LIDD_CLK_EN		BIT(1)
>  #define LCD_V2_CORE_CLK_EN		BIT(0)
>  #define LCD_V2_LPP_B10			26
> +#define LCD_V2_TFT_24BPP_MODE		BIT(25)
> +#define LCD_V2_TFT_24BPP_UNPACK		BIT(26)
>  
>  /* LCD Raster Timing 2 Register */
>  #define LCD_AC_BIAS_TRANSITIONS_PER_INT(x)	((x) << 16)
> @@ -157,7 +159,6 @@ struct da8xx_fb_par {
>  	unsigned int		dma_end;
>  	struct clk *lcdc_clk;
>  	int irq;
> -	unsigned short pseudo_palette[16];
>  	unsigned int palette_sz;
>  	unsigned int pxl_clk;
>  	int blank;
> @@ -176,6 +177,7 @@ struct da8xx_fb_par {
>  	unsigned int		lcd_fck_rate;
>  #endif
>  	void (*panel_power_ctrl)(int);
> +	u32 pseudo_palette[16];
>  };
>  
>  /* Variable Screen Information */
> @@ -528,6 +530,9 @@ static int lcd_cfg_frame_buffer(struct da8xx_fb_par *par, u32 width, u32 height,
>  {
>  	u32 reg;
>  
> +	if (bpp > 16 && lcd_revision = LCD_VERSION_1)
> +		return -EINVAL;
> +
>  	/* Set the Panel Width */
>  	/* Pixels per line = (PPL + 1)*16 */
>  	if (lcd_revision = LCD_VERSION_1) {
> @@ -571,14 +576,19 @@ static int lcd_cfg_frame_buffer(struct da8xx_fb_par *par, u32 width, u32 height,
>  	reg = lcdc_read(LCD_RASTER_CTRL_REG) & ~(1 << 8);
>  	if (raster_order)
>  		reg |= LCD_RASTER_ORDER;
> -	lcdc_write(reg, LCD_RASTER_CTRL_REG);
> +
> +	par->palette_sz = 16 * 2;
>  
>  	switch (bpp) {
>  	case 1:
>  	case 2:
>  	case 4:
>  	case 16:
> -		par->palette_sz = 16 * 2;
> +		break;
> +	case 24:
> +		reg |= LCD_V2_TFT_24BPP_MODE;
> +	case 32:
> +		reg |= LCD_V2_TFT_24BPP_UNPACK;
>  		break;
>  
>  	case 8:
> @@ -589,9 +599,12 @@ static int lcd_cfg_frame_buffer(struct da8xx_fb_par *par, u32 width, u32 height,
>  		return -EINVAL;
>  	}
>  
> +	lcdc_write(reg, LCD_RASTER_CTRL_REG);
> +
>  	return 0;
>  }
>  
> +#define CNVT_TOHW(val, width) ((((val) << (width)) + 0x7FFF - (val)) >> 16)
>  static int fb_setcolreg(unsigned regno, unsigned red, unsigned green,
>  			      unsigned blue, unsigned transp,
>  			      struct fb_info *info)
> @@ -607,13 +620,38 @@ static int fb_setcolreg(unsigned regno, unsigned red, unsigned green,
>  	if (info->fix.visual = FB_VISUAL_DIRECTCOLOR)
>  		return 1;
>  
> -	if (info->var.bits_per_pixel = 4) {
> -		if (regno > 15)
> -			return 1;
> +	if (info->var.bits_per_pixel > 16 && lcd_revision = LCD_VERSION_1)
> +		return -EINVAL;
>  
> -		if (info->var.grayscale) {
> -			pal = regno;
> -		} else {
> +	switch (info->fix.visual) {
> +	case FB_VISUAL_TRUECOLOR:
> +		red = CNVT_TOHW(red, info->var.red.length);
> +		green = CNVT_TOHW(green, info->var.green.length);
> +		blue = CNVT_TOHW(blue, info->var.blue.length);
> +		break;
> +	case FB_VISUAL_PSEUDOCOLOR:
> +		switch (info->var.bits_per_pixel) {
> +		case 4:
> +			if (regno > 15)
> +				return -EINVAL;
> +
> +			if (info->var.grayscale) {
> +				pal = regno;
> +			} else {
> +				red >>= 4;
> +				green >>= 8;
> +				blue >>= 12;
> +
> +				pal = red & 0x0f00;
> +				pal |= green & 0x00f0;
> +				pal |= blue & 0x000f;
> +			}
> +			if (regno = 0)
> +				pal |= 0x2000;
> +			palette[regno] = pal;
> +			break;
> +
> +		case 8:
>  			red >>= 4;
>  			green >>= 8;
>  			blue >>= 12;
> @@ -621,36 +659,36 @@ static int fb_setcolreg(unsigned regno, unsigned red, unsigned green,
>  			pal = (red & 0x0f00);
>  			pal |= (green & 0x00f0);
>  			pal |= (blue & 0x000f);
> -		}
> -		if (regno = 0)
> -			pal |= 0x2000;
> -		palette[regno] = pal;
>  
> -	} else if (info->var.bits_per_pixel = 8) {
> -		red >>= 4;
> -		green >>= 8;
> -		blue >>= 12;
> -
> -		pal = (red & 0x0f00);
> -		pal |= (green & 0x00f0);
> -		pal |= (blue & 0x000f);
> -
> -		if (palette[regno] != pal) {
> -			update_hw = 1;
> -			palette[regno] = pal;
> +			if (palette[regno] != pal) {
> +				update_hw = 1;
> +				palette[regno] = pal;
> +			}
> +			break;
>  		}
> -	} else if ((info->var.bits_per_pixel = 16) && regno < 16) {
> -		red >>= (16 - info->var.red.length);
> -		red <<= info->var.red.offset;
> +		break;
> +	}
>  
> -		green >>= (16 - info->var.green.length);
> -		green <<= info->var.green.offset;
> +	/* Truecolor has hardware independent palette */
> +	if (info->fix.visual = FB_VISUAL_TRUECOLOR) {
> +		u32 v;
>  
> -		blue >>= (16 - info->var.blue.length);
> -		blue <<= info->var.blue.offset;
> +		if (regno > 15)
> +			return -EINVAL;
>  
> -		par->pseudo_palette[regno] = red | green | blue;
> +		v = (red << info->var.red.offset) |
> +			(green << info->var.green.offset) |
> +			(blue << info->var.blue.offset);
>  
> +		switch (info->var.bits_per_pixel) {
> +		case 16:
> +			((u16 *) (info->pseudo_palette))[regno] = v;
> +			break;
> +		case 24:
> +		case 32:
> +			((u32 *) (info->pseudo_palette))[regno] = v;
> +			break;
> +		}
>  		if (palette[0] != 0x4000) {
>  			update_hw = 1;
>  			palette[0] = 0x4000;
> @@ -663,6 +701,7 @@ static int fb_setcolreg(unsigned regno, unsigned red, unsigned green,
>  
>  	return 0;
>  }
> +#undef CNVT_TOHW
>  
>  static void lcd_reset(struct da8xx_fb_par *par)
>  {
> @@ -871,6 +910,9 @@ static int fb_check_var(struct fb_var_screeninfo *var,
>  {
>  	int err = 0;
>  
> +	if (var->bits_per_pixel > 16 && lcd_revision = LCD_VERSION_1)
> +		return -EINVAL;
> +
>  	switch (var->bits_per_pixel) {
>  	case 1:
>  	case 8:
> @@ -906,6 +948,26 @@ static int fb_check_var(struct fb_var_screeninfo *var,
>  		var->transp.length = 0;
>  		var->nonstd = 0;
>  		break;
> +	case 24:
> +		var->red.offset = 16;
> +		var->red.length = 8;
> +		var->green.offset = 8;
> +		var->green.length = 8;
> +		var->blue.offset = 0;
> +		var->blue.length = 8;
> +		var->nonstd = 0;
> +		break;
> +	case 32:
> +		var->transp.offset = 24;
> +		var->transp.length = 8;
> +		var->red.offset = 16;
> +		var->red.length = 8;
> +		var->green.offset = 8;
> +		var->green.length = 8;
> +		var->blue.offset = 0;
> +		var->blue.length = 8;
> +		var->nonstd = 0;
> +		break;
>  	default:
>  		err = -EINVAL;
>  	}


^ permalink raw reply

* Re: [PATCH] fbdev/amifb: Remove write-only variable amifb_inverse
From: Florian Tobias Schandinat @ 2012-08-23 20:47 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: linux-fbdev, linux-m68k
In-Reply-To: <1345296621-15367-1-git-send-email-geert@linux-m68k.org>

On 08/18/2012 01:30 PM, Geert Uytterhoeven wrote:
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>

Applied.


Thanks,

Florian Tobias Schandinat

> ---
>  drivers/video/amifb.c |    2 --
>  1 files changed, 0 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/video/amifb.c b/drivers/video/amifb.c
> index 887df9d..7fa1bf8 100644
> --- a/drivers/video/amifb.c
> +++ b/drivers/video/amifb.c
> @@ -949,7 +949,6 @@ static int round_down_bpp = 1;	/* for mode probing */
>  
>  
>  static int amifb_ilbm = 0;	/* interleaved or normal bitplanes */
> -static int amifb_inverse = 0;
>  
>  static u32 amifb_hfmin __initdata;	/* monitor hfreq lower limit (Hz) */
>  static u32 amifb_hfmax __initdata;	/* monitor hfreq upper limit (Hz) */
> @@ -2355,7 +2354,6 @@ static int __init amifb_setup(char *options)
>  		if (!*this_opt)
>  			continue;
>  		if (!strcmp(this_opt, "inverse")) {
> -			amifb_inverse = 1;
>  			fb_invert_cmaps();
>  		} else if (!strcmp(this_opt, "ilbm"))
>  			amifb_ilbm = 1;


^ permalink raw reply

* Re: [PATCH 8/14] drivers/video/sunxvr2500.c: fix error return code
From: Florian Tobias Schandinat @ 2012-08-23 20:48 UTC (permalink / raw)
  To: Julia Lawall; +Cc: kernel-janitors, linux-fbdev, linux-kernel
In-Reply-To: <1345365870-29831-9-git-send-email-Julia.Lawall@lip6.fr>

On 08/19/2012 08:44 AM, Julia Lawall wrote:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> Initialize return variable before exiting on an error path.
> 
> A simplified version of the semantic match that finds this problem is as
> follows: (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> (
> if@p1 (\(ret < 0\|ret != 0\))
>  { ... return ret; }
> |
> ret@p1 = 0
> )
> ... when != ret = e1
>     when != &ret
> *if(...)
> {
>   ... when != ret = e2
>       when forall
>  return ret;
> }
> 
> // </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Applied.


Thanks,

Florian Tobias Schandinat

> 
> ---
>  drivers/video/sunxvr2500.c |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/video/sunxvr2500.c b/drivers/video/sunxvr2500.c
> index 5848436..7fbcba8 100644
> --- a/drivers/video/sunxvr2500.c
> +++ b/drivers/video/sunxvr2500.c
> @@ -181,8 +181,10 @@ static int __devinit s3d_pci_register(struct pci_dev *pdev,
>  	sp->fb_size = info->fix.line_length * sp->height;
>  
>  	sp->fb_base = ioremap(sp->fb_base_phys, sp->fb_size);
> -	if (!sp->fb_base)
> +	if (!sp->fb_base) {
> +		err = -ENOMEM;
>  		goto err_release_pci;
> +	}
>  
>  	err = s3d_set_fbinfo(sp);
>  	if (err)
> 
> 


^ permalink raw reply

* Re: [PATCH 01/10] video: exynos_dp: Change aux transaction failures
From: Florian Tobias Schandinat @ 2012-08-23 20:48 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <1344398064-13563-2-git-send-email-seanpaul@chromium.org>

On 08/20/2012 09:02 AM, Jingoo Han wrote:
> On Wednesday, August 08, 2012 12:54 PM Sean Paul wrote:
>>
>> This patch adds the function name to aux transaction failure messages
>> so we can tell which transaction is failing. It also changes the level
>> of Aux Transaction fail messages from error to debug. We retry the
>> transactions a few times and will report errors if warranted outside of
>> this function.
>>
>> Signed-off-by: Sean Paul <seanpaul@chromium.org>
>> Reviewed-by: Doug Anderson <dianders@chromium.org>
>> Reviewed-by: Bernie Thompson <bhthompson@chromium.org>
>> ---
> 
> 
> Acked-by: Jingoo Han <jg1.han@samsung.com>
> 
> It looks good.

Applied.


Thanks,

Florian Tobias Schandinat

> 
> 
> 
>>  drivers/video/exynos/exynos_dp_reg.c |   21 ++++++++++++++-------
>>  1 files changed, 14 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/video/exynos/exynos_dp_reg.c b/drivers/video/exynos/exynos_dp_reg.c
>> index ce401c8..a121bed 100644
>> --- a/drivers/video/exynos/exynos_dp_reg.c
>> +++ b/drivers/video/exynos/exynos_dp_reg.c
>> @@ -471,7 +471,8 @@ int exynos_dp_write_byte_to_dpcd(struct exynos_dp_device *dp,
>>  		if (retval = 0)
>>  			break;
>>  		else
>> -			dev_err(dp->dev, "Aux Transaction fail!\n");
>> +			dev_dbg(dp->dev, "%s: Aux Transaction fail!\n",
>> +				__func__);
>>  	}
>>
>>  	return retval;
>> @@ -511,7 +512,8 @@ int exynos_dp_read_byte_from_dpcd(struct exynos_dp_device *dp,
>>  		if (retval = 0)
>>  			break;
>>  		else
>> -			dev_err(dp->dev, "Aux Transaction fail!\n");
>> +			dev_dbg(dp->dev, "%s: Aux Transaction fail!\n",
>> +				__func__);
>>  	}
>>
>>  	/* Read data buffer */
>> @@ -575,7 +577,8 @@ int exynos_dp_write_bytes_to_dpcd(struct exynos_dp_device *dp,
>>  			if (retval = 0)
>>  				break;
>>  			else
>> -				dev_err(dp->dev, "Aux Transaction fail!\n");
>> +				dev_dbg(dp->dev, "%s: Aux Transaction fail!\n",
>> +					__func__);
>>  		}
>>
>>  		start_offset += cur_data_count;
>> @@ -632,7 +635,8 @@ int exynos_dp_read_bytes_from_dpcd(struct exynos_dp_device *dp,
>>  			if (retval = 0)
>>  				break;
>>  			else
>> -				dev_err(dp->dev, "Aux Transaction fail!\n");
>> +				dev_dbg(dp->dev, "%s: Aux Transaction fail!\n",
>> +					__func__);
>>  		}
>>
>>  		for (cur_data_idx = 0; cur_data_idx < cur_data_count;
>> @@ -677,7 +681,7 @@ int exynos_dp_select_i2c_device(struct exynos_dp_device *dp,
>>  	/* Start AUX transaction */
>>  	retval = exynos_dp_start_aux_transaction(dp);
>>  	if (retval != 0)
>> -		dev_err(dp->dev, "Aux Transaction fail!\n");
>> +		dev_dbg(dp->dev, "%s: Aux Transaction fail!\n", __func__);
>>
>>  	return retval;
>>  }
>> @@ -717,7 +721,8 @@ int exynos_dp_read_byte_from_i2c(struct exynos_dp_device *dp,
>>  		if (retval = 0)
>>  			break;
>>  		else
>> -			dev_err(dp->dev, "Aux Transaction fail!\n");
>> +			dev_dbg(dp->dev, "%s: Aux Transaction fail!\n",
>> +				__func__);
>>  	}
>>
>>  	/* Read data */
>> @@ -777,7 +782,9 @@ int exynos_dp_read_bytes_from_i2c(struct exynos_dp_device *dp,
>>  				if (retval = 0)
>>  					break;
>>  				else
>> -					dev_err(dp->dev, "Aux Transaction fail!\n");
>> +					dev_dbg(dp->dev,
>> +						"%s: Aux Transaction fail!\n",
>> +						__func__);
>>  			}
>>  			/* Check if Rx sends defer */
>>  			reg = readl(dp->reg_base + EXYNOS_DP_AUX_RX_COMM);
>> --
>> 1.7.7.3
> 
> 


^ permalink raw reply

* Re: [PATCH 06/10] video: exynos_dp: Fix get_pll_lock_status return value
From: Florian Tobias Schandinat @ 2012-08-23 20:49 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <1344398064-13563-7-git-send-email-seanpaul@chromium.org>

On 08/20/2012 09:20 AM, Jingoo Han wrote:
> On Wednesday, August 08, 2012 12:54 PM Sean Paul wrote:
>>
>> Fix the return value of exynos_dp_get_pll_lock_status to
>> reflect what it actually returns.
>>
>> Signed-off-by: Sean Paul <seanpaul@chromium.org>
>> Reviewed-by: Olof Johansson <olofj@chromium.org>
> 
> 
> Acked-by: Jingoo Han <jg1.han@samsung.com>

Applied.


Thanks,

Florian Tobias Schandinat

> 
> 
>> ---
>>  drivers/video/exynos/exynos_dp_core.h |    2 +-
>>  drivers/video/exynos/exynos_dp_reg.c  |    2 +-
>>  2 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/video/exynos/exynos_dp_core.h b/drivers/video/exynos/exynos_dp_core.h
>> index 8526e54..6431c65 100644
>> --- a/drivers/video/exynos/exynos_dp_core.h
>> +++ b/drivers/video/exynos/exynos_dp_core.h
>> @@ -43,7 +43,7 @@ void exynos_dp_init_interrupt(struct exynos_dp_device *dp);
>>  void exynos_dp_reset(struct exynos_dp_device *dp);
>>  void exynos_dp_swreset(struct exynos_dp_device *dp);
>>  void exynos_dp_config_interrupt(struct exynos_dp_device *dp);
>> -u32 exynos_dp_get_pll_lock_status(struct exynos_dp_device *dp);
>> +enum pll_status exynos_dp_get_pll_lock_status(struct exynos_dp_device *dp);
>>  void exynos_dp_set_pll_power_down(struct exynos_dp_device *dp, bool enable);
>>  void exynos_dp_set_analog_power_down(struct exynos_dp_device *dp,
>>  				enum analog_power_block block,
>> diff --git a/drivers/video/exynos/exynos_dp_reg.c b/drivers/video/exynos/exynos_dp_reg.c
>> index a121bed..d7b1494 100644
>> --- a/drivers/video/exynos/exynos_dp_reg.c
>> +++ b/drivers/video/exynos/exynos_dp_reg.c
>> @@ -179,7 +179,7 @@ void exynos_dp_config_interrupt(struct exynos_dp_device *dp)
>>  	writel(reg, dp->reg_base + EXYNOS_DP_INT_STA_MASK);
>>  }
>>
>> -u32 exynos_dp_get_pll_lock_status(struct exynos_dp_device *dp)
>> +enum pll_status exynos_dp_get_pll_lock_status(struct exynos_dp_device *dp)
>>  {
>>  	u32 reg;
>>
>> --
>> 1.7.7.3
> 
> 


^ permalink raw reply

* Re: [PATCH 1/2] video: exynos_dp: change return type of exynos_dp_init_video to void
From: Florian Tobias Schandinat @ 2012-08-23 20:49 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <000a01cd811d$a408b080$ec1a1180$%han@samsung.com>

On 08/23/2012 10:54 AM, Jingoo Han wrote:
> This patch changes return type of exynos_dp_init_video to void,
> because the return value is unnecessary.
> 
> Signed-off-by: Jingoo Han <jg1.han@samsung.com>

Applied.


Thanks,

Florian Tobias Schandinat

> ---
>  drivers/video/exynos/exynos_dp_core.h |    2 +-
>  drivers/video/exynos/exynos_dp_reg.c  |    4 +---
>  2 files changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/video/exynos/exynos_dp_core.h b/drivers/video/exynos/exynos_dp_core.h
> index 8526e54..1e244ea 100644
> --- a/drivers/video/exynos/exynos_dp_core.h
> +++ b/drivers/video/exynos/exynos_dp_core.h
> @@ -105,7 +105,7 @@ u32 exynos_dp_get_lane1_link_training(struct exynos_dp_device *dp);
>  u32 exynos_dp_get_lane2_link_training(struct exynos_dp_device *dp);
>  u32 exynos_dp_get_lane3_link_training(struct exynos_dp_device *dp);
>  void exynos_dp_reset_macro(struct exynos_dp_device *dp);
> -int exynos_dp_init_video(struct exynos_dp_device *dp);
> +void exynos_dp_init_video(struct exynos_dp_device *dp);
>  
>  void exynos_dp_set_video_color_format(struct exynos_dp_device *dp,
>  				u32 color_depth,
> diff --git a/drivers/video/exynos/exynos_dp_reg.c b/drivers/video/exynos/exynos_dp_reg.c
> index 2db5b9a..e29497b 100644
> --- a/drivers/video/exynos/exynos_dp_reg.c
> +++ b/drivers/video/exynos/exynos_dp_reg.c
> @@ -994,7 +994,7 @@ void exynos_dp_reset_macro(struct exynos_dp_device *dp)
>  	writel(reg, dp->reg_base + EXYNOS_DP_PHY_TEST);
>  }
>  
> -int exynos_dp_init_video(struct exynos_dp_device *dp)
> +void exynos_dp_init_video(struct exynos_dp_device *dp)
>  {
>  	u32 reg;
>  
> @@ -1012,8 +1012,6 @@ int exynos_dp_init_video(struct exynos_dp_device *dp)
>  
>  	reg = VID_HRES_TH(2) | VID_VRES_TH(0);
>  	writel(reg, dp->reg_base + EXYNOS_DP_VIDEO_CTL_8);
> -
> -	return 0;
>  }
>  
>  void exynos_dp_set_video_color_format(struct exynos_dp_device *dp,


^ permalink raw reply

* Re: [PATCH 2/2] video: exynos_dp: move setting analog parameter and interrupt to after sw reset
From: Florian Tobias Schandinat @ 2012-08-23 20:50 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <000b01cd811d$c5890b60$509b2220$%han@samsung.com>

On 08/23/2012 10:55 AM, Jingoo Han wrote:
> SW reset sets DP TX to initial value, so configurations for analog parameter
> and interrupt are not set properly. Therefore, exynos_dp_init_analog_param()
> and exynos_dp_init_interrupt() should be moved to after sw reset is called,
> in order to set these values properly.
> 
> Signed-off-by: Jingoo Han <jg1.han@samsung.com>

Applied.


Thanks,

Florian Tobias Schandinat

> ---
>  drivers/video/exynos/exynos_dp_core.c |    3 +++
>  drivers/video/exynos/exynos_dp_reg.c  |    3 ---
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/video/exynos/exynos_dp_core.c b/drivers/video/exynos/exynos_dp_core.c
> index c6c016a..8113698 100644
> --- a/drivers/video/exynos/exynos_dp_core.c
> +++ b/drivers/video/exynos/exynos_dp_core.c
> @@ -29,6 +29,9 @@ static int exynos_dp_init_dp(struct exynos_dp_device *dp)
>  
>  	exynos_dp_swreset(dp);
>  
> +	exynos_dp_init_analog_param(dp);
> +	exynos_dp_init_interrupt(dp);
> +
>  	/* SW defined function Normal operation */
>  	exynos_dp_enable_sw_function(dp);
>  
> diff --git a/drivers/video/exynos/exynos_dp_reg.c b/drivers/video/exynos/exynos_dp_reg.c
> index e29497b..9a862f5 100644
> --- a/drivers/video/exynos/exynos_dp_reg.c
> +++ b/drivers/video/exynos/exynos_dp_reg.c
> @@ -148,9 +148,6 @@ void exynos_dp_reset(struct exynos_dp_device *dp)
>  	writel(0x2, dp->reg_base + EXYNOS_DP_M_AUD_GEN_FILTER_TH);
>  
>  	writel(0x00000101, dp->reg_base + EXYNOS_DP_SOC_GENERAL_CTL);
> -
> -	exynos_dp_init_analog_param(dp);
> -	exynos_dp_init_interrupt(dp);
>  }
>  
>  void exynos_dp_swreset(struct exynos_dp_device *dp)


^ permalink raw reply

* [PATCH] pwm-imx: Fix config / enable / disable
From: Benoît Thébaudeau @ 2012-08-23 20:58 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20120823191108.GB8127@avionic-0098.mockup.avionic-design.de>

imx_pwm_config() did not enable the PWM IP clock while accessing the registers.
Hence, a call to pwm_config() had no effect before pwm_enable() had been called,
which does not comply to the PWM API.

Moreover, calling pwm_disable() then pwm_enable() must be a transparent
operation.

This fixes the first setting of brightness through sysfs that had no effect with
leds-pwm.

Cc: Thierry Reding <thierry.reding@avionic-design.de>
Cc: <linux-kernel@vger.kernel.org>
Cc: Sascha Hauer <kernel@pengutronix.de>
Cc: <linux-arm-kernel@lists.infradead.org>
Cc: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
---
 .../drivers/pwm/pwm-imx.c                          |   55 +++++++++++++++-----
 1 file changed, 43 insertions(+), 12 deletions(-)

diff --git linux-next-c94456b.orig/drivers/pwm/pwm-imx.c linux-next-c94456b/drivers/pwm/pwm-imx.c
index 2a0b353..0519bf2 100644
--- linux-next-c94456b.orig/drivers/pwm/pwm-imx.c
+++ linux-next-c94456b/drivers/pwm/pwm-imx.c
@@ -55,6 +55,16 @@ static int imx_pwm_config(struct pwm_chip *chip,
 {
 	struct imx_chip *imx = to_imx_chip(chip);
 
+	/*
+	 * If the PWM is disabled, make sure to turn on the clock before
+	 * accessing the registers.
+	 */
+	if (!imx->clk_enabled) {
+		int rc = clk_prepare_enable(imx->clk);
+		if (rc)
+			return rc;
+	}
+
 	if (!(cpu_is_mx1() || cpu_is_mx21())) {
 		unsigned long long c;
 		unsigned long period_cycles, duty_cycles, prescale;
@@ -85,8 +95,11 @@ static int imx_pwm_config(struct pwm_chip *chip,
 		writel(period_cycles, imx->mmio_base + MX3_PWMPR);
 
 		cr = MX3_PWMCR_PRESCALER(prescale) |
-			MX3_PWMCR_DOZEEN | MX3_PWMCR_WAITEN |
-			MX3_PWMCR_DBGEN | MX3_PWMCR_EN;
+			MX3_PWMCR_DOZEEN | MX3_PWMCR_WAITEN | MX3_PWMCR_DBGEN;
+
+		/* If the PWM is enabled, keep it so. */
+		if (imx->clk_enabled)
+			cr |= MX3_PWMCR_EN;
 
 		if (cpu_is_mx25())
 			cr |= MX3_PWMCR_CLKSRC_IPG;
@@ -118,32 +131,50 @@ static int imx_pwm_config(struct pwm_chip *chip,
 		BUG();
 	}
 
+	/* If the PWM is disabled, turn the clock off again to save power. */
+	if (!imx->clk_enabled)
+		clk_disable_unprepare(imx->clk);
+
 	return 0;
 }
 
 static int imx_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm)
 {
 	struct imx_chip *imx = to_imx_chip(chip);
-	int rc = 0;
+	int rc;
 
-	if (!imx->clk_enabled) {
-		rc = clk_prepare_enable(imx->clk);
-		if (!rc)
-			imx->clk_enabled = 1;
+	if (imx->clk_enabled)
+		return 0;
+
+	rc = clk_prepare_enable(imx->clk);
+	if (rc)
+		return rc;
+
+	if (!(cpu_is_mx1() || cpu_is_mx21())) {
+		u32 cr = readl(imx->mmio_base + MX3_PWMCR);
+		cr |= MX3_PWMCR_EN;
+		writel(cr, imx->mmio_base + MX3_PWMCR);
 	}
-	return rc;
+
+	imx->clk_enabled = 1;
+	return 0;
 }
 
 static void imx_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm)
 {
 	struct imx_chip *imx = to_imx_chip(chip);
 
-	writel(0, imx->mmio_base + MX3_PWMCR);
+	if (!imx->clk_enabled)
+		return;
 
-	if (imx->clk_enabled) {
-		clk_disable_unprepare(imx->clk);
-		imx->clk_enabled = 0;
+	if (!(cpu_is_mx1() || cpu_is_mx21())) {
+		u32 cr = readl(imx->mmio_base + MX3_PWMCR);
+		cr &= ~MX3_PWMCR_EN;
+		writel(cr, imx->mmio_base + MX3_PWMCR);
 	}
+
+	clk_disable_unprepare(imx->clk);
+	imx->clk_enabled = 0;
 }
 
 static struct pwm_ops imx_pwm_ops = {

^ permalink raw reply related

* Re: [PATCHv3 3/9] serial: vt8500: Add devicetree support for
From: Rob Landley @ 2012-08-23 21:29 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <201208220644.18059.arnd@arndb.de>

On 08/22/2012 01:44 AM, Arnd Bergmann wrote:
> On Wednesday 22 August 2012, Tony Prisk wrote:
>> The original patch was very simple, but I revisited it to fix other
>> issues and forgot to add the relevant comments.
>>
>> Port size is changed to fix a problem - WM8505 actually had 6 uart's
>> defined in platform data but the vt8500_ports variable was only 4.
>>
>> I have added devicetree port id support as well.
> 
> If you do multiple things in one driver, you should normally send multiple
> patches as well, each with a description why that change is done.
> It may seem silly at first to send out a one-line patch next to a 100-line
> patch for the same file, but those cases are actually the ones where it's
> most important.

Think of us poor git-bisect monkeys who have no idea why something broke
but can (purely mechanically) figure out which commit did it. If it's a
patch that does three unrelated things, we're kinda stuck.

Rob
-- 
GNU/Linux isn't: Linux=GPLv2, GNU=GPLv3+, they can't share code.
Either it's "mere aggregation", or a license violation.  Pick one.

^ permalink raw reply

* [PATCH] video: bfin-lq035q1: use module_platform_driver
From: Devendra Naga @ 2012-08-23 21:55 UTC (permalink / raw)
  To: linux-fbdev

the driver's module init and exit functions are calling
platform_driver_register and platform_driver_unregister and doing nothing
else.

This same as that of the module_platform_driver,
remove this init and exit functions and use the module_platform_driver instead

Signed-off-by: Devendra Naga <develkernel412222@gmail.com>
---
 drivers/video/bfin-lq035q1-fb.c |   12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/drivers/video/bfin-lq035q1-fb.c b/drivers/video/bfin-lq035q1-fb.c
index 353c02f..1b21519 100644
--- a/drivers/video/bfin-lq035q1-fb.c
+++ b/drivers/video/bfin-lq035q1-fb.c
@@ -853,17 +853,7 @@ static struct platform_driver bfin_lq035q1_driver = {
 	},
 };
 
-static int __init bfin_lq035q1_driver_init(void)
-{
-	return platform_driver_register(&bfin_lq035q1_driver);
-}
-module_init(bfin_lq035q1_driver_init);
-
-static void __exit bfin_lq035q1_driver_cleanup(void)
-{
-	platform_driver_unregister(&bfin_lq035q1_driver);
-}
-module_exit(bfin_lq035q1_driver_cleanup);
+module_platform_driver(bfin_lq035q1_driver);
 
 MODULE_DESCRIPTION("Blackfin TFT LCD Driver");
 MODULE_LICENSE("GPL");
-- 
1.7.9.5


^ permalink raw reply related

* Re: [PATCH 8/8] OMAPDSS: fix use of dssdev->caps
From: Archit Taneja @ 2012-08-24  5:52 UTC (permalink / raw)
  To: Tomi Valkeinen; +Cc: linux-omap, linux-fbdev
In-Reply-To: <1345729514-2441-9-git-send-email-tomi.valkeinen@ti.com>

On Thursday 23 August 2012 07:15 PM, Tomi Valkeinen wrote:
> Recent commit dca2b1522ccab28d03fb79f6e70e70ea78033d52 (OMAPDSS: DSI:
> Maintain copy of operation mode in driver data) broke DSI for video mode
> displays. The commit changed the way dssdev->caps are initialized, and
> the result was that every DSI display is initialized with manual-update
> and tear-elim caps.

Ah, I didn't realise that. Thanks for catching this.

>
> The code that sets dssdev->caps is not very good, even when fixed.
> omapdss driver shouldn't be writing dssdev->caps at all.
>
> This patch fixes the problem with video mode displays by moving the
> initialization of dssdev->caps to the panel driver. The same change is
> done for RFBI.

Yes, it makes more sense to configure these in the panel driver.

Archit

>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> ---
>   drivers/video/omap2/displays/panel-n8x0.c |    1 +
>   drivers/video/omap2/displays/panel-taal.c |    2 ++
>   drivers/video/omap2/dss/dsi.c             |    5 -----
>   drivers/video/omap2/dss/rfbi.c            |    1 -
>   4 files changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/video/omap2/displays/panel-n8x0.c b/drivers/video/omap2/displays/panel-n8x0.c
> index 17ae85e..3fc5ad0 100644
> --- a/drivers/video/omap2/displays/panel-n8x0.c
> +++ b/drivers/video/omap2/displays/panel-n8x0.c
> @@ -489,6 +489,7 @@ static int n8x0_panel_probe(struct omap_dss_device *dssdev)
>   	dssdev->panel.timings.y_res = 480;
>   	dssdev->ctrl.pixel_size = 16;
>   	dssdev->ctrl.rfbi_timings = n8x0_panel_timings;
> +	dssdev->caps = OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE;
>
>   	memset(&props, 0, sizeof(props));
>   	props.max_brightness = 127;
> diff --git a/drivers/video/omap2/displays/panel-taal.c b/drivers/video/omap2/displays/panel-taal.c
> index ddda96a..7b2d7bb 100644
> --- a/drivers/video/omap2/displays/panel-taal.c
> +++ b/drivers/video/omap2/displays/panel-taal.c
> @@ -884,6 +884,8 @@ static int taal_probe(struct omap_dss_device *dssdev)
>
>   	dssdev->panel.timings = panel_config->timings;
>   	dssdev->panel.dsi_pix_fmt = OMAP_DSS_DSI_FMT_RGB888;
> +	dssdev->caps = OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE |
> +		OMAP_DSS_DISPLAY_CAP_TEAR_ELIM;
>
>   	td = kzalloc(sizeof(*td), GFP_KERNEL);
>   	if (!td) {
> diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
> index 340c832..254666f 100644
> --- a/drivers/video/omap2/dss/dsi.c
> +++ b/drivers/video/omap2/dss/dsi.c
> @@ -4866,11 +4866,6 @@ static int __init dsi_init_display(struct omap_dss_device *dssdev)
>
>   	DSSDBG("DSI init\n");
>
> -	if (dsi->mode = OMAP_DSS_DSI_CMD_MODE) {
> -		dssdev->caps = OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE |
> -			OMAP_DSS_DISPLAY_CAP_TEAR_ELIM;
> -	}
> -
>   	if (dsi->vdds_dsi_reg = NULL) {
>   		struct regulator *vdds_dsi;
>
> diff --git a/drivers/video/omap2/dss/rfbi.c b/drivers/video/omap2/dss/rfbi.c
> index 5a9c0e9..2e520d3 100644
> --- a/drivers/video/omap2/dss/rfbi.c
> +++ b/drivers/video/omap2/dss/rfbi.c
> @@ -939,7 +939,6 @@ EXPORT_SYMBOL(omapdss_rfbi_display_disable);
>   static int __init rfbi_init_display(struct omap_dss_device *dssdev)
>   {
>   	rfbi.dssdev[dssdev->phy.rfbi.channel] = dssdev;
> -	dssdev->caps = OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE;
>   	return 0;
>   }
>
>


^ permalink raw reply

* Re: [PATCH 1/8] OMAPDSS: HDMI: Move GPIO handling to HDMI driver
From: Archit Taneja @ 2012-08-24  6:12 UTC (permalink / raw)
  To: Tomi Valkeinen; +Cc: linux-omap, linux-fbdev, Tony Lindgren
In-Reply-To: <1345729514-2441-2-git-send-email-tomi.valkeinen@ti.com>

On Thursday 23 August 2012 07:15 PM, Tomi Valkeinen wrote:
> We currently manage HDMI GPIOs in the board files via
> platform_enable/disable calls. This won't work with device tree, and in
> any case the correct place to manage the GPIOs is in the HDMI driver.
>
> This patch moves the handling of the GPIOs to the HDMI driver. The GPIO
> handling is moved to the common hdmi.c file, and this probably needs to
> be revisited when adding OMAP5 HDMI support to see if the GPIO handling
> needs to be moved to IP specific files.
>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> Cc: Tony Lindgren <tony@atomide.com>
> ---
>   arch/arm/mach-omap2/board-4430sdp.c    |   27 +-----------
>   arch/arm/mach-omap2/board-omap4panda.c |   27 +-----------
>   drivers/video/omap2/dss/hdmi.c         |   75 +++++++++++++++++++++++---------
>   include/video/omapdss.h                |    2 +
>   4 files changed, 61 insertions(+), 70 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c
> index 8e17284..852e05c 100644
> --- a/arch/arm/mach-omap2/board-4430sdp.c
> +++ b/arch/arm/mach-omap2/board-4430sdp.c
> @@ -601,29 +601,6 @@ static void __init omap_sfh7741prox_init(void)
>   			__func__, OMAP4_SFH7741_ENABLE_GPIO, error);
>   }
>
> -static struct gpio sdp4430_hdmi_gpios[] = {
> -	{ HDMI_GPIO_CT_CP_HPD, GPIOF_OUT_INIT_HIGH, "hdmi_gpio_ct_cp_hpd" },
> -	{ HDMI_GPIO_LS_OE,	GPIOF_OUT_INIT_HIGH,	"hdmi_gpio_ls_oe" },
> -	{ HDMI_GPIO_HPD, GPIOF_DIR_IN, "hdmi_gpio_hpd" },
> -};
> -
> -static int sdp4430_panel_enable_hdmi(struct omap_dss_device *dssdev)
> -{
> -	int status;
> -
> -	status = gpio_request_array(sdp4430_hdmi_gpios,
> -				    ARRAY_SIZE(sdp4430_hdmi_gpios));
> -	if (status)
> -		pr_err("%s: Cannot request HDMI GPIOs\n", __func__);
> -
> -	return status;
> -}
> -
> -static void sdp4430_panel_disable_hdmi(struct omap_dss_device *dssdev)
> -{
> -	gpio_free_array(sdp4430_hdmi_gpios, ARRAY_SIZE(sdp4430_hdmi_gpios));
> -}
> -
>   static struct nokia_dsi_panel_data dsi1_panel = {
>   		.name		= "taal",
>   		.reset_gpio	= 102,
> @@ -718,6 +695,8 @@ static struct omap_dss_device sdp4430_lcd2_device = {
>   };
>
>   static struct omap_dss_hdmi_data sdp4430_hdmi_data = {
> +	.ct_cp_hpd_gpio = HDMI_GPIO_CT_CP_HPD,
> +	.ls_oe_gpio = HDMI_GPIO_LS_OE,
>   	.hpd_gpio = HDMI_GPIO_HPD,
>   };
>
> @@ -725,8 +704,6 @@ static struct omap_dss_device sdp4430_hdmi_device = {
>   	.name = "hdmi",
>   	.driver_name = "hdmi_panel",
>   	.type = OMAP_DISPLAY_TYPE_HDMI,
> -	.platform_enable = sdp4430_panel_enable_hdmi,
> -	.platform_disable = sdp4430_panel_disable_hdmi,
>   	.channel = OMAP_DSS_CHANNEL_DIGIT,
>   	.data = &sdp4430_hdmi_data,
>   };
> diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c
> index 982fb26..5415faa 100644
> --- a/arch/arm/mach-omap2/board-omap4panda.c
> +++ b/arch/arm/mach-omap2/board-omap4panda.c
> @@ -405,30 +405,9 @@ static struct omap_dss_device omap4_panda_dvi_device = {
>   	.channel		= OMAP_DSS_CHANNEL_LCD2,
>   };
>
> -static struct gpio panda_hdmi_gpios[] = {
> -	{ HDMI_GPIO_CT_CP_HPD, GPIOF_OUT_INIT_HIGH, "hdmi_gpio_ct_cp_hpd" },
> -	{ HDMI_GPIO_LS_OE,	GPIOF_OUT_INIT_HIGH, "hdmi_gpio_ls_oe" },
> -	{ HDMI_GPIO_HPD, GPIOF_DIR_IN, "hdmi_gpio_hpd" },
> -};
> -
> -static int omap4_panda_panel_enable_hdmi(struct omap_dss_device *dssdev)
> -{
> -	int status;
> -
> -	status = gpio_request_array(panda_hdmi_gpios,
> -				    ARRAY_SIZE(panda_hdmi_gpios));
> -	if (status)
> -		pr_err("Cannot request HDMI GPIOs\n");
> -
> -	return status;
> -}
> -
> -static void omap4_panda_panel_disable_hdmi(struct omap_dss_device *dssdev)
> -{
> -	gpio_free_array(panda_hdmi_gpios, ARRAY_SIZE(panda_hdmi_gpios));
> -}
> -
>   static struct omap_dss_hdmi_data omap4_panda_hdmi_data = {
> +	.ct_cp_hpd_gpio = HDMI_GPIO_CT_CP_HPD,
> +	.ls_oe_gpio = HDMI_GPIO_LS_OE,
>   	.hpd_gpio = HDMI_GPIO_HPD,
>   };
>
> @@ -436,8 +415,6 @@ static struct omap_dss_device  omap4_panda_hdmi_device = {
>   	.name = "hdmi",
>   	.driver_name = "hdmi_panel",
>   	.type = OMAP_DISPLAY_TYPE_HDMI,
> -	.platform_enable = omap4_panda_panel_enable_hdmi,
> -	.platform_disable = omap4_panda_panel_disable_hdmi,
>   	.channel = OMAP_DSS_CHANNEL_DIGIT,
>   	.data = &omap4_panda_hdmi_data,
>   };
> diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c
> index 0cdf246..4fbe271 100644
> --- a/drivers/video/omap2/dss/hdmi.c
> +++ b/drivers/video/omap2/dss/hdmi.c
> @@ -32,6 +32,7 @@
>   #include <linux/platform_device.h>
>   #include <linux/pm_runtime.h>
>   #include <linux/clk.h>
> +#include <linux/gpio.h>
>   #include <video/omapdss.h>
>
>   #include "ti_hdmi.h"
> @@ -61,6 +62,10 @@ static struct {
>   	struct hdmi_ip_data ip_data;
>
>   	struct clk *sys_clk;
> +
> +	int ct_cp_hpd_gpio;
> +	int ls_oe_gpio;
> +	int hpd_gpio;
>   } hdmi;
>
>   /*
> @@ -314,12 +319,34 @@ static void hdmi_runtime_put(void)
>
>   static int __init hdmi_init_display(struct omap_dss_device *dssdev)
>   {
> +	int r;
> +
> +	struct gpio gpios[] = {
> +		{ hdmi.ct_cp_hpd_gpio, GPIOF_OUT_INIT_LOW, "hdmi_ct_cp_hpd" },
> +		{ hdmi.ls_oe_gpio, GPIOF_OUT_INIT_LOW, "hdmi_ls_oe" },
> +		{ hdmi.hpd_gpio, GPIOF_DIR_IN, "hdmi_hpd" },
> +	};
> +
>   	DSSDBG("init_display\n");
>
>   	dss_init_hdmi_ip_ops(&hdmi.ip_data);
> +
> +	r = gpio_request_array(gpios, ARRAY_SIZE(gpios));
> +	if (r)
> +		return r;
> +

Is there a reason to request these gpios in hdmi_init_display()? Why 
can't these be requested simply in the probe of the hdmi platform 
device. These gpios are sort of specific to the hdmi output on OMAP, 
aren't they?

<snip>

Archit


^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox