Commit 3aff5b12 authored by Lars-Peter Clausen's avatar Lars-Peter Clausen Committed by Tomi Valkeinen

OMAPDSS: nec-nl8048 panel: Use dev_pm_ops

Use dev_pm_ops instead of the deprecated legacy suspend/resume callbacks.
Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent d0df9a2c
...@@ -303,16 +303,22 @@ static int nec_8048_spi_remove(struct spi_device *spi) ...@@ -303,16 +303,22 @@ static int nec_8048_spi_remove(struct spi_device *spi)
return 0; return 0;
} }
static int nec_8048_spi_suspend(struct spi_device *spi, pm_message_t mesg) #ifdef CONFIG_PM_SLEEP
static int nec_8048_spi_suspend(struct device *dev)
{ {
struct spi_device *spi = to_spi_device(dev);
nec_8048_spi_send(spi, 2, 0x01); nec_8048_spi_send(spi, 2, 0x01);
mdelay(40); mdelay(40);
return 0; return 0;
} }
static int nec_8048_spi_resume(struct spi_device *spi) static int nec_8048_spi_resume(struct device *dev)
{ {
struct spi_device *spi = to_spi_device(dev);
/* reinitialize the panel */ /* reinitialize the panel */
spi_setup(spi); spi_setup(spi);
nec_8048_spi_send(spi, 2, 0x00); nec_8048_spi_send(spi, 2, 0x00);
...@@ -321,14 +327,20 @@ static int nec_8048_spi_resume(struct spi_device *spi) ...@@ -321,14 +327,20 @@ static int nec_8048_spi_resume(struct spi_device *spi)
return 0; return 0;
} }
static SIMPLE_DEV_PM_OPS(nec_8048_spi_pm_ops, nec_8048_spi_suspend,
nec_8048_spi_resume);
#define NEC_8048_SPI_PM_OPS (&nec_8048_spi_pm_ops)
#else
#define NEC_8048_SPI_PM_OPS NULL
#endif
static struct spi_driver nec_8048_spi_driver = { static struct spi_driver nec_8048_spi_driver = {
.probe = nec_8048_spi_probe, .probe = nec_8048_spi_probe,
.remove = nec_8048_spi_remove, .remove = nec_8048_spi_remove,
.suspend = nec_8048_spi_suspend,
.resume = nec_8048_spi_resume,
.driver = { .driver = {
.name = "nec_8048_spi", .name = "nec_8048_spi",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.pm = NEC_8048_SPI_PM_OPS,
}, },
}; };
......
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