* [PATCH v2] pwm_backlight: avoid short blank screen while doing hibernation
@ 2013-10-09 2:33 Barry Song
2013-10-22 7:39 ` Thierry Reding
0 siblings, 1 reply; 2+ messages in thread
From: Barry Song @ 2013-10-09 2:33 UTC (permalink / raw)
To: linux-pwm, thierry.reding; +Cc: workgroup.linux, Huayi Li, Barry Song
From: Huayi Li <huayi.li@csr.com>
Use SIMPLE_DEV_PM_OPS macro will initialize the member "freeze"
and "thaw" of pwm_backlight_pm_ops as below,
.freeze = suspend_fn,
.thaw = resume_fn,
then during the process of making hibernation snapshot, screen
will be blank at the moment of freezing, and then light at the
moment of thawing.
this is not the right user experience for suspending to disk.
so this patch drops freeze and thaw callback, make the LCD is
always lighting before the final shutdown.
Signed-off-by: Huayi Li <huayi.li@csr.com>
Signed-off-by: Barry Song <Baohua.Song@csr.com>
---
-v2: move the #ifdef inside of the pwm_backlight_pwm_ops so that we
don't have to clutter the platform_driver here
drivers/video/backlight/pwm_bl.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
index 1fea627..8ffd54e 100644
--- a/drivers/video/backlight/pwm_bl.c
+++ b/drivers/video/backlight/pwm_bl.c
@@ -298,8 +298,14 @@ static int pwm_backlight_resume(struct device *dev)
}
#endif
-static SIMPLE_DEV_PM_OPS(pwm_backlight_pm_ops, pwm_backlight_suspend,
- pwm_backlight_resume);
+static const struct dev_pm_ops pwm_backlight_pm_ops = {
+#ifdef CONFIG_PM_SLEEP
+ .suspend = pwm_backlight_suspend,
+ .resume = pwm_backlight_resume,
+ .poweroff = pwm_backlight_suspend,
+ .restore = pwm_backlight_resume,
+#endif
+};
static struct platform_driver pwm_backlight_driver = {
.driver = {
--
1.8.2.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] pwm_backlight: avoid short blank screen while doing hibernation
2013-10-09 2:33 [PATCH v2] pwm_backlight: avoid short blank screen while doing hibernation Barry Song
@ 2013-10-22 7:39 ` Thierry Reding
0 siblings, 0 replies; 2+ messages in thread
From: Thierry Reding @ 2013-10-22 7:39 UTC (permalink / raw)
To: Barry Song; +Cc: linux-pwm, workgroup.linux, Huayi Li, Barry Song
[-- Attachment #1: Type: text/plain, Size: 971 bytes --]
On Wed, Oct 09, 2013 at 10:33:02AM +0800, Barry Song wrote:
> From: Huayi Li <huayi.li@csr.com>
>
> Use SIMPLE_DEV_PM_OPS macro will initialize the member "freeze"
> and "thaw" of pwm_backlight_pm_ops as below,
> .freeze = suspend_fn,
> .thaw = resume_fn,
> then during the process of making hibernation snapshot, screen
> will be blank at the moment of freezing, and then light at the
> moment of thawing.
> this is not the right user experience for suspending to disk.
>
> so this patch drops freeze and thaw callback, make the LCD is
> always lighting before the final shutdown.
>
> Signed-off-by: Huayi Li <huayi.li@csr.com>
> Signed-off-by: Barry Song <Baohua.Song@csr.com>
> ---
> -v2: move the #ifdef inside of the pwm_backlight_pwm_ops so that we
> don't have to clutter the platform_driver here
>
> drivers/video/backlight/pwm_bl.c | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
Applied, thanks.
Thierry
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-10-22 7:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-09 2:33 [PATCH v2] pwm_backlight: avoid short blank screen while doing hibernation Barry Song
2013-10-22 7:39 ` Thierry Reding
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).