]> git.alsa-project.org Git - alsa-ucm-conf.git/commitdiff
bytcr-rt5640: Add support for a second headset input
authorHans de Goede <hdegoede@redhat.com>
Wed, 29 Sep 2021 09:11:44 +0000 (11:11 +0200)
committerJaroslav Kysela <perex@perex.cz>
Wed, 29 Sep 2021 10:57:14 +0000 (12:57 +0200)
Some devices (HP Elitepad 1000 G2) have a second headphones output
(1 on the dock, 2nd on the tablet itself) the headset mic input of
this second headset is connected to IN1, add support for this.

BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=213415
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
ucm2/bytcr-rt5640/HiFi-Components.conf
ucm2/bytcr-rt5640/HiFi.conf
ucm2/codecs/rt5640/HeadsetMic2-IN1.conf [new file with mode: 0644]

index 3f941acf4ad20b685319e1f883a32d28abfd281e..ae5fd05bf1be4407a799f076a1824a358e16015d 100644 (file)
@@ -66,3 +66,12 @@ If.in3 {
        }
        True.Define.HaveInternalMic "in3"
 }
+
+If.hs2 {
+       Condition {
+               Type String
+               Haystack "${CardComponents}"
+               Needle "cfg-hs2:in1"
+       }
+       True.Define.HaveHeadsetMic2 "in1"
+}
index 2e099bd933b8b498ea6efd6119176541f8d10279..f7585072697a7bcbfcc7d587660ce06580c86fad 100644 (file)
@@ -5,6 +5,7 @@ Define.HaveSpeaker ""
 Define.HaveHeadPhones2 ""
 Define.HaveInternalMic ""
 Define.HaveHeadsetMic "yes"
+Define.HaveHeadsetMic2 ""
 Define.StereoADC2Mux "DMIC1"
 
 If.DefineAif1 {
@@ -213,3 +214,24 @@ If.hsmic {
                }
        }
 }
+
+If.hsmic2 {
+       Condition {
+               Type String
+               Haystack "${var:HaveHeadsetMic2}"
+               Needle "in1"
+       }
+       True {
+               Include.hsmic.File "/codecs/rt5640/HeadsetMic2-IN1.conf"
+
+               SectionDevice."Headset2" {
+                       EnableSequence [
+                               cset "name='Headset Mic 2 Switch' on"
+                       ]
+
+                       DisableSequence [
+                               cset "name='Headset Mic 2 Switch' off"
+                       ]
+               }
+       }
+}
diff --git a/ucm2/codecs/rt5640/HeadsetMic2-IN1.conf b/ucm2/codecs/rt5640/HeadsetMic2-IN1.conf
new file mode 100644 (file)
index 0000000..ff05f82
--- /dev/null
@@ -0,0 +1,52 @@
+SectionDevice."Headset2" {
+       Comment "Headset Microphone 2"
+
+       ConflictingDevice [
+               "Mic"
+               "Headset"
+       ]
+
+       EnableSequence [
+               cset "name='RECMIXL BST1 Switch' on"
+               cset "name='RECMIXR BST1 Switch' on"
+
+               cset "name='Stereo ADC MIXL ADC1 Switch' on"
+               cset "name='Stereo ADC MIXR ADC1 Switch' on"
+               cset "name='Mono ADC MIXL ADC1 Switch' on"
+               cset "name='Mono ADC MIXR ADC1 Switch' on"
+       ]
+
+       DisableSequence [
+               cset "name='Stereo ADC MIXL ADC1 Switch' off"
+               cset "name='Stereo ADC MIXR ADC1 Switch' off"
+               cset "name='Mono ADC MIXL ADC1 Switch' off"
+               cset "name='Mono ADC MIXR ADC1 Switch' off"
+
+               cset "name='RECMIXL BST1 Switch' off"
+               cset "name='RECMIXR BST1 Switch' off"
+       ]
+
+       Value {
+               CapturePriority 300
+               CapturePCM "hw:${CardId}"
+               JackControl "Headset Mic 2 Jack"
+               CaptureMixerElem "IN1 Boost"
+               CaptureVolume "IN1 Boost"
+               If.In1Aif1 {
+                       Condition {
+                               Type String
+                               String1 "${var:HaveAif}"
+                               String2 "1"
+                       }
+                       True.CaptureMasterElem "ADC"
+               }
+               If.In1Aif2 {
+                       Condition {
+                               Type String
+                               String1 "${var:HaveAif}"
+                               String2 "2"
+                       }
+                       True.CaptureMasterElem "Mono ADC"
+               }
+       }
+}