From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: <jingoohan1@gmail.com>, <lee.jones@linaro.org>
Cc: <linux-fbdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<b.zolnierkie@samsung.com>
Subject: [PATCH v2] backlight: gpio-backlight: Correct initial power state handling
Date: Thu, 12 Jan 2017 11:35:52 +0200 [thread overview]
Message-ID: <20170112093552.16641-1-peter.ujfalusi@ti.com> (raw)
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.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
Hi,
Changes since v1:
- Added missing Signed-off-by line.
Regards,
Peter
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
next reply other threads:[~2017-01-12 9:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-12 9:35 Peter Ujfalusi [this message]
2018-10-22 8:11 Peter Ujfalusi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170112093552.16641-1-peter.ujfalusi@ti.com \
--to=peter.ujfalusi@ti.com \
--cc=b.zolnierkie@samsung.com \
--cc=jingoohan1@gmail.com \
--cc=lee.jones@linaro.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®