rk610 codec : The headphone playback the probability of loss of a channel
author邱建斌 <qjb@rock-chips.com>
Mon, 18 Feb 2013 12:00:54 +0000 (20:00 +0800)
committer邱建斌 <qjb@rock-chips.com>
Mon, 18 Feb 2013 12:00:54 +0000 (20:00 +0800)
sound/soc/codecs/rk610_codec.c

index a6b89a04fa58fa15ad7605d91ed279589bbaefc3..b2139ced16ef3829705baeb1568c708ebed08d8d 100755 (executable)
@@ -712,11 +712,15 @@ void rk610_codec_reg_set(void)
     rk610_codec_write(codec,ACCELCODEC_R00, ASC_HPF_ENABLE|ASC_DSM_MODE_ENABLE|ASC_SCRAMBLE_ENABLE|ASC_DITHER_ENABLE|ASC_BCLKDIV_4);
     //2volume,input,output
     digital_gain = Volume_Output;
-    rk610_codec_write(codec,ACCELCODEC_R05, (digital_gain >> 8) & 0xFF);
-    rk610_codec_write(codec,ACCELCODEC_R06, digital_gain & 0xFF);
-    rk610_codec_write(codec,ACCELCODEC_R07, (digital_gain >> 8) & 0xFF);
-    rk610_codec_write(codec,ACCELCODEC_R08, digital_gain & 0xFF);
-
+       
+       if(rk610_codec_read(codec,ACCELCODEC_R05)!=0x0f) {
+               rk610_codec_write(codec,ACCELCODEC_R05, (digital_gain >> 8) & 0xFF);
+               rk610_codec_write(codec,ACCELCODEC_R06, digital_gain & 0xFF);
+       }
+       if(rk610_codec_read(codec,ACCELCODEC_R07)!=0x0f){
+               rk610_codec_write(codec,ACCELCODEC_R07, (digital_gain >> 8) & 0xFF);
+               rk610_codec_write(codec,ACCELCODEC_R08, digital_gain & 0xFF);
+       }
     rk610_codec_write(codec,ACCELCODEC_R0B, ASC_DEC_ENABLE|ASC_INT_ENABLE);
     gR0BReg = ASC_DEC_ENABLE|ASC_INT_ENABLE;  //ASC_DEC_DISABLE|ASC_INT_ENABLE;