Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1529314 > unrolled thread

[PATCH] backlight: gpio-backlight: Correct initial power state handling

Started byPeter Ujfalusi <peter.ujfalusi@ti.com>
First post2016-11-24 15:10 +0100
Last post2016-11-24 15:10 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] backlight: gpio-backlight: Correct initial power state handling Peter Ujfalusi <peter.ujfalusi@ti.com> - 2016-11-24 15:10 +0100

#1529314 — [PATCH] backlight: gpio-backlight: Correct initial power state handling

FromPeter Ujfalusi <peter.ujfalusi@ti.com>
Date2016-11-24 15:10 +0100
Subject[PATCH] backlight: gpio-backlight: Correct initial power state handling
Message-ID<sH2SR-3MJ-7@gated-at.bofh.it>
The default-on property - or the def_value via legacy pdata) should be
handled as:
if it is 1, the backlight must be enabled (kept enabled)
if it is 0, the backlight must be disabled (kept disabled)

This only works for the case when default-on is set. If it is not set then
the brightness of the backlight is set to 0. Now if the backlight is
enabled by external driver (graphics) the backlight will stay disabled since
the brightness is configured as 0. The backlight will not turn on.

The correct action at probe time is to configure the props.power to
FB_BLANK_UNBLANK if we want the backlight on by default or to
FB_BLANK_POWERDOWN if the backlight should be off by default.

The initial brightness should be set to 1.
---
 drivers/video/backlight/gpio_backlight.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/video/backlight/gpio_backlight.c b/drivers/video/backlight/gpio_backlight.c
index 18134416b154..8be7d4d194d3 100644
--- a/drivers/video/backlight/gpio_backlight.c
+++ b/drivers/video/backlight/gpio_backlight.c
@@ -138,7 +138,9 @@ static int gpio_backlight_probe(struct platform_device *pdev)
 		return PTR_ERR(bl);
 	}
 
-	bl->props.brightness = gbl->def_value;
+	bl->props.power = gbl->def_value ? FB_BLANK_UNBLANK : FB_BLANK_POWERDOWN;
+	bl->props.brightness = 1;
+
 	backlight_update_status(bl);
 
 	platform_set_drvdata(pdev, bl);
-- 
2.11.0.rc2

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web