* [PATCH] ASoC: Move WM2000 to dev_pm_ops
@ 2011-02-25 12:25 Mark Brown
2011-02-25 12:55 ` Liam Girdwood
0 siblings, 1 reply; 2+ messages in thread
From: Mark Brown @ 2011-02-25 12:25 UTC (permalink / raw)
To: Liam Girdwood; +Cc: alsa-devel, patches, Mark Brown
There's a general move to use dev_pm_ops rather than bus specific functions
in order to facilitate work on the PM core. Do this conversion to WM2000.
The driver ought to be updated to work better in a multi-component model
but the mechanical conversion ensures that we avoid blocking PM core work
until that happens.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
sound/soc/codecs/wm2000.c | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/sound/soc/codecs/wm2000.c b/sound/soc/codecs/wm2000.c
index 80ddf4f..a3b9cbb 100644
--- a/sound/soc/codecs/wm2000.c
+++ b/sound/soc/codecs/wm2000.c
@@ -836,24 +836,25 @@ static void wm2000_i2c_shutdown(struct i2c_client *i2c)
}
#ifdef CONFIG_PM
-static int wm2000_i2c_suspend(struct i2c_client *i2c, pm_message_t mesg)
+static int wm2000_i2c_suspend(struct device *dev)
{
+ struct i2c_client *i2c = to_i2c_client(dev);
struct wm2000_priv *wm2000 = dev_get_drvdata(&i2c->dev);
return wm2000_anc_transition(wm2000, ANC_OFF);
}
-static int wm2000_i2c_resume(struct i2c_client *i2c)
+static int wm2000_i2c_resume(struct device *dev)
{
+ struct i2c_client *i2c = to_i2c_client(dev);
struct wm2000_priv *wm2000 = dev_get_drvdata(&i2c->dev);
return wm2000_anc_set_mode(wm2000);
}
-#else
-#define wm2000_i2c_suspend NULL
-#define wm2000_i2c_resume NULL
#endif
+static SIMPLE_DEV_PM_OPS(wm2000_pm, wm2000_i2c_suspend, wm2000_i2c_resume);
+
static const struct i2c_device_id wm2000_i2c_id[] = {
{ "wm2000", 0 },
{ }
@@ -864,11 +865,10 @@ static struct i2c_driver wm2000_i2c_driver = {
.driver = {
.name = "wm2000",
.owner = THIS_MODULE,
+ .pm = &wm2000_pm,
},
.probe = wm2000_i2c_probe,
.remove = __devexit_p(wm2000_i2c_remove),
- .suspend = wm2000_i2c_suspend,
- .resume = wm2000_i2c_resume,
.shutdown = wm2000_i2c_shutdown,
.id_table = wm2000_i2c_id,
};
--
1.7.2.3
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] ASoC: Move WM2000 to dev_pm_ops
2011-02-25 12:25 [PATCH] ASoC: Move WM2000 to dev_pm_ops Mark Brown
@ 2011-02-25 12:55 ` Liam Girdwood
0 siblings, 0 replies; 2+ messages in thread
From: Liam Girdwood @ 2011-02-25 12:55 UTC (permalink / raw)
To: Mark Brown; +Cc: alsa-devel, patches
On Fri, 2011-02-25 at 12:25 +0000, Mark Brown wrote:
> There's a general move to use dev_pm_ops rather than bus specific functions
> in order to facilitate work on the PM core. Do this conversion to WM2000.
> The driver ought to be updated to work better in a multi-component model
> but the mechanical conversion ensures that we avoid blocking PM core work
> until that happens.
>
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> ---
> sound/soc/codecs/wm2000.c | 14 +++++++-------
> 1 files changed, 7 insertions(+), 7 deletions(-)
>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-02-25 12:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-25 12:25 [PATCH] ASoC: Move WM2000 to dev_pm_ops Mark Brown
2011-02-25 12:55 ` Liam Girdwood
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).