backlight: switch to da903x driver to dev_pm_ops
Signed-off-by: Mike Rapoport <mike@compulab.co.il> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
This commit is contained in:
parent
3b96ea9ef8
commit
0f7e727380
1 changed files with 10 additions and 10 deletions
|
@ -153,35 +153,35 @@ static int da903x_backlight_remove(struct platform_device *pdev)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PM
|
static int da903x_backlight_suspend(struct device *dev)
|
||||||
static int da903x_backlight_suspend(struct platform_device *pdev,
|
|
||||||
pm_message_t state)
|
|
||||||
{
|
{
|
||||||
|
struct platform_device *pdev = to_platform_device(dev);
|
||||||
struct backlight_device *bl = platform_get_drvdata(pdev);
|
struct backlight_device *bl = platform_get_drvdata(pdev);
|
||||||
return da903x_backlight_set(bl, 0);
|
return da903x_backlight_set(bl, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int da903x_backlight_resume(struct platform_device *pdev)
|
static int da903x_backlight_resume(struct device *dev)
|
||||||
{
|
{
|
||||||
|
struct platform_device *pdev = to_platform_device(dev);
|
||||||
struct backlight_device *bl = platform_get_drvdata(pdev);
|
struct backlight_device *bl = platform_get_drvdata(pdev);
|
||||||
|
|
||||||
backlight_update_status(bl);
|
backlight_update_status(bl);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
#define da903x_backlight_suspend NULL
|
static struct dev_pm_ops da903x_backlight_pm_ops = {
|
||||||
#define da903x_backlight_resume NULL
|
.suspend = da903x_backlight_suspend,
|
||||||
#endif
|
.resume = da903x_backlight_resume,
|
||||||
|
};
|
||||||
|
|
||||||
static struct platform_driver da903x_backlight_driver = {
|
static struct platform_driver da903x_backlight_driver = {
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = "da903x-backlight",
|
.name = "da903x-backlight",
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
|
.pm = &da903x_backlight_pm_ops,
|
||||||
},
|
},
|
||||||
.probe = da903x_backlight_probe,
|
.probe = da903x_backlight_probe,
|
||||||
.remove = da903x_backlight_remove,
|
.remove = da903x_backlight_remove,
|
||||||
.suspend = da903x_backlight_suspend,
|
|
||||||
.resume = da903x_backlight_resume,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static int __init da903x_backlight_init(void)
|
static int __init da903x_backlight_init(void)
|
||||||
|
|
Reference in a new issue