linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 3/6] FBDEV: JZ4740: Initialize framebuffer properly
@ 2011-03-01 12:06 Maurus Cuelenaere
  2011-03-01 13:58 ` Lars-Peter Clausen
  2011-03-01 17:21 ` Maurus Cuelenaere
  0 siblings, 2 replies; 3+ messages in thread
From: Maurus Cuelenaere @ 2011-03-01 12:06 UTC (permalink / raw)
  To: linux-fbdev

Use the jzfb_enable() function instead of manually faking it in jzfb_probe().
Also add the reverse operation when the framebuffer couldn't be registered.

Signed-off-by: Maurus Cuelenaere <mcuelenaere@gmail.com>
---
 drivers/video/jz4740_fb.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/video/jz4740_fb.c b/drivers/video/jz4740_fb.c
index cea7b7e..2f3ea57 100644
--- a/drivers/video/jz4740_fb.c
+++ b/drivers/video/jz4740_fb.c
@@ -707,16 +707,13 @@ static int __devinit jzfb_probe(struct platform_device *pdev)
 
 	fb_alloc_cmap(&fb->cmap, 256, 0);
 
-	clk_enable(jzfb->ldclk);
-	jzfb->is_enabled = 1;
-
-	writel(jzfb->framedesc->next, jzfb->base + JZ_REG_LCD_DA0);
-
 	fb->mode = NULL;
 	jzfb_set_par(fb);
 
 	jzfb_pins_operation(jzfb, REQUEST_PINS);
 
+	jzfb_blank(FB_BLANK_UNBLANK, fb);
+
 	ret = register_framebuffer(fb);
 	if (ret) {
 		dev_err(&pdev->dev, "Failed to register framebuffer: %d\n", ret);
@@ -726,6 +723,7 @@ static int __devinit jzfb_probe(struct platform_device *pdev)
 	return 0;
 
 err_free_devmem:
+	jzfb_blank(FB_BLANK_POWERDOWN, fb);
 	jzfb_pins_operation(jzfb, FREE_PINS);
 
 	fb_dealloc_cmap(&fb->cmap);
-- 
1.7.4


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

* Re: [PATCH 3/6] FBDEV: JZ4740: Initialize framebuffer properly
  2011-03-01 12:06 [PATCH 3/6] FBDEV: JZ4740: Initialize framebuffer properly Maurus Cuelenaere
@ 2011-03-01 13:58 ` Lars-Peter Clausen
  2011-03-01 17:21 ` Maurus Cuelenaere
  1 sibling, 0 replies; 3+ messages in thread
From: Lars-Peter Clausen @ 2011-03-01 13:58 UTC (permalink / raw)
  To: linux-fbdev

On 03/01/2011 01:06 PM, Maurus Cuelenaere wrote:
> Use the jzfb_enable() function instead of manually faking it in jzfb_probe().
> Also add the reverse operation when the framebuffer couldn't be registered.
> 
> Signed-off-by: Maurus Cuelenaere <mcuelenaere@gmail.com>
> ---
>  drivers/video/jz4740_fb.c |    8 +++-----
>  1 files changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/video/jz4740_fb.c b/drivers/video/jz4740_fb.c
> index cea7b7e..2f3ea57 100644
> --- a/drivers/video/jz4740_fb.c
> +++ b/drivers/video/jz4740_fb.c
> @@ -707,16 +707,13 @@ static int __devinit jzfb_probe(struct platform_device *pdev)
>  
>  	fb_alloc_cmap(&fb->cmap, 256, 0);
>  
> -	clk_enable(jzfb->ldclk);
> -	jzfb->is_enabled = 1;
> -
> -	writel(jzfb->framedesc->next, jzfb->base + JZ_REG_LCD_DA0);
> -
>  	fb->mode = NULL;
>  	jzfb_set_par(fb);
>  
>  	jzfb_pins_operation(jzfb, REQUEST_PINS);
>  
> +	jzfb_blank(FB_BLANK_UNBLANK, fb);
> +

I'd prefer:
jzfb_enable(jzfb);
jzfb->is_enabled = 1;

since there is no need for locking here.

>  	ret = register_framebuffer(fb);
>  	if (ret) {
>  		dev_err(&pdev->dev, "Failed to register framebuffer: %d\n", ret);
> @@ -726,6 +723,7 @@ static int __devinit jzfb_probe(struct platform_device *pdev)
>  	return 0;
>  
>  err_free_devmem:
> +	jzfb_blank(FB_BLANK_POWERDOWN, fb);
>  	jzfb_pins_operation(jzfb, FREE_PINS);
>  
>  	fb_dealloc_cmap(&fb->cmap);


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

* Re: [PATCH 3/6] FBDEV: JZ4740: Initialize framebuffer properly
  2011-03-01 12:06 [PATCH 3/6] FBDEV: JZ4740: Initialize framebuffer properly Maurus Cuelenaere
  2011-03-01 13:58 ` Lars-Peter Clausen
@ 2011-03-01 17:21 ` Maurus Cuelenaere
  1 sibling, 0 replies; 3+ messages in thread
From: Maurus Cuelenaere @ 2011-03-01 17:21 UTC (permalink / raw)
  To: linux-fbdev

> On 03/01/2011 01:06 PM, Maurus Cuelenaere wrote:
>> Use the jzfb_enable() function instead of manually faking it in jzfb_probe().
>> Also add the reverse operation when the framebuffer couldn't be registered.
>>
>> Signed-off-by: Maurus Cuelenaere <mcuelenaere@gmail.com>
>> ---
>>  drivers/video/jz4740_fb.c |    8 +++-----
>>  1 files changed, 3 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/video/jz4740_fb.c b/drivers/video/jz4740_fb.c
>> index cea7b7e..2f3ea57 100644
>> --- a/drivers/video/jz4740_fb.c
>> +++ b/drivers/video/jz4740_fb.c
>> @@ -707,16 +707,13 @@ static int __devinit jzfb_probe(struct platform_device *pdev)
>>  
>>  	fb_alloc_cmap(&fb->cmap, 256, 0);
>>  
>> -	clk_enable(jzfb->ldclk);
>> -	jzfb->is_enabled = 1;
>> -
>> -	writel(jzfb->framedesc->next, jzfb->base + JZ_REG_LCD_DA0);
>> -
>>  	fb->mode = NULL;
>>  	jzfb_set_par(fb);
>>  
>>  	jzfb_pins_operation(jzfb, REQUEST_PINS);
>>  
>> +	jzfb_blank(FB_BLANK_UNBLANK, fb);
>> +
> I'd prefer:
> jzfb_enable(jzfb);
> jzfb->is_enabled = 1;
>
> since there is no need for locking here.
>

Ok.

-- 
Maurus Cuelenaere


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

end of thread, other threads:[~2011-03-01 17:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-01 12:06 [PATCH 3/6] FBDEV: JZ4740: Initialize framebuffer properly Maurus Cuelenaere
2011-03-01 13:58 ` Lars-Peter Clausen
2011-03-01 17:21 ` Maurus Cuelenaere

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).