aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-core.c
diff options
context:
space:
mode:
authorDimitris Papastamos <dp@opensource.wolfsonmicro.com>2011-03-24 09:45:17 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-03-26 13:45:16 -0400
commit8020454c9a1ec5ac5801805896b5f69d0c573e17 (patch)
tree60141172b88a90a0f31d9412d338d65c2d9c4f00 /sound/soc/soc-core.c
parentacd61451e55ea5848a6ab50d39a103e146fcf7ba (diff)
ASoC: Add default snd_soc_default_writable_register() callback
By using struct snd_soc_reg_access for the read/write/vol attributes of the registers, we provide callbacks that automatically determine whether a given register is readable/writable or volatile. Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/soc-core.c')
-rw-r--r--sound/soc/soc-core.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 636328e868e8..074a0c6e99f4 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -3673,6 +3673,7 @@ int snd_soc_register_codec(struct device *dev,
3673 codec->read = codec_drv->read; 3673 codec->read = codec_drv->read;
3674 codec->volatile_register = codec_drv->volatile_register; 3674 codec->volatile_register = codec_drv->volatile_register;
3675 codec->readable_register = codec_drv->readable_register; 3675 codec->readable_register = codec_drv->readable_register;
3676 codec->writable_register = codec_drv->writable_register;
3676 codec->dapm.bias_level = SND_SOC_BIAS_OFF; 3677 codec->dapm.bias_level = SND_SOC_BIAS_OFF;
3677 codec->dapm.dev = dev; 3678 codec->dapm.dev = dev;
3678 codec->dapm.codec = codec; 3679 codec->dapm.codec = codec;
@@ -3707,6 +3708,8 @@ int snd_soc_register_codec(struct device *dev,
3707 codec->volatile_register = snd_soc_default_volatile_register; 3708 codec->volatile_register = snd_soc_default_volatile_register;
3708 if (!codec->readable_register) 3709 if (!codec->readable_register)
3709 codec->readable_register = snd_soc_default_readable_register; 3710 codec->readable_register = snd_soc_default_readable_register;
3711 if (!codec->writable_register)
3712 codec->writable_register = snd_soc_default_writable_register;
3710 } 3713 }
3711 3714
3712 for (i = 0; i < num_dai; i++) { 3715 for (i = 0; i < num_dai; i++) {