OSDN Git Service

codecs/rt5640: Make headset optional
authorDmitry Osipenko <digetx@gmail.com>
Thu, 20 May 2021 16:20:57 +0000 (19:20 +0300)
committerJaroslav Kysela <perex@perex.cz>
Thu, 27 May 2021 07:08:38 +0000 (09:08 +0200)
Nexus 7 has a 3-pin 3.5mm headphones jack, it doesn't support headset
microphone, and thus, it doesn't have headset microphone jack. Make
headset device optional.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
ucm2/bytcr-rt5640/HiFi-Components.conf
ucm2/bytcr-rt5640/HiFi-LongName.conf
ucm2/codecs/rt5640/DigitalMics.conf
ucm2/codecs/rt5640/IN1-InternalMic.conf
ucm2/codecs/rt5640/IN3-InternalMic.conf

index 227a9f5..b3ab9a0 100644 (file)
@@ -1,4 +1,5 @@
 Define.HaveSpeaker ""
+Define.HaveHeadsetMic ""
 Define.HaveInternalMic ""
 
 If.spk {
@@ -129,6 +130,7 @@ If.in3 {
 If.hsmic {
        Condition { Type String Empty "" }
        True.Include.hsmic.File "/codecs/rt5640/HeadsetMic.conf"
+       Define.HaveHeadsetMic "yes"
 
        SectionDevice."Headset" {
                EnableSequence [
index 7b53284..090010a 100644 (file)
@@ -1,4 +1,5 @@
 Define.HaveSpeaker ""
+Define.HaveHeadsetMic ""
 Define.HaveInternalMic ""
 
 If.spk {
@@ -129,6 +130,7 @@ If.in3 {
 If.hsmic {
        Condition { Type String Empty "" }
        True.Include.hsmic.File "/codecs/rt5640/HeadsetMic.conf"
+       Define.HaveHeadsetMic "yes"
 
        SectionDevice."Headset" {
                EnableSequence [
index 7566f5b..79da8a3 100644 (file)
@@ -1,9 +1,17 @@
 SectionDevice."Mic" {
        Comment "Internal Digital Microphones"
 
-       ConflictingDevice [
-               "Headset"
-       ]
+       If.have-headset {
+               Condition {
+                       Type String
+                       Empty "${var:HaveHeadsetMic}"
+               }
+               False {
+                       ConflictingDevice [
+                               "Headset"
+                       ]
+               }
+       }
 
        EnableSequence [
                cset "name='Mono ADC MIXL ADC2 Switch' on"
index 18715e5..146d7ec 100644 (file)
@@ -1,9 +1,17 @@
 SectionDevice."Mic" {
        Comment "Internal Microphone on IN1"
 
-       ConflictingDevice [
-               "Headset"
-       ]
+       If.have-headset {
+               Condition {
+                       Type String
+                       Empty "${var:HaveHeadsetMic}"
+               }
+               False {
+                       ConflictingDevice [
+                               "Headset"
+                       ]
+               }
+       }
 
        EnableSequence [
                cset "name='RECMIXL BST1 Switch' on"
index c90b6e4..c896082 100644 (file)
@@ -1,9 +1,17 @@
 SectionDevice."Mic" {
        Comment "Internal Microphone on IN3"
 
-       ConflictingDevice [
-               "Headset"
-       ]
+       If.have-headset {
+               Condition {
+                       Type String
+                       Empty "${var:HaveHeadsetMic}"
+               }
+               False {
+                       ConflictingDevice [
+                               "Headset"
+                       ]
+               }
+       }
 
        EnableSequence [
                cset "name='RECMIXL BST3 Switch' on"