diff mbox

[U-Boot,v1,7/8] video: drop duplicate set of DISPC_CONFIG register

Message ID 1346140007-9563-7-git-send-email-sbabic@denx.de
State Changes Requested
Headers show

Commit Message

Stefano Babic Aug. 28, 2012, 7:46 a.m. UTC
Signed-off-by: Stefano Babic <sbabic@denx.de>
---
 drivers/video/omap3_dss.c |    1 -
 1 file changed, 1 deletion(-)

Comments

Jeroen Hofstee Aug. 28, 2012, 10:40 a.m. UTC | #1
Hi Stefano,

On 08/28/2012 09:46 AM, Stefano Babic wrote:
> Signed-off-by: Stefano Babic <sbabic@denx.de>
> ---
>   drivers/video/omap3_dss.c |    1 -
>   1 file changed, 1 deletion(-)
>
> diff --git a/drivers/video/omap3_dss.c b/drivers/video/omap3_dss.c
> index 6686718..5fcc0fb 100644
> --- a/drivers/video/omap3_dss.c
> +++ b/drivers/video/omap3_dss.c
> @@ -112,7 +112,6 @@ void omap3_dss_panel_config(const struct panel_config *panel_cfg)
>   	writel(panel_cfg->pol_freq, &dispc->pol_freq);
>   	writel(panel_cfg->divisor, &dispc->divisor);
>   	writel(panel_cfg->lcd_size, &dispc->size_lcd);
> -	writel(panel_cfg->load_mode << FRAME_MODE_SHIFT, &dispc->config);
>   	writel(panel_cfg->panel_type << TFTSTN_SHIFT |
>   		panel_cfg->data_lines << DATALINES_SHIFT, &dispc->control);
>   	writel(panel_cfg->panel_color, &dispc->default_color0);
The beagle board doesn't have a framebuffer, but uses the panel color
only. So only the part till if (!panel_cfg->frame_buffer) is used by the 
beagle
board, so the other should be removed.

And perhaps change the FRAME_MODE_SHIFT to LOADMODE_SHIFT
(both defined as 1 though).

Regards,
Jeroen
Stefano Babic Aug. 28, 2012, 10:59 a.m. UTC | #2
On 28/08/2012 12:40, Jeroen Hofstee wrote:
> Hi Stefano,
> 

Hi Jeroen,

> On 08/28/2012 09:46 AM, Stefano Babic wrote:
>> Signed-off-by: Stefano Babic <sbabic@denx.de>
>> ---
>>   drivers/video/omap3_dss.c |    1 -
>>   1 file changed, 1 deletion(-)
>>
>> diff --git a/drivers/video/omap3_dss.c b/drivers/video/omap3_dss.c
>> index 6686718..5fcc0fb 100644
>> --- a/drivers/video/omap3_dss.c
>> +++ b/drivers/video/omap3_dss.c
>> @@ -112,7 +112,6 @@ void omap3_dss_panel_config(const struct
>> panel_config *panel_cfg)
>>       writel(panel_cfg->pol_freq, &dispc->pol_freq);
>>       writel(panel_cfg->divisor, &dispc->divisor);
>>       writel(panel_cfg->lcd_size, &dispc->size_lcd);
>> -    writel(panel_cfg->load_mode << FRAME_MODE_SHIFT, &dispc->config);
>>       writel(panel_cfg->panel_type << TFTSTN_SHIFT |
>>           panel_cfg->data_lines << DATALINES_SHIFT, &dispc->control);
>>       writel(panel_cfg->panel_color, &dispc->default_color0);
> The beagle board doesn't have a framebuffer, but uses the panel color
> only. So only the part till if (!panel_cfg->frame_buffer) is used by the
> beagle
> board, so the other should be removed.
> 
> And perhaps change the FRAME_MODE_SHIFT to LOADMODE_SHIFT
> (both defined as 1 though).

This is exactly the duplication. In code, after some lines :

 writel(panel_cfg->load_mode << LOADMODE_SHIFT, &dispc->config);

that is equivalent to the dropped line. Then I will move this line
before the check if frame_buffer is set. And by the way, I drop
FRAME_MODE_SHIFT.

Best regards,
Stefano
diff mbox

Patch

diff --git a/drivers/video/omap3_dss.c b/drivers/video/omap3_dss.c
index 6686718..5fcc0fb 100644
--- a/drivers/video/omap3_dss.c
+++ b/drivers/video/omap3_dss.c
@@ -112,7 +112,6 @@  void omap3_dss_panel_config(const struct panel_config *panel_cfg)
 	writel(panel_cfg->pol_freq, &dispc->pol_freq);
 	writel(panel_cfg->divisor, &dispc->divisor);
 	writel(panel_cfg->lcd_size, &dispc->size_lcd);
-	writel(panel_cfg->load_mode << FRAME_MODE_SHIFT, &dispc->config);
 	writel(panel_cfg->panel_type << TFTSTN_SHIFT |
 		panel_cfg->data_lines << DATALINES_SHIFT, &dispc->control);
 	writel(panel_cfg->panel_color, &dispc->default_color0);