pwm-backlight: Disable backlight on shutdown
authorThierry Reding <treding@nvidia.com>
Tue, 29 Apr 2014 15:28:59 +0000 (17:28 +0200)
committerThierry Reding <thierry.reding@gmail.com>
Fri, 2 May 2014 11:25:59 +0000 (13:25 +0200)
When a device is shut down, make sure to disable the backlight. If it
stays lit, it gives the impression that the device hasn't turned off.
Furthermore keeping the backlight on may consume power, which is not
what users expect when they shut down a device.

Tested-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/video/backlight/pwm_bl.c

index b75201ff46f6d1bc133a5cae571b90082d11347d..fa7f5c35b7fbe0d567e675119f7b17a6320f3570 100644 (file)
@@ -359,6 +359,14 @@ static int pwm_backlight_remove(struct platform_device *pdev)
        return 0;
 }
 
+static void pwm_backlight_shutdown(struct platform_device *pdev)
+{
+       struct backlight_device *bl = platform_get_drvdata(pdev);
+       struct pwm_bl_data *pb = bl_get_data(bl);
+
+       pwm_backlight_power_off(pb);
+}
+
 #ifdef CONFIG_PM_SLEEP
 static int pwm_backlight_suspend(struct device *dev)
 {
@@ -404,6 +412,7 @@ static struct platform_driver pwm_backlight_driver = {
        },
        .probe          = pwm_backlight_probe,
        .remove         = pwm_backlight_remove,
+       .shutdown       = pwm_backlight_shutdown,
 };
 
 module_platform_driver(pwm_backlight_driver);