Commit 622f7c9b authored by Manish Badarkhe's avatar Manish Badarkhe Committed by Tomi Valkeinen

video: da8xx-fb: Use "SIMPLE_DEV_PM_OPS" macro

Update driver to use SIMPLE_DEV_PM_OPS macro for power
management suspend and resume operations.
Signed-off-by: default avatarManish Badarkhe <badarkhe.manish@gmail.com>
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent f1d2ff8b
...@@ -1546,7 +1546,7 @@ static int fb_probe(struct platform_device *device) ...@@ -1546,7 +1546,7 @@ static int fb_probe(struct platform_device *device)
return ret; return ret;
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM_SLEEP
static struct lcdc_context { static struct lcdc_context {
u32 clk_enable; u32 clk_enable;
u32 ctrl; u32 ctrl;
...@@ -1610,9 +1610,9 @@ static void lcd_context_restore(void) ...@@ -1610,9 +1610,9 @@ static void lcd_context_restore(void)
return; return;
} }
static int fb_suspend(struct platform_device *dev, pm_message_t state) static int fb_suspend(struct device *dev)
{ {
struct fb_info *info = platform_get_drvdata(dev); struct fb_info *info = dev_get_drvdata(dev);
struct da8xx_fb_par *par = info->par; struct da8xx_fb_par *par = info->par;
console_lock(); console_lock();
...@@ -1622,18 +1622,18 @@ static int fb_suspend(struct platform_device *dev, pm_message_t state) ...@@ -1622,18 +1622,18 @@ static int fb_suspend(struct platform_device *dev, pm_message_t state)
fb_set_suspend(info, 1); fb_set_suspend(info, 1);
lcd_disable_raster(DA8XX_FRAME_WAIT); lcd_disable_raster(DA8XX_FRAME_WAIT);
lcd_context_save(); lcd_context_save();
pm_runtime_put_sync(&dev->dev); pm_runtime_put_sync(dev);
console_unlock(); console_unlock();
return 0; return 0;
} }
static int fb_resume(struct platform_device *dev) static int fb_resume(struct device *dev)
{ {
struct fb_info *info = platform_get_drvdata(dev); struct fb_info *info = dev_get_drvdata(dev);
struct da8xx_fb_par *par = info->par; struct da8xx_fb_par *par = info->par;
console_lock(); console_lock();
pm_runtime_get_sync(&dev->dev); pm_runtime_get_sync(dev);
lcd_context_restore(); lcd_context_restore();
if (par->blank == FB_BLANK_UNBLANK) { if (par->blank == FB_BLANK_UNBLANK) {
lcd_enable_raster(); lcd_enable_raster();
...@@ -1647,19 +1647,17 @@ static int fb_resume(struct platform_device *dev) ...@@ -1647,19 +1647,17 @@ static int fb_resume(struct platform_device *dev)
return 0; return 0;
} }
#else
#define fb_suspend NULL
#define fb_resume NULL
#endif #endif
static SIMPLE_DEV_PM_OPS(fb_pm_ops, fb_suspend, fb_resume);
static struct platform_driver da8xx_fb_driver = { static struct platform_driver da8xx_fb_driver = {
.probe = fb_probe, .probe = fb_probe,
.remove = fb_remove, .remove = fb_remove,
.suspend = fb_suspend,
.resume = fb_resume,
.driver = { .driver = {
.name = DRIVER_NAME, .name = DRIVER_NAME,
.owner = THIS_MODULE, .owner = THIS_MODULE,
.pm = &fb_pm_ops,
}, },
}; };
module_platform_driver(da8xx_fb_driver); module_platform_driver(da8xx_fb_driver);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment