]> git.alsa-project.org Git - alsa-ucm-conf.git/commitdiff
sof-hda-dsp: make Headphone Playback Switch conditional
authorKai Vehmanen <kai.vehmanen@linux.intel.com>
Thu, 11 Jun 2020 14:46:07 +0000 (17:46 +0300)
committerJaroslav Kysela <perex@perex.cz>
Tue, 23 Jun 2020 15:18:29 +0000 (17:18 +0200)
The Headphone Playback Switch control is not present in all
HDA codecs. Allow the Headphones definition to work also on
such systems.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
ucm2/sof-hda-dsp/HiFi.conf

index 3b54d4a2ccfa6317833c26d8a208dbdd91e740ab..127948844d67f021113e145582a5b45fec78d5bb 100644 (file)
@@ -17,13 +17,20 @@ SectionVerb {
 SectionDevice."Headphones" {
        Comment "Headphones"
 
-       EnableSequence [
-               cset "name='Headphone Playback Switch' on"
-       ]
-
-       DisableSequence [
-               cset "name='Headphone Playback Switch' off"
-       ]
+       If.headphone_switch {
+               Condition {
+                       Type ControlExists
+                       Control "name='Headphone Playback Switch'"
+               }
+               True {
+                       EnableSequence [
+                               cset "name='Headphone Playback Switch' on"
+                       ]
+                       DisableSequence [
+                               cset "name='Headphone Playback Switch' off"
+                       ]
+               }
+       }
 
        Value {
                PlaybackPriority 200