diff options
author | Andreas Bießmann <biessmann@corscience.de> | 2011-02-11 10:19:43 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2011-03-22 03:23:44 -0400 |
commit | 7cdcdb69bdf51192bcbfb7cf479850fe7c33357d (patch) | |
tree | 03a1743101c30ea5ee7e793812b0cd58748ec5e6 /drivers/video/atmel_lcdfb.c | |
parent | 942b8d05cdf1da396b4449a38b87c677591947c0 (diff) |
atmel_lcdfb: implement inverted contrast pwm
This patch introduces lcdc->lcdcon_pol_negative which set CONTRAST_CTR
register to inverted polarity.
Signed-off-by: Andreas Bießmann <biessmann@corscience.de>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers/video/atmel_lcdfb.c')
-rw-r--r-- | drivers/video/atmel_lcdfb.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c index bac163450216..16da8af7425c 100644 --- a/drivers/video/atmel_lcdfb.c +++ b/drivers/video/atmel_lcdfb.c | |||
@@ -68,7 +68,7 @@ static void atmel_lcdfb_update_dma2d(struct atmel_lcdfb_info *sinfo, | |||
68 | } | 68 | } |
69 | #endif | 69 | #endif |
70 | 70 | ||
71 | static const u32 contrast_ctr = ATMEL_LCDC_PS_DIV8 | 71 | static u32 contrast_ctr = ATMEL_LCDC_PS_DIV8 |
72 | | ATMEL_LCDC_POL_POSITIVE | 72 | | ATMEL_LCDC_POL_POSITIVE |
73 | | ATMEL_LCDC_ENA_PWMENABLE; | 73 | | ATMEL_LCDC_ENA_PWMENABLE; |
74 | 74 | ||
@@ -163,6 +163,10 @@ static void exit_backlight(struct atmel_lcdfb_info *sinfo) | |||
163 | 163 | ||
164 | static void init_contrast(struct atmel_lcdfb_info *sinfo) | 164 | static void init_contrast(struct atmel_lcdfb_info *sinfo) |
165 | { | 165 | { |
166 | /* contrast pwm can be 'inverted' */ | ||
167 | if (sinfo->lcdcon_pol_negative) | ||
168 | contrast_ctr &= ~(ATMEL_LCDC_POL_POSITIVE); | ||
169 | |||
166 | /* have some default contrast/backlight settings */ | 170 | /* have some default contrast/backlight settings */ |
167 | lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR, contrast_ctr); | 171 | lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR, contrast_ctr); |
168 | lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_VAL, ATMEL_LCDC_CVAL_DEFAULT); | 172 | lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_VAL, ATMEL_LCDC_CVAL_DEFAULT); |
@@ -816,6 +820,7 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev) | |||
816 | sinfo->guard_time = pdata_sinfo->guard_time; | 820 | sinfo->guard_time = pdata_sinfo->guard_time; |
817 | sinfo->smem_len = pdata_sinfo->smem_len; | 821 | sinfo->smem_len = pdata_sinfo->smem_len; |
818 | sinfo->lcdcon_is_backlight = pdata_sinfo->lcdcon_is_backlight; | 822 | sinfo->lcdcon_is_backlight = pdata_sinfo->lcdcon_is_backlight; |
823 | sinfo->lcdcon_pol_negative = pdata_sinfo->lcdcon_pol_negative; | ||
819 | sinfo->lcd_wiring_mode = pdata_sinfo->lcd_wiring_mode; | 824 | sinfo->lcd_wiring_mode = pdata_sinfo->lcd_wiring_mode; |
820 | } else { | 825 | } else { |
821 | dev_err(dev, "cannot get default configuration\n"); | 826 | dev_err(dev, "cannot get default configuration\n"); |