[alsa-devel] [PATCH 1/6] ASoC: Intel: byt-max98090: Move MICBIAS widget to supply of Headset Mic
![](https://secure.gravatar.com/avatar/89f61c5f3ee192ab43c77c8694b1e1ef.jpg?s=120&d=mm&r=g)
Move "MICBIAS" as a supply widget to "Headset Mic" instead of keeping it between input pin "IN34" and "Headset Mic".
Signed-off-by: Jarkko Nikula jarkko.nikula@linux.intel.com --- sound/soc/intel/byt-max98090.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/sound/soc/intel/byt-max98090.c b/sound/soc/intel/byt-max98090.c index 5fc98c64a3f4..a3c5f02a60fc 100644 --- a/sound/soc/intel/byt-max98090.c +++ b/sound/soc/intel/byt-max98090.c @@ -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"},
![](https://secure.gravatar.com/avatar/89f61c5f3ee192ab43c77c8694b1e1ef.jpg?s=120&d=mm&r=g)
Mic detect GPIO is active low when headset microphone is detected. Found both by debugging and checking the schematics.
Signed-off-by: Jarkko Nikula jarkko.nikula@linux.intel.com --- sound/soc/intel/byt-max98090.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/sound/soc/intel/byt-max98090.c b/sound/soc/intel/byt-max98090.c index a3c5f02a60fc..3d06440278ec 100644 --- a/sound/soc/intel/byt-max98090.c +++ b/sound/soc/intel/byt-max98090.c @@ -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, },
![](https://secure.gravatar.com/avatar/89f61c5f3ee192ab43c77c8694b1e1ef.jpg?s=120&d=mm&r=g)
Headset jack has only mono microphone input.
Signed-off-by: Jarkko Nikula jarkko.nikula@linux.intel.com --- sound/soc/intel/byt-max98090.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/intel/byt-max98090.c b/sound/soc/intel/byt-max98090.c index 3d06440278ec..165ab6d6c4a3 100644 --- a/sound/soc/intel/byt-max98090.c +++ b/sound/soc/intel/byt-max98090.c @@ -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, }, };
![](https://secure.gravatar.com/avatar/89f61c5f3ee192ab43c77c8694b1e1ef.jpg?s=120&d=mm&r=g)
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.
Reported-by: Jin Yao yao.jin@intel.com Signed-off-by: Jarkko Nikula jarkko.nikula@linux.intel.com --- sound/soc/intel/byt-max98090.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sound/soc/intel/byt-max98090.c b/sound/soc/intel/byt-max98090.c index 165ab6d6c4a3..3e2e7152ae66 100644 --- a/sound/soc/intel/byt-max98090.c +++ b/sound/soc/intel/byt-max98090.c @@ -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;
![](https://secure.gravatar.com/avatar/89f61c5f3ee192ab43c77c8694b1e1ef.jpg?s=120&d=mm&r=g)
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.
Signed-off-by: Jarkko Nikula jarkko.nikula@linux.intel.com --- sound/soc/intel/byt-max98090.c | 8 -------- 1 file changed, 8 deletions(-)
diff --git a/sound/soc/intel/byt-max98090.c b/sound/soc/intel/byt-max98090.c index 3e2e7152ae66..deb1db9a9a97 100644 --- a/sound/soc/intel/byt-max98090.c +++ b/sound/soc/intel/byt-max98090.c @@ -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[] = {
![](https://secure.gravatar.com/avatar/89f61c5f3ee192ab43c77c8694b1e1ef.jpg?s=120&d=mm&r=g)
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.
Signed-off-by: Jarkko Nikula jarkko.nikula@linux.intel.com --- sound/soc/intel/byt-max98090.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/sound/soc/intel/byt-max98090.c b/sound/soc/intel/byt-max98090.c index deb1db9a9a97..b8b8af571ef1 100644 --- a/sound/soc/intel/byt-max98090.c +++ b/sound/soc/intel/byt-max98090.c @@ -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[] = {
![](https://secure.gravatar.com/avatar/d930951cb00393ecf9c3db3a56d78fa9.jpg?s=120&d=mm&r=g)
On Mon, Jun 23, 2014 at 04:29:37PM +0300, Jarkko Nikula wrote:
Move "MICBIAS" as a supply widget to "Headset Mic" instead of keeping it between input pin "IN34" and "Headset Mic".
Applied all, thanks.
participants (2)
-
Jarkko Nikula
-
Mark Brown