ASoC: ALC5632: Capture path improvements
cover ASoC: ALC5632: Capture path improvements
This patches is bringing improved support of capture path to ALC5632 codec.
Andrey Danin (10):
ASoC: alc5632: Coding style. Remove two extra empty lines.
ASoC: alc5632: Fixed voice DAC volume step.
ASoC: alc5632: Add voice DAC playback switch
ASoC: alc5632: Rename capture switches to common scheme XXX2REC
ASoC: alc5632: Remove unexisting route from Phone Mix to Mono Mix
ASoC: alc5632: Refactored DAPM routes to add voice support
ASoC: alc5632: Add DMIC switches and controls
ASoC: alc5632: Fix I2S digital interface power for recording
ASoC: alc5632: Allow 8kHz stream support.
ASoC: alc5632: Connect HP/HPL/HPR mix'es to HPOut Mix
Paul Fertser (2):
ASoC: alc5632: Fix Boost Volume TLVs used for the external
microphones
ASoC: alc5632: Fix Capture/Playback attributes for microphone inputs
sound/soc/codecs/alc5632.c | 183 +++++++++++++++++++++++++++++++------------- sound/soc/codecs/alc5632.h | 1 + 2 files changed, 130 insertions(+), 54 deletions(-)
Signature · 1 line
1.7.3.4
PATCH 1/12 ASoC: alc5632: Coding style. Remove two extra empty lines.
From: Andrey Danin <[email protected]>
--- sound/soc/codecs/alc5632.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)
sound/soc/codecs/alc5632.c +0 -2
@@ -437,8 +437,6 @@ static const struct snd_soc_dapm_route alc5632_dapm_routes[] = { {"Speaker Mix", "MIC22SPK Playback Switch", "MIC2 PGA"}, {"Speaker Mix", "DAC2SPK Playback Switch", "DAC Left Channel"}, - -/* mono mixer */ {"Mono Mix", "ADC2MONO_L Playback Switch", "Left Capture Mix"}, {"Mono Mix", "ADC2MONO_R Playback Switch", "Right Capture Mix"},
Signature · 1 line
1.7.3.4
PATCH 2/12 ASoC: alc5632: Fixed voice DAC volume step.
In reply to Leon RomanovskyFrom: Andrey Danin <[email protected]>
Remove extra zero from volume step in DECLARE_TLV_DB_SCALE macro.
--- sound/soc/codecs/alc5632.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
sound/soc/codecs/alc5632.c +1 -1
@@ -153,7 +153,7 @@ static const unsigned int boost_tlv[] = {/* 0db min scale, 6 db steps, no mute */ static const DECLARE_TLV_DB_SCALE(dig_tlv, 0, 600, 0);/* 0db min scalem 0.75db steps, no mute */ -static const DECLARE_TLV_DB_SCALE(vdac_tlv, -3525, 075, 0); +static const DECLARE_TLV_DB_SCALE(vdac_tlv, -3525, 75, 0);static const struct snd_kcontrol_new alc5632_vol_snd_controls[] = {/* left starts at bit 8, right at bit 0 */
Signature · 1 line
1.7.3.4
PATCH 3/12 ASoC: alc5632: Add voice DAC playback switch
In reply to Leon RomanovskyFrom: Andrey Danin <[email protected]>
Add voice DAC playback switch.
--- sound/soc/codecs/alc5632.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
sound/soc/codecs/alc5632.c +2 -0
@@ -176,6 +176,8 @@ static const struct snd_kcontrol_new alc5632_snd_controls[] = { ALC5632_AUX_OUT_VOL, 15, 7, 1, 1),SOC_SINGLE_TLV ("Voice DAC Playback Volume" ,ALC5632_VOICE_DAC_VOL ,0 ,63 ,0 , vdac_tlv), +SOC_SINGLE ("Voice DAC Playback Switch" , +ALC5632_VOICE_DAC_VOL ,12 ,1 ,1 ),SOC_SINGLE_TLV ("Phone Capture Volume" ,ALC5632_PHONE_IN_VOL ,8 ,31 ,1 , vol_tlv), SOC_DOUBLE_TLV("LineIn Capture Volume",
Signature · 1 line
1.7.3.4
PATCH 4/12 ASoC: alc5632: Rename capture switches to common scheme XXX2REC
In reply to Leon RomanovskyFrom: Andrey Danin <[email protected]>
Rename capture switches to common scheme XXX2REC.
--- sound/soc/codecs/alc5632.c | 56 ++++++++++++++++++++++---------------------- 1 files changed, 28 insertions(+), 28 deletions(-)
sound/soc/codecs/alc5632.c +28 -28
@@ -246,24 +246,24 @@ SOC_DAPM_SINGLE("VOICE2SPK Playback Switch", ALC5632_VOICE_DAC_VOL, 14, 1, 1),/* Left Record Mixer */ static const struct snd_kcontrol_new alc5632_captureL_mixer_controls[] = { -SOC_DAPM_SINGLE ("Mic1 Capture Switch" ,ALC5632_ADC_REC_MIXER ,14 ,1 ,1 ), -SOC_DAPM_SINGLE ("Mic2 Capture Switch" ,ALC5632_ADC_REC_MIXER ,13 ,1 ,1 ), -SOC_DAPM_SINGLE ("LineInL Capture Switch" ,ALC5632_ADC_REC_MIXER ,12 ,1 ,1 ), -SOC_DAPM_SINGLE ("Left Phone Capture Switch" ,ALC5632_ADC_REC_MIXER ,11 ,1 ,1 ), -SOC_DAPM_SINGLE ("HPMixerL Capture Switch" ,ALC5632_ADC_REC_MIXER ,10 ,1 ,1 ), -SOC_DAPM_SINGLE ("SPKMixer Capture Switch" ,ALC5632_ADC_REC_MIXER ,9 ,1 ,1 ), -SOC_DAPM_SINGLE ("MonoMixer Capture Switch" ,ALC5632_ADC_REC_MIXER ,8 ,1 ,1 ), +SOC_DAPM_SINGLE ("MIC12REC_L Capture Switch" ,ALC5632_ADC_REC_MIXER ,14 ,1 ,1 ), +SOC_DAPM_SINGLE ("MIC22REC_L Capture Switch" ,ALC5632_ADC_REC_MIXER ,13 ,1 ,1 ), +SOC_DAPM_SINGLE ("LIL2REC Capture Switch" ,ALC5632_ADC_REC_MIXER ,12 ,1 ,1 ), +SOC_DAPM_SINGLE ("PH2REC_L Capture Switch" ,ALC5632_ADC_REC_MIXER ,11 ,1 ,1 ), +SOC_DAPM_SINGLE ("HPL2REC Capture Switch" ,ALC5632_ADC_REC_MIXER ,10 ,1 ,1 ), +SOC_DAPM_SINGLE ("SPK2REC_L Capture Switch" ,ALC5632_ADC_REC_MIXER ,9 ,1 ,1 ), +SOC_DAPM_SINGLE ("MONO2REC_L Capture Switch" ,ALC5632_ADC_REC_MIXER ,8 ,1 ,1 ), };/* Right Record Mixer */ static const struct snd_kcontrol_new alc5632_captureR_mixer_controls[] = { -SOC_DAPM_SINGLE ("Mic1 Capture Switch" ,ALC5632_ADC_REC_MIXER ,6 ,1 ,1 ), -SOC_DAPM_SINGLE ("Mic2 Capture Switch" ,ALC5632_ADC_REC_MIXER ,5 ,1 ,1 ), -SOC_DAPM_SINGLE ("LineInR Capture Switch" ,ALC5632_ADC_REC_MIXER ,4 ,1 ,1 ), -SOC_DAPM_SINGLE ("Right Phone Capture Switch" ,ALC5632_ADC_REC_MIXER ,3 ,1 ,1 ), -SOC_DAPM_SINGLE ("HPMixerR Capture Switch" ,ALC5632_ADC_REC_MIXER ,2 ,1 ,1 ), -SOC_DAPM_SINGLE ("SPKMixer Capture Switch" ,ALC5632_ADC_REC_MIXER ,1 ,1 ,1 ), -SOC_DAPM_SINGLE ("MonoMixer Capture Switch" ,ALC5632_ADC_REC_MIXER ,0 ,1 ,1 ), +SOC_DAPM_SINGLE ("MIC12REC_R Capture Switch" ,ALC5632_ADC_REC_MIXER ,6 ,1 ,1 ), +SOC_DAPM_SINGLE ("MIC22REC_R Capture Switch" ,ALC5632_ADC_REC_MIXER ,5 ,1 ,1 ), +SOC_DAPM_SINGLE ("LIR2REC Capture Switch" ,ALC5632_ADC_REC_MIXER ,4 ,1 ,1 ), +SOC_DAPM_SINGLE ("PH2REC_R Capture Switch" ,ALC5632_ADC_REC_MIXER ,3 ,1 ,1 ), +SOC_DAPM_SINGLE ("HPR2REC Capture Switch" ,ALC5632_ADC_REC_MIXER ,2 ,1 ,1 ), +SOC_DAPM_SINGLE ("SPK2REC_R Capture Switch" ,ALC5632_ADC_REC_MIXER ,1 ,1 ,1 ), +SOC_DAPM_SINGLE ("MONO2REC_R Capture Switch" ,ALC5632_ADC_REC_MIXER ,0 ,1 ,1 ), };static const char *alc5632_spk_n_sour_sel[] = {
@@ -449,22 +449,22 @@ static const struct snd_soc_dapm_route alc5632_dapm_routes[] = { {"Mono Mix", "DAC2MONO Playback Switch", "DAC Left Channel"},/* Left record mixer */ - {"Left Capture Mix", "LineInL Capture Switch", "LINEINL"}, - {"Left Capture Mix", "Left Phone Capture Switch", "PHONEN"}, - {"Left Capture Mix", "Mic1 Capture Switch", "MIC1 Pre Amp"}, - {"Left Capture Mix", "Mic2 Capture Switch", "MIC2 Pre Amp"}, - {"Left Capture Mix", "HPMixerL Capture Switch", "HPL Mix"}, - {"Left Capture Mix", "SPKMixer Capture Switch", "Speaker Mix"}, - {"Left Capture Mix", "MonoMixer Capture Switch", "Mono Mix"}, + {"Left Capture Mix", "LIL2REC Capture Switch", "LINEINL"}, + {"Left Capture Mix", "PH2REC_L Capture Switch", "PHONEN"}, + {"Left Capture Mix", "MIC12REC_L Capture Switch", "MIC1 Pre Amp"}, + {"Left Capture Mix", "MIC22REC_L Capture Switch", "MIC2 Pre Amp"}, + {"Left Capture Mix", "HPL2REC Capture Switch", "HPL Mix"}, + {"Left Capture Mix", "SPK2REC_L Capture Switch", "Speaker Mix"}, + {"Left Capture Mix", "MONO2REC_L Capture Switch", "Mono Mix"},/*Right record mixer */ - {"Right Capture Mix", "LineInR Capture Switch", "LINEINR"}, - {"Right Capture Mix", "Right Phone Capture Switch", "PHONEP"}, - {"Right Capture Mix", "Mic1 Capture Switch", "MIC1 Pre Amp"}, - {"Right Capture Mix", "Mic2 Capture Switch", "MIC2 Pre Amp"}, - {"Right Capture Mix", "HPMixerR Capture Switch", "HPR Mix"}, - {"Right Capture Mix", "SPKMixer Capture Switch", "Speaker Mix"}, - {"Right Capture Mix", "MonoMixer Capture Switch", "Mono Mix"}, + {"Right Capture Mix", "LIR2REC Capture Switch", "LINEINR"}, + {"Right Capture Mix", "PH2REC_R Capture Switch", "PHONEP"}, + {"Right Capture Mix", "MIC12REC_R Capture Switch", "MIC1 Pre Amp"}, + {"Right Capture Mix", "MIC22REC_R Capture Switch", "MIC2 Pre Amp"}, + {"Right Capture Mix", "HPR2REC Capture Switch", "HPR Mix"}, + {"Right Capture Mix", "SPK2REC_R Capture Switch", "Speaker Mix"}, + {"Right Capture Mix", "MONO2REC_R Capture Switch", "Mono Mix"},/* headphone left mux */ {"Left Headphone Mux", "HP Left Mix", "HPL Mix"},
Signature · 1 line
1.7.3.4
PATCH 5/12 ASoC: alc5632: Remove unexisting route from Phone Mix to Mono Mix
In reply to Leon RomanovskyFrom: Andrey Danin <[email protected]>
There is no Phone Mix<->Mono Mix route in datasheet.
--- sound/soc/codecs/alc5632.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
sound/soc/codecs/alc5632.c +0 -1
@@ -443,7 +443,6 @@ static const struct snd_soc_dapm_route alc5632_dapm_routes[] = { {"Mono Mix", "ADC2MONO_L Playback Switch", "Left Capture Mix"}, {"Mono Mix", "ADC2MONO_R Playback Switch", "Right Capture Mix"}, {"Mono Mix", "LI2MONO Playback Switch", "Line Mix"}, - {"Mono Mix", "VOICE2MONO Playback Switch", "Phone Mix"}, {"Mono Mix", "MIC12MONO Playback Switch", "MIC1 PGA"}, {"Mono Mix", "MIC22MONO Playback Switch", "MIC2 PGA"}, {"Mono Mix", "DAC2MONO Playback Switch", "DAC Left Channel"},
Signature · 1 line
1.7.3.4
PATCH 6/12 ASoC: alc5632: Refactored DAPM routes to add voice support
In reply to Leon RomanovskyFrom: Andrey Danin <[email protected]>
Refactored DAPM routes to add voice support.
- Added undocumented register
- Used AIF in/out
- Added missed voice items and routes
- Added DMIC input
- Romoved unrelevant items
--- sound/soc/codecs/alc5632.c | 75 +++++++++++++++++++++++++++++++++++++------ sound/soc/codecs/alc5632.h | 1 + 2 files changed, 65 insertions(+), 11 deletions(-)
sound/soc/codecs/alc5632.c +64 -11
@@ -276,6 +276,10 @@ static const char * const alc5632_spkout_input_sel[] = { "Vmid", "HPOut Mix", "Speaker Mix", "Mono Mix"};static const char *const alc5632_aux_out_input_sel[] = {"Vmid" ,"HPOut Mix" ,"Speaker Mix" ,"Mono Mix" }; +static const char *const alc5632_adcr_func_sel[] = { +"Stereo ADC" ,"Voice ADC" }; +static const char *const alc5632_i2s_out_sel[] = { +"ADC LR" ,"Voice Stereo Digital" };/* auxout output mux */ static const struct soc_enum alc5632_aux_out_input_enum =
@@ -314,6 +318,17 @@ static const struct soc_enum alc5632_amp_enum =static const struct snd_kcontrol_new alc5632_amp_mux_controls =SOC_DAPM_ENUM ("AB-D Amp Mux" , alc5632_amp_enum); +/* ADC output select */ +static const struct soc_enum alc5632_adcr_func_enum = +SOC_ENUM_SINGLE (ALC5632_DAC_FUNC_SELECT ,5 ,2 , alc5632_adcr_func_sel); +static const struct snd_kcontrol_new alc5632_adcr_func_controls = +SOC_DAPM_ENUM ("ADCR Mux" , alc5632_adcr_func_enum); + +/* I2S out select */ +static const struct soc_enum alc5632_i2s_out_enum = +SOC_ENUM_SINGLE (ALC5632_I2S_OUT_CTL ,5 ,2 , alc5632_i2s_out_sel); +static const struct snd_kcontrol_new alc5632_i2s_out_controls = +SOC_DAPM_ENUM ("I2SOut Mux" , alc5632_i2s_out_enum);static const struct snd_soc_dapm_widget alc5632_dapm_widgets[] = {/* Muxes */
@@ -327,6 +342,10 @@ SND_SOC_DAPM_MUX("Right Headphone Mux", SND_SOC_NOPM, 0, 0, &alc5632_hpr_out_mux_controls),SND_SOC_DAPM_MUX ("SpeakerOut N Mux" ,SND_SOC_NOPM ,0 ,0 , &alc5632_spkoutn_mux_controls), +SND_SOC_DAPM_MUX ("ADCR Mux" ,SND_SOC_NOPM ,0 ,0 , + &alc5632_adcr_func_controls), +SND_SOC_DAPM_MUX ("I2SOut Mux" ,SND_SOC_NOPM ,0 ,0 , + &alc5632_i2s_out_controls),/* output mixers */ SND_SOC_DAPM_MIXER("HP Mix", SND_SOC_NOPM, 0, 0,
@@ -354,20 +373,28 @@ SND_SOC_DAPM_MIXER("Right Capture Mix", ALC5632_PWR_MANAG_ADD2, 0, 0, &alc5632_captureR_mixer_controls[0], ARRAY_SIZE(alc5632_captureR_mixer_controls)), -SND_SOC_DAPM_DAC ("Left DAC" ,"HiFi Playback" , -ALC5632_PWR_MANAG_ADD2 ,9 ,0 ), -SND_SOC_DAPM_DAC ("Right DAC" ,"HiFi Playback" , -ALC5632_PWR_MANAG_ADD2 ,8 ,0 ), +SND_SOC_DAPM_AIF_IN ("AIFRXL" ,"Left HiFi Playback" ,0 ,SND_SOC_NOPM ,0 ,0 ), +SND_SOC_DAPM_AIF_IN ("AIFRXR" ,"Right HiFi Playback" ,0 ,SND_SOC_NOPM ,0 ,0 ), +SND_SOC_DAPM_AIF_OUT ("AIFTXL" ,"Left HiFi Capture" ,0 ,SND_SOC_NOPM ,0 ,0 ), +SND_SOC_DAPM_AIF_OUT ("AIFTXR" ,"Right HiFi Capture" ,0 ,SND_SOC_NOPM ,0 ,0 ), +SND_SOC_DAPM_AIF_IN ("VAIFRX" ,"Voice Playback" ,0 ,SND_SOC_NOPM ,0 ,0 ), +SND_SOC_DAPM_AIF_OUT ("VAIFTX" ,"Voice Capture" ,0 ,SND_SOC_NOPM ,0 ,0 ), + +SND_SOC_DAPM_DAC ("Voice DAC" ,NULL ,ALC5632_PWR_MANAG_ADD2 ,10 ,0 ), +SND_SOC_DAPM_DAC ("Left DAC" ,NULL ,ALC5632_PWR_MANAG_ADD2 ,9 ,0 ), +SND_SOC_DAPM_DAC ("Right DAC" ,NULL ,ALC5632_PWR_MANAG_ADD2 ,8 ,0 ), +SND_SOC_DAPM_ADC ("Left ADC" ,NULL ,ALC5632_PWR_MANAG_ADD2 ,7 ,0 ), +SND_SOC_DAPM_ADC ("Right ADC" ,NULL ,ALC5632_PWR_MANAG_ADD2 ,6 ,0 ), +SND_SOC_DAPM_MIXER ("DAC Left Channel" ,ALC5632_PWR_MANAG_ADD1 ,15 ,0 ,NULL ,0 ),SND_SOC_DAPM_MIXER ("DAC Right Channel" ,ALC5632_PWR_MANAG_ADD1 ,14 ,0 ,NULL ,0 ),SND_SOC_DAPM_MIXER ("I2S Mix" ,ALC5632_PWR_MANAG_ADD1 ,11 ,0 ,NULL ,0 ),SND_SOC_DAPM_MIXER ("Phone Mix" ,SND_SOC_NOPM ,0 ,0 ,NULL ,0 ),SND_SOC_DAPM_MIXER ("Line Mix" ,SND_SOC_NOPM ,0 ,0 ,NULL ,0 ), -SND_SOC_DAPM_ADC ("Left ADC" ,"HiFi Capture" , -ALC5632_PWR_MANAG_ADD2 ,7 ,0 ), -SND_SOC_DAPM_ADC ("Right ADC" ,"HiFi Capture" , -ALC5632_PWR_MANAG_ADD2 ,6 ,0 ), +SND_SOC_DAPM_MIXER ("Voice Mix" ,SND_SOC_NOPM ,0 ,0 ,NULL ,0 ), +SND_SOC_DAPM_MIXER ("ADCLR" ,SND_SOC_NOPM ,0 ,0 ,NULL ,0 ), +SND_SOC_DAPM_PGA ("Left Headphone" ,ALC5632_PWR_MANAG_ADD3 ,11 ,0 ,NULL ,0 ),SND_SOC_DAPM_PGA ("Right Headphone" ,ALC5632_PWR_MANAG_ADD3 ,10 ,0 ,NULL ,0 ), SND_SOC_DAPM_PGA("Left Speaker", ALC5632_PWR_MANAG_ADD3, 13, 0, NULL, 0),
@@ -395,10 +422,12 @@ SND_SOC_DAPM_OUTPUT("HPL"),SND_SOC_DAPM_OUTPUT ("HPR" ),SND_SOC_DAPM_OUTPUT ("SPKOUT" ),SND_SOC_DAPM_OUTPUT ("SPKOUTN" ), +SND_SOC_DAPM_INPUT ("LINEINL" ),SND_SOC_DAPM_INPUT ("LINEINR" ),SND_SOC_DAPM_INPUT ("PHONEP" ),SND_SOC_DAPM_INPUT ("PHONEN" ), +SND_SOC_DAPM_INPUT ("DMICDAT" ),SND_SOC_DAPM_INPUT ("MIC1" ),SND_SOC_DAPM_INPUT ("MIC2" ), SND_SOC_DAPM_VMID("Vmid"),
@@ -406,6 +435,10 @@ SND_SOC_DAPM_VMID("Vmid"),static const struct snd_soc_dapm_route alc5632_dapm_routes[] = { +/* Playback streams */ + {"Left DAC" ,NULL ,"AIFRXL" }, + {"Right DAC" ,NULL ,"AIFRXR" }, +/* virtual mixer - mixes left & right channels */ {"I2S Mix" ,NULL ,"Left DAC" }, {"I2S Mix" ,NULL ,"Right DAC" },
@@ -428,7 +461,7 @@ static const struct snd_soc_dapm_route alc5632_dapm_routes[] = { {"HP Mix", "PHONE2HP Playback Switch", "Phone Mix"}, {"HP Mix", "MIC12HP Playback Switch", "MIC1 PGA"}, {"HP Mix", "MIC22HP Playback Switch", "MIC2 PGA"}, - + {"HP Mix", "VOICE2HP Playback Switch", "Voice Mix"}, {"HPR Mix", "DACR2HP Playback Switch", "DAC Right Channel"}, {"HPL Mix", "DACL2HP Playback Switch", "DAC Left Channel"},
@@ -438,6 +471,7 @@ static const struct snd_soc_dapm_route alc5632_dapm_routes[] = { {"Speaker Mix", "MIC12SPK Playback Switch", "MIC1 PGA"}, {"Speaker Mix", "MIC22SPK Playback Switch", "MIC2 PGA"}, {"Speaker Mix", "DAC2SPK Playback Switch", "DAC Left Channel"}, + {"Speaker Mix", "VOICE2SPK Playback Switch", "Voice Mix"},/* mono mixer */ {"Mono Mix", "ADC2MONO_L Playback Switch", "Left Capture Mix"},
@@ -446,6 +480,7 @@ static const struct snd_soc_dapm_route alc5632_dapm_routes[] = { {"Mono Mix", "MIC12MONO Playback Switch", "MIC1 PGA"}, {"Mono Mix", "MIC22MONO Playback Switch", "MIC2 PGA"}, {"Mono Mix", "DAC2MONO Playback Switch", "DAC Left Channel"}, + {"Mono Mix", "VOICE2MONO Playback Switch", "Voice Mix"},/* Left record mixer */ {"Left Capture Mix", "LIL2REC Capture Switch", "LINEINL"},
@@ -503,10 +538,28 @@ static const struct snd_soc_dapm_route alc5632_dapm_routes[] = {/* left ADC */ {"Left ADC", NULL, "Left Capture Mix"}, + {"Left ADC", NULL, "DMICDAT"}, + {"ADCLR", NULL, "Left ADC"},/* right ADC */ - {"Right ADC", NULL, "Right Capture Mix"}, - + {"Right ADC", NULL, "Right Capture Mix"}, + {"Right ADC", NULL, "DMICDAT"}, + {"ADCR Mux", "Stereo ADC", "Right ADC"}, + {"ADCR Mux", "Voice ADC", "Right ADC"}, + {"ADCLR", NULL, "ADCR Mux"}, + {"VAIFTX", NULL, "ADCR Mux"}, + +/* Digital I2S out */ + {"I2SOut Mux", "ADC LR", "ADCLR"}, + {"I2SOut Mux", "Voice Stereo Digital", "VAIFRX"}, + {"AIFTXL", NULL, "I2SOut Mux"}, + {"AIFTXR", NULL, "I2SOut Mux"}, + +/* Voice Mix */ + {"Voice DAC", NULL, "VAIFRX"}, + {"Voice Mix", NULL, "Voice DAC"}, + +/* Speaker Output */ {"SpeakerOut N Mux", "RN/-R", "Left Speaker"}, {"SpeakerOut N Mux", "RP/+R", "Left Speaker"}, {"SpeakerOut N Mux", "LN/-R", "Left Speaker"},
sound/soc/codecs/alc5632.h +1 -0
@@ -51,6 +51,7 @@#define ALC5632_ADC_REC_MONOMIX (1 << 0)#define ALC5632_VOICE_DAC_VOL 0x18/* voice dac vol */ +#define ALC5632_I2S_OUT_CTL 0x1A/* undocumented reg. found in path scheme */ /* ALC5632_OUTPUT_MIXER_CTRL : */ /* same remark as for reg 2 line vs speaker */ #define ALC5632_OUTPUT_MIXER_CTRL 0x1C/* out mix ctrl */
Signature · 1 line
1.7.3.4
PATCH 7/12 ASoC: alc5632: Add DMIC switches and controls
In reply to Leon RomanovskyFrom: Andrey Danin <[email protected]>
Add DMIC switches and controls to ALC5632 codec.
--- sound/soc/codecs/alc5632.c | 26 +++++++++++++++++++++++--- 1 files changed, 23 insertions(+), 3 deletions(-)
sound/soc/codecs/alc5632.c +23 -3
@@ -196,8 +196,12 @@ static const struct snd_kcontrol_new alc5632_snd_controls[] = { ALC5632_MIC_CTRL, 10, 2, 0, boost_tlv),SOC_SINGLE_TLV ("Mic 2 Boost Volume" ,ALC5632_MIC_CTRL ,8 ,2 ,0 , boost_tlv), - SOC_SINGLE_TLV("Digital Boost Volume", +SOC_SINGLE_TLV ("DMIC Boost Volume" ,ALC5632_DIGI_BOOST_CTRL ,0 ,7 ,0 , dig_tlv), +SOC_SINGLE ("DMIC En Capture Switch" , +ALC5632_DIGI_BOOST_CTRL ,15 ,1 ,0 ), +SOC_SINGLE ("DMIC PreFilter Capture Switch" , + ALC5632_DIGI_BOOST_CTRL, 12, 1, 0), };/*
@@ -266,6 +270,14 @@ SOC_DAPM_SINGLE("SPK2REC_R Capture Switch", ALC5632_ADC_REC_MIXER, 1, 1, 1), SOC_DAPM_SINGLE("MONO2REC_R Capture Switch", ALC5632_ADC_REC_MIXER, 0, 1, 1), }; +/* Dmic Mixer */ +static const struct snd_kcontrol_new alc5632_dmicl_mixer_controls[] = { +SOC_DAPM_SINGLE ("DMICL2ADC Capture Switch" ,ALC5632_DIGI_BOOST_CTRL ,7 ,1 ,1 ), +}; +static const struct snd_kcontrol_new alc5632_dmicr_mixer_controls[] = { +SOC_DAPM_SINGLE ("DMICR2ADC Capture Switch" ,ALC5632_DIGI_BOOST_CTRL ,6 ,1 ,1 ), +}; +static const char *alc5632_spk_n_sour_sel[] = {"RN/-R" ,"RP/+R" ,"LN/-R" ,"Mute" };static const char *alc5632_hpl_out_input_sel[] = {
@@ -364,6 +376,12 @@ SND_SOC_DAPM_MIXER("Mono Mix", ALC5632_PWR_MANAG_ADD2, 2, 0,SND_SOC_DAPM_MIXER ("Speaker Mix" ,ALC5632_PWR_MANAG_ADD2 ,3 ,0 , &alc5632_speaker_mixer_controls[0 ],ARRAY_SIZE (alc5632_speaker_mixer_controls)), +SND_SOC_DAPM_MIXER ("DMICL Mix" ,SND_SOC_NOPM ,0 ,0 , + &alc5632_dmicl_mixer_controls[0 ], +ARRAY_SIZE (alc5632_dmicl_mixer_controls)), +SND_SOC_DAPM_MIXER ("DMICR Mix" ,SND_SOC_NOPM ,0 ,0 , + &alc5632_dmicr_mixer_controls[0 ], +ARRAY_SIZE (alc5632_dmicr_mixer_controls)),/* input mixers */ SND_SOC_DAPM_MIXER("Left Capture Mix", ALC5632_PWR_MANAG_ADD2, 1, 0,
@@ -538,12 +556,14 @@ static const struct snd_soc_dapm_route alc5632_dapm_routes[] = {/* left ADC */ {"Left ADC", NULL, "Left Capture Mix"}, - {"Left ADC", NULL, "DMICDAT"}, + {"DMICL Mix", "DMICL2ADC Capture Switch", "DMICDAT"}, + {"Left ADC", NULL, "DMICL Mix"}, {"ADCLR", NULL, "Left ADC"},/* right ADC */ {"Right ADC", NULL, "Right Capture Mix"}, - {"Right ADC", NULL, "DMICDAT"}, + {"DMICR Mix", "DMICR2ADC Capture Switch", "DMICDAT"}, + {"Right ADC", NULL, "DMICR Mix"}, {"ADCR Mux", "Stereo ADC", "Right ADC"}, {"ADCR Mux", "Voice ADC", "Right ADC"}, {"ADCLR", NULL, "ADCR Mux"},
Signature · 1 line
1.7.3.4
PATCH 8/12 ASoC: alc5632: Fix I2S digital interface power for recording
In reply to Leon RomanovskyFrom: Andrey Danin <[email protected]>
Fix I2S digital interface power for recording.
--- sound/soc/codecs/alc5632.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
sound/soc/codecs/alc5632.c +1 -1
@@ -356,7 +356,7 @@ SND_SOC_DAPM_MUX("SpeakerOut N Mux", SND_SOC_NOPM, 0, 0, &alc5632_spkoutn_mux_controls),SND_SOC_DAPM_MUX ("ADCR Mux" ,SND_SOC_NOPM ,0 ,0 , &alc5632_adcr_func_controls), -SND_SOC_DAPM_MUX ("I2SOut Mux" ,SND_SOC_NOPM ,0 ,0 , +SND_SOC_DAPM_MUX ("I2SOut Mux" ,ALC5632_PWR_MANAG_ADD1 ,11 ,0 , &alc5632_i2s_out_controls),/* output mixers */
Signature · 1 line
1.7.3.4
PATCH 9/12 ASoC: alc5632: Connect HP/HPL/HPR mix'es to HPOut Mix
In reply to Leon RomanovskyFrom: Andrey Danin <[email protected]>
This patch should fix output through speakers using HP mixer.
--- sound/soc/codecs/alc5632.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
sound/soc/codecs/alc5632.c +3 -0
@@ -482,6 +482,9 @@ static const struct snd_soc_dapm_route alc5632_dapm_routes[] = { {"HP Mix", "VOICE2HP Playback Switch", "Voice Mix"}, {"HPR Mix", "DACR2HP Playback Switch", "DAC Right Channel"}, {"HPL Mix", "DACL2HP Playback Switch", "DAC Left Channel"}, + {"HPOut Mix", NULL, "HP Mix"}, + {"HPOut Mix", NULL, "HPR Mix"}, + {"HPOut Mix", NULL, "HPL Mix"},/* speaker mixer */ {"Speaker Mix", "LI2SPK Playback Switch", "Line Mix"},
Signature · 1 line
1.7.3.4
PATCH 10/12 ASoC: alc5632: Fix Boost Volume TLVs used for the external microphones
In reply to Leon RomanovskyFrom: Paul Fertser <[email protected]>
This brings the TLVs in sync with the documentation and allows to properly manipulate mic boost controls with alsamixer.
--- sound/soc/codecs/alc5632.c | 11 +++++------ 1 files changed, 5 insertions(+), 6 deletions(-)
sound/soc/codecs/alc5632.c +5 -6
@@ -145,10 +145,9 @@ static const DECLARE_TLV_DB_SCALE(hp_tlv, -4650, 150, 0);/* -16.5db min scale, 1.5db steps, no mute */ static const DECLARE_TLV_DB_SCALE(adc_rec_tlv, -1650, 150, 0);static const unsigned int boost_tlv[] = { -TLV_DB_RANGE_HEAD (3 ), -0 ,0 ,TLV_DB_SCALE_ITEM (0 ,0 ,0 ), -1 ,1 ,TLV_DB_SCALE_ITEM (2000 ,0 ,0 ), -2 ,2 ,TLV_DB_SCALE_ITEM (3000 ,0 ,0 ), +TLV_DB_RANGE_HEAD (2 ), +0 ,1 ,TLV_DB_SCALE_ITEM (0 ,2000 ,0 ), +1 ,3 ,TLV_DB_SCALE_ITEM (2000 ,1000 ,0 ), };/* 0db min scale, 6 db steps, no mute */ static const DECLARE_TLV_DB_SCALE(dig_tlv, 0, 600, 0);
@@ -193,9 +192,9 @@ static const struct snd_kcontrol_new alc5632_snd_controls[] = {SOC_DOUBLE_TLV ("Rec Capture Volume" ,ALC5632_ADC_REC_GAIN ,8 ,0 ,31 ,0 , adc_rec_tlv),SOC_SINGLE_TLV ("Mic 1 Boost Volume" , -ALC5632_MIC_CTRL ,10 ,2 ,0 , boost_tlv), +ALC5632_MIC_CTRL ,10 ,3 ,0 , boost_tlv),SOC_SINGLE_TLV ("Mic 2 Boost Volume" , -ALC5632_MIC_CTRL ,8 ,2 ,0 , boost_tlv), +ALC5632_MIC_CTRL ,8 ,3 ,0 , boost_tlv),SOC_SINGLE_TLV ("DMIC Boost Volume" ,ALC5632_DIGI_BOOST_CTRL ,0 ,7 ,0 , dig_tlv), SOC_SINGLE("DMIC En Capture Switch",
Signature · 1 line
1.7.3.4
PATCH 11/12 ASoC: alc5632: Fix Capture/Playback attributes for microphone inputs
In reply to Leon RomanovskyFrom: Paul Fertser <[email protected]>
According to the mixer path diagram input sources' attenuators logically belong to the playback path and DMIC boost only affects capture.
--- sound/soc/codecs/alc5632.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-)
sound/soc/codecs/alc5632.c +5 -5
@@ -177,17 +177,17 @@ static const struct snd_kcontrol_new alc5632_snd_controls[] = { ALC5632_VOICE_DAC_VOL, 0, 63, 0, vdac_tlv),SOC_SINGLE ("Voice DAC Playback Switch" ,ALC5632_VOICE_DAC_VOL ,12 ,1 ,1 ), -SOC_SINGLE_TLV ("Phone Capture Volume" , +SOC_SINGLE_TLV ("Phone Playback Volume" ,ALC5632_PHONE_IN_VOL ,8 ,31 ,1 , vol_tlv), -SOC_DOUBLE_TLV ("LineIn Capture Volume" , +SOC_DOUBLE_TLV ("LineIn Playback Volume" ,ALC5632_LINE_IN_VOL ,8 ,0 ,31 ,1 , vol_tlv),SOC_DOUBLE_TLV ("Master Playback Volume" ,ALC5632_STEREO_DAC_IN_VOL ,8 ,0 ,63 ,1 , vdac_tlv),SOC_DOUBLE ("Master Playback Switch" ,ALC5632_STEREO_DAC_IN_VOL ,15 ,7 ,1 ,1 ), -SOC_SINGLE_TLV ("Mic1 Capture Volume" , +SOC_SINGLE_TLV ("Mic1 Playback Volume" ,ALC5632_MIC_VOL ,8 ,31 ,1 , vol_tlv), -SOC_SINGLE_TLV ("Mic2 Capture Volume" , +SOC_SINGLE_TLV ("Mic2 Playback Volume" ,ALC5632_MIC_VOL ,0 ,31 ,1 , vol_tlv),SOC_DOUBLE_TLV ("Rec Capture Volume" , ALC5632_ADC_REC_GAIN, 8, 0, 31, 0, adc_rec_tlv),
@@ -195,7 +195,7 @@ static const struct snd_kcontrol_new alc5632_snd_controls[] = { ALC5632_MIC_CTRL, 10, 3, 0, boost_tlv),SOC_SINGLE_TLV ("Mic 2 Boost Volume" ,ALC5632_MIC_CTRL ,8 ,3 ,0 , boost_tlv), -SOC_SINGLE_TLV ("DMIC Boost Volume" , +SOC_SINGLE_TLV ("DMIC Boost Capture Volume" ,ALC5632_DIGI_BOOST_CTRL ,0 ,7 ,0 , dig_tlv),SOC_SINGLE ("DMIC En Capture Switch" , ALC5632_DIGI_BOOST_CTRL, 15, 1, 0),
Signature · 1 line
1.7.3.4
PATCH 12/12 ASoC: alc5632: Allow 8kHz stream support.
In reply to Leon RomanovskyFrom: Andrey Danin <[email protected]>
--- sound/soc/codecs/alc5632.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
sound/soc/codecs/alc5632.c +1 -0
@@ -788,6 +788,7 @@ static int alc5632_set_dai_sysclk(struct snd_soc_dai *codec_dai,struct alc5632_priv *alc5632 =snd_soc_codec_get_drvdata (codec);switch (freq) { +case 4096000 :case 8192000 :case 11289600 :case 12288000 :
Signature · 1 line
1.7.3.4