aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorUK KIM <w0806.kim@samsung.com>2011-01-20 15:13:07 -0800
committerArve Hjønnevåg <arve@android.com>2011-11-17 17:52:59 -0800
commit77af1a3dbbcd68a9cdeaaa57d005aecd4211e652 (patch)
treeccb631909f00a365ce8567db657794fbd0ae3426 /sound
parent57fa7462e9b473fc5c8859558fa078c6422d0051 (diff)
downloadkernel_samsung_crespo-77af1a3dbbcd68a9cdeaaa57d005aecd4211e652.zip
kernel_samsung_crespo-77af1a3dbbcd68a9cdeaaa57d005aecd4211e652.tar.gz
kernel_samsung_crespo-77af1a3dbbcd68a9cdeaaa57d005aecd4211e652.tar.bz2
ASOC: added input source for voice communication.
devided gain table between voice capture and voice communication. Signed-off-by: UK KIM <w0806.kim@samsung.com> Change-Id: Ie29abf9e2bb7fd48582ef3a7550bb82398c511c6
Diffstat (limited to 'sound')
-rwxr-xr-xsound/soc/codecs/wm8994_herring.c47
-rwxr-xr-xsound/soc/codecs/wm8994_samsung.c2
-rwxr-xr-xsound/soc/codecs/wm8994_samsung.h7
3 files changed, 52 insertions, 4 deletions
diff --git a/sound/soc/codecs/wm8994_herring.c b/sound/soc/codecs/wm8994_herring.c
index f760ac6..8580e5a 100755
--- a/sound/soc/codecs/wm8994_herring.c
+++ b/sound/soc/codecs/wm8994_herring.c
@@ -534,7 +534,47 @@ struct gain_info_t recording_gain_table[RECORDING_GAIN_NUM] = {
.reg = WM8994_AIF1_ADC1_RIGHT_VOLUME, /* 401h */
.mask = WM8994_AIF1ADC1R_VOL_MASK,
.gain = WM8994_AIF1ADC1_VU | 0xC0
- },
+ }, { /* VOICE COMMUNICATION MAIN */
+ .mode = RECORDING_VC_MAIN,
+ .reg = WM8994_LEFT_LINE_INPUT_1_2_VOLUME, /* 18h */
+ .mask = WM8994_IN1L_VOL_MASK,
+ .gain = WM8994_IN1L_VU | 0x12 /* +10.5dB */
+ }, {
+ .mode = RECORDING_VC_MAIN,
+ .reg = WM8994_INPUT_MIXER_3, /* 29h */
+ .mask = WM8994_IN1L_MIXINL_VOL_MASK | WM8994_MIXOUTL_MIXINL_VOL_MASK,
+ .gain = 0x10 /* +30dB */
+ }, {
+ .mode = RECORDING_VC_MAIN,
+ .reg = WM8994_AIF1_ADC1_LEFT_VOLUME, /* 400h */
+ .mask = WM8994_AIF1ADC1L_VOL_MASK,
+ .gain = WM8994_AIF1ADC1_VU | 0xC0 /* 0dB */
+ }, {
+ .mode = RECORDING_VC_MAIN,
+ .reg = WM8994_AIF1_ADC1_RIGHT_VOLUME, /* 401h */
+ .mask = WM8994_AIF1ADC1R_VOL_MASK,
+ .gain = WM8994_AIF1ADC1_VU | 0xC0 /* 0dB */
+ }, { /* VOICE COMMUNICATION HP */
+ .mode = RECORDING_VC_HP,
+ .reg = WM8994_RIGHT_LINE_INPUT_1_2_VOLUME, /* 1Ah */
+ .mask = WM8994_IN1R_VOL_MASK,
+ .gain = WM8994_IN1R_VU | 0x15
+ }, {
+ .mode = RECORDING_VC_HP,
+ .reg = WM8994_INPUT_MIXER_4, /* 2Ah */
+ .mask = WM8994_IN1R_MIXINR_VOL_MASK | WM8994_MIXOUTR_MIXINR_VOL_MASK,
+ .gain = 0x10
+ }, {
+ .mode = RECORDING_VC_HP,
+ .reg = WM8994_AIF1_ADC1_LEFT_VOLUME, /* 400h */
+ .mask = WM8994_AIF1ADC1L_VOL_MASK,
+ .gain = WM8994_AIF1ADC1_VU | 0xC0
+ }, {
+ .mode = RECORDING_VC_HP,
+ .reg = WM8994_AIF1_ADC1_RIGHT_VOLUME, /* 401h */
+ .mask = WM8994_AIF1ADC1R_VOL_MASK,
+ .gain = WM8994_AIF1ADC1_VU | 0xC0
+ }
};
struct gain_info_t gain_code_table[GAIN_CODE_NUM] = {
@@ -1134,6 +1174,8 @@ void wm8994_record_headset_mic(struct snd_soc_codec *codec)
wm8994_set_codec_gain(codec, RECORDING_MODE, RECORDING_REC_HP);
else if (wm8994->input_source == CAMCORDER)
wm8994_set_codec_gain(codec, RECORDING_MODE, RECORDING_CAM_HP);
+ else if (wm8994->input_source == VOICE_COMMUNICATION)
+ wm8994_set_codec_gain(codec, RECORDING_MODE, RECORDING_VC_HP);
else
wm8994_set_codec_gain(codec, RECORDING_MODE, RECORDING_HP);
@@ -1244,6 +1286,9 @@ void wm8994_record_main_mic(struct snd_soc_codec *codec)
else if (wm8994->input_source == CAMCORDER)
wm8994_set_codec_gain(codec, RECORDING_MODE,
RECORDING_CAM_MAIN);
+ else if (wm8994->input_source == VOICE_COMMUNICATION)
+ wm8994_set_codec_gain(codec, RECORDING_MODE,
+ RECORDING_VC_MAIN);
else
wm8994_set_codec_gain(codec, RECORDING_MODE, RECORDING_MAIN);
diff --git a/sound/soc/codecs/wm8994_samsung.c b/sound/soc/codecs/wm8994_samsung.c
index 74a75dd..32b6163 100755
--- a/sound/soc/codecs/wm8994_samsung.c
+++ b/sound/soc/codecs/wm8994_samsung.c
@@ -283,7 +283,7 @@ static const char *voicecall_path[] = { "OFF", "RCV", "SPK", "HP",
static const char *mic_path[] = { "Main Mic", "Hands Free Mic",
"BT Sco Mic", "MIC OFF" };
static const char *input_source_state[] = { "Default", "Voice Recognition",
- "Camcorder" };
+ "Camcorder", "Voice Communication"};
static int wm8994_get_mic_path(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
diff --git a/sound/soc/codecs/wm8994_samsung.h b/sound/soc/codecs/wm8994_samsung.h
index e28937c..f0b92e3 100755
--- a/sound/soc/codecs/wm8994_samsung.h
+++ b/sound/soc/codecs/wm8994_samsung.h
@@ -91,10 +91,13 @@ Codec Output Path BIT
#define RECORDING_CAM_MAIN (0x01 << 7)
#define RECORDING_CAM_HP (0x01 << 8)
#define RECORDING_CAM_BT (0x01 << 9)
+#define RECORDING_VC_MAIN (0x01 << 10)
+#define RECORDING_VC_HP (0x01 << 11)
+#define RECORDING_VC_BT (0x01 << 12)
#define PLAYBACK_GAIN_NUM 43
#define VOICECALL_GAIN_NUM 32
-#define RECORDING_GAIN_NUM 24
+#define RECORDING_GAIN_NUM 32
#define GAIN_CODE_NUM 13
/*
* Definitions of enum type
@@ -106,7 +109,7 @@ enum audio_path {
enum mic_path {MAIN, SUB, BT_REC, MIC_OFF};
enum power_state {CODEC_OFF, CODEC_ON };
enum ringtone_state {RING_OFF, RING_ON};
-enum input_source_state {DEFAULT, RECOGNITION, CAMCORDER};
+enum input_source_state {DEFAULT, RECOGNITION, CAMCORDER, VOICE_COMMUNICATION};
typedef void (*select_route)(struct snd_soc_codec *);
typedef void (*select_mic_route)(struct snd_soc_codec *);