From 47ec40cdf0fc96c91fa9245f3f12dbd5a8ef3c96 Mon Sep 17 00:00:00 2001 From: Nikesh Oswal Date: Tue, 24 Jan 2012 12:20:22 +0530 Subject: 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 Signed-off-by: Varun Wadekar Reviewed-on: http://git-master/r/77732 Reviewed-by: Automatic_Commit_Validation_User --- sound/soc/codecs/wm8753.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'sound/soc') 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); -- cgit v1.2.3