]> git.alsa-project.org Git - alsa-ucm-conf.git/commitdiff
ucm2: sof-essx8336: initial support
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Thu, 17 Feb 2022 17:39:52 +0000 (11:39 -0600)
committerJaroslav Kysela <perex@perex.cz>
Fri, 11 Mar 2022 08:51:53 +0000 (09:51 +0100)
Loosely based on the sof-hda-dsp model for DMIC conditional handling.

Fixes: https://github.com/alsa-project/alsa-ucm-conf/pull/139
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
ucm2/Intel/sof-essx8336/Hdmi.conf [new file with mode: 0644]
ucm2/Intel/sof-essx8336/HiFi.conf [new file with mode: 0644]
ucm2/Intel/sof-essx8336/sof-essx8336.conf [new file with mode: 0644]

diff --git a/ucm2/Intel/sof-essx8336/Hdmi.conf b/ucm2/Intel/sof-essx8336/Hdmi.conf
new file mode 100644 (file)
index 0000000..8912b4f
--- /dev/null
@@ -0,0 +1,40 @@
+# Use case Configuration for sof-es8336
+
+If.hdmi1 {
+       Condition { Type String Empty "" }
+       True {
+               Define {
+                       HdmiNum 1
+                       HdmiPCM 5
+                       HdmiCtlIndex 0
+                       HdmiPrio 500
+               }
+               Include.hdmi1.File "/codecs/hda/hdmi.conf"
+       }
+}
+
+If.hdmi2 {
+       Condition { Type String Empty "" }
+       True {
+               Define {
+                       HdmiNum 2
+                       HdmiPCM 6
+                       HdmiCtlIndex 1
+                       HdmiPrio 600
+               }
+               Include.hdmi2.File "/codecs/hda/hdmi.conf"
+       }
+}
+
+If.hdmi3 {
+       Condition { Type String Empty "" }
+       True {
+               Define {
+                       HdmiNum 3
+                       HdmiPCM 7
+                       HdmiCtlIndex 2
+                       HdmiPrio 700
+               }
+               Include.hdmi3.File "/codecs/hda/hdmi.conf"
+       }
+}
diff --git a/ucm2/Intel/sof-essx8336/HiFi.conf b/ucm2/Intel/sof-essx8336/HiFi.conf
new file mode 100644 (file)
index 0000000..14575c5
--- /dev/null
@@ -0,0 +1,137 @@
+SectionVerb {
+
+If.amic {
+       Condition {
+               Type String
+               Empty "${var:DeviceDmic}"
+       }
+       True.SectionDevice."Mic" {
+               Comment "Analog Microphone"
+
+               ConflictingDevice [
+                       "Headset"
+               ]
+
+               Value {
+                       CapturePriority 100
+                       CapturePCM "hw:${CardId}"
+               }
+
+               EnableSequence [
+                       cset "name='Internal Mic Switch' on"
+               ]
+
+               DisableSequence [
+                       cset "name='Internal Mic Switch' off"
+               ]
+       }
+}
+
+If.dmic {
+       Condition {
+               Type String
+               Empty "${var:DeviceDmic}"
+       }
+       False.SectionDevice."${var:DeviceDmic}" {
+               Comment "Digital Microphone"
+
+               Value {
+                       CapturePriority 100
+                       CapturePCM "hw:${CardId},1"
+                       If.chn {
+                               Condition {
+                                       Type RegexMatch
+                                       Regex "cfg-dmics:[34]"
+                                       String "${CardComponents}"
+                               }
+                               True {
+                                       CaptureChannels 4
+                               }
+                       }
+                       CaptureMixerElem "Dmic0"
+                       CaptureVolume "Dmic0 Capture Volume"
+                       CaptureSwitch "Dmic0 Capture Switch"
+               }
+       }
+}
+
+SectionDevice."Speaker" {
+       Comment "Speaker"
+
+       ConflictingDevice [
+               "Headphones"
+       ]
+
+       EnableSequence [
+               cset "name='Speaker Switch' on"
+       ]
+
+       DisableSequence [
+               cset "name='Speaker Switch' off"
+       ]
+       Value {
+               PlaybackPriority 100
+               PlaybackPCM "hw:${CardId}"
+               PlaybackMixerElem "Speaker"
+               PlaybackMasterElem "Master"
+               PlaybackVolume "Speaker Volume"
+               PlaybackSwitch "Speaker Switch"
+       }
+}
+
+SectionDevice."Headphones" {
+       Comment "Headphones"
+
+       ConflictingDevice [
+               "Speaker"
+       ]
+
+       EnableSequence [
+               cset "name='Headphone Switch' on"
+       ]
+
+       DisableSequence [
+               cset "name='Headphone Switch' off"
+       ]
+
+       Value {
+               PlaybackPriority 300
+               PlaybackPCM "hw:${CardId}"
+               PlaybackMixerElem "Headphone"
+               PlaybackMasterElem "Master"
+               PlaybackVolume "Headphone Volume"
+               PlaybackSwitch "Headphone Switch"
+               JackControl "Headphone Jack"
+               JackHWMute "Speaker"
+       }
+}
+
+SectionDevice."Headset" {
+       Comment "Headset Microphone"
+
+       If.conflict {
+               Condition {
+                       Type String
+                       Empty "${var:DeviceDmic}"
+               }
+               True.ConflictingDevice [
+                       "Mic"
+               ]
+       }
+
+       EnableSequence [
+               cset "name='Headset Mic Switch' on"
+       ]
+
+       DisableSequence [
+               cset "name='Headset Mic Switch' off"
+       ]
+
+       Value {
+               CapturePriority 300
+               CapturePCM "hw:${CardId}"
+               JackControl "Headset Mic Jack"
+       }
+}
+
+Include.hdmi.File "/Intel/sof-essx8336/Hdmi.conf"
diff --git a/ucm2/Intel/sof-essx8336/sof-essx8336.conf b/ucm2/Intel/sof-essx8336/sof-essx8336.conf
new file mode 100644 (file)
index 0000000..88e3edb
--- /dev/null
@@ -0,0 +1,64 @@
+Syntax 4
+
+Define.DeviceDmic ""
+
+If.devdmic {
+       Condition {
+               Type String
+               Haystack "${CardComponents}"
+               Needle "cfg-dmics:"
+       }
+       True.Define.DeviceDmic "Dmic"
+}
+
+SectionUseCase."HiFi" {
+       File "/Intel/sof-es8336/HiFi.conf"
+       Comment "Play and record HiFi quality Music"
+}
+
+# the kcontrols initial values, which will be set by `alsactl init`
+If.speaker {
+       Condition {
+               Type ControlExists
+               Control "DAC Playback Volume"
+       }
+       True.BootSequence [
+               cset "name='DAC Playback Volume' 60%"
+       ]
+}
+
+If.headphone {
+       Condition {
+               Type ControlExists
+               Control "name='Headphone Playback Volume'"
+       }
+       True.BootSequence [
+               cset "name='Headphone Playback Volume' 60%"
+       ]
+}
+
+If.dmic {
+       Condition {
+               Type String
+               Empty "${var:DeviceDmic}"
+       }
+       False.If.Dmic0 {
+               Condition {
+                       Type ControlExists
+                       Control "name='Dmic0 Capture Volume'"
+               }
+               True.BootSequence [
+                       cset "name='Dmic0 Capture Volume' 70%"
+               ]
+       }
+}
+
+If.Capture {
+       Condition {
+               Type ControlExists
+               Control "name='ADC Capture Volume'"
+       }
+       True.BootSequence [
+               cset "name='ADC Capture Volume' 60%"
+       ]
+}