]> git.alsa-project.org Git - alsa-ucm-conf.git/commitdiff
sof-hda-dsp: adapt to latest alsa-lib
authorJaroslav Kysela <perex@perex.cz>
Tue, 5 Nov 2019 19:09:21 +0000 (20:09 +0100)
committerJaroslav Kysela <perex@perex.cz>
Sat, 9 Nov 2019 20:42:40 +0000 (21:42 +0100)
- move to ucm2
- add 'Syntax 2' to the main configuration files
- use condition for 'Headphone Jack' / 'Headphone Mic Jack' selection
- remove cdev (not required)
- use ${CardId} where appropriate
- merge config for Lenovo Carbon X1 7th gen to main HiFi.conf

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
ucm/LENOVO-20QE000VMC-ThinkPadX1Carbon7th-20QE000VMC/HiFi.conf [deleted file]
ucm/LENOVO-20QE000VMC-ThinkPadX1Carbon7th-20QE000VMC/LENOVO-20QE000VMC-ThinkPadX1Carbon7th-20QE000VMC.conf [deleted file]
ucm/sof-hda-dsp/HiFi.conf [deleted file]
ucm2/sof-hda-dsp/Hdmi.conf [moved from ucm/sof-hda-dsp/Hdmi.conf with 78% similarity]
ucm2/sof-hda-dsp/HiFi.conf [new file with mode: 0644]
ucm2/sof-hda-dsp/sof-hda-dsp.conf [moved from ucm/sof-hda-dsp/sof-hda-dsp.conf with 67% similarity]

diff --git a/ucm/LENOVO-20QE000VMC-ThinkPadX1Carbon7th-20QE000VMC/HiFi.conf b/ucm/LENOVO-20QE000VMC-ThinkPadX1Carbon7th-20QE000VMC/HiFi.conf
deleted file mode 100644 (file)
index ff86641..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-# Use case Configuration for ThinkPad X1 Carbon 7th
-
-<sof-hda-dsp/HiFi.conf>
-
-SectionDevice."BassSpeaker" {
-       Comment "Bass Speaker"
-
-       EnableSequence [
-               cdev "hw:sofhdadsp"
-               cset "name='Bass Speaker Playback Switch' on"
-               cset "name='Speaker Playback Switch' on"
-               cset "name='Speaker Playback Volume' 80"
-       ]
-
-       DisableSequence [
-               cdev "hw:sofhdadsp"
-               cset "name='Speaker Playback Switch' off"
-               cset "name='Bass Speaker Playback Switch' off"
-       ]
-
-       Value {
-               PlaybackPCM "hw:sofhdadsp,0"
-               PlaybackChannels "2"
-       }
-}
-
-# override JackHWMute
-SectionDevice."Headphone".!JackHWMute "Speaker BassSpeaker"
diff --git a/ucm/LENOVO-20QE000VMC-ThinkPadX1Carbon7th-20QE000VMC/LENOVO-20QE000VMC-ThinkPadX1Carbon7th-20QE000VMC.conf b/ucm/LENOVO-20QE000VMC-ThinkPadX1Carbon7th-20QE000VMC/LENOVO-20QE000VMC-ThinkPadX1Carbon7th-20QE000VMC.conf
deleted file mode 100644 (file)
index 0e159d4..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-SectionUseCase."HiFi" {
-       File "../LENOVO-20QE000VMC-ThinkPadX1Carbon7th-20QE000VMC/HiFi.conf"
-       Comment "Play HiFi quality Music"
-}
-
-SectionUseCase."Hdmi" {
-       File "../sof-hda-dsp/Hdmi.conf"
-       Comment "Play to HDMI/DP"
-}
-
-ValueDefaults {
-       PlaybackCTL "hw:sofhdadsp"
-       CaptureCTL "hw:sofhdadsp"
-}
diff --git a/ucm/sof-hda-dsp/HiFi.conf b/ucm/sof-hda-dsp/HiFi.conf
deleted file mode 100644 (file)
index f104354..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-# Use case Configuration for sof-hda-dsp
-
-SectionVerb {
-       EnableSequence [
-               cdev "hw:sofhdadsp"
-               cset "name='Master Playback Switch' on"
-               cset "name='Capture Switch' on"
-       ]
-
-       DisableSequence [
-               cdev "hw:sofhdadsp"
-       ]
-}
-
-SectionDevice."Headphone" {
-       Comment "Headphone"
-
-       EnableSequence [
-               cdev "hw:sofhdadsp"
-               cset "name='Headphone Playback Switch' on"
-       ]
-
-       DisableSequence [
-               cdev "hw:sofhdadsp"
-               cset "name='Headphone Playback Switch' off"
-       ]
-
-       Value {
-               PlaybackPCM "hw:sofhdadsp,0"
-               PlaybackVolume "name='Headphone'"
-               PlaybackSwitch "name='Headphone Playback Switch'"
-               PlaybackChannels "2"
-               JackName "sof-hda-dsp Headphone"
-               JackType "gpio"
-               JackSwitch "12"
-               JackControl "Headphone Jack"
-               JackHWMute "Speaker"
-       }
-}
-
-SectionDevice."Speaker" {
-       Comment "Speaker"
-
-       EnableSequence [
-               cdev "hw:sofhdadsp"
-               cset "name='Speaker Playback Switch' on"
-       ]
-
-       DisableSequence [
-               cdev "hw:sofhdadsp"
-               cset "name='Speaker Playback Switch' off"
-       ]
-
-       Value {
-               PlaybackPCM "hw:sofhdadsp,0"
-               PlaybackVolume "name='Speaker'"
-               PlaybackSwitch "name='Speaker Playback Switch'"
-               PlaybackChannels "2"
-       }
-}
-
-SectionDevice."HeadsetMic" {
-       Comment "Headset Microphone"
-
-       ConflictingDevice [
-               "DigitalMic"
-       ]
-
-       EnableSequence [
-               cdev "hw:sofhdadsp"
-       ]
-
-       DisableSequence [
-               cdev "hw:sofhdadsp"
-       ]
-
-       Value {
-               CapturePCM "hw:sofhdadsp,0"
-               CaptureVolume "name='Capture'"
-               CaptureSwitch "name='Capture Switch'"
-               CaptureChannels "2"
-               JackControl "Mic Jack"
-       }
-}
-
-SectionDevice."DigitalMic" {
-       Comment "Digital Microphone"
-
-       ConflictingDevice [
-               "HeadsetMic"
-       ]
-
-       EnableSequence [
-               cdev "hw:sofhdadsp"
-       ]
-
-       DisableSequence [
-               cdev "hw:sofhdadsp"
-       ]
-
-       Value {
-               CapturePCM "hw:sofhdadsp,6"
-               CaptureVolume "name='Dmic0 Capture Volume'"
-               CaptureSwitch "name='Dmic0 Capture Switch'"
-               CaptureChannels "2"
-       }
-}
similarity index 78%
rename from ucm/sof-hda-dsp/Hdmi.conf
rename to ucm2/sof-hda-dsp/Hdmi.conf
index 4605feba905895824045b3605ca1fa30dc25d49c..a559bc62955e7155b2c276cfba621598ced29aa2 100644 (file)
@@ -4,17 +4,15 @@ SectionDevice."HDMI1" {
        Comment "HDMI1/DP1 Output"
 
        EnableSequence [
-               cdev "hw:sofhdadsp"
                cset "name='IEC958 Playback Switch' on"
        ]
 
        DisableSequence [
-               cdev "hw:sofhdadsp"
                cset "name='IEC958 Playback Switch' off"
        ]
 
        Value {
-               PlaybackPCM "hw:sofhdadsp,3"
+               PlaybackPCM "hw:${CardId},3"
                PlaybackChannels "2"
                JackControl "HDMI/DP,pcm=3 Jack"
        }
@@ -24,17 +22,15 @@ SectionDevice."HDMI2" {
        Comment "HDMI2/DP2 Output"
 
        EnableSequence [
-               cdev "hw:sofhdadsp"
                cset "name='IEC958 Playback Switch',index=1 on"
        ]
 
        DisableSequence [
-               cdev "hw:sofhdadsp"
                cset "name='IEC958 Playback Switch',index=1 off"
        ]
 
        Value {
-               PlaybackPCM "hw:sofhdadsp,4"
+               PlaybackPCM "hw:${CardId},4"
                PlaybackChannels "2"
                JackControl "HDMI/DP,pcm=4 Jack"
        }
@@ -44,17 +40,15 @@ SectionDevice."HDMI3" {
        Comment "HDMI3/DP3 Output"
 
        EnableSequence [
-               cdev "hw:sofhdadsp"
                cset "name='IEC958 Playback Switch',index=2 on"
        ]
 
        DisableSequence [
-               cdev "hw:sofhdadsp"
                cset "name='IEC958 Playback Switch',index=2 off"
        ]
 
        Value {
-               PlaybackPCM "hw:sofhdadsp,5"
+               PlaybackPCM "hw:${CardId},5"
                PlaybackChannels "2"
                JackControl "HDMI/DP,pcm=5 Jack"
        }
diff --git a/ucm2/sof-hda-dsp/HiFi.conf b/ucm2/sof-hda-dsp/HiFi.conf
new file mode 100644 (file)
index 0000000..5fbdd37
--- /dev/null
@@ -0,0 +1,132 @@
+# Use case Configuration for sof-hda-dsp
+
+SectionVerb {
+       EnableSequence [
+               cset "name='Master Playback Switch' on"
+               cset "name='Capture Switch' on"
+       ]
+}
+
+SectionDevice."Headphone" {
+       Comment "Headphone"
+
+       EnableSequence [
+               cset "name='Headphone Playback Switch' on"
+       ]
+
+       DisableSequence [
+               cset "name='Headphone Playback Switch' off"
+       ]
+
+       Value {
+               PlaybackPCM "hw:${CardId},0"
+               PlaybackVolume "Headphone Playback Volume"
+               PlaybackSwitch "Headphone Playback Switch"
+               PlaybackChannels "2"
+               JackName "SOF HDA DSP Headphone"
+               JackType "gpio"
+               JackSwitch "12"
+               If.1 {
+                       Condition {
+                               Type ControlExists
+                               Control "name='Bass Speaker Playback Switch'"
+                       }
+                       True {
+                               JackHWMute "Speaker BassSpeaker"
+                       }
+                       False {
+                               JackHWMute "Speaker"
+                       }
+               }
+               If.2 {
+                       Condition {
+                               Type ControlExists
+                               Control "iface=CARD,name='Headphone Mic Jack'"
+                       }
+                       True {
+                               JackControl "Headphone Mic Jack"
+                       }
+                       False {
+                               JackControl "Headphone Jack"
+                       }
+               }
+       }
+}
+
+SectionDevice."Speaker" {
+       Comment "Speaker"
+
+       EnableSequence [
+               cset "name='Speaker Playback Switch' on"
+       ]
+
+       DisableSequence [
+               cset "name='Speaker Playback Switch' off"
+       ]
+
+       Value {
+               PlaybackPCM "hw:${CardId},0"
+               PlaybackVolume "Speaker Playback Volume"
+               PlaybackSwitch "Speaker Playback Switch"
+               PlaybackChannels "2"
+       }
+}
+
+If.1 {
+       Condition {
+               Type ControlExists
+               Control "name='Bass Speaker Playback Switch'"
+       }
+       True {
+               SectionDevice."BassSpeaker" {
+                       Comment "Bass Speaker"
+
+                       EnableSequence [
+                               cset "name='Bass Speaker Playback Switch' on"
+                               cset "name='Speaker Playback Switch' on"
+                               cset "name='Speaker Playback Volume' 80"
+                       ]
+
+                       DisableSequence [
+                               cset "name='Speaker Playback Switch' off"
+                               cset "name='Bass Speaker Playback Switch' off"
+                       ]
+
+                       Value {
+                               PlaybackPCM "hw:${CardId},0"
+                               PlaybackChannels "2"
+                       }
+               }
+       }
+}
+
+SectionDevice."HeadsetMic" {
+       Comment "Headset Microphone"
+
+       ConflictingDevice [
+               "DigitalMic"
+       ]
+
+       Value {
+               CapturePCM "hw:${CardId},0"
+               CaptureVolume "Capture Volume"
+               CaptureSwitch "Capture Switch"
+               CaptureChannels "2"
+               JackControl "Mic Jack"
+       }
+}
+
+SectionDevice."DigitalMic" {
+       Comment "Digital Microphone"
+
+       ConflictingDevice [
+               "HeadsetMic"
+       ]
+
+       Value {
+               CapturePCM "hw:${CardId},6"
+               CaptureVolume "Dmic0 Capture Volume"
+               CaptureSwitch "Dmic0 Capture Switch"
+               CaptureChannels "2"
+       }
+}
similarity index 67%
rename from ucm/sof-hda-dsp/sof-hda-dsp.conf
rename to ucm2/sof-hda-dsp/sof-hda-dsp.conf
index add60cc586cf7187e1988cda9e4948650dd703e7..c67d6e2f93149671e0cb6291f7d41f2c701ef444 100644 (file)
@@ -1,3 +1,5 @@
+Syntax 2
+
 SectionUseCase."HiFi" {
        File "HiFi.conf"
        Comment "Play HiFi quality Music"
@@ -7,8 +9,3 @@ SectionUseCase."Hdmi" {
        File "Hdmi.conf"
        Comment "Play to HDMI/DP"
 }
-
-ValueDefaults {
-       PlaybackCTL "hw:sofhdadsp"
-       CaptureCTL "hw:sofhdadsp"
-}