aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Brown2020-04-14 15:45:36 +0100
committerMark Brown2020-04-14 15:45:36 +0100
commit41d5d7b330b0a7b9b24aa7bfc61fdc9cfb64d27a (patch)
treeb5d6c103210e8b38e685ea2119e2a0ce4318ce33
parentdf3e71c42f058998b5a38e292a70f41d229e8fa9 (diff)
parent8240fe6c91b884b5f1f861a8c22721d6ea4c53c9 (diff)
Merge series "Support headset on Tegra boards that use WM8903" from Dmitry Osipenko <digetx@gmail.com>:
Hello, Some devices have a 4-pin jack instead of a 3-pin and currently the WM8903 configuration is hardcoded to the case of 3-pin jack in the Tegra's ASoC driver. A new device-tree property is required in order to convey that hardware has a 4-pin jack, and thus, microphone's detection needs to be done in a different way. In particular this is needed for Acer A500 tablet device that has a 4-pin headset jack, otherwise userspace sees headset instead of headphones and internal microphone isn't enabled by ALSA UCM rule when it should be. Please review and apply, thanks in advance. Dmitry Osipenko (2): dt-bindings: sound: tegra-wm8903: Document new nvidia,headset property ASoC: tegra: tegra_wm8903: Support nvidia,headset property .../devicetree/bindings/sound/nvidia,tegra-audio-wm8903.txt | 1 + sound/soc/tegra/tegra_wm8903.c | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) -- 2.25.1
-rw-r--r--Documentation/devicetree/bindings/sound/nvidia,tegra-audio-wm8903.txt1
-rw-r--r--sound/soc/tegra/tegra_wm8903.c6
2 files changed, 6 insertions, 1 deletions
diff --git a/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-wm8903.txt b/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-wm8903.txt
index a8f2b0c56c79..bbd581a8c5bc 100644
--- a/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-wm8903.txt
+++ b/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-wm8903.txt
@@ -29,6 +29,7 @@ Optional properties:
- nvidia,hp-det-gpios : The GPIO that detect headphones are plugged in
- nvidia,int-mic-en-gpios : The GPIO that enables the internal microphone
- nvidia,ext-mic-en-gpios : The GPIO that enables the external microphone
+- nvidia,headset : The Mic Jack represents state of the headset microphone pin
Example:
diff --git a/sound/soc/tegra/tegra_wm8903.c b/sound/soc/tegra/tegra_wm8903.c
index 9b5651502f12..3aca354f9e08 100644
--- a/sound/soc/tegra/tegra_wm8903.c
+++ b/sound/soc/tegra/tegra_wm8903.c
@@ -177,6 +177,7 @@ static int tegra_wm8903_init(struct snd_soc_pcm_runtime *rtd)
struct snd_soc_component *component = codec_dai->component;
struct snd_soc_card *card = rtd->card;
struct tegra_wm8903 *machine = snd_soc_card_get_drvdata(card);
+ int shrt = 0;
if (gpio_is_valid(machine->gpio_hp_det)) {
tegra_wm8903_hp_jack_gpio.gpio = machine->gpio_hp_det;
@@ -189,12 +190,15 @@ static int tegra_wm8903_init(struct snd_soc_pcm_runtime *rtd)
&tegra_wm8903_hp_jack_gpio);
}
+ if (of_property_read_bool(card->dev->of_node, "nvidia,headset"))
+ shrt = SND_JACK_MICROPHONE;
+
snd_soc_card_jack_new(rtd->card, "Mic Jack", SND_JACK_MICROPHONE,
&tegra_wm8903_mic_jack,
tegra_wm8903_mic_jack_pins,
ARRAY_SIZE(tegra_wm8903_mic_jack_pins));
wm8903_mic_detect(component, &tegra_wm8903_mic_jack, SND_JACK_MICROPHONE,
- 0);
+ shrt);
snd_soc_dapm_force_enable_pin(&card->dapm, "MICBIAS");