Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Andreas Bießmann and committed by
Paul Mundt
7cdcdb69 942b8d05

+7 -1
+6 -1
drivers/video/atmel_lcdfb.c
··· 68 68 } 69 69 #endif 70 70 71 - static const u32 contrast_ctr = ATMEL_LCDC_PS_DIV8 71 + static u32 contrast_ctr = ATMEL_LCDC_PS_DIV8 72 72 | ATMEL_LCDC_POL_POSITIVE 73 73 | ATMEL_LCDC_ENA_PWMENABLE; 74 74 ··· 163 163 164 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 170 /* have some default contrast/backlight settings */ 167 171 lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR, contrast_ctr); 168 172 lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_VAL, ATMEL_LCDC_CVAL_DEFAULT); ··· 820 816 sinfo->guard_time = pdata_sinfo->guard_time; 821 817 sinfo->smem_len = pdata_sinfo->smem_len; 822 818 sinfo->lcdcon_is_backlight = pdata_sinfo->lcdcon_is_backlight; 819 + sinfo->lcdcon_pol_negative = pdata_sinfo->lcdcon_pol_negative; 823 820 sinfo->lcd_wiring_mode = pdata_sinfo->lcd_wiring_mode; 824 821 } else { 825 822 dev_err(dev, "cannot get default configuration\n");
+1
include/video/atmel_lcdc.h
··· 52 52 u8 bl_power; 53 53 #endif 54 54 bool lcdcon_is_backlight; 55 + bool lcdcon_pol_negative; 55 56 u8 saved_lcdcon; 56 57 57 58 u8 default_bpp;