* [PATCH 1/2] atmel_lcdfb: Adjust HFP calculation so it matches the manual. @ 2011-10-05 7:59 Alexander Stein 2011-10-05 7:59 ` [PATCH 2/2] atmel_lcdfb: Use proper blanking on negative contrast polarity Alexander Stein ` (2 more replies) 0 siblings, 3 replies; 6+ messages in thread From: Alexander Stein @ 2011-10-05 7:59 UTC (permalink / raw) To: linux-arm-kernel In the AT91SAM9263 Manual the HFP part in LCDTIM2 is described as follows: * HFP: Horizontal Front Porch Number of idle LCDDOTCK cycles at the end of the line. Idle period is (HFP+2) LCDDOTCK cycles. It is only a minor issue. I also changed all boards using atmel_lcdfb I found to respect the new calculation. Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com> --- arch/arm/mach-at91/board-cap9adk.c | 2 +- arch/arm/mach-at91/board-neocore926.c | 2 +- arch/arm/mach-at91/board-sam9261ek.c | 4 ++-- arch/arm/mach-at91/board-sam9263ek.c | 2 +- arch/arm/mach-at91/board-sam9m10g45ek.c | 2 +- arch/arm/mach-at91/board-sam9rlek.c | 2 +- drivers/video/atmel_lcdfb.c | 4 ++-- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/arch/arm/mach-at91/board-cap9adk.c b/arch/arm/mach-at91/board-cap9adk.c index 679b0b7..ae962bf 100644 --- a/arch/arm/mach-at91/board-cap9adk.c +++ b/arch/arm/mach-at91/board-cap9adk.c @@ -304,7 +304,7 @@ static struct fb_videomode at91_tft_vga_modes[] = { .xres = 240, .yres = 320, .pixclock = KHZ2PICOS(4965), - .left_margin = 1, .right_margin = 33, + .left_margin = 1, .right_margin = 34, .upper_margin = 1, .lower_margin = 0, .hsync_len = 5, .vsync_len = 1, diff --git a/arch/arm/mach-at91/board-neocore926.c b/arch/arm/mach-at91/board-neocore926.c index 9bc6ab3..583878e 100644 --- a/arch/arm/mach-at91/board-neocore926.c +++ b/arch/arm/mach-at91/board-neocore926.c @@ -235,7 +235,7 @@ static struct fb_videomode at91_tft_vga_modes[] = { .xres = 240, .yres = 320, .pixclock = KHZ2PICOS(5000), - .left_margin = 1, .right_margin = 33, + .left_margin = 1, .right_margin = 34, .upper_margin = 1, .lower_margin = 0, .hsync_len = 5, .vsync_len = 1, diff --git a/arch/arm/mach-at91/board-sam9261ek.c b/arch/arm/mach-at91/board-sam9261ek.c index 5096a0e..8dda83b 100644 --- a/arch/arm/mach-at91/board-sam9261ek.c +++ b/arch/arm/mach-at91/board-sam9261ek.c @@ -370,7 +370,7 @@ static struct fb_videomode at91_stn_modes[] = { .xres = 320, .yres = 240, .pixclock = KHZ2PICOS(1440), - .left_margin = 1, .right_margin = 1, + .left_margin = 1, .right_margin = 2, .upper_margin = 0, .lower_margin = 0, .hsync_len = 1, .vsync_len = 1, @@ -431,7 +431,7 @@ static struct fb_videomode at91_tft_vga_modes[] = { .xres = 240, .yres = 320, .pixclock = KHZ2PICOS(4965), - .left_margin = 1, .right_margin = 33, + .left_margin = 1, .right_margin = 34, .upper_margin = 1, .lower_margin = 0, .hsync_len = 5, .vsync_len = 1, diff --git a/arch/arm/mach-at91/board-sam9263ek.c b/arch/arm/mach-at91/board-sam9263ek.c index ea8f185..e260070 100644 --- a/arch/arm/mach-at91/board-sam9263ek.c +++ b/arch/arm/mach-at91/board-sam9263ek.c @@ -258,7 +258,7 @@ static struct fb_videomode at91_tft_vga_modes[] = { .xres = 240, .yres = 320, .pixclock = KHZ2PICOS(4965), - .left_margin = 1, .right_margin = 33, + .left_margin = 1, .right_margin = 34, .upper_margin = 1, .lower_margin = 0, .hsync_len = 5, .vsync_len = 1, diff --git a/arch/arm/mach-at91/board-sam9m10g45ek.c b/arch/arm/mach-at91/board-sam9m10g45ek.c index ad234cc..5e9a5ca 100644 --- a/arch/arm/mach-at91/board-sam9m10g45ek.c +++ b/arch/arm/mach-at91/board-sam9m10g45ek.c @@ -197,7 +197,7 @@ static struct fb_videomode at91_tft_vga_modes[] = { .xres = 480, .yres = 272, .pixclock = KHZ2PICOS(9000), - .left_margin = 1, .right_margin = 1, + .left_margin = 1, .right_margin = 2, .upper_margin = 40, .lower_margin = 1, .hsync_len = 45, .vsync_len = 1, diff --git a/arch/arm/mach-at91/board-sam9rlek.c b/arch/arm/mach-at91/board-sam9rlek.c index 4f14b54..ad9e5c9 100644 --- a/arch/arm/mach-at91/board-sam9rlek.c +++ b/arch/arm/mach-at91/board-sam9rlek.c @@ -154,7 +154,7 @@ static struct fb_videomode at91_tft_vga_modes[] = { .xres = 240, .yres = 320, .pixclock = KHZ2PICOS(4965), - .left_margin = 1, .right_margin = 33, + .left_margin = 1, .right_margin = 34, .upper_margin = 1, .lower_margin = 0, .hsync_len = 5, .vsync_len = 1, diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c index 817ab60..816d528 100644 --- a/drivers/video/atmel_lcdfb.c +++ b/drivers/video/atmel_lcdfb.c @@ -393,7 +393,7 @@ static int atmel_lcdfb_check_var(struct fb_var_screeninfo *var, var->lower_margin = min_t(u32, var->lower_margin, ATMEL_LCDC_VFP); var->right_margin = min_t(u32, var->right_margin, - (ATMEL_LCDC_HFP >> ATMEL_LCDC_HFP_OFFSET) + 1); + (ATMEL_LCDC_HFP >> ATMEL_LCDC_HFP_OFFSET) + 2); var->hsync_len = min_t(u32, var->hsync_len, (ATMEL_LCDC_HPW >> ATMEL_LCDC_HPW_OFFSET) + 1); var->left_margin = min_t(u32, var->left_margin, @@ -578,7 +578,7 @@ static int atmel_lcdfb_set_par(struct fb_info *info) lcdc_writel(sinfo, ATMEL_LCDC_TIM1, value); /* Horizontal timing */ - value = (info->var.right_margin - 1) << ATMEL_LCDC_HFP_OFFSET; + value = (info->var.right_margin - 2) << ATMEL_LCDC_HFP_OFFSET; value |= (info->var.hsync_len - 1) << ATMEL_LCDC_HPW_OFFSET; value |= (info->var.left_margin - 1); dev_dbg(info->device, " * LCDTIM2 = %08lx\n", value); -- 1.7.3.4 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] atmel_lcdfb: Use proper blanking on negative contrast polarity 2011-10-05 7:59 [PATCH 1/2] atmel_lcdfb: Adjust HFP calculation so it matches the manual Alexander Stein @ 2011-10-05 7:59 ` Alexander Stein 2012-01-09 16:17 ` [PATCH 2/2] atmel_lcdfb: Use proper blanking on negative contrast Nicolas Ferre 2011-11-12 0:14 ` [PATCH 1/2] atmel_lcdfb: Adjust HFP calculation so it matches Florian Tobias Schandinat 2012-01-09 14:21 ` Nicolas Ferre 2 siblings, 1 reply; 6+ messages in thread From: Alexander Stein @ 2011-10-05 7:59 UTC (permalink / raw) To: linux-arm-kernel If used with negative polarity the PWM unit cannot be disabled. This would result in a full contrast screen. Instead let the PWM unit enabled using 0x0 as compare value which darkens the display. In result no power saving is possible if inverted contrast polarity is used. Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com> --- drivers/video/atmel_lcdfb.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c index 816d528..2bd75b5 100644 --- a/drivers/video/atmel_lcdfb.c +++ b/drivers/video/atmel_lcdfb.c @@ -96,8 +96,11 @@ static int atmel_bl_update_status(struct backlight_device *bl) brightness = 0; lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_VAL, brightness); - lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR, + if (contrast_ctr & ATMEL_LCDC_POL_POSITIVE) + lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR, brightness ? contrast_ctr : 0); + else + lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR, contrast_ctr); bl->props.fb_blank = bl->props.power = sinfo->bl_power = power; -- 1.7.3.4 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] atmel_lcdfb: Use proper blanking on negative contrast 2011-10-05 7:59 ` [PATCH 2/2] atmel_lcdfb: Use proper blanking on negative contrast polarity Alexander Stein @ 2012-01-09 16:17 ` Nicolas Ferre 0 siblings, 0 replies; 6+ messages in thread From: Nicolas Ferre @ 2012-01-09 16:17 UTC (permalink / raw) To: linux-arm-kernel On 10/05/2011 09:59 AM, Alexander Stein : > If used with negative polarity the PWM unit cannot be disabled. This would > result in a full contrast screen. > Instead let the PWM unit enabled using 0x0 as compare value which darkens > the display. > In result no power saving is possible if inverted contrast polarity > is used. Ok, this patch looks correct. > Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Florian, you can propagate this one upstream. Thanks you, best regards, > --- > drivers/video/atmel_lcdfb.c | 5 ++++- > 1 files changed, 4 insertions(+), 1 deletions(-) > > diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c > index 816d528..2bd75b5 100644 > --- a/drivers/video/atmel_lcdfb.c > +++ b/drivers/video/atmel_lcdfb.c > @@ -96,8 +96,11 @@ static int atmel_bl_update_status(struct backlight_device *bl) > brightness = 0; > > lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_VAL, brightness); > - lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR, > + if (contrast_ctr & ATMEL_LCDC_POL_POSITIVE) > + lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR, > brightness ? contrast_ctr : 0); > + else > + lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR, contrast_ctr); > > bl->props.fb_blank = bl->props.power = sinfo->bl_power = power; > -- Nicolas Ferre ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] atmel_lcdfb: Adjust HFP calculation so it matches 2011-10-05 7:59 [PATCH 1/2] atmel_lcdfb: Adjust HFP calculation so it matches the manual Alexander Stein 2011-10-05 7:59 ` [PATCH 2/2] atmel_lcdfb: Use proper blanking on negative contrast polarity Alexander Stein @ 2011-11-12 0:14 ` Florian Tobias Schandinat 2012-01-09 14:21 ` Nicolas Ferre 2 siblings, 0 replies; 6+ messages in thread From: Florian Tobias Schandinat @ 2011-11-12 0:14 UTC (permalink / raw) To: linux-arm-kernel On 10/05/2011 07:59 AM, Alexander Stein wrote: > In the AT91SAM9263 Manual the HFP part in LCDTIM2 is described as follows: > * HFP: Horizontal Front Porch > Number of idle LCDDOTCK cycles at the end of the line. > Idle period is (HFP+2) LCDDOTCK cycles. > > It is only a minor issue. I also changed all boards using atmel_lcdfb > I found to respect the new calculation. Applied both patches of this series. Thanks, Florian Tobias Schandinat > > Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com> > --- > arch/arm/mach-at91/board-cap9adk.c | 2 +- > arch/arm/mach-at91/board-neocore926.c | 2 +- > arch/arm/mach-at91/board-sam9261ek.c | 4 ++-- > arch/arm/mach-at91/board-sam9263ek.c | 2 +- > arch/arm/mach-at91/board-sam9m10g45ek.c | 2 +- > arch/arm/mach-at91/board-sam9rlek.c | 2 +- > drivers/video/atmel_lcdfb.c | 4 ++-- > 7 files changed, 9 insertions(+), 9 deletions(-) > > diff --git a/arch/arm/mach-at91/board-cap9adk.c b/arch/arm/mach-at91/board-cap9adk.c > index 679b0b7..ae962bf 100644 > --- a/arch/arm/mach-at91/board-cap9adk.c > +++ b/arch/arm/mach-at91/board-cap9adk.c > @@ -304,7 +304,7 @@ static struct fb_videomode at91_tft_vga_modes[] = { > .xres = 240, .yres = 320, > .pixclock = KHZ2PICOS(4965), > > - .left_margin = 1, .right_margin = 33, > + .left_margin = 1, .right_margin = 34, > .upper_margin = 1, .lower_margin = 0, > .hsync_len = 5, .vsync_len = 1, > > diff --git a/arch/arm/mach-at91/board-neocore926.c b/arch/arm/mach-at91/board-neocore926.c > index 9bc6ab3..583878e 100644 > --- a/arch/arm/mach-at91/board-neocore926.c > +++ b/arch/arm/mach-at91/board-neocore926.c > @@ -235,7 +235,7 @@ static struct fb_videomode at91_tft_vga_modes[] = { > .xres = 240, .yres = 320, > .pixclock = KHZ2PICOS(5000), > > - .left_margin = 1, .right_margin = 33, > + .left_margin = 1, .right_margin = 34, > .upper_margin = 1, .lower_margin = 0, > .hsync_len = 5, .vsync_len = 1, > > diff --git a/arch/arm/mach-at91/board-sam9261ek.c b/arch/arm/mach-at91/board-sam9261ek.c > index 5096a0e..8dda83b 100644 > --- a/arch/arm/mach-at91/board-sam9261ek.c > +++ b/arch/arm/mach-at91/board-sam9261ek.c > @@ -370,7 +370,7 @@ static struct fb_videomode at91_stn_modes[] = { > .xres = 320, .yres = 240, > .pixclock = KHZ2PICOS(1440), > > - .left_margin = 1, .right_margin = 1, > + .left_margin = 1, .right_margin = 2, > .upper_margin = 0, .lower_margin = 0, > .hsync_len = 1, .vsync_len = 1, > > @@ -431,7 +431,7 @@ static struct fb_videomode at91_tft_vga_modes[] = { > .xres = 240, .yres = 320, > .pixclock = KHZ2PICOS(4965), > > - .left_margin = 1, .right_margin = 33, > + .left_margin = 1, .right_margin = 34, > .upper_margin = 1, .lower_margin = 0, > .hsync_len = 5, .vsync_len = 1, > > diff --git a/arch/arm/mach-at91/board-sam9263ek.c b/arch/arm/mach-at91/board-sam9263ek.c > index ea8f185..e260070 100644 > --- a/arch/arm/mach-at91/board-sam9263ek.c > +++ b/arch/arm/mach-at91/board-sam9263ek.c > @@ -258,7 +258,7 @@ static struct fb_videomode at91_tft_vga_modes[] = { > .xres = 240, .yres = 320, > .pixclock = KHZ2PICOS(4965), > > - .left_margin = 1, .right_margin = 33, > + .left_margin = 1, .right_margin = 34, > .upper_margin = 1, .lower_margin = 0, > .hsync_len = 5, .vsync_len = 1, > > diff --git a/arch/arm/mach-at91/board-sam9m10g45ek.c b/arch/arm/mach-at91/board-sam9m10g45ek.c > index ad234cc..5e9a5ca 100644 > --- a/arch/arm/mach-at91/board-sam9m10g45ek.c > +++ b/arch/arm/mach-at91/board-sam9m10g45ek.c > @@ -197,7 +197,7 @@ static struct fb_videomode at91_tft_vga_modes[] = { > .xres = 480, .yres = 272, > .pixclock = KHZ2PICOS(9000), > > - .left_margin = 1, .right_margin = 1, > + .left_margin = 1, .right_margin = 2, > .upper_margin = 40, .lower_margin = 1, > .hsync_len = 45, .vsync_len = 1, > > diff --git a/arch/arm/mach-at91/board-sam9rlek.c b/arch/arm/mach-at91/board-sam9rlek.c > index 4f14b54..ad9e5c9 100644 > --- a/arch/arm/mach-at91/board-sam9rlek.c > +++ b/arch/arm/mach-at91/board-sam9rlek.c > @@ -154,7 +154,7 @@ static struct fb_videomode at91_tft_vga_modes[] = { > .xres = 240, .yres = 320, > .pixclock = KHZ2PICOS(4965), > > - .left_margin = 1, .right_margin = 33, > + .left_margin = 1, .right_margin = 34, > .upper_margin = 1, .lower_margin = 0, > .hsync_len = 5, .vsync_len = 1, > > diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c > index 817ab60..816d528 100644 > --- a/drivers/video/atmel_lcdfb.c > +++ b/drivers/video/atmel_lcdfb.c > @@ -393,7 +393,7 @@ static int atmel_lcdfb_check_var(struct fb_var_screeninfo *var, > var->lower_margin = min_t(u32, var->lower_margin, > ATMEL_LCDC_VFP); > var->right_margin = min_t(u32, var->right_margin, > - (ATMEL_LCDC_HFP >> ATMEL_LCDC_HFP_OFFSET) + 1); > + (ATMEL_LCDC_HFP >> ATMEL_LCDC_HFP_OFFSET) + 2); > var->hsync_len = min_t(u32, var->hsync_len, > (ATMEL_LCDC_HPW >> ATMEL_LCDC_HPW_OFFSET) + 1); > var->left_margin = min_t(u32, var->left_margin, > @@ -578,7 +578,7 @@ static int atmel_lcdfb_set_par(struct fb_info *info) > lcdc_writel(sinfo, ATMEL_LCDC_TIM1, value); > > /* Horizontal timing */ > - value = (info->var.right_margin - 1) << ATMEL_LCDC_HFP_OFFSET; > + value = (info->var.right_margin - 2) << ATMEL_LCDC_HFP_OFFSET; > value |= (info->var.hsync_len - 1) << ATMEL_LCDC_HPW_OFFSET; > value |= (info->var.left_margin - 1); > dev_dbg(info->device, " * LCDTIM2 = %08lx\n", value); ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] atmel_lcdfb: Adjust HFP calculation so it matches 2011-10-05 7:59 [PATCH 1/2] atmel_lcdfb: Adjust HFP calculation so it matches the manual Alexander Stein 2011-10-05 7:59 ` [PATCH 2/2] atmel_lcdfb: Use proper blanking on negative contrast polarity Alexander Stein 2011-11-12 0:14 ` [PATCH 1/2] atmel_lcdfb: Adjust HFP calculation so it matches Florian Tobias Schandinat @ 2012-01-09 14:21 ` Nicolas Ferre 2012-01-11 22:39 ` [PATCH 1/2] atmel_lcdfb: Adjust HFP calculation so it matches the manual Florian Tobias Schandinat 2 siblings, 1 reply; 6+ messages in thread From: Nicolas Ferre @ 2012-01-09 14:21 UTC (permalink / raw) To: linux-arm-kernel On 10/05/2011 09:59 AM, Alexander Stein : > In the AT91SAM9263 Manual the HFP part in LCDTIM2 is described as follows: > * HFP: Horizontal Front Porch > Number of idle LCDDOTCK cycles at the end of the line. > Idle period is (HFP+2) LCDDOTCK cycles. Hi Alexander, Unfortunately this is not true for all the SoC that embed the atmel_lcdfb... So I may need to rework this patch but it is certainly not applicable in the current form. Florian, can you please remove it from your git tree? Thanks, Best regards, > It is only a minor issue. I also changed all boards using atmel_lcdfb > I found to respect the new calculation. > > Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com> > --- > arch/arm/mach-at91/board-cap9adk.c | 2 +- > arch/arm/mach-at91/board-neocore926.c | 2 +- > arch/arm/mach-at91/board-sam9261ek.c | 4 ++- > arch/arm/mach-at91/board-sam9263ek.c | 2 +- > arch/arm/mach-at91/board-sam9m10g45ek.c | 2 +- > arch/arm/mach-at91/board-sam9rlek.c | 2 +- > drivers/video/atmel_lcdfb.c | 4 ++-- > 7 files changed, 9 insertions(+), 9 deletions(-) > > diff --git a/arch/arm/mach-at91/board-cap9adk.c b/arch/arm/mach-at91/board-cap9adk.c > index 679b0b7..ae962bf 100644 > --- a/arch/arm/mach-at91/board-cap9adk.c > +++ b/arch/arm/mach-at91/board-cap9adk.c > @@ -304,7 +304,7 @@ static struct fb_videomode at91_tft_vga_modes[] = { > .xres = 240, .yres = 320, > .pixclock = KHZ2PICOS(4965), > > - .left_margin = 1, .right_margin = 33, > + .left_margin = 1, .right_margin = 34, > .upper_margin = 1, .lower_margin = 0, > .hsync_len = 5, .vsync_len = 1, > > diff --git a/arch/arm/mach-at91/board-neocore926.c b/arch/arm/mach-at91/board-neocore926.c > index 9bc6ab3..583878e 100644 > --- a/arch/arm/mach-at91/board-neocore926.c > +++ b/arch/arm/mach-at91/board-neocore926.c > @@ -235,7 +235,7 @@ static struct fb_videomode at91_tft_vga_modes[] = { > .xres = 240, .yres = 320, > .pixclock = KHZ2PICOS(5000), > > - .left_margin = 1, .right_margin = 33, > + .left_margin = 1, .right_margin = 34, > .upper_margin = 1, .lower_margin = 0, > .hsync_len = 5, .vsync_len = 1, > > diff --git a/arch/arm/mach-at91/board-sam9261ek.c b/arch/arm/mach-at91/board-sam9261ek.c > index 5096a0e..8dda83b 100644 > --- a/arch/arm/mach-at91/board-sam9261ek.c > +++ b/arch/arm/mach-at91/board-sam9261ek.c > @@ -370,7 +370,7 @@ static struct fb_videomode at91_stn_modes[] = { > .xres = 320, .yres = 240, > .pixclock = KHZ2PICOS(1440), > > - .left_margin = 1, .right_margin = 1, > + .left_margin = 1, .right_margin = 2, > .upper_margin = 0, .lower_margin = 0, > .hsync_len = 1, .vsync_len = 1, > > @@ -431,7 +431,7 @@ static struct fb_videomode at91_tft_vga_modes[] = { > .xres = 240, .yres = 320, > .pixclock = KHZ2PICOS(4965), > > - .left_margin = 1, .right_margin = 33, > + .left_margin = 1, .right_margin = 34, > .upper_margin = 1, .lower_margin = 0, > .hsync_len = 5, .vsync_len = 1, > > diff --git a/arch/arm/mach-at91/board-sam9263ek.c b/arch/arm/mach-at91/board-sam9263ek.c > index ea8f185..e260070 100644 > --- a/arch/arm/mach-at91/board-sam9263ek.c > +++ b/arch/arm/mach-at91/board-sam9263ek.c > @@ -258,7 +258,7 @@ static struct fb_videomode at91_tft_vga_modes[] = { > .xres = 240, .yres = 320, > .pixclock = KHZ2PICOS(4965), > > - .left_margin = 1, .right_margin = 33, > + .left_margin = 1, .right_margin = 34, > .upper_margin = 1, .lower_margin = 0, > .hsync_len = 5, .vsync_len = 1, > > diff --git a/arch/arm/mach-at91/board-sam9m10g45ek.c b/arch/arm/mach-at91/board-sam9m10g45ek.c > index ad234cc..5e9a5ca 100644 > --- a/arch/arm/mach-at91/board-sam9m10g45ek.c > +++ b/arch/arm/mach-at91/board-sam9m10g45ek.c > @@ -197,7 +197,7 @@ static struct fb_videomode at91_tft_vga_modes[] = { > .xres = 480, .yres = 272, > .pixclock = KHZ2PICOS(9000), > > - .left_margin = 1, .right_margin = 1, > + .left_margin = 1, .right_margin = 2, > .upper_margin = 40, .lower_margin = 1, > .hsync_len = 45, .vsync_len = 1, > > diff --git a/arch/arm/mach-at91/board-sam9rlek.c b/arch/arm/mach-at91/board-sam9rlek.c > index 4f14b54..ad9e5c9 100644 > --- a/arch/arm/mach-at91/board-sam9rlek.c > +++ b/arch/arm/mach-at91/board-sam9rlek.c > @@ -154,7 +154,7 @@ static struct fb_videomode at91_tft_vga_modes[] = { > .xres = 240, .yres = 320, > .pixclock = KHZ2PICOS(4965), > > - .left_margin = 1, .right_margin = 33, > + .left_margin = 1, .right_margin = 34, > .upper_margin = 1, .lower_margin = 0, > .hsync_len = 5, .vsync_len = 1, > > diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c > index 817ab60..816d528 100644 > --- a/drivers/video/atmel_lcdfb.c > +++ b/drivers/video/atmel_lcdfb.c > @@ -393,7 +393,7 @@ static int atmel_lcdfb_check_var(struct fb_var_screeninfo *var, > var->lower_margin = min_t(u32, var->lower_margin, > ATMEL_LCDC_VFP); > var->right_margin = min_t(u32, var->right_margin, > - (ATMEL_LCDC_HFP >> ATMEL_LCDC_HFP_OFFSET) + 1); > + (ATMEL_LCDC_HFP >> ATMEL_LCDC_HFP_OFFSET) + 2); > var->hsync_len = min_t(u32, var->hsync_len, > (ATMEL_LCDC_HPW >> ATMEL_LCDC_HPW_OFFSET) + 1); > var->left_margin = min_t(u32, var->left_margin, > @@ -578,7 +578,7 @@ static int atmel_lcdfb_set_par(struct fb_info *info) > lcdc_writel(sinfo, ATMEL_LCDC_TIM1, value); > > /* Horizontal timing */ > - value = (info->var.right_margin - 1) << ATMEL_LCDC_HFP_OFFSET; > + value = (info->var.right_margin - 2) << ATMEL_LCDC_HFP_OFFSET; > value |= (info->var.hsync_len - 1) << ATMEL_LCDC_HPW_OFFSET; > value |= (info->var.left_margin - 1); > dev_dbg(info->device, " * LCDTIM2 = %08lx\n", value); -- Nicolas Ferre ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] atmel_lcdfb: Adjust HFP calculation so it matches the manual. 2012-01-09 14:21 ` Nicolas Ferre @ 2012-01-11 22:39 ` Florian Tobias Schandinat 0 siblings, 0 replies; 6+ messages in thread From: Florian Tobias Schandinat @ 2012-01-11 22:39 UTC (permalink / raw) To: linux-arm-kernel Hi Nicolas, Alexander, On 01/09/2012 02:21 PM, Nicolas Ferre wrote: > On 10/05/2011 09:59 AM, Alexander Stein : >> In the AT91SAM9263 Manual the HFP part in LCDTIM2 is described as follows: >> * HFP: Horizontal Front Porch >> Number of idle LCDDOTCK cycles at the end of the line. >> Idle period is (HFP+2) LCDDOTCK cycles. > > Hi Alexander, > > Unfortunately this is not true for all the SoC that embed the > atmel_lcdfb... So I may need to rework this patch but it is certainly > not applicable in the current form. > > Florian, can you please remove it from your git tree? Done, I reverted this patch for now. For the other patches, those that are currently in my tree, I will ask Linus to pull them really soon. For the others I'll take care of them after the merge window is closed. Best regards, Florian Tobias Schandinat > > Thanks, > > Best regards, > >> It is only a minor issue. I also changed all boards using atmel_lcdfb >> I found to respect the new calculation. >> >> Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com> >> --- >> arch/arm/mach-at91/board-cap9adk.c | 2 +- >> arch/arm/mach-at91/board-neocore926.c | 2 +- >> arch/arm/mach-at91/board-sam9261ek.c | 4 ++- >> arch/arm/mach-at91/board-sam9263ek.c | 2 +- >> arch/arm/mach-at91/board-sam9m10g45ek.c | 2 +- >> arch/arm/mach-at91/board-sam9rlek.c | 2 +- >> drivers/video/atmel_lcdfb.c | 4 ++-- >> 7 files changed, 9 insertions(+), 9 deletions(-) >> >> diff --git a/arch/arm/mach-at91/board-cap9adk.c b/arch/arm/mach-at91/board-cap9adk.c >> index 679b0b7..ae962bf 100644 >> --- a/arch/arm/mach-at91/board-cap9adk.c >> +++ b/arch/arm/mach-at91/board-cap9adk.c >> @@ -304,7 +304,7 @@ static struct fb_videomode at91_tft_vga_modes[] = { >> .xres = 240, .yres = 320, >> .pixclock = KHZ2PICOS(4965), >> >> - .left_margin = 1, .right_margin = 33, >> + .left_margin = 1, .right_margin = 34, >> .upper_margin = 1, .lower_margin = 0, >> .hsync_len = 5, .vsync_len = 1, >> >> diff --git a/arch/arm/mach-at91/board-neocore926.c b/arch/arm/mach-at91/board-neocore926.c >> index 9bc6ab3..583878e 100644 >> --- a/arch/arm/mach-at91/board-neocore926.c >> +++ b/arch/arm/mach-at91/board-neocore926.c >> @@ -235,7 +235,7 @@ static struct fb_videomode at91_tft_vga_modes[] = { >> .xres = 240, .yres = 320, >> .pixclock = KHZ2PICOS(5000), >> >> - .left_margin = 1, .right_margin = 33, >> + .left_margin = 1, .right_margin = 34, >> .upper_margin = 1, .lower_margin = 0, >> .hsync_len = 5, .vsync_len = 1, >> >> diff --git a/arch/arm/mach-at91/board-sam9261ek.c b/arch/arm/mach-at91/board-sam9261ek.c >> index 5096a0e..8dda83b 100644 >> --- a/arch/arm/mach-at91/board-sam9261ek.c >> +++ b/arch/arm/mach-at91/board-sam9261ek.c >> @@ -370,7 +370,7 @@ static struct fb_videomode at91_stn_modes[] = { >> .xres = 320, .yres = 240, >> .pixclock = KHZ2PICOS(1440), >> >> - .left_margin = 1, .right_margin = 1, >> + .left_margin = 1, .right_margin = 2, >> .upper_margin = 0, .lower_margin = 0, >> .hsync_len = 1, .vsync_len = 1, >> >> @@ -431,7 +431,7 @@ static struct fb_videomode at91_tft_vga_modes[] = { >> .xres = 240, .yres = 320, >> .pixclock = KHZ2PICOS(4965), >> >> - .left_margin = 1, .right_margin = 33, >> + .left_margin = 1, .right_margin = 34, >> .upper_margin = 1, .lower_margin = 0, >> .hsync_len = 5, .vsync_len = 1, >> >> diff --git a/arch/arm/mach-at91/board-sam9263ek.c b/arch/arm/mach-at91/board-sam9263ek.c >> index ea8f185..e260070 100644 >> --- a/arch/arm/mach-at91/board-sam9263ek.c >> +++ b/arch/arm/mach-at91/board-sam9263ek.c >> @@ -258,7 +258,7 @@ static struct fb_videomode at91_tft_vga_modes[] = { >> .xres = 240, .yres = 320, >> .pixclock = KHZ2PICOS(4965), >> >> - .left_margin = 1, .right_margin = 33, >> + .left_margin = 1, .right_margin = 34, >> .upper_margin = 1, .lower_margin = 0, >> .hsync_len = 5, .vsync_len = 1, >> >> diff --git a/arch/arm/mach-at91/board-sam9m10g45ek.c b/arch/arm/mach-at91/board-sam9m10g45ek.c >> index ad234cc..5e9a5ca 100644 >> --- a/arch/arm/mach-at91/board-sam9m10g45ek.c >> +++ b/arch/arm/mach-at91/board-sam9m10g45ek.c >> @@ -197,7 +197,7 @@ static struct fb_videomode at91_tft_vga_modes[] = { >> .xres = 480, .yres = 272, >> .pixclock = KHZ2PICOS(9000), >> >> - .left_margin = 1, .right_margin = 1, >> + .left_margin = 1, .right_margin = 2, >> .upper_margin = 40, .lower_margin = 1, >> .hsync_len = 45, .vsync_len = 1, >> >> diff --git a/arch/arm/mach-at91/board-sam9rlek.c b/arch/arm/mach-at91/board-sam9rlek.c >> index 4f14b54..ad9e5c9 100644 >> --- a/arch/arm/mach-at91/board-sam9rlek.c >> +++ b/arch/arm/mach-at91/board-sam9rlek.c >> @@ -154,7 +154,7 @@ static struct fb_videomode at91_tft_vga_modes[] = { >> .xres = 240, .yres = 320, >> .pixclock = KHZ2PICOS(4965), >> >> - .left_margin = 1, .right_margin = 33, >> + .left_margin = 1, .right_margin = 34, >> .upper_margin = 1, .lower_margin = 0, >> .hsync_len = 5, .vsync_len = 1, >> >> diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c >> index 817ab60..816d528 100644 >> --- a/drivers/video/atmel_lcdfb.c >> +++ b/drivers/video/atmel_lcdfb.c >> @@ -393,7 +393,7 @@ static int atmel_lcdfb_check_var(struct fb_var_screeninfo *var, >> var->lower_margin = min_t(u32, var->lower_margin, >> ATMEL_LCDC_VFP); >> var->right_margin = min_t(u32, var->right_margin, >> - (ATMEL_LCDC_HFP >> ATMEL_LCDC_HFP_OFFSET) + 1); >> + (ATMEL_LCDC_HFP >> ATMEL_LCDC_HFP_OFFSET) + 2); >> var->hsync_len = min_t(u32, var->hsync_len, >> (ATMEL_LCDC_HPW >> ATMEL_LCDC_HPW_OFFSET) + 1); >> var->left_margin = min_t(u32, var->left_margin, >> @@ -578,7 +578,7 @@ static int atmel_lcdfb_set_par(struct fb_info *info) >> lcdc_writel(sinfo, ATMEL_LCDC_TIM1, value); >> >> /* Horizontal timing */ >> - value = (info->var.right_margin - 1) << ATMEL_LCDC_HFP_OFFSET; >> + value = (info->var.right_margin - 2) << ATMEL_LCDC_HFP_OFFSET; >> value |= (info->var.hsync_len - 1) << ATMEL_LCDC_HPW_OFFSET; >> value |= (info->var.left_margin - 1); >> dev_dbg(info->device, " * LCDTIM2 = %08lx\n", value); > > ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-01-11 22:39 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2011-10-05 7:59 [PATCH 1/2] atmel_lcdfb: Adjust HFP calculation so it matches the manual Alexander Stein 2011-10-05 7:59 ` [PATCH 2/2] atmel_lcdfb: Use proper blanking on negative contrast polarity Alexander Stein 2012-01-09 16:17 ` [PATCH 2/2] atmel_lcdfb: Use proper blanking on negative contrast Nicolas Ferre 2011-11-12 0:14 ` [PATCH 1/2] atmel_lcdfb: Adjust HFP calculation so it matches Florian Tobias Schandinat 2012-01-09 14:21 ` Nicolas Ferre 2012-01-11 22:39 ` [PATCH 1/2] atmel_lcdfb: Adjust HFP calculation so it matches the manual Florian Tobias Schandinat
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).