提交 07cac9d7 编写于 作者: J Jingoo Han 提交者: Linus Torvalds

backlight: omap1: convert omapbl to dev_pm_ops

Instead of using legacy suspend/resume methods, using newer dev_pm_ops
structure allows better control over power management.
Signed-off-by: NJingoo Han <jg1.han@samsung.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 46e1915e
...@@ -71,27 +71,24 @@ static void omapbl_blank(struct omap_backlight *bl, int mode) ...@@ -71,27 +71,24 @@ static void omapbl_blank(struct omap_backlight *bl, int mode)
} }
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM_SLEEP
static int omapbl_suspend(struct platform_device *pdev, pm_message_t state) static int omapbl_suspend(struct device *dev)
{ {
struct backlight_device *dev = platform_get_drvdata(pdev); struct backlight_device *bl_dev = dev_get_drvdata(dev);
struct omap_backlight *bl = bl_get_data(dev); struct omap_backlight *bl = bl_get_data(bl_dev);
omapbl_blank(bl, FB_BLANK_POWERDOWN); omapbl_blank(bl, FB_BLANK_POWERDOWN);
return 0; return 0;
} }
static int omapbl_resume(struct platform_device *pdev) static int omapbl_resume(struct device *dev)
{ {
struct backlight_device *dev = platform_get_drvdata(pdev); struct backlight_device *bl_dev = dev_get_drvdata(dev);
struct omap_backlight *bl = bl_get_data(dev); struct omap_backlight *bl = bl_get_data(bl_dev);
omapbl_blank(bl, bl->powermode); omapbl_blank(bl, bl->powermode);
return 0; return 0;
} }
#else
#define omapbl_suspend NULL
#define omapbl_resume NULL
#endif #endif
static int omapbl_set_power(struct backlight_device *dev, int state) static int omapbl_set_power(struct backlight_device *dev, int state)
...@@ -182,13 +179,14 @@ static int omapbl_remove(struct platform_device *pdev) ...@@ -182,13 +179,14 @@ static int omapbl_remove(struct platform_device *pdev)
return 0; return 0;
} }
static SIMPLE_DEV_PM_OPS(omapbl_pm_ops, omapbl_suspend, omapbl_resume);
static struct platform_driver omapbl_driver = { static struct platform_driver omapbl_driver = {
.probe = omapbl_probe, .probe = omapbl_probe,
.remove = omapbl_remove, .remove = omapbl_remove,
.suspend = omapbl_suspend,
.resume = omapbl_resume,
.driver = { .driver = {
.name = "omap-bl", .name = "omap-bl",
.pm = &omapbl_pm_ops,
}, },
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册