@@ -3546,6 +3546,9 @@ static int wm8962_set_pdata_from_of(struct i2c_client *i2c,
return 0;
}
+static int wm8962_runtime_resume(struct device *dev);
+static int wm8962_runtime_suspend(struct device *dev);
+
static int wm8962_i2c_probe(struct i2c_client *i2c,
const struct i2c_device_id *id)
{
@@ -3771,6 +3774,9 @@ static int wm8962_i2c_probe(struct i2c_client *i2c,
/* The drivers should power up as needed */
regulator_bulk_disable(ARRAY_SIZE(wm8962->supplies), wm8962->supplies);
+ if (!IS_ENABLED(CONFIG_PM))
+ wm8962_runtime_resume(&i2c->dev);
+
return 0;
err_enable:
@@ -3781,11 +3787,12 @@ err:
static int wm8962_i2c_remove(struct i2c_client *client)
{
+ if (!IS_ENABLED(CONFIG_PM))
+ wm8962_runtime_suspend(&client->dev);
snd_soc_unregister_codec(&client->dev);
return 0;
}
-#ifdef CONFIG_PM
static int wm8962_runtime_resume(struct device *dev)
{
struct wm8962_priv *wm8962 = dev_get_drvdata(dev);
@@ -3860,7 +3867,6 @@ static int wm8962_runtime_suspend(struct device *dev)
return 0;
}
-#endif
static struct dev_pm_ops wm8962_pm = {
SET_RUNTIME_PM_OPS(wm8962_runtime_suspend, wm8962_runtime_resume, NULL)