The codec/ sequences must not have the platform specific checks.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
# RT5682 specific volume control settings
-If.RT5682init {
- Condition {
- Type String
- Haystack "${CardComponents}"
- Needle "hs:rt5682"
- }
- True {
- BootSequence [
- cset "name='rt5682 Stereo1 DAC MIXL DAC L1 Switch' 1"
- cset "name='rt5682 Stereo1 DAC MIXR DAC R1 Switch' 1"
- cset "name='rt5682 DAC L Mux' 1"
- cset "name='rt5682 DAC R Mux' 1"
- cset "name='rt5682 IF1 01 ADC Swap Mux' 2"
- cset "name='rt5682 CBJ Boost Volume' 3"
- cset "name='rt5682 Stereo1 ADC L Mux' 0"
- cset "name='rt5682 Stereo1 ADC R Mux' 0"
- cset "name='rt5682 Stereo1 ADC L1 Mux' 1"
- cset "name='rt5682 Stereo1 ADC R1 Mux' 1"
- cset "name='rt5682 Stereo1 ADC MIXL ADC2 Switch' 0"
- cset "name='rt5682 Stereo1 ADC MIXR ADC2 Switch' 0"
- ]
- }
-}
+
+BootSequence [
+ cset "name='rt5682 Stereo1 DAC MIXL DAC L1 Switch' 1"
+ cset "name='rt5682 Stereo1 DAC MIXR DAC R1 Switch' 1"
+ cset "name='rt5682 DAC L Mux' 1"
+ cset "name='rt5682 DAC R Mux' 1"
+ cset "name='rt5682 IF1 01 ADC Swap Mux' 2"
+ cset "name='rt5682 CBJ Boost Volume' 3"
+ cset "name='rt5682 Stereo1 ADC L Mux' 0"
+ cset "name='rt5682 Stereo1 ADC R Mux' 0"
+ cset "name='rt5682 Stereo1 ADC L1 Mux' 1"
+ cset "name='rt5682 Stereo1 ADC R1 Mux' 1"
+ cset "name='rt5682 Stereo1 ADC MIXL ADC2 Switch' 0"
+ cset "name='rt5682 Stereo1 ADC MIXR ADC2 Switch' 0"
+]
# RT700 specific volume control settings
-If.rt700init {
- Condition {
- Type String
- Haystack "${CardComponents}"
- Needle "hs:rt700"
- }
- True {
- BootSequence [
- cset "name='DAC Front Playback Volume' 87"
- cset "name='HPO Mux' 'Front'"
- cset "name='ADC 09 Capture Volume' 63"
- cset "name='ADC 22 Mux' 'MIC2'"
- cset "name='AMIC Volume' 1"
- ]
- }
-}
+
+BootSequence [
+ cset "name='DAC Front Playback Volume' 87"
+ cset "name='HPO Mux' 'Front'"
+ cset "name='ADC 09 Capture Volume' 63"
+ cset "name='ADC 22 Mux' 'MIC2'"
+ cset "name='AMIC Volume' 1"
+]
# RT711 specific volume control settings
-If.rt711init {
- Condition {
- Type String
- Haystack "${CardComponents}"
- Needle "hs:rt711"
- }
- True {
- BootSequence [
- cset "name='rt711 DAC Surr Playback Volume' 87"
- cset "name='rt711 ADC 08 Capture Volume' 63"
- cset "name='rt711 ADC 23 Mux' 'MIC2'"
- cset "name='rt711 ADC 08 Capture Switch' 1"
- cset "name='rt711 AMIC Volume' 1"
- ]
- }
-}
+
+BootSequence [
+ cset "name='rt711 DAC Surr Playback Volume' 87"
+ cset "name='rt711 ADC 08 Capture Volume' 63"
+ cset "name='rt711 ADC 23 Mux' 'MIC2'"
+ cset "name='rt711 ADC 08 Capture Switch' 1"
+ cset "name='rt711 AMIC Volume' 1"
+]
# RT715 specific volume control settings
-If.RT715init {
- Condition {
- Type String
- Haystack "${CardComponents}"
- Needle "mic:rt715"
- }
- True {
- BootSequence [
- cset "name='rt715 DMIC3 Boost' 2"
- cset "name='rt715 DMIC4 Boost' 2"
- cset "name='rt715 ADC 24 Mux' 3"
- cset "name='rt715 ADC 25 Mux' 4"
- cset "name='rt715 ADC 27 Capture Switch' 1"
- cset "name='rt715 ADC 07 Capture Switch' 1"
- ]
- }
-}
+BootSequence [
+ cset "name='rt715 DMIC3 Boost' 2"
+ cset "name='rt715 DMIC4 Boost' 2"
+ cset "name='rt715 ADC 24 Mux' 3"
+ cset "name='rt715 ADC 25 Mux' 4"
+ cset "name='rt715 ADC 27 Capture Switch' 1"
+ cset "name='rt715 ADC 07 Capture Switch' 1"
+]
# Use case Configuration for sof-soundwire card
-<sof-soundwire/RT700.conf>
-<sof-soundwire/RT711.conf>
-<sof-soundwire/RT5682.conf>
-<sof-soundwire/RT1308.conf>
-<sof-soundwire/RT715.conf>
+SectionVerb {
+ Value.TQ "HiFi"
+}
+
+If.spkdev {
+ Condition {
+ Type String
+ Empty "${var:SpeakerCodec1}"
+ }
+ False.Include.spkdev.File "/sof-soundwire/${var:SpeakerCodec1}-${var:SpeakerChannels1}.conf"
+}
+
+If.micdev {
+ Condition {
+ Type String
+ Empty "${var:MicCodec1}"
+ }
+ False.Include.micdev.File "/sof-soundwire/${var:MicCodec1}.conf"
+}
+
+If.hsdev {
+ Condition {
+ Type String
+ Empty "${var:HeadsetCodec1}"
+ }
+ False.Include.hsdev.File "/sof-soundwire/${var:HeadsetCodec1}.conf"
+}
+
<sof-soundwire/Hdmi.conf>
+++ /dev/null
-# Use case Configuration for sof-soundwire card
-# alsaucm -c sof-soundwire set _verb HiFi set _enadev Speaker
-
-If.RT1308 {
- Condition {
- Type String
- Haystack "${CardComponents}"
- Needle "spk:rt1308"
- }
- True {
-
- If.2ch {
- Condition {
- Type String
- Haystack "${CardComponents}"
- Needle "cfg-spk:2"
- }
- True {
-
-<sof-soundwire/RT1308-1.conf>
-
- }
- False {
-
-<sof-soundwire/RT1308-2.conf>
-
- }
- }
- }
-}
+++ /dev/null
-# Use case Configuration for sof-soundwire card
-
-If.RT5682 {
- Condition {
- Type String
- Haystack "${CardComponents}"
- Needle "hs:rt5682"
- }
- True {
-
- SectionDevice."Headphones" {
- Comment "Headphones"
-
- EnableSequence [
- cset "name='Headphone Switch' on"
- cset "name='rt5682 HPOL Playback Switch' 1"
- cset "name='rt5682 HPOR Playback Switch' 1"
- ]
-
- DisableSequence [
- cset "name='rt5682 HPOL Playback Switch' 0"
- cset "name='rt5682 HPOR Playback Switch' 0"
- cset "name='Headphone Switch' off"
-
- ]
-
- Value {
- PlaybackPriority 200
- PlaybackPCM "hw:${CardId}"
- JackControl "Headphone Jack"
- }
- }
-
- SectionDevice."Headset" {
- Comment "Headset Microphone"
-
- EnableSequence [
- cset "name='Headset Mic Switch' on"
- cset "name='rt5682 STO1 ADC Capture Switch' 1"
- cset "name='rt5682 RECMIX1L CBJ Switch' 1"
- cset "name='rt5682 Stereo1 ADC MIXL ADC1 Switch' 1"
- cset "name='rt5682 Stereo1 ADC MIXR ADC1 Switch' 1"
- ]
-
- DisableSequence [
- cset "name='rt5682 STO1 ADC Capture Switch' 0"
- cset "name='rt5682 RECMIX1L CBJ Switch' 0"
- cset "name='rt5682 Stereo1 ADC MIXL ADC1 Switch' 0"
- cset "name='rt5682 Stereo1 ADC MIXR ADC1 Switch' 0"
- cset "name='Headset Mic Switch' off"
- ]
-
- Value {
- CapturePriority 200
- CapturePCM "hw:${CardId},1"
- JackControl "Headset Mic Jack"
- }
- }
- }
-}
+++ /dev/null
-# Use case Configuration for sof-soundwire card
-
-If.RT700 {
- Condition {
- Type String
- Haystack "${CardComponents}"
- Needle "hs:rt700"
- }
- True {
-
- SectionDevice."Headphones" {
- Comment "Headphones"
-
- ConflictingDevice [
- "Speaker"
- ]
-
- EnableSequence [
- cset "name='Headphones Switch' on"
- ]
-
- DisableSequence [
- cset "name='Headphones Switch' off"
- ]
-
- Value {
- PlaybackPriority 200
- PlaybackPCM "hw:${CardId}"
- JackControl "Headphone Jack"
- }
- }
-
- SectionDevice."Speaker" {
- Comment "Speaker"
-
- ConflictingDevice [
- "Headphones"
- ]
-
- EnableSequence [
- cset "name='Speaker Switch' on"
- ]
-
- DisableSequence [
- cset "name='Speaker Switch' off"
- ]
-
- Value {
- PlaybackPriority 100
- PlaybackPCM "hw:${CardId}"
- }
- }
-
- SectionDevice."Headset" {
- Comment "Headset Microphone"
-
- EnableSequence [
- cset "name='ADC 09 Capture Switch' 1"
- ]
-
- DisableSequence [
- cset "name='ADC 09 Capture Switch' 0"
- ]
-
- Value {
- CapturePriority 200
- CapturePCM "hw:${CardId},1"
- JackControl "Headset Mic Jack"
- }
- }
- }
-}
+++ /dev/null
-# Use case Configuration for sof-soundwire card
-
-If.RT711 {
- Condition {
- Type String
- Haystack "${CardComponents}"
- Needle "hs:rt711"
- }
- True {
-
- SectionDevice."Headphones" {
- Comment "Headphones"
-
- EnableSequence [
- cset "name='Headphone Switch' on"
- ]
-
- DisableSequence [
- cset "name='Headphone Switch' off"
- ]
-
- Value {
- PlaybackPriority 200
- PlaybackPCM "hw:${CardId}"
- JackControl "Headphone Jack"
- }
- }
-
- SectionDevice."Headset" {
- Comment "Headset Microphone"
-
- EnableSequence [
- cset "name='PGA2.0 2 Master Capture Switch' 1"
- ]
-
- DisableSequence [
- cset "name='PGA2.0 2 Master Capture Switch' 0"
- ]
-
- Value {
- CapturePriority 200
- CapturePCM "hw:${CardId},1"
- JackControl "Headset Mic Jack"
- CaptureSwitch "PGA2.0 2 Master Capture Switch"
- CaptureVolume "PGA2.0 2 Master Capture Volume"
- }
- }
- }
-}
+++ /dev/null
-# Use case Configuration for sof-soundwire card
-
-If.RT715 {
- Condition {
- Type String
- Haystack "${CardComponents}"
- Needle "mic:rt715"
- }
- True {
-
- SectionDevice."Mic" {
- Comment "SoundWire microphones"
-
- EnableSequence [
- cset "name='PGA5.0 5 Master Capture Switch' 1"
- ]
-
- DisableSequence [
- cset "name='PGA5.0 5 Master Capture Switch' 0"
- ]
-
- Value {
- CapturePriority 100
- CapturePCM "hw:${CardId},4"
- CaptureSwitch "PGA5.0 5 Master Capture Switch"
- CaptureVolume "PGA5.0 5 Master Capture Volume"
- }
- }
- }
-}
--- /dev/null
+# Use case Configuration for sof-soundwire card
+
+SectionDevice."Headphones" {
+ Comment "Headphones"
+
+ EnableSequence [
+ cset "name='Headphone Switch' on"
+ cset "name='rt5682 HPOL Playback Switch' 1"
+ cset "name='rt5682 HPOR Playback Switch' 1"
+ ]
+
+ DisableSequence [
+ cset "name='rt5682 HPOL Playback Switch' 0"
+ cset "name='rt5682 HPOR Playback Switch' 0"
+ cset "name='Headphone Switch' off"
+
+ ]
+
+ Value {
+ PlaybackPriority 200
+ PlaybackPCM "hw:${CardId}"
+ JackControl "Headphone Jack"
+ }
+}
+
+SectionDevice."Headset" {
+ Comment "Headset Microphone"
+
+ EnableSequence [
+ cset "name='Headset Mic Switch' on"
+ cset "name='rt5682 STO1 ADC Capture Switch' 1"
+ cset "name='rt5682 RECMIX1L CBJ Switch' 1"
+ cset "name='rt5682 Stereo1 ADC MIXL ADC1 Switch' 1"
+ cset "name='rt5682 Stereo1 ADC MIXR ADC1 Switch' 1"
+ ]
+
+ DisableSequence [
+ cset "name='rt5682 STO1 ADC Capture Switch' 0"
+ cset "name='rt5682 RECMIX1L CBJ Switch' 0"
+ cset "name='rt5682 Stereo1 ADC MIXL ADC1 Switch' 0"
+ cset "name='rt5682 Stereo1 ADC MIXR ADC1 Switch' 0"
+ cset "name='Headset Mic Switch' off"
+ ]
+
+ Value {
+ CapturePriority 200
+ CapturePCM "hw:${CardId},1"
+ JackControl "Headset Mic Jack"
+ }
+}
--- /dev/null
+# Use case Configuration for sof-soundwire card
+
+SectionDevice."Headphones" {
+ Comment "Headphones"
+
+ ConflictingDevice [
+ "Speaker"
+ ]
+
+ EnableSequence [
+ cset "name='Headphones Switch' on"
+ ]
+
+ DisableSequence [
+ cset "name='Headphones Switch' off"
+ ]
+
+ Value {
+ PlaybackPriority 200
+ PlaybackPCM "hw:${CardId}"
+ JackControl "Headphone Jack"
+ }
+}
+
+SectionDevice."Speaker" {
+ Comment "Speaker"
+
+ ConflictingDevice [
+ "Headphones"
+ ]
+
+ EnableSequence [
+ cset "name='Speaker Switch' on"
+ ]
+
+ DisableSequence [
+ cset "name='Speaker Switch' off"
+ ]
+
+ Value {
+ PlaybackPriority 100
+ PlaybackPCM "hw:${CardId}"
+ }
+}
+
+SectionDevice."Headset" {
+ Comment "Headset Microphone"
+
+ EnableSequence [
+ cset "name='ADC 09 Capture Switch' 1"
+ ]
+
+ DisableSequence [
+ cset "name='ADC 09 Capture Switch' 0"
+ ]
+
+ Value {
+ CapturePriority 200
+ CapturePCM "hw:${CardId},1"
+ JackControl "Headset Mic Jack"
+ }
+}
--- /dev/null
+# Use case Configuration for sof-soundwire card
+
+SectionDevice."Headphones" {
+ Comment "Headphones"
+
+ EnableSequence [
+ cset "name='Headphone Switch' on"
+ ]
+
+ DisableSequence [
+ cset "name='Headphone Switch' off"
+ ]
+
+ Value {
+ PlaybackPriority 200
+ PlaybackPCM "hw:${CardId}"
+ JackControl "Headphone Jack"
+ }
+}
+
+SectionDevice."Headset" {
+ Comment "Headset Microphone"
+
+ EnableSequence [
+ cset "name='PGA2.0 2 Master Capture Switch' 1"
+ ]
+
+ DisableSequence [
+ cset "name='PGA2.0 2 Master Capture Switch' 0"
+ ]
+
+ Value {
+ CapturePriority 200
+ CapturePCM "hw:${CardId},1"
+ JackControl "Headset Mic Jack"
+ CaptureSwitch "PGA2.0 2 Master Capture Switch"
+ CaptureVolume "PGA2.0 2 Master Capture Volume"
+ }
+}
--- /dev/null
+# Use case Configuration for sof-soundwire card
+
+SectionDevice."Mic" {
+ Comment "SoundWire microphones"
+
+ EnableSequence [
+ cset "name='PGA5.0 5 Master Capture Switch' 1"
+ ]
+
+ DisableSequence [
+ cset "name='PGA5.0 5 Master Capture Switch' 0"
+ ]
+
+ Value {
+ CapturePriority 100
+ CapturePCM "hw:${CardId},4"
+ CaptureSwitch "PGA5.0 5 Master Capture Switch"
+ CaptureVolume "PGA5.0 5 Master Capture Volume"
+ }
+}
-Syntax 2
+Syntax 3
SectionUseCase."HiFi" {
File "HiFi.conf"
Comment "Play HiFi quality Music"
}
-<codecs/rt5682/init.conf>
-<codecs/rt700/init.conf>
-<codecs/rt711/init.conf>
-<codecs/rt715/init.conf>
+Define {
+ SpeakerCodec1 ""
+ SpeakerChannels1 "2"
+ SpeakerAmps1 "0"
+ HeadsetCodec1 ""
+ MicCodec1 ""
+}
+
+DefineRegex {
+ SpeakerCodec {
+ Regex " spk:([a-z0-9]+)"
+ String "${CardComponents}"
+ }
+ SpeakerChannels {
+ Regex " cfg-spk:([0-9]+)"
+ String "${CardComponents}"
+ }
+ SpeakerAmps {
+ Regex " cfg-amp:([0-9]+)"
+ String "${CardComponents}"
+ }
+ HeadsetCodec {
+ Regex " hs:([a-z0-9]+)"
+ String "${CardComponents}"
+ }
+ MicCodec {
+ Regex " mic:([a-z0-9]+)"
+ String "${CardComponents}"
+ }
+}
+
+If.hs_init {
+ Condition {
+ Type Regex
+ Regex "(rt5682|rt700|rt711)"
+ String "${var:HeadsetCodec1}"
+ }
+ True.Include.hs_init.File "/codecs/${var:HeadsetCodec1}/init.conf"
+}
+
+If.mic_init {
+ Condition {
+ Type Regex
+ Regex "(rt715)"
+ String "${var:MicCodec1}"
+ }
+ True.Include.mic_init.File "/codecs/${var:MicCodec1}/init.conf"
+}