[PATCH alsa-ucm-conf] chtrt5645: Add support for the components string

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 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




[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux