Skip to content

Commit

Permalink
pwm-backlight: Disable backlight on shutdown
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
  • Loading branch information
thierryreding committed May 2, 2014
1 parent 093e00b commit 5f33b89
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions drivers/video/backlight/pwm_bl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 5f33b89

Please sign in to comment.