ASoC: Move WM2000 to dev_pm_ops
Subsystems (3)
PATCH 1/1 ASoC: Move WM2000 to dev_pm_ops
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 <[email protected]>
--- sound/soc/codecs/wm2000.c | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-)
sound/soc/codecs/wm2000.c +7 -7
@@ -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, };
Signature · 1 line
1.7.2.3
Quoted 11 lines · Mark Brown
There's a general move to use
dev_pm_opsrather 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 <[email protected]>--- sound/soc/codecs/wm2000.c | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-)
Acked-by Liam Girdwood <[email protected]>