Skip to content

Commit

Permalink
ASoC: io: Remove support for ASoC cache in conjunction with regmap
Browse files Browse the repository at this point in the history
Since all regmap CODECs should be (and are) using the more advance regmap
cache infrastructure remove the code which supports that and just proxy
I/O straight through to regmap.

Signed-off-by: Mark Brown <broonie@linaro.org>
  • Loading branch information
Mark Brown committed Mar 19, 2014
1 parent a32c17b commit 6572547
Showing 1 changed file with 4 additions and 31 deletions.
35 changes: 4 additions & 31 deletions sound/soc/soc-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,6 @@
static int hw_write(struct snd_soc_codec *codec, unsigned int reg,
unsigned int value)
{
int ret;

if (!snd_soc_codec_volatile_register(codec, reg) &&
reg < codec->driver->reg_cache_size &&
!codec->cache_bypass) {
ret = snd_soc_cache_write(codec, reg, value);
if (ret < 0)
return -1;
}

if (codec->cache_only) {
codec->cache_sync = 1;
return 0;
}

return regmap_write(codec->control_data, reg, value);
}

Expand All @@ -46,23 +31,11 @@ static unsigned int hw_read(struct snd_soc_codec *codec, unsigned int reg)
int ret;
unsigned int val;

if (reg >= codec->driver->reg_cache_size ||
snd_soc_codec_volatile_register(codec, reg) ||
codec->cache_bypass) {
if (codec->cache_only)
return -1;

ret = regmap_read(codec->control_data, reg, &val);
if (ret == 0)
return val;
else
return -1;
}

ret = snd_soc_cache_read(codec, reg, &val);
if (ret < 0)
ret = regmap_read(codec->control_data, reg, &val);
if (ret == 0)
return val;
else
return -1;
return val;
}

/**
Expand Down

0 comments on commit 6572547

Please sign in to comment.