return 0;
}
-#if defined(CONFIG_PM)
-
-static int lms501kf03_suspend(struct spi_device *spi, pm_message_t mesg)
+#ifdef CONFIG_PM_SLEEP
+static int lms501kf03_suspend(struct device *dev)
{
- struct lms501kf03 *lcd = spi_get_drvdata(spi);
+ struct lms501kf03 *lcd = dev_get_drvdata(dev);
- dev_dbg(&spi->dev, "lcd->power = %d\n", lcd->power);
+ dev_dbg(dev, "lcd->power = %d\n", lcd->power);
/*
* when lcd panel is suspend, lcd panel becomes off
return lms501kf03_power(lcd, FB_BLANK_POWERDOWN);
}
-static int lms501kf03_resume(struct spi_device *spi)
+static int lms501kf03_resume(struct device *dev)
{
- struct lms501kf03 *lcd = spi_get_drvdata(spi);
+ struct lms501kf03 *lcd = dev_get_drvdata(dev);
lcd->power = FB_BLANK_POWERDOWN;
return lms501kf03_power(lcd, FB_BLANK_UNBLANK);
}
-#else
-#define lms501kf03_suspend NULL
-#define lms501kf03_resume NULL
#endif
+static SIMPLE_DEV_PM_OPS(lms501kf03_pm_ops, lms501kf03_suspend,
+ lms501kf03_resume);
+
static void lms501kf03_shutdown(struct spi_device *spi)
{
struct lms501kf03 *lcd = spi_get_drvdata(spi);
.driver = {
.name = "lms501kf03",
.owner = THIS_MODULE,
+ .pm = &lms501kf03_pm_ops,
},
.probe = lms501kf03_probe,
.remove = lms501kf03_remove,
.shutdown = lms501kf03_shutdown,
- .suspend = lms501kf03_suspend,
- .resume = lms501kf03_resume,
};
module_spi_driver(lms501kf03_driver);