Commit b3111a9a authored by Mark Brown's avatar Mark Brown

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: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: default avatarLiam Girdwood <lrg@slimlogic.co.uk>
parent 9b34e6cc
...@@ -836,24 +836,25 @@ static void wm2000_i2c_shutdown(struct i2c_client *i2c) ...@@ -836,24 +836,25 @@ static void wm2000_i2c_shutdown(struct i2c_client *i2c)
} }
#ifdef CONFIG_PM #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); struct wm2000_priv *wm2000 = dev_get_drvdata(&i2c->dev);
return wm2000_anc_transition(wm2000, ANC_OFF); 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); struct wm2000_priv *wm2000 = dev_get_drvdata(&i2c->dev);
return wm2000_anc_set_mode(wm2000); return wm2000_anc_set_mode(wm2000);
} }
#else
#define wm2000_i2c_suspend NULL
#define wm2000_i2c_resume NULL
#endif #endif
static SIMPLE_DEV_PM_OPS(wm2000_pm, wm2000_i2c_suspend, wm2000_i2c_resume);
static const struct i2c_device_id wm2000_i2c_id[] = { static const struct i2c_device_id wm2000_i2c_id[] = {
{ "wm2000", 0 }, { "wm2000", 0 },
{ } { }
...@@ -864,11 +865,10 @@ static struct i2c_driver wm2000_i2c_driver = { ...@@ -864,11 +865,10 @@ static struct i2c_driver wm2000_i2c_driver = {
.driver = { .driver = {
.name = "wm2000", .name = "wm2000",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.pm = &wm2000_pm,
}, },
.probe = wm2000_i2c_probe, .probe = wm2000_i2c_probe,
.remove = __devexit_p(wm2000_i2c_remove), .remove = __devexit_p(wm2000_i2c_remove),
.suspend = wm2000_i2c_suspend,
.resume = wm2000_i2c_resume,
.shutdown = wm2000_i2c_shutdown, .shutdown = wm2000_i2c_shutdown,
.id_table = wm2000_i2c_id, .id_table = wm2000_i2c_id,
}; };
......
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