|
@@ -460,6 +460,7 @@ struct snd_soc_dai wm8731_dai = {
|
|
};
|
|
};
|
|
EXPORT_SYMBOL_GPL(wm8731_dai);
|
|
EXPORT_SYMBOL_GPL(wm8731_dai);
|
|
|
|
|
|
|
|
+#ifdef CONFIG_PM
|
|
static int wm8731_suspend(struct platform_device *pdev, pm_message_t state)
|
|
static int wm8731_suspend(struct platform_device *pdev, pm_message_t state)
|
|
{
|
|
{
|
|
struct snd_soc_device *socdev = platform_get_drvdata(pdev);
|
|
struct snd_soc_device *socdev = platform_get_drvdata(pdev);
|
|
@@ -488,6 +489,10 @@ static int wm8731_resume(struct platform_device *pdev)
|
|
wm8731_set_bias_level(codec, codec->suspend_bias_level);
|
|
wm8731_set_bias_level(codec, codec->suspend_bias_level);
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
+#else
|
|
|
|
+#define wm8731_suspend NULL
|
|
|
|
+#define wm8731_resume NULL
|
|
|
|
+#endif
|
|
|
|
|
|
static int wm8731_probe(struct platform_device *pdev)
|
|
static int wm8731_probe(struct platform_device *pdev)
|
|
{
|
|
{
|
|
@@ -680,6 +685,21 @@ static int __devexit wm8731_spi_remove(struct spi_device *spi)
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+#ifdef CONFIG_PM
|
|
|
|
+static int wm8731_spi_suspend(struct spi_device *spi, pm_message_t msg)
|
|
|
|
+{
|
|
|
|
+ return snd_soc_suspend_device(&spi->dev);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static int wm8731_spi_resume(struct spi_device *spi)
|
|
|
|
+{
|
|
|
|
+ return snd_soc_resume_device(&spi->dev);
|
|
|
|
+}
|
|
|
|
+#else
|
|
|
|
+#define wm8731_spi_suspend NULL
|
|
|
|
+#define wm8731_spi_resume NULL
|
|
|
|
+#endif
|
|
|
|
+
|
|
static struct spi_driver wm8731_spi_driver = {
|
|
static struct spi_driver wm8731_spi_driver = {
|
|
.driver = {
|
|
.driver = {
|
|
.name = "wm8731",
|
|
.name = "wm8731",
|
|
@@ -687,6 +707,8 @@ static struct spi_driver wm8731_spi_driver = {
|
|
.owner = THIS_MODULE,
|
|
.owner = THIS_MODULE,
|
|
},
|
|
},
|
|
.probe = wm8731_spi_probe,
|
|
.probe = wm8731_spi_probe,
|
|
|
|
+ .suspend = wm8731_spi_suspend,
|
|
|
|
+ .resume = wm8731_spi_resume,
|
|
.remove = __devexit_p(wm8731_spi_remove),
|
|
.remove = __devexit_p(wm8731_spi_remove),
|
|
};
|
|
};
|
|
#endif /* CONFIG_SPI_MASTER */
|
|
#endif /* CONFIG_SPI_MASTER */
|
|
@@ -720,6 +742,21 @@ static __devexit int wm8731_i2c_remove(struct i2c_client *client)
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+#ifdef CONFIG_PM
|
|
|
|
+static int wm8731_i2c_suspend(struct i2c_client *i2c, pm_message_t msg)
|
|
|
|
+{
|
|
|
|
+ return snd_soc_suspend_device(&i2c->dev);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static int wm8731_i2c_resume(struct i2c_client *i2c)
|
|
|
|
+{
|
|
|
|
+ return snd_soc_resume_device(&i2c->dev);
|
|
|
|
+}
|
|
|
|
+#else
|
|
|
|
+#define wm8731_i2c_suspend NULL
|
|
|
|
+#define wm8731_i2c_resume NULL
|
|
|
|
+#endif
|
|
|
|
+
|
|
static const struct i2c_device_id wm8731_i2c_id[] = {
|
|
static const struct i2c_device_id wm8731_i2c_id[] = {
|
|
{ "wm8731", 0 },
|
|
{ "wm8731", 0 },
|
|
{ }
|
|
{ }
|
|
@@ -733,6 +770,8 @@ static struct i2c_driver wm8731_i2c_driver = {
|
|
},
|
|
},
|
|
.probe = wm8731_i2c_probe,
|
|
.probe = wm8731_i2c_probe,
|
|
.remove = __devexit_p(wm8731_i2c_remove),
|
|
.remove = __devexit_p(wm8731_i2c_remove),
|
|
|
|
+ .suspend = wm8731_i2c_suspend,
|
|
|
|
+ .resume = wm8731_i2c_resume,
|
|
.id_table = wm8731_i2c_id,
|
|
.id_table = wm8731_i2c_id,
|
|
};
|
|
};
|
|
#endif
|
|
#endif
|