# Use case Configuration for sof-soundwire card # # Arguments: # ForAmps - regex filter for var:SpeakerAmps # Amp - amplifier number (1,2 etc.) # Sel - channel selection (L,R R,L L,L R,R L,L+R R,L+R L+R,L L+R,R L+R,L+R) # DefineMacro.rt1320spk.If.0 { Condition { Type RegexMatch Regex "${var:__ForAmps}" String "${var:SpeakerAmps}" } True { EnableSequence [ cset "name='rt1320-${var:__Amp} RX Channel Select' ${var:__Sel}" cset "name='rt1320-${var:__Amp} OT23 L Switch' 1" cset "name='rt1320-${var:__Amp} OT23 R Switch' 1" ] DisableSequence [ cset "name='rt1320-${var:__Amp} OT23 L Switch' 0" cset "name='rt1320-${var:__Amp} OT23 R Switch' 0" ] } } SectionDevice."Speaker" { Comment "Speaker" Macro.num1.rt1320spk { ForAmps "1" Amp 1 Sel "L,R" } Macro.num2.rt1320spk { ForAmps "2" Amp 1 Sel "L,L" } Macro.num3.rt1320spk { ForAmps "2" Amp 2 Sel "R,R" } EnableSequence [ cset "name='Speaker Switch' on" ] DisableSequence [ cset "name='Speaker Switch' off" ] Value { PlaybackPriority 100 PlaybackPCM "hw:${CardId},2" PlaybackMixer "default:${CardId}" PlaybackMixerElem "${var:SpeakerMixerElem}" PlaybackSwitch "${var:SpeakerMixerElem} Playback Switch" } } # Use case Configuration for RT1320 SoundWire DMIC (microphone function) DefineMacro.rt1320dmic.If.0 { Condition { Type RegexMatch Regex "${var:__ForMics}" String "${var:Mics}" } True { EnableSequence [ cset "name='rt1320-${var:__Mic} FU Capture Switch' 1" ] DisableSequence [ cset "name='rt1320-${var:__Mic} FU Capture Switch' 0" ] } } If.codecmic { Condition { Type String Needle "rt1320" Haystack "${var:MultiMicShadow}" } True { SectionDevice."Mic" { Comment "Microphones" Macro.num1.rt1320dmic { ForMics "[12]" Mic 1 } Macro.num2.rt1320dmic { ForMics "2" Mic 2 } Value { CapturePriority 100 CapturePCM "hw:${CardId},4" CaptureMixerElem "${var:MicMixerElem}" CaptureSwitch "${var:MicMixerElem} Capture Switch" } } } }