backlight: vgg2432a4: convert vgg2432a4_driver to dev_pm_ops
Instead of using legacy suspend/resume methods, using newer dev_pm_ops structure allows better control over power management. Also, use of pm_message_t is deprecated. Thus, it is removed. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
1dde37d457
commit
eb39ad2558
3 changed files with 18 additions and 26 deletions
|
@ -270,14 +270,11 @@ int ili9320_remove(struct ili9320 *ili)
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(ili9320_remove);
|
EXPORT_SYMBOL_GPL(ili9320_remove);
|
||||||
|
|
||||||
#ifdef CONFIG_PM
|
#ifdef CONFIG_PM_SLEEP
|
||||||
int ili9320_suspend(struct ili9320 *lcd, pm_message_t state)
|
int ili9320_suspend(struct ili9320 *lcd)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
dev_dbg(lcd->dev, "%s: event %d\n", __func__, state.event);
|
|
||||||
|
|
||||||
if (state.event == PM_EVENT_SUSPEND) {
|
|
||||||
ret = ili9320_power(lcd, FB_BLANK_POWERDOWN);
|
ret = ili9320_power(lcd, FB_BLANK_POWERDOWN);
|
||||||
|
|
||||||
if (lcd->platdata->suspend == ILI9320_SUSPEND_DEEP) {
|
if (lcd->platdata->suspend == ILI9320_SUSPEND_DEEP) {
|
||||||
|
@ -288,9 +285,6 @@ int ili9320_suspend(struct ili9320 *lcd, pm_message_t state)
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(ili9320_suspend);
|
EXPORT_SYMBOL_GPL(ili9320_suspend);
|
||||||
|
|
||||||
|
|
|
@ -76,5 +76,5 @@ extern void ili9320_shutdown(struct ili9320 *lcd);
|
||||||
|
|
||||||
/* PM */
|
/* PM */
|
||||||
|
|
||||||
extern int ili9320_suspend(struct ili9320 *lcd, pm_message_t state);
|
extern int ili9320_suspend(struct ili9320 *lcd);
|
||||||
extern int ili9320_resume(struct ili9320 *lcd);
|
extern int ili9320_resume(struct ili9320 *lcd);
|
||||||
|
|
|
@ -205,18 +205,15 @@ static int vgg2432a4_lcd_init(struct ili9320 *lcd,
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PM
|
#ifdef CONFIG_PM_SLEEP
|
||||||
static int vgg2432a4_suspend(struct spi_device *spi, pm_message_t state)
|
static int vgg2432a4_suspend(struct device *dev)
|
||||||
{
|
{
|
||||||
return ili9320_suspend(spi_get_drvdata(spi), state);
|
return ili9320_suspend(dev_get_drvdata(dev));
|
||||||
}
|
}
|
||||||
static int vgg2432a4_resume(struct spi_device *spi)
|
static int vgg2432a4_resume(struct device *dev)
|
||||||
{
|
{
|
||||||
return ili9320_resume(spi_get_drvdata(spi));
|
return ili9320_resume(dev_get_drvdata(dev));
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
#define vgg2432a4_suspend NULL
|
|
||||||
#define vgg2432a4_resume NULL
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static struct ili9320_client vgg2432a4_client = {
|
static struct ili9320_client vgg2432a4_client = {
|
||||||
|
@ -249,16 +246,17 @@ static void vgg2432a4_shutdown(struct spi_device *spi)
|
||||||
ili9320_shutdown(spi_get_drvdata(spi));
|
ili9320_shutdown(spi_get_drvdata(spi));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static SIMPLE_DEV_PM_OPS(vgg2432a4_pm_ops, vgg2432a4_suspend, vgg2432a4_resume);
|
||||||
|
|
||||||
static struct spi_driver vgg2432a4_driver = {
|
static struct spi_driver vgg2432a4_driver = {
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = "VGG2432A4",
|
.name = "VGG2432A4",
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
|
.pm = &vgg2432a4_pm_ops,
|
||||||
},
|
},
|
||||||
.probe = vgg2432a4_probe,
|
.probe = vgg2432a4_probe,
|
||||||
.remove = vgg2432a4_remove,
|
.remove = vgg2432a4_remove,
|
||||||
.shutdown = vgg2432a4_shutdown,
|
.shutdown = vgg2432a4_shutdown,
|
||||||
.suspend = vgg2432a4_suspend,
|
|
||||||
.resume = vgg2432a4_resume,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
module_spi_driver(vgg2432a4_driver);
|
module_spi_driver(vgg2432a4_driver);
|
||||||
|
|
Loading…
Reference in a new issue