summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorNikesh Oswal <noswal@nvidia.com>2012-01-24 12:20:22 +0530
committerVarun Colbert <vcolbert@nvidia.com>2012-01-30 11:56:57 -0800
commit47ec40cdf0fc96c91fa9245f3f12dbd5a8ef3c96 (patch)
tree4132d65ef5f48d33d0d8722984b205070f32a179 /sound
parentc8b140cfc9db43d43e9513df55e6d6813d0aaead (diff)
asoc: codecs: wm8753: allow to change the dai mode even when codec is busy
In Voice Call when ringtone stream is opened the codec is busy and the call mode needs to be set before closing the ringtone stream hence we put the logic in codec driver to enable dai mode change even when codec is busy Bug: 919350 Reviewed-on: http://git-master/r/76954 Change-Id: Iaf7176b3a7f72709140e29c2c6071ab4101ec418 Signed-off-by: Nikesh Oswal <noswal@nvidia.com> Signed-off-by: Varun Wadekar <vwadekar@nvidia.com> Reviewed-on: http://git-master/r/77732 Reviewed-by: Automatic_Commit_Validation_User
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/wm8753.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/sound/soc/codecs/wm8753.c b/sound/soc/codecs/wm8753.c
index c822e119555f..d4b822d2d472 100644
--- a/sound/soc/codecs/wm8753.c
+++ b/sound/soc/codecs/wm8753.c
@@ -197,7 +197,8 @@ static int wm8753_set_dai(struct snd_kcontrol *kcontrol,
return 0;
if (codec->active)
- return -EBUSY;
+ printk(KERN_WARNING
+ "Trying to Change the Dai Mode when codec is active\n");
ioctl = snd_soc_read(codec, WM8753_IOCTL);
@@ -911,6 +912,10 @@ static int wm8753_pcm_hw_params(struct snd_pcm_substream *substream,
/* sample rate */
if (params_rate(params) * 384 == wm8753->pcmclk)
srate |= 0x80;
+
+ /* ADC and V-DAC at same sample rate */
+ srate |= 1<<8;
+
snd_soc_write(codec, WM8753_SRATE1, srate);
snd_soc_write(codec, WM8753_PCM, voice);
@@ -1130,6 +1135,10 @@ static int wm8753_i2s_hw_params(struct snd_pcm_substream *substream,
printk(KERN_ERR "wm8753 invalid MCLK or rate\n");
return coeff;
}
+
+ /* ADC and HiFi-DAC at same sample rate */
+ srate &= ~(1<<8);
+
snd_soc_write(codec, WM8753_SRATE1, srate | (coeff_div[coeff].sr << 1) |
coeff_div[coeff].usb);