* [PATCH AUTOSEL 5.15 01/10] ASoC: jack: allow multiple interrupt per gpio
@ 2023-05-07 0:35 Sasha Levin
2023-05-07 0:35 ` [PATCH AUTOSEL 5.15 03/10] ASoC: tegra: Support coupled mic-hp detection Sasha Levin
0 siblings, 1 reply; 2+ messages in thread
From: Sasha Levin @ 2023-05-07 0:35 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Svyatoslav Ryhel, Mark Brown, Sasha Levin, lgirdwood, tiwai,
alsa-devel
From: Svyatoslav Ryhel <clamor95@gmail.com>
[ Upstream commit a2d4051b0bd6dffcd736888ae89a550d6f60b060 ]
This feature is required for coupled hp-mic quirk used
by some Nvidia Tegra 3 based devices work properly.
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Link: https://lore.kernel.org/r/20230221183211.21964-3-clamor95@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/soc-jack.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/sound/soc/soc-jack.c b/sound/soc/soc-jack.c
index d798765d168c4..a7256ad49b243 100644
--- a/sound/soc/soc-jack.c
+++ b/sound/soc/soc-jack.c
@@ -367,6 +367,7 @@ int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count,
ret = request_any_context_irq(gpiod_to_irq(gpios[i].desc),
gpio_handler,
+ IRQF_SHARED |
IRQF_TRIGGER_RISING |
IRQF_TRIGGER_FALLING,
gpios[i].name,
--
2.39.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH AUTOSEL 5.15 03/10] ASoC: tegra: Support coupled mic-hp detection
2023-05-07 0:35 [PATCH AUTOSEL 5.15 01/10] ASoC: jack: allow multiple interrupt per gpio Sasha Levin
@ 2023-05-07 0:35 ` Sasha Levin
0 siblings, 0 replies; 2+ messages in thread
From: Sasha Levin @ 2023-05-07 0:35 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Svyatoslav Ryhel, Mark Brown, Sasha Levin, lgirdwood, tiwai,
thierry.reding, jonathanh, ion, jiapeng.chong, robh, alsa-devel,
linux-tegra
From: Svyatoslav Ryhel <clamor95@gmail.com>
[ Upstream commit eb0b8481c2e03a5ae01f6bea60b42109bd12b6fe ]
This quirk is used for cases when there is GPIO which detects
any type of 3.5 Jack insertion and actual type of jack is defined
by other GPIO. 3.5 Jack GPIO generates interrupt and MIC GPIO
indicates type of Jack only if 3.5 Jack GPIO is active.
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Link: https://lore.kernel.org/r/20230308073502.5421-3-clamor95@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/tegra/tegra_asoc_machine.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/sound/soc/tegra/tegra_asoc_machine.c b/sound/soc/tegra/tegra_asoc_machine.c
index 2e549b69061ca..21ae1dd5191ca 100644
--- a/sound/soc/tegra/tegra_asoc_machine.c
+++ b/sound/soc/tegra/tegra_asoc_machine.c
@@ -51,6 +51,17 @@ static struct snd_soc_jack_gpio tegra_machine_headset_jack_gpio = {
};
/* Mic Jack */
+static int coupled_mic_hp_check(void *data)
+{
+ struct tegra_machine *machine = (struct tegra_machine *)data;
+
+ /* Detect mic insertion only if 3.5 jack is in */
+ if (gpiod_get_value_cansleep(machine->gpiod_hp_det) &&
+ gpiod_get_value_cansleep(machine->gpiod_mic_det))
+ return SND_JACK_MICROPHONE;
+
+ return 0;
+}
static struct snd_soc_jack tegra_machine_mic_jack;
@@ -183,8 +194,15 @@ int tegra_asoc_machine_init(struct snd_soc_pcm_runtime *rtd)
return err;
}
+ tegra_machine_mic_jack_gpio.data = machine;
tegra_machine_mic_jack_gpio.desc = machine->gpiod_mic_det;
+ if (of_property_read_bool(card->dev->of_node,
+ "nvidia,coupled-mic-hp-det")) {
+ tegra_machine_mic_jack_gpio.desc = machine->gpiod_hp_det;
+ tegra_machine_mic_jack_gpio.jack_status_check = coupled_mic_hp_check;
+ };
+
err = snd_soc_jack_add_gpios(&tegra_machine_mic_jack, 1,
&tegra_machine_mic_jack_gpio);
if (err)
--
2.39.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-05-07 0:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-07 0:35 [PATCH AUTOSEL 5.15 01/10] ASoC: jack: allow multiple interrupt per gpio Sasha Levin
2023-05-07 0:35 ` [PATCH AUTOSEL 5.15 03/10] ASoC: tegra: Support coupled mic-hp detection Sasha Levin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox