Commit 01f9326a authored by Lars-Peter Clausen's avatar Lars-Peter Clausen Committed by Takashi Iwai

ALSA: at73c213: 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>
Acked-by: default avatarHans-Christian Egtvedt <egtvedt@samfundet.no>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 21bb5aaf
...@@ -1075,10 +1075,11 @@ static int snd_at73c213_remove(struct spi_device *spi) ...@@ -1075,10 +1075,11 @@ static int snd_at73c213_remove(struct spi_device *spi)
return 0; return 0;
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM_SLEEP
static int snd_at73c213_suspend(struct spi_device *spi, pm_message_t msg)
static int snd_at73c213_suspend(struct device *dev)
{ {
struct snd_card *card = dev_get_drvdata(&spi->dev); struct snd_card *card = dev_get_drvdata(dev);
struct snd_at73c213 *chip = card->private_data; struct snd_at73c213 *chip = card->private_data;
ssc_writel(chip->ssc->regs, CR, SSC_BIT(CR_TXDIS)); ssc_writel(chip->ssc->regs, CR, SSC_BIT(CR_TXDIS));
...@@ -1087,9 +1088,9 @@ static int snd_at73c213_suspend(struct spi_device *spi, pm_message_t msg) ...@@ -1087,9 +1088,9 @@ static int snd_at73c213_suspend(struct spi_device *spi, pm_message_t msg)
return 0; return 0;
} }
static int snd_at73c213_resume(struct spi_device *spi) static int snd_at73c213_resume(struct device *dev)
{ {
struct snd_card *card = dev_get_drvdata(&spi->dev); struct snd_card *card = dev_get_drvdata(dev);
struct snd_at73c213 *chip = card->private_data; struct snd_at73c213 *chip = card->private_data;
clk_enable(chip->board->dac_clk); clk_enable(chip->board->dac_clk);
...@@ -1097,18 +1098,21 @@ static int snd_at73c213_resume(struct spi_device *spi) ...@@ -1097,18 +1098,21 @@ static int snd_at73c213_resume(struct spi_device *spi)
return 0; return 0;
} }
static SIMPLE_DEV_PM_OPS(at73c213_pm_ops, snd_at73c213_suspend,
snd_at73c213_resume);
#define AT73C213_PM_OPS (&at73c213_pm_ops)
#else #else
#define snd_at73c213_suspend NULL #define AT73C213_PM_OPS NULL
#define snd_at73c213_resume NULL
#endif #endif
static struct spi_driver at73c213_driver = { static struct spi_driver at73c213_driver = {
.driver = { .driver = {
.name = "at73c213", .name = "at73c213",
.pm = AT73C213_PM_OPS,
}, },
.probe = snd_at73c213_probe, .probe = snd_at73c213_probe,
.suspend = snd_at73c213_suspend,
.resume = snd_at73c213_resume,
.remove = snd_at73c213_remove, .remove = snd_at73c213_remove,
}; };
......
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