File 0004-sof-hda-dsp-don-t-fail-if-Auto-Mute-control-is-not-p.patch of Package alsa-ucm-conf

From 4c1189fdcb4819df6c36cf490d17f532f82c8bbe Mon Sep 17 00:00:00 2001
From: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Date: Wed, 10 Jun 2020 17:14:16 +0300
Subject: [PATCH 04/51] sof-hda-dsp: don't fail if Auto-Mute control is not
 present

The "Auto-Mute Mode" control is not present in all HDA codecs.
The generic SOF HDA UCM file should be robust enough to handle
these cases as well.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
---
 ucm2/sof-hda-dsp/HiFi.conf | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/ucm2/sof-hda-dsp/HiFi.conf b/ucm2/sof-hda-dsp/HiFi.conf
index 9a8293077e3e..eea6ed9c6ccc 100644
--- a/ucm2/sof-hda-dsp/HiFi.conf
+++ b/ucm2/sof-hda-dsp/HiFi.conf
@@ -1,9 +1,17 @@
 # Use case Configuration for sof-hda-dsp
 
 SectionVerb {
-	EnableSequence [
-		cset "name='Auto-Mute Mode' 'Disabled'"
-	]
+	If.automute {
+		Condition {
+			Type ControlExists
+			Control "name='Auto-Mute Mode'"
+		}
+		True {
+			EnableSequence [
+				cset "name='Auto-Mute Mode' 'Disabled'"
+			]
+		}
+	}
 }
 
 SectionDevice."Headphones" {
-- 
2.16.4

openSUSE Build Service is sponsored by