ASoC: Intel: byt-max98090: Move MICBIAS widget to supply of Headset Mic
Subsystems (3)
PATCH 1/6 ASoC: Intel: byt-max98090: Move MICBIAS widget to supply of Headset Mic
Move "MICBIAS" as a supply widget to "Headset Mic" instead of keeping it between input pin "IN34" and "Headset Mic".
--- sound/soc/intel/byt-max98090.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
sound/soc/intel/byt-max98090.c +1 -2
@@ -39,8 +39,7 @@ static const struct snd_soc_dapm_widget byt_max98090_widgets[] = {static const struct snd_soc_dapm_route byt_max98090_audio_map[] = { {"IN34" ,NULL ,"Headset Mic" }, - {"IN34" ,NULL ,"MICBIAS" }, - {"MICBIAS" ,NULL ,"Headset Mic" }, + {"Headset Mic" ,NULL ,"MICBIAS" }, {"DMICL" ,NULL ,"Int Mic" }, {"Headphone" ,NULL ,"HPL" }, {"Headphone" ,NULL ,"HPR" },
Signature · 1 line
2.0.0
PATCH 2/6 ASoC: Intel: byt-max98090: Fix mic detect GPIO polarity
Mic detect GPIO is active low when headset microphone is detected. Found both by debugging and checking the schematics.
--- sound/soc/intel/byt-max98090.c | 1 + 1 file changed, 1 insertion(+)
sound/soc/intel/byt-max98090.c +1 -0
@@ -83,6 +83,7 @@ static struct snd_soc_jack_gpio hs_jack_gpios[] = { { .name = "mic-gpio", .idx = 1, + .invert = 1, .report = SND_JACK_MICROPHONE | SND_JACK_LINEIN, .debounce_time = 200, },
Signature · 1 line
2.0.0
PATCH 3/6 ASoC: Intel: byt-max98090: Do not report SND_JACK_LINEIN
In reply to Jarkko NikulaHeadset jack has only mono microphone input.
--- sound/soc/intel/byt-max98090.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/intel/byt-max98090.c +1 -1
@@ -84,7 +84,7 @@ static struct snd_soc_jack_gpio hs_jack_gpios[] = { .name = "mic-gpio", .idx = 1, .invert = 1, - .report = SND_JACK_MICROPHONE | SND_JACK_LINEIN, + .report = SND_JACK_MICROPHONE, .debounce_time = 200, }, };
Signature · 1 line
2.0.0
PATCH 4/6 ASoC: Intel: byt-max98090: Fix jack type in order to report correctly
In reply to Jarkko NikulaPass actual jack type bitmask to snd_soc_jack_new() in order to report also microphone detections and not only headphone. While at it change also jack name and pass also SND_JACK_LINEOUT type.
--- sound/soc/intel/byt-max98090.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
sound/soc/intel/byt-max98090.c +2 -1
@@ -108,7 +108,8 @@ static int byt_max98090_init(struct snd_soc_pcm_runtime *runtime) }/* Enable jack detection */ - ret =snd_soc_jack_new (codec,"Headphone" ,SND_JACK_HEADPHONE , jack); + ret =snd_soc_jack_new (codec,"Headset" , +SND_JACK_LINEOUT |SND_JACK_HEADSET , jack);if (ret)return ret;
Signature · 1 line
2.0.0
PATCH 5/6 ASoC: Intel: byt-max98090: Do not change speaker and DMIC with jack state
In reply to Jarkko NikulaKernel should not enable/disable speakers and digital microphone whenever jack is inserted/removed. This is more use-case than kernel specific decision. For instance one may want to play VoIP ring tones using both speakers and headphone but play music only from one of them.
Because of above reason remove "Ext Spk" and "Int Mic" update when jack state is changed. Also this update was illogical anyway: "Ext Spk" was enabled when jack was inserted and disabled when jack was removed.
--- sound/soc/intel/byt-max98090.c | 8 -------- 1 file changed, 8 deletions(-)
sound/soc/intel/byt-max98090.c +0 -8
@@ -63,14 +63,6 @@ static struct snd_soc_jack_pin hs_jack_pins[] = { .pin = "Headset Mic", .mask = SND_JACK_MICROPHONE, }, - { - .pin = "Ext Spk", - .mask = SND_JACK_LINEOUT, - }, - { - .pin = "Int Mic", - .mask = SND_JACK_LINEIN, - }, }; static struct snd_soc_jack_gpio hs_jack_gpios[] = {
Signature · 1 line
2.0.0
PATCH 6/6 ASoC: Intel: byt-max98090: Do not enable MAX98090 microphone detection
In reply to Jarkko NikulaIt turned out there is no need to enable microphone detection in MAX98090 codec. Headset microphone is anyway detected by a GPIO signal from another chip and headset button presses cannot be detected either because a signal needed for it is not connected.
--- sound/soc/intel/byt-max98090.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-)
sound/soc/intel/byt-max98090.c +3 -7
@@ -110,13 +110,9 @@ static int byt_max98090_init(struct snd_soc_pcm_runtime *runtime)if (ret)return ret; - ret =snd_soc_jack_add_gpiods (card->dev->parent, jack, -ARRAY_SIZE (hs_jack_gpios), - hs_jack_gpios); -if (ret) -return ret; - -return max98090_mic_detect (codec, jack); +return snd_soc_jack_add_gpiods (card->dev->parent, jack, +ARRAY_SIZE (hs_jack_gpios), + hs_jack_gpios); }static struct snd_soc_dai_link byt_max98090_dais[] = {
Signature · 1 line
2.0.0
Quoted 2 lines · Jarkko Nikula
Move "MICBIAS" as a supply widget to "Headset Mic" instead of keeping it between input pin "IN34" and "Headset Mic".
Applied all, thanks.