From: 邱建斌 <qjb@rock-chips.com>
Date: Fri, 8 Apr 2011 04:04:05 +0000 (+0800)
Subject: rk29phonesdk:wm8994防止无限读写问题
X-Git-Tag: firefly_0821_release~10546
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=5ea9ba14b5831ef1455e2cc47c9f828870855dcb;p=firefly-linux-kernel-4.4.55.git

rk29phonesdk:wm8994防止无限读写问题
---

diff --git a/arch/arm/configs/rk29_phonesdk_defconfig b/arch/arm/configs/rk29_phonesdk_defconfig
old mode 100755
new mode 100644
index eed4c4625d91..9cb90c9779b4
--- a/arch/arm/configs/rk29_phonesdk_defconfig
+++ b/arch/arm/configs/rk29_phonesdk_defconfig
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
 # Linux kernel version: 2.6.32.27
-# Fri Apr  1 20:19:39 2011
+# Fri Apr  8 11:38:34 2011
 #
 CONFIG_ARM=y
 CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -965,7 +965,7 @@ CONFIG_ADC=y
 # CONFIG_ADC_RK28 is not set
 CONFIG_ADC_RK29=y
 # CONFIG_SPI_FPGA is not set
-# CONFIG_HEADSET_DET is not set
+CONFIG_HEADSET_DET=y
 
 #
 # PPS support
@@ -1053,6 +1053,7 @@ CONFIG_MFD_CORE=y
 CONFIG_MFD_WM831X=y
 # CONFIG_MFD_WM831X_I2C is not set
 CONFIG_MFD_WM831X_SPI=y
+# CONFIG_MFD_WM831X_SPI_A22 is not set
 # CONFIG_MFD_WM8350_I2C is not set
 # CONFIG_MFD_PCF50633 is not set
 # CONFIG_MFD_MC13783 is not set
@@ -2068,6 +2069,7 @@ CONFIG_CRC32=y
 # CONFIG_CRC7 is not set
 # CONFIG_LIBCRC32C is not set
 CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=y
 CONFIG_DECOMPRESS_GZIP=y
 CONFIG_REED_SOLOMON=y
 CONFIG_REED_SOLOMON_ENC8=y
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c
index 65e5e2090cf7..bf3d6729a968 100755
--- a/sound/soc/codecs/wm8994.c
+++ b/sound/soc/codecs/wm8994.c
@@ -2720,7 +2720,7 @@ void wm8994_check_channel(void)
 {
 	wm8994_codec_fnc_t **wm8994_fnc_ptr = wm8994_codec_sequence;
 	unsigned char wm8994_mode = wm8994_current_mode;
-
+unsigned int error_count = 0;
 	DBG("%s--%d::Enter\n",__FUNCTION__,__LINE__);
 
 	isWM8994SetChannel = true;
@@ -2746,7 +2746,9 @@ void wm8994_check_channel(void)
 		gpio_free(WM_EN_PIN);
 
 		msleep(50);
-
+		error_count ++;
+		if(error_count >= 10)
+			return;
 		wm8994_current_mode = null;
 		isSetChannelErr = false;
 
@@ -3934,7 +3936,7 @@ static ssize_t wm8994_proc_write(struct file *file, const char __user *buffer,
 		}
 		break;	
 	case 's':
-		AP_to_speakers();
+		recorder_and_AP_to_speakers();
 		break;
 	case 'h':
 		recorder_and_AP_to_headset();