OSDN Git Service

sof-soundwire: add support for dmics
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Thu, 21 Jan 2021 20:44:05 +0000 (14:44 -0600)
committerJaroslav Kysela <perex@perex.cz>
Thu, 28 Jan 2021 11:07:35 +0000 (12:07 +0100)
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 <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
ucm2/sof-soundwire/dmic.conf [new file with mode: 0644]
ucm2/sof-soundwire/sof-soundwire.conf

diff --git a/ucm2/sof-soundwire/dmic.conf b/ucm2/sof-soundwire/dmic.conf
new file mode 100644 (file)
index 0000000..1f704a5
--- /dev/null
@@ -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"
+       }
+}
index 2ba44be..ec8b01e 100644 (file)
@@ -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 {