Skip to content

Commit

Permalink
drivers: video: fbdev: atmel_lcdfb.c: Add ability to inverted backlig…
Browse files Browse the repository at this point in the history
…ht PWM.

The code has a variable to change the polarity of the PWM backlight control but
it was not being initialized. This patch adds a devicetree entry to set the
variable if required.

Signed-off-by: Michael Welling <mwelling@ieee.org>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
  • Loading branch information
Michael Welling authored and Tomi Valkeinen committed Jul 30, 2014
1 parent d10715b commit d7aa64c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions Documentation/devicetree/bindings/video/atmel,lcdc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Required properties (as per of_videomode_helper):

Optional properties (as per of_videomode_helper):
- atmel,lcdcon-backlight: enable backlight
- atmel,lcdcon-backlight-inverted: invert backlight PWM polarity
- atmel,lcd-wiring-mode: lcd wiring mode "RGB" or "BRG"
- atmel,power-control-gpio: gpio to power on or off the LCD (as many as needed)

Expand Down
3 changes: 2 additions & 1 deletion drivers/video/fbdev/atmel_lcdfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ static void init_contrast(struct atmel_lcdfb_info *sinfo)

/* contrast pwm can be 'inverted' */
if (pdata->lcdcon_pol_negative)
contrast_ctr &= ~(ATMEL_LCDC_POL_POSITIVE);
contrast_ctr &= ~(ATMEL_LCDC_POL_POSITIVE);

/* have some default contrast/backlight settings */
lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR, contrast_ctr);
Expand Down Expand Up @@ -1095,6 +1095,7 @@ static int atmel_lcdfb_of_init(struct atmel_lcdfb_info *sinfo)
pdata->lcd_wiring_mode = ret;

pdata->lcdcon_is_backlight = of_property_read_bool(display_np, "atmel,lcdcon-backlight");
pdata->lcdcon_pol_negative = of_property_read_bool(display_np, "atmel,lcdcon-backlight-inverted");

timings = of_get_display_timings(display_np);
if (!timings) {
Expand Down

0 comments on commit d7aa64c

Please sign in to comment.