Skip to contentSkip to conversation

ASoC: Intel: byt-max98090: Move MICBIAS widget to supply of Headset Mic

PATCH Applied Jarkko Nikula 2 participants 7 messages Jun 23, 2014 – Jun 24, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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
index 5fc98c64a3f4..a3c5f02a60fc 100644
@@ -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
#1 lore raw

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
index a3c5f02a60fc..3d06440278ec 100644
@@ -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
#2 lore raw

PATCH 3/6 ASoC: Intel: byt-max98090: Do not report SND_JACK_LINEIN

In reply to Jarkko Nikula

Headset 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
index 3d06440278ec..165ab6d6c4a3 100644
@@ -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
#3 lore raw

PATCH 4/6 ASoC: Intel: byt-max98090: Fix jack type in order to report correctly

In reply to Jarkko Nikula

Pass 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
index 165ab6d6c4a3..3e2e7152ae66 100644
@@ -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
#4 lore raw

PATCH 5/6 ASoC: Intel: byt-max98090: Do not change speaker and DMIC with jack state

In reply to Jarkko Nikula

Kernel 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
index 3e2e7152ae66..deb1db9a9a97 100644
@@ -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
#5 lore raw

PATCH 6/6 ASoC: Intel: byt-max98090: Do not enable MAX98090 microphone detection

In reply to Jarkko Nikula

It 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
index deb1db9a9a97..b8b8af571ef1 100644
@@ -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
maintainer Applied
#6 lore raw
In reply to Jarkko Nikula
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.