diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2014-03-05 13:17:45 +0100 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-03-06 17:04:55 +0800 |
commit | 5c898e74d135a23ce12e0263c1a3c78eeae1b52b (patch) | |
tree | 987d9a6a06174368d141d6caee65ad4c9e6349bf /sound/soc/codecs/wm8753.c | |
parent | a1a0cc0646e38b41bfaac94f2b84422bb1df40e0 (diff) | |
download | linux-stable-5c898e74d135a23ce12e0263c1a3c78eeae1b52b.tar.gz linux-stable-5c898e74d135a23ce12e0263c1a3c78eeae1b52b.tar.bz2 linux-stable-5c898e74d135a23ce12e0263c1a3c78eeae1b52b.zip |
ASoC: Add helper function to check whether a CODEC is active
Instead of directly checking the 'active' field of the CODEC struct add a new
helper function that will return either true or false depending on whether the
CODEC is active. This will make the migration to the component level easier.
The patch also updates all CODEC drivers that check the active attribute to use
the new helper function.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/codecs/wm8753.c')
-rw-r--r-- | sound/soc/codecs/wm8753.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/soc/codecs/wm8753.c b/sound/soc/codecs/wm8753.c index be85da93a268..5cf4bebc5d89 100644 --- a/sound/soc/codecs/wm8753.c +++ b/sound/soc/codecs/wm8753.c @@ -251,7 +251,7 @@ static int wm8753_set_dai(struct snd_kcontrol *kcontrol, if (wm8753->dai_func == ucontrol->value.integer.value[0]) return 0; - if (codec->active) + if (snd_soc_codec_is_active(codec)) return -EBUSY; ioctl = snd_soc_read(codec, WM8753_IOCTL); @@ -1314,7 +1314,7 @@ static int wm8753_mute(struct snd_soc_dai *dai, int mute) /* the digital mute covers the HiFi and Voice DAC's on the WM8753. * make sure we check if they are not both active when we mute */ if (mute && wm8753->dai_func == 1) { - if (!codec->active) + if (!snd_soc_codec_is_active(codec)) snd_soc_write(codec, WM8753_DAC, mute_reg | 0x8); } else { if (mute) |