diff options
-rw-r--r-- | sound/soc/tegra/tegra_soc.h | 3 | ||||
-rw-r--r-- | sound/soc/tegra/tegra_soc_controls.c | 8 | ||||
-rw-r--r-- | sound/soc/tegra/tegra_soc_wm8753.c | 20 | ||||
-rw-r--r-- | sound/soc/tegra/tegra_soc_wm8903.c | 37 |
4 files changed, 40 insertions, 28 deletions
diff --git a/sound/soc/tegra/tegra_soc.h b/sound/soc/tegra/tegra_soc.h index 238497aacb2c..58e12fb872ab 100644 --- a/sound/soc/tegra/tegra_soc.h +++ b/sound/soc/tegra/tegra_soc.h @@ -88,7 +88,8 @@ #define TEGRA_INT_MIC 0x10 #define TEGRA_EXT_MIC 0x20 #define TEGRA_LINEIN 0x40 -#define TEGRA_HEADSET 0x80 +#define TEGRA_HEADSET_OUT 0x80 +#define TEGRA_HEADSET_IN 0x100 struct tegra_dma_channel; diff --git a/sound/soc/tegra/tegra_soc_controls.c b/sound/soc/tegra/tegra_soc_controls.c index 138fac279f47..1e103b9d1118 100644 --- a/sound/soc/tegra/tegra_soc_controls.c +++ b/sound/soc/tegra/tegra_soc_controls.c @@ -35,7 +35,7 @@ static void tegra_audio_route(struct tegra_audio_data* audio_data, if (play_device_new != audio_data->play_device) { codec_con &= ~(TEGRA_HEADPHONE | TEGRA_LINEOUT | - TEGRA_SPK | TEGRA_EAR_SPK | TEGRA_HEADSET); + TEGRA_SPK | TEGRA_EAR_SPK | TEGRA_HEADSET_OUT); if (play_device_new & TEGRA_AUDIO_DEVICE_OUT_HEADPHONE) codec_con |= TEGRA_HEADPHONE; @@ -50,7 +50,7 @@ static void tegra_audio_route(struct tegra_audio_data* audio_data, codec_con |= TEGRA_EAR_SPK; if (play_device_new & TEGRA_AUDIO_DEVICE_OUT_HEADSET) - codec_con |= TEGRA_HEADSET; + codec_con |= TEGRA_HEADSET_OUT; tegra_ext_control(audio_data->codec, codec_con); audio_data->play_device = play_device_new; @@ -58,7 +58,7 @@ static void tegra_audio_route(struct tegra_audio_data* audio_data, if (capture_device_new != audio_data->capture_device) { codec_con &= ~(TEGRA_INT_MIC | TEGRA_EXT_MIC | - TEGRA_LINEIN | TEGRA_HEADSET); + TEGRA_LINEIN | TEGRA_HEADSET_IN); if (capture_device_new & (TEGRA_AUDIO_DEVICE_IN_BUILTIN_MIC | TEGRA_AUDIO_DEVICE_IN_BACK_MIC)) @@ -71,7 +71,7 @@ static void tegra_audio_route(struct tegra_audio_data* audio_data, codec_con |= TEGRA_LINEIN; if (capture_device_new & TEGRA_AUDIO_DEVICE_IN_HEADSET) - codec_con |= TEGRA_HEADSET; + codec_con |= TEGRA_HEADSET_IN; tegra_ext_control(audio_data->codec, codec_con); audio_data->capture_device = capture_device_new; diff --git a/sound/soc/tegra/tegra_soc_wm8753.c b/sound/soc/tegra/tegra_soc_wm8753.c index b285e6f82b33..b8abf99dd87b 100644 --- a/sound/soc/tegra/tegra_soc_wm8753.c +++ b/sound/soc/tegra/tegra_soc_wm8753.c @@ -470,10 +470,15 @@ void tegra_ext_control(struct snd_soc_codec *codec, int new_con) else snd_soc_dapm_disable_pin(codec, "Linein"); - if (new_con & TEGRA_HEADSET) - snd_soc_dapm_enable_pin(codec, "Headset"); + if (new_con & TEGRA_HEADSET_OUT) + snd_soc_dapm_enable_pin(codec, "Headset Out"); else - snd_soc_dapm_disable_pin(codec, "Headset"); + snd_soc_dapm_disable_pin(codec, "Headset Out"); + + if (new_con & TEGRA_HEADSET_IN) + snd_soc_dapm_enable_pin(codec, "Headset In"); + else + snd_soc_dapm_disable_pin(codec, "Headset In"); /* signal a DAPM event */ snd_soc_dapm_sync(codec); @@ -484,7 +489,8 @@ void tegra_ext_control(struct snd_soc_codec *codec, int new_con) static const struct snd_soc_dapm_widget tegra_dapm_widgets[] = { SND_SOC_DAPM_HP("Headphone", NULL), SND_SOC_DAPM_HP("EarPiece", NULL), - SND_SOC_DAPM_HP("Headset", NULL), + SND_SOC_DAPM_HP("Headset Out", NULL), + SND_SOC_DAPM_MIC("Headset In", NULL), SND_SOC_DAPM_SPK("Int Spk", NULL), SND_SOC_DAPM_MIC("Ext Mic", NULL), SND_SOC_DAPM_MIC("Int Mic", NULL), @@ -503,10 +509,10 @@ static const struct snd_soc_dapm_route audio_map[] = { {"EarPiece", NULL, "LOUT2"}, /* headset Jack */ - {"Headset", NULL, "ROUT1"}, - {"Headset", NULL, "LOUT1"}, + {"Headset Out", NULL, "ROUT1"}, + {"Headset Out", NULL, "LOUT1"}, {"MIC1", NULL, "Mic Bias"}, - {"Mic Bias", NULL, "Headset"}, + {"Mic Bias", NULL, "Headset In"}, /* build-in speaker */ {"Int Spk", NULL, "ROUT1"}, diff --git a/sound/soc/tegra/tegra_soc_wm8903.c b/sound/soc/tegra/tegra_soc_wm8903.c index efad1e607e9d..1c3ed544ddd5 100644 --- a/sound/soc/tegra/tegra_soc_wm8903.c +++ b/sound/soc/tegra/tegra_soc_wm8903.c @@ -179,7 +179,6 @@ static int tegra_hifi_hw_params(struct snd_pcm_substream *substream, if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK) { int CtrlReg = 0; int VolumeCtrlReg = 0; - int SidetoneCtrlReg = 0; snd_soc_write(codec, WM8903_ANALOGUE_LEFT_INPUT_0, 0X7); snd_soc_write(codec, WM8903_ANALOGUE_RIGHT_INPUT_0, 0X7); @@ -203,23 +202,24 @@ static int tegra_hifi_hw_params(struct snd_pcm_substream *substream, VolumeCtrlReg); snd_soc_write(codec, WM8903_ANALOGUE_RIGHT_INPUT_0, VolumeCtrlReg); - /* replicate mic setting on both channels */ + /* Left ADC data on both channels */ CtrlReg = snd_soc_read(codec, WM8903_AUDIO_INTERFACE_0); CtrlReg = SET_REG_VAL(CtrlReg, 0x1, B06_AIF_ADCR, 0x0); CtrlReg = SET_REG_VAL(CtrlReg, 0x1, B06_AIF_ADCL, 0x0); snd_soc_write(codec, WM8903_AUDIO_INTERFACE_0, CtrlReg); /* Enable analog inputs */ - CtrlReg = (0x1<<B01_INL_ENA) | (0x1<<B00_INR_ENA); + CtrlReg = (0x1<<B01_INL_ENA); snd_soc_write(codec, WM8903_POWER_MANAGEMENT_0, CtrlReg); /* ADC Settings */ CtrlReg = snd_soc_read(codec, WM8903_ADC_DIGITAL_0); CtrlReg |= (0x1<<B04_ADC_HPF_ENA); snd_soc_write(codec, WM8903_ADC_DIGITAL_0, CtrlReg); - SidetoneCtrlReg = 0; - snd_soc_write(codec, R20_SIDETONE_CTRL, SidetoneCtrlReg); + /* Disable sidetone */ + CtrlReg = 0; + snd_soc_write(codec, R20_SIDETONE_CTRL, CtrlReg); /* Enable ADC */ CtrlReg = snd_soc_read(codec, WM8903_POWER_MANAGEMENT_6); - CtrlReg |= (0x1<<B00_ADCR_ENA)|(0x1<<B01_ADCL_ENA); + CtrlReg |= (0x1<<B01_ADCL_ENA); snd_soc_write(codec, WM8903_POWER_MANAGEMENT_6, CtrlReg); CtrlReg = snd_soc_read(codec, R29_DRC_1); CtrlReg |= 0x3; /*mic volume 18 db */ @@ -383,10 +383,15 @@ void tegra_ext_control(struct snd_soc_codec *codec, int new_con) else snd_soc_dapm_disable_pin(codec, "Linein"); - if (new_con & TEGRA_HEADSET) - snd_soc_dapm_enable_pin(codec, "Headset"); + if (new_con & TEGRA_HEADSET_OUT) + snd_soc_dapm_enable_pin(codec, "Headset Out"); else - snd_soc_dapm_disable_pin(codec, "Headset"); + snd_soc_dapm_disable_pin(codec, "Headset Out"); + + if (new_con & TEGRA_HEADSET_IN) + snd_soc_dapm_enable_pin(codec, "Headset In"); + else + snd_soc_dapm_disable_pin(codec, "Headset In"); /* signal a DAPM event */ snd_soc_dapm_sync(codec); @@ -448,7 +453,8 @@ static int tegra_dapm_event_ext_mic(struct snd_soc_dapm_widget* w, /*tegra machine dapm widgets */ static const struct snd_soc_dapm_widget tegra_dapm_widgets[] = { SND_SOC_DAPM_HP("Headphone", NULL), - SND_SOC_DAPM_HP("Headset", NULL), + SND_SOC_DAPM_HP("Headset Out", NULL), + SND_SOC_DAPM_MIC("Headset In", NULL), SND_SOC_DAPM_SPK("Lineout", NULL), SND_SOC_DAPM_SPK("Int Spk", tegra_dapm_event_int_spk), SND_SOC_DAPM_MIC("Ext Mic", tegra_dapm_event_ext_mic), @@ -464,10 +470,9 @@ static const struct snd_soc_dapm_route audio_map[] = { {"Headphone", NULL, "HPOUTL"}, /* headset Jack - in = micin, out = HPOUT*/ - {"Headset", NULL, "HPOUTR"}, - {"Headset", NULL, "HPOUTL"}, - {"IN1L", NULL, "Headset"}, - {"IN1R", NULL, "Headset"}, + {"Headset Out", NULL, "HPOUTR"}, + {"Headset Out", NULL, "HPOUTL"}, + {"IN1L", NULL, "Headset In"}, /* lineout connected to LINEOUTR and LINEOUTL */ {"Lineout", NULL, "LINEOUTR"}, @@ -480,9 +485,9 @@ static const struct snd_soc_dapm_route audio_map[] = { {"Int Spk", NULL, "LOP"}, /* internal mic is mono */ - {"IN1R", NULL, "Int Mic"}, + {"IN1L", NULL, "Int Mic"}, - /* external mic is stero */ + /* external mic is stereo */ {"IN1L", NULL, "Ext Mic"}, {"IN1R", NULL, "Ext Mic"}, |