Skip to content

Commit d66b853

Browse files
zonquebroonie
authored andcommitted
ASoC: cs4720: use snd_soc_cache_sync()
Replace the manual register restore mechanism in cs4270.c and call the generic snd_soc_cache_sync() handler instead. This factors code out in favour of core facilities and also fixes a bus confusion that is most probably caused by intermixing i2c-regmap functions and i2c_smbus_* accessors. Signed-off-by: Daniel Mack <zonque@gmail.com> Reported-and-tested-by: Sven Neumann <s.neumann@raumfeld.com> Acked-by: Timur Tabi <timur@freescale.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
1 parent 3d94a2a commit d66b853

1 file changed

Lines changed: 1 addition & 9 deletions

File tree

‎sound/soc/codecs/cs4270.c‎

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,6 @@ static int cs4270_soc_suspend(struct snd_soc_codec *codec, pm_message_t mesg)
601601
static int cs4270_soc_resume(struct snd_soc_codec *codec)
602602
{
603603
struct cs4270_private *cs4270 = snd_soc_codec_get_drvdata(codec);
604-
struct i2c_client *i2c_client = to_i2c_client(codec->dev);
605604
int reg;
606605

607606
regulator_bulk_enable(ARRAY_SIZE(cs4270->supplies),
@@ -612,14 +611,7 @@ static int cs4270_soc_resume(struct snd_soc_codec *codec)
612611
ndelay(500);
613612

614613
/* first restore the entire register cache ... */
615-
for (reg = CS4270_FIRSTREG; reg <= CS4270_LASTREG; reg++) {
616-
u8 val = snd_soc_read(codec, reg);
617-
618-
if (i2c_smbus_write_byte_data(i2c_client, reg, val)) {
619-
dev_err(codec->dev, "i2c write failed\n");
620-
return -EIO;
621-
}
622-
}
614+
snd_soc_cache_sync(codec);
623615

624616
/* ... then disable the power-down bits */
625617
reg = snd_soc_read(codec, CS4270_PWRCTL);

0 commit comments

Comments
 (0)