All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH alsa-ucm-conf] chtrt5645: Add support for the components string
@ 2023-11-26 21:35 Hans de Goede
  0 siblings, 0 replies; only message in thread
From: Hans de Goede @ 2023-11-26 21:35 UTC (permalink / raw)
  To: Jaroslav Kysela
  Cc: Pierre-Louis Bossart, Bard Liao, alsa-devel, Hans de Goede

Upcoming kernel versions will report which speaker and dmic config is used
by the device in a components strings so that we don't need to duplicate
the DMI quirks in both the kernel and the UCM profile.

Add support for getting the speaker and dmic config from the components string.

Note the old DMI matching is kept for support of older kernels, this means
that on devices where the old DMI matching was used things like:

Define.MonoSpeaker "Yes"

Will now be done twice, this is harmless as long as the kernel and UCM profile
DMI quirks are in sync, which they are.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 ucm2/Intel/chtrt5645/HiFi.conf | 35 ++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/ucm2/Intel/chtrt5645/HiFi.conf b/ucm2/Intel/chtrt5645/HiFi.conf
index 30fad50..f8dcbf5 100644
--- a/ucm2/Intel/chtrt5645/HiFi.conf
+++ b/ucm2/Intel/chtrt5645/HiFi.conf
@@ -2,6 +2,41 @@ Define.MonoSpeaker ""
 Define.AnalogMic "yes"
 Define.DigitalMic ""
 
+If.components-dmic1 {
+	Condition {
+		Type String
+		Haystack "${CardComponents}"
+		Needle "cfg-mic:dmic1"
+	}
+	True {
+		Define.AnalogMic ""
+		Define.DigitalMic "DMIC1"
+	}
+}
+
+If.components-dmic2 {
+	Condition {
+		Type String
+		Haystack "${CardComponents}"
+		Needle "cfg-mic:dmic2"
+	}
+	True {
+		Define.AnalogMic ""
+		Define.DigitalMic "DMIC2"
+	}
+}
+
+If.components-mspk {
+	Condition {
+		Type String
+		Haystack "${CardComponents}"
+		Needle "cfg-spk:1"
+	}
+	True {
+		Define.MonoSpeaker "yes"
+	}
+}
+
 If.cfg-dmic1 {
 	Condition {
 		Type RegexMatch
-- 
2.41.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2023-11-26 21:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-26 21:35 [PATCH alsa-ucm-conf] chtrt5645: Add support for the components string Hans de Goede

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.