sof-soundwire: rt1320: add rt1320 dmic config
This patch adds configs for rt1320 dmic function. It defines the MicMixerElem, a remapped control for the two rt1320-dmic case, and also attaches rt1320 FU capture controls to the mic LED. Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/743 Signed-off-by: derek fang <derek.fang@realtek.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
ee39f9ec0c
commit
97d1f76ca4
2 changed files with 91 additions and 0 deletions
|
|
@ -65,3 +65,53 @@ If.twoAmps {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# RT1320 DMIC specific switch control settings
|
||||||
|
|
||||||
|
Define.MicMixerElem "rt1320-1 FU"
|
||||||
|
|
||||||
|
DefineMacro.rt1320micled.If.0 {
|
||||||
|
Condition {
|
||||||
|
Type RegexMatch
|
||||||
|
Regex "${var:__ForMics}"
|
||||||
|
String "${var:Mics}"
|
||||||
|
}
|
||||||
|
True.Macro [{ SetLED { LED="mic" Action="attach" CtlId="rt1320-${var:__Mic} FU Capture Switch" } }]
|
||||||
|
}
|
||||||
|
|
||||||
|
If.mic_init_rt1320 {
|
||||||
|
Condition {
|
||||||
|
Type String
|
||||||
|
Needle "rt1320"
|
||||||
|
Haystack "${var:MultiMicShadow}"
|
||||||
|
}
|
||||||
|
True {
|
||||||
|
Macro.num1.rt1320micled { ForMics "[12]" Mic 1 }
|
||||||
|
Macro.num2.rt1320micled { ForMics "2" Mic 2 }
|
||||||
|
|
||||||
|
If.twoMics {
|
||||||
|
Condition {
|
||||||
|
Type RegexMatch
|
||||||
|
Regex "2"
|
||||||
|
String "${var:Mics}"
|
||||||
|
}
|
||||||
|
True {
|
||||||
|
Define.MicMixerElem "rt1320 FU"
|
||||||
|
LibraryConfig.remap.Config {
|
||||||
|
ctl.default.map {
|
||||||
|
"name='rt1320 FU Capture Switch'" {
|
||||||
|
"name='rt1320-1 FU Capture Switch'".vindex.0 0
|
||||||
|
"name='rt1320-1 FU Capture Switch'".vindex.1 1
|
||||||
|
"name='rt1320-1 FU Capture Switch'".vindex.2 2
|
||||||
|
"name='rt1320-1 FU Capture Switch'".vindex.3 3
|
||||||
|
"name='rt1320-2 FU Capture Switch'".vindex.4 0
|
||||||
|
"name='rt1320-2 FU Capture Switch'".vindex.5 1
|
||||||
|
"name='rt1320-2 FU Capture Switch'".vindex.6 2
|
||||||
|
"name='rt1320-2 FU Capture Switch'".vindex.7 3
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -48,3 +48,44 @@ SectionDevice."Speaker" {
|
||||||
PlaybackSwitch "${var:SpeakerMixerElem} Playback Switch"
|
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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue