From: Pierre-Louis Bossart Date: Thu, 21 Jan 2021 20:44:05 +0000 (-0600) Subject: sof-soundwire: add support for dmics X-Git-Tag: v1.2.5~57 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=889c5b9809f1635005d77871bb9abc09df6a3cc3;p=alsa-ucm-conf.git sof-soundwire: add support for dmics the pinmux allows for SoundWire to be used on e.g. link0 and link1, and the rest of the pins can be assigned for dmic usages. We currently don't track this capability which means users don't see a capture device, e.g. on HP Spectre x360. The sof_sdw machine driver was modified to report the cfg-dmics string, possible values are 0..4. BugLink: https://github.com/thesofproject/linux/issues/2700 BugLink: https://github.com/alsa-project/alsa-ucm-conf/pull/75 Signed-off-by: Pierre-Louis Bossart Signed-off-by: Jaroslav Kysela --- diff --git a/ucm2/sof-soundwire/dmic.conf b/ucm2/sof-soundwire/dmic.conf new file mode 100644 index 0000000..1f704a5 --- /dev/null +++ b/ucm2/sof-soundwire/dmic.conf @@ -0,0 +1,21 @@ +SectionDevice."Mic" { + Comment "Digital Microphone" + + Value { + CapturePriority 100 + CapturePCM "hw:${CardId},3" + If.chn { + Condition { + Type RegexMatch + Regex "[34]" + String "${var:Mics1}" + } + True { + CaptureChannels 4 + } + } + CaptureMixerElem "Dmic0" + CaptureVolume "Dmic0 Capture Volume" + CaptureSwitch "Dmic0 Capture Switch" + } +} diff --git a/ucm2/sof-soundwire/sof-soundwire.conf b/ucm2/sof-soundwire/sof-soundwire.conf index 2ba44be..ec8b01e 100644 --- a/ucm2/sof-soundwire/sof-soundwire.conf +++ b/ucm2/sof-soundwire/sof-soundwire.conf @@ -11,6 +11,7 @@ Define { SpeakerAmps1 "0" HeadsetCodec1 "" MicCodec1 "" + Mics1 "0" } DefineRegex { @@ -34,6 +35,10 @@ DefineRegex { Regex " mic:([a-z0-9]+)" String "${CardComponents}" } + Mics { + Regex " cfg-mics:([1-9][0-9]*)" + String "${CardComponents}" + } } If.hs_init {