aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-core.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2010-12-02 16:15:29 +0000
committerMark Brown <broonie@opensource.wolfsonmicro.com>2010-12-03 12:18:17 +0000
commitc3acec2671cc448bc549b06b561ae2454238e9a0 (patch)
tree82365178227d23ed6da7d27138ffba4be58f653b /sound/soc/soc-core.c
parentASoC: Make the DAI ops constant in the DAI structure (diff)
downloadlinux-dev-c3acec2671cc448bc549b06b561ae2454238e9a0.tar.xz
linux-dev-c3acec2671cc448bc549b06b561ae2454238e9a0.zip
ASoC: Move active copy of CODEC read and write into runtime structure
We shouldn't be assigning to the driver structure (which really ought to be const, further patch to follow) though there's unlikely to be any actual problem except in the unlikely case that two devices with the same driver but different bus types appear in the same system. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'sound/soc/soc-core.c')
-rw-r--r--sound/soc/soc-core.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 20dcc978588f..5720dbcefbc4 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -2077,7 +2077,7 @@ unsigned int snd_soc_read(struct snd_soc_codec *codec, unsigned int reg)
{
unsigned int ret;
- ret = codec->driver->read(codec, reg);
+ ret = codec->read(codec, reg);
dev_dbg(codec->dev, "read %x => %x\n", reg, ret);
trace_snd_soc_reg_read(codec, reg, ret);
@@ -2090,7 +2090,7 @@ unsigned int snd_soc_write(struct snd_soc_codec *codec,
{
dev_dbg(codec->dev, "write %x = %x\n", reg, val);
trace_snd_soc_reg_write(codec, reg, val);
- return codec->driver->write(codec, reg, val);
+ return codec->write(codec, reg, val);
}
EXPORT_SYMBOL_GPL(snd_soc_write);
@@ -3448,6 +3448,8 @@ int snd_soc_register_codec(struct device *dev,
INIT_LIST_HEAD(&codec->dapm.widgets);
INIT_LIST_HEAD(&codec->dapm.paths);
+ codec->write = codec_drv->write;
+ codec->read = codec_drv->read;
codec->dapm.bias_level = SND_SOC_BIAS_OFF;
codec->dapm.dev = dev;
codec->dapm.codec = codec;