Skip to content

Commit

Permalink
atmel_lcdfb: implement inverted contrast pwm
Browse files Browse the repository at this point in the history
This patch introduces lcdc->lcdcon_pol_negative which set CONTRAST_CTR
 register to inverted polarity.

Signed-off-by: Andreas Bießmann <[email protected]>
Signed-off-by: Paul Mundt <[email protected]>
  • Loading branch information
Andreas Bießmann authored and pmundt committed Mar 22, 2011
1 parent 942b8d0 commit 7cdcdb6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/video/atmel_lcdfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ static void atmel_lcdfb_update_dma2d(struct atmel_lcdfb_info *sinfo,
}
#endif

static const u32 contrast_ctr = ATMEL_LCDC_PS_DIV8
static u32 contrast_ctr = ATMEL_LCDC_PS_DIV8
| ATMEL_LCDC_POL_POSITIVE
| ATMEL_LCDC_ENA_PWMENABLE;

Expand Down Expand Up @@ -163,6 +163,10 @@ static void exit_backlight(struct atmel_lcdfb_info *sinfo)

static void init_contrast(struct atmel_lcdfb_info *sinfo)
{
/* contrast pwm can be 'inverted' */
if (sinfo->lcdcon_pol_negative)
contrast_ctr &= ~(ATMEL_LCDC_POL_POSITIVE);

/* have some default contrast/backlight settings */
lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR, contrast_ctr);
lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_VAL, ATMEL_LCDC_CVAL_DEFAULT);
Expand Down Expand Up @@ -816,6 +820,7 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev)
sinfo->guard_time = pdata_sinfo->guard_time;
sinfo->smem_len = pdata_sinfo->smem_len;
sinfo->lcdcon_is_backlight = pdata_sinfo->lcdcon_is_backlight;
sinfo->lcdcon_pol_negative = pdata_sinfo->lcdcon_pol_negative;
sinfo->lcd_wiring_mode = pdata_sinfo->lcd_wiring_mode;
} else {
dev_err(dev, "cannot get default configuration\n");
Expand Down
1 change: 1 addition & 0 deletions include/video/atmel_lcdc.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ struct atmel_lcdfb_info {
u8 bl_power;
#endif
bool lcdcon_is_backlight;
bool lcdcon_pol_negative;
u8 saved_lcdcon;

u8 default_bpp;
Expand Down

0 comments on commit 7cdcdb6

Please sign in to comment.