OSDN Git Service

chtnau8824: Add support for laptops using stereo DMICs
authorHans de Goede <hdegoede@redhat.com>
Sun, 6 Dec 2020 12:47:17 +0000 (13:47 +0100)
committerJaroslav Kysela <perex@perex.cz>
Mon, 14 Dec 2020 08:21:15 +0000 (09:21 +0100)
The Medion E2228T uses a NAU8824 codec combined with stereo
DMICs, add support for this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
ucm2/chtnau8824/HiFi.conf
ucm2/codecs/nau8824/DMIC1_2.conf [new file with mode: 0644]

index d7a5f63..105f360 100644 (file)
@@ -1,4 +1,5 @@
 Define.Speaker "Speaker"
+Define.Mic "InternalMic"
 
 If.cfg-mspk {
        Condition {
@@ -11,6 +12,19 @@ If.cfg-mspk {
        }
 }
 
+If.cfg-mic {
+       Condition {
+               Type RegexMatch
+               String "${CardLongName}"
+               # Medion E22??T models put DMIC in their product version
+               # when using DMICs
+               Regex "(MEDION-E22..T.*-DMIC-)"
+       }
+       True {
+               Define.Mic "DMIC1_2"
+       }
+}
+
 SectionVerb {
 
        Value {
@@ -42,7 +56,7 @@ If.cfg-includes {
                Include.spk.File "/codecs/nau8824/${var:Speaker}.conf"
                Include.hp.File "/codecs/nau8824/HeadPhones.conf"
 
-               Include.mic.File "/codecs/nau8824/InternalMic.conf"
+               Include.mic.File "/codecs/nau8824/${var:Mic}.conf"
                Include.hsmic.File "/codecs/nau8824/HeadsetMic.conf"
        }
 }
diff --git a/ucm2/codecs/nau8824/DMIC1_2.conf b/ucm2/codecs/nau8824/DMIC1_2.conf
new file mode 100644 (file)
index 0000000..f54f671
--- /dev/null
@@ -0,0 +1,30 @@
+# Stereo DMICs on the DMIC1 and DMIC2 inputs
+
+SectionDevice."Mic" {
+       Comment "Internal Digital Microphones"
+
+       Value {
+               CapturePriority 200
+               CapturePCM "hw:${CardId}"
+       }
+
+       ConflictingDevice [
+               "Headset"
+       ]
+
+       EnableSequence [
+               # Note needs to be swapped / swap is deliberate!
+               cset "name='ADC CH0 Select' 1"
+               cset "name='ADC CH1 Select' 0"
+
+               cset "name='Int Mic Switch' on"
+               cset "name='DMIC1 Enable Switch' on"
+               cset "name='DMIC2 Enable Switch' on"
+       ]
+
+       DisableSequence [
+               cset "name='Int Mic Switch' off"
+               cset "name='DMIC1 Enable Switch' off"
+               cset "name='DMIC2 Enable Switch' off"
+       ]
+}