From: Dmitry Osipenko Date: Thu, 20 May 2021 16:20:57 +0000 (+0300) Subject: codecs/rt5640: Make headset optional X-Git-Tag: android-x86-8.1-r6~8 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=61d820037de892e28f38afb708e5db314206fb92;p=android-x86%2Fexternal-alsa-ucm-conf.git codecs/rt5640: Make headset optional 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 Signed-off-by: Jaroslav Kysela --- diff --git a/ucm2/bytcr-rt5640/HiFi-Components.conf b/ucm2/bytcr-rt5640/HiFi-Components.conf index 227a9f5..b3ab9a0 100644 --- a/ucm2/bytcr-rt5640/HiFi-Components.conf +++ b/ucm2/bytcr-rt5640/HiFi-Components.conf @@ -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 [ diff --git a/ucm2/bytcr-rt5640/HiFi-LongName.conf b/ucm2/bytcr-rt5640/HiFi-LongName.conf index 7b53284..090010a 100644 --- a/ucm2/bytcr-rt5640/HiFi-LongName.conf +++ b/ucm2/bytcr-rt5640/HiFi-LongName.conf @@ -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 [ diff --git a/ucm2/codecs/rt5640/DigitalMics.conf b/ucm2/codecs/rt5640/DigitalMics.conf index 7566f5b..79da8a3 100644 --- a/ucm2/codecs/rt5640/DigitalMics.conf +++ b/ucm2/codecs/rt5640/DigitalMics.conf @@ -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" diff --git a/ucm2/codecs/rt5640/IN1-InternalMic.conf b/ucm2/codecs/rt5640/IN1-InternalMic.conf index 18715e5..146d7ec 100644 --- a/ucm2/codecs/rt5640/IN1-InternalMic.conf +++ b/ucm2/codecs/rt5640/IN1-InternalMic.conf @@ -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" diff --git a/ucm2/codecs/rt5640/IN3-InternalMic.conf b/ucm2/codecs/rt5640/IN3-InternalMic.conf index c90b6e4..c896082 100644 --- a/ucm2/codecs/rt5640/IN3-InternalMic.conf +++ b/ucm2/codecs/rt5640/IN3-InternalMic.conf @@ -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"