summaryrefslogtreecommitdiffstats
path: root/sound/soc
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2020-03-23 18:17:26 +0000
committerMark Brown <broonie@kernel.org>2020-03-23 18:17:26 +0000
commitc793d0917167a1a580b7bb8b69c9622d4d5a7d9a (patch)
tree08d5d39ff94086de2a14e4972ddd243096fae339 /sound/soc
parent235eb70034a09596bcf6a2a92e9b6c20c47dfae1 (diff)
parent7efa128e610fb0a44df23f20364c7278a4ead051 (diff)
downloadlinux-c793d0917167a1a580b7bb8b69c9622d4d5a7d9a.tar.bz2
Merge series "Support built-in Mic on Tegra boards that use WM8903" from Dmitry Osipenko <digetx@gmail.com>:
Hello, This small series adds audio route for built-in microphone on NVIDIA Tegra boards that use WM8903 CODEC. In particular this is needed in order to unmute internal microphone on Acer A500 tablet device. I'm planning to send out the device tree for the A500 for 5.8, so will be nice to get the microphone sorted out. Please review and apply, thanks in advance. Dmitry Osipenko (2): dt-bindings: sound: tegra-wm8903: Document built-in microphone audio source ASoC: tegra: tegra_wm8903: Support DAPM events for built-in microphone .../sound/nvidia,tegra-audio-wm8903.txt | 1 + sound/soc/tegra/tegra_wm8903.c | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) -- 2.25.1
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/tegra/tegra_wm8903.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/sound/soc/tegra/tegra_wm8903.c b/sound/soc/tegra/tegra_wm8903.c
index f08d3489c3cf..071c7d2de77c 100644
--- a/sound/soc/tegra/tegra_wm8903.c
+++ b/sound/soc/tegra/tegra_wm8903.c
@@ -143,14 +143,32 @@ static int tegra_wm8903_event_hp(struct snd_soc_dapm_widget *w,
return 0;
}
+static int tegra_wm8903_event_int_mic(struct snd_soc_dapm_widget *w,
+ struct snd_kcontrol *k, int event)
+{
+ struct snd_soc_dapm_context *dapm = w->dapm;
+ struct snd_soc_card *card = dapm->card;
+ struct tegra_wm8903 *machine = snd_soc_card_get_drvdata(card);
+
+ if (!gpio_is_valid(machine->gpio_int_mic_en))
+ return 0;
+
+ gpio_set_value_cansleep(machine->gpio_int_mic_en,
+ SND_SOC_DAPM_EVENT_ON(event));
+
+ return 0;
+}
+
static const struct snd_soc_dapm_widget tegra_wm8903_dapm_widgets[] = {
SND_SOC_DAPM_SPK("Int Spk", tegra_wm8903_event_int_spk),
SND_SOC_DAPM_HP("Headphone Jack", tegra_wm8903_event_hp),
SND_SOC_DAPM_MIC("Mic Jack", NULL),
+ SND_SOC_DAPM_MIC("Int Mic", tegra_wm8903_event_int_mic),
};
static const struct snd_kcontrol_new tegra_wm8903_controls[] = {
SOC_DAPM_PIN_SWITCH("Int Spk"),
+ SOC_DAPM_PIN_SWITCH("Int Mic"),
};
static int tegra_wm8903_init(struct snd_soc_pcm_runtime *rtd)