[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191028095229.99438-1-cychiang@chromium.org>
Date: Mon, 28 Oct 2019 17:52:29 +0800
From: Cheng-Yi Chiang <cychiang@...omium.org>
To: linux-kernel@...r.kernel.org
Cc: Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>,
Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>,
Heiko Stuebner <heiko@...ech.de>, enric.balletbo@...labora.com,
dianders@...omium.org, dgreid@...omium.org, tzungbi@...omium.org,
alsa-devel@...a-project.org, linux-arm-kernel@...ts.infradead.org,
linux-rockchip@...ts.infradead.org,
Cheng-Yi Chiang <cychiang@...omium.org>
Subject: [PATCH] ASoC: rockchip: rockchip_max98090: Enable SHDN to fix headset detection
max98090 spec states that chip needs to be in turned-on state to supply
mic bias. Enable SHDN dapm widget along with MICBIAS widget to
actually turn on mic bias for proper headset button detection.
This is similar to cht_ti_jack_event in
sound/soc/intel/boards/cht_bsw_max98090_ti.c.
Note that due to ts3a227e reports the jack event right away before the
notifier is registered, if headset is plugged on boot, headset button
will not get detected until headset is unplugged and plugged. This is
still an issue to be fixed.
Signed-off-by: Cheng-Yi Chiang <cychiang@...omium.org>
---
sound/soc/rockchip/rockchip_max98090.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/sound/soc/rockchip/rockchip_max98090.c b/sound/soc/rockchip/rockchip_max98090.c
index 0097df1fae66..e80b09143b63 100644
--- a/sound/soc/rockchip/rockchip_max98090.c
+++ b/sound/soc/rockchip/rockchip_max98090.c
@@ -66,10 +66,13 @@ static int rk_jack_event(struct notifier_block *nb, unsigned long event,
struct snd_soc_jack *jack = (struct snd_soc_jack *)data;
struct snd_soc_dapm_context *dapm = &jack->card->dapm;
- if (event & SND_JACK_MICROPHONE)
+ if (event & SND_JACK_MICROPHONE) {
snd_soc_dapm_force_enable_pin(dapm, "MICBIAS");
- else
+ snd_soc_dapm_force_enable_pin(dapm, "SHDN");
+ } else {
snd_soc_dapm_disable_pin(dapm, "MICBIAS");
+ snd_soc_dapm_disable_pin(dapm, "SHDN");
+ }
snd_soc_dapm_sync(dapm);
--
2.24.0.rc0.303.g954a862665-goog
Powered by blists - more mailing lists