@@ -305,19 +305,8 @@ static int cs4349_i2c_probe(struct i2c_client *client,
return ret;
}
- if (pdata) {
+ if (pdata)
cs4349->pdata = *pdata;
- } else {
- pdata = devm_kzalloc(&client->dev,
- sizeof(struct cs4349_platform_data),
- GFP_KERNEL);
- if (!pdata) {
- dev_err(&client->dev,
- "could not allocate pdata\n");
- return -ENOMEM;
- }
- cs4349->pdata = *pdata;
- }
/* Reset the Device */
cs4349->reset_gpio = devm_gpiod_get_optional(&client->dev,
@@ -330,9 +319,6 @@ static int cs4349_i2c_probe(struct i2c_client *client,
i2c_set_clientdata(client, cs4349);
- dev_info(&client->dev,
- "Cirrus Logic CS4349\n");
-
return snd_soc_register_codec(&client->dev, &soc_codec_dev_cs4349,
&cs4349_dai, 1);
}
@@ -357,14 +343,17 @@ static int cs4349_runtime_suspend(struct device *dev)
struct snd_soc_pcm_runtime *rtd = dev_get_drvdata(dev);
int ret;
- /* Hold down reset */
- if (cs4349->reset_gpio)
- gpiod_set_value_cansleep(cs4349->reset_gpio, 0);
-
ret = snd_soc_update_bits(rtd->codec, CS4349_MISC, PWR_DWN, 1);
if (ret < 0)
return ret;
+ regcache_cache_only(cs4349->regmap, true);
+ regcache_sync(cs4349->regmap);
+
+ /* Hold down reset */
+ if (cs4349->reset_gpio)
+ gpiod_set_value_cansleep(cs4349->reset_gpio, 0);
+
return 0;
}