summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorCharles Keepax <ckeepax@opensource.cirrus.com>2023-10-19 12:34:04 -0500
committerMark Brown <broonie@kernel.org>2023-10-19 19:00:15 +0100
commitd74bad3b74524e4f34c97903ad170d9061bcfbd9 (patch)
tree8fa69755a4e71c78467abffc6e5894816e3c1899 /sound
parenta92ccd574390149d3d64488ec5fe1e9b80e5f74c (diff)
ASoC: intel: sof_sdw_cs42l43: Create separate jacks for hp and mic
It makes sense to report the microphone separately from the headphones, that way ALSA UCM can differentiate between switching the playback and the capture. For example, still using the built-in microphone path when a 3-pole headset is inserted. Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20231019173411.166759-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/intel/boards/sof_sdw_cs42l43.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/sound/soc/intel/boards/sof_sdw_cs42l43.c b/sound/soc/intel/boards/sof_sdw_cs42l43.c
index 9b072c745f10..360f11b72aa2 100644
--- a/sound/soc/intel/boards/sof_sdw_cs42l43.c
+++ b/sound/soc/intel/boards/sof_sdw_cs42l43.c
@@ -39,6 +39,17 @@ static const struct snd_soc_dapm_route cs42l43_dmic_map[] = {
{ "cs42l43 PDM2_DIN", NULL, "DMIC" },
};
+static struct snd_soc_jack_pin sof_jack_pins[] = {
+ {
+ .pin = "Headphone",
+ .mask = SND_JACK_HEADPHONE,
+ },
+ {
+ .pin = "Headset Mic",
+ .mask = SND_JACK_MICROPHONE,
+ },
+};
+
static int cs42l43_hs_rtd_init(struct snd_soc_pcm_runtime *rtd)
{
struct snd_soc_component *component = snd_soc_rtd_to_codec(rtd, 0)->component;
@@ -66,12 +77,13 @@ static int cs42l43_hs_rtd_init(struct snd_soc_pcm_runtime *rtd)
return ret;
}
- ret = snd_soc_card_jack_new(card, "Headphone Jack",
- SND_JACK_MECHANICAL | SND_JACK_AVOUT |
- SND_JACK_HEADSET | SND_JACK_LINEOUT |
- SND_JACK_BTN_0 | SND_JACK_BTN_1 |
- SND_JACK_BTN_2 | SND_JACK_BTN_3,
- jack);
+ ret = snd_soc_card_jack_new_pins(card, "Jack",
+ SND_JACK_MECHANICAL | SND_JACK_AVOUT |
+ SND_JACK_HEADSET | SND_JACK_LINEOUT |
+ SND_JACK_BTN_0 | SND_JACK_BTN_1 |
+ SND_JACK_BTN_2 | SND_JACK_BTN_3,
+ jack, sof_jack_pins,
+ ARRAY_SIZE(sof_jack_pins));
if (ret) {
dev_err(card->dev, "Failed to create jack: %d\n", ret);
return ret;