]> git.alsa-project.org Git - alsa-ucm-conf.git/commitdiff
codecs/rt5640: Cleanup: unify Stereo / Mono ADC handling
authorHans de Goede <hdegoede@redhat.com>
Mon, 8 Mar 2021 22:05:48 +0000 (23:05 +0100)
committerJaroslav Kysela <perex@perex.cz>
Wed, 10 Mar 2021 10:04:01 +0000 (11:04 +0100)
Cleanup: no functional changes intended.

The rt5640 codec is sometimes used with AIF1 connected to the SoC
and sometimes with AIF2 connected to the SoC.

The rt5640 UCM configuration deals with this by accepting input from
and sending output to both AIFs, relying on the kernels DAPM framework to
disable parts of the graph which are connected to the unconnected AIF.

On the output side we solve this by enabling both the IF1_DAC and
IF2_DAC data inputs to the digital 'Stereo DAC MIX' mixer.

On the input side handling this is somewhat more complicated, the
"Digital Mixer Path" leading to the IF1_ADC and IF2_ADC outputs
are entirely separate paths. To solve this we enable the active
input (DMIC or ADC) in both the Stereo ADC (connected to IF1_ADC)
and the Mono ADC (IF2_ADC) paths.

So far we've not been entirely consistent in our handling of
the Stereo ADC vs Mono ADC paths, this commit cleans this up:

1. Set the 'Mono ADC Capture Switch' to on once from EnableSeq.conf,
   like we do for the 'ADC Capture Switch' instead of toggling it on/off
   from the individual input Enable/Disable sequences.

2. Group all the 'Mono ADC ...' mixer cset calls together with their
   stereo ADC counterparts.

3. Explicitly select DMIC L/R 1 for the Mono ADC L/R 2 Mux input, instead
   of relying on this being the default.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
ucm2/codecs/rt5640/DigitalMics.conf
ucm2/codecs/rt5640/EnableSeq.conf
ucm2/codecs/rt5640/HeadsetMic.conf
ucm2/codecs/rt5640/IN1-InternalMic.conf
ucm2/codecs/rt5640/IN3-InternalMic.conf

index fdd412f5e323145efca3cc83c2bb7cbb21a0ce50..157c544d77dd8b257e2236831658ec52930a4ed0 100644 (file)
@@ -8,7 +8,6 @@ SectionDevice."Mic" {
        EnableSequence [
                cset "name='Mono ADC MIXL ADC2 Switch' on"
                cset "name='Mono ADC MIXR ADC2 Switch' on"
-               cset "name='Mono ADC Capture Switch' on"
                cset "name='Stereo ADC MIXL ADC2 Switch' on"
                cset "name='Stereo ADC MIXR ADC2 Switch' on"
                cset "name='Internal Mic Switch' on"
@@ -18,7 +17,6 @@ SectionDevice."Mic" {
        DisableSequence [
                cset "name='Mono ADC MIXL ADC2 Switch' off"
                cset "name='Mono ADC MIXR ADC2 Switch' off"
-               cset "name='Mono ADC Capture Switch' off"
                cset "name='Stereo ADC MIXL ADC2 Switch' off"
                cset "name='Stereo ADC MIXR ADC2 Switch' off"
                cset "name='Internal Mic Switch' off"
index 145a23bd42fce1e4eb4a0441c7ddc3de433ad27f..4754df79c0a23d52676a2e2a145b53bc6ede76cb 100644 (file)
@@ -30,8 +30,13 @@ EnableSequence [
        # Input Configuration
        cset "name='Stereo ADC1 Mux' ADC"
        cset "name='Stereo ADC2 Mux' DMIC1"
-       cset "name='Mono ADC L1 Mux' 1"
-       cset "name='Mono ADC R1 Mux' 1"
+       cset "name='ADC Capture Switch' on"
+
+       cset "name='Mono ADC L1 Mux' ADCL"
+       cset "name='Mono ADC R1 Mux' ADCR"
+       cset "name='Mono ADC L2 Mux' DMIC L1"
+       cset "name='Mono ADC R2 Mux' DMIC R1"
+       cset "name='Mono ADC Capture Switch' on"
 
        # 47=0dB, 0.375 dB/step, set it to 6 dB to help with soft mics
        cset "name='ADC Capture Volume' 63"
@@ -45,5 +50,4 @@ EnableSequence [
 
        cset "name='Internal Mic Switch' off"
        cset "name='Headset Mic Switch' off"
-       cset "name='ADC Capture Switch' on"
 ]
index f88b611a45c5af181b198212a672992dc035e121..829e4e6a938e29f5d2faa1507d8ae8be95ba12f7 100644 (file)
@@ -21,26 +21,20 @@ SectionDevice."Headset" {
 
                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"
-
-               cset "name='Mono ADC Capture 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 BST2 Switch' off"
                cset "name='RECMIXR BST2 Switch' off"
 
                cset "name='Headset Mic Switch' off"
-
-               cset "name='Mono ADC MIXL ADC1 Switch' off"
-               cset "name='Mono ADC MIXR ADC1 Switch' off"
-
-               cset "name='Mono ADC Capture Switch' off"
        ]
 
        Value {
index ebb5b6de426f0d51fb81a3a9d74a6996b4c8266b..260df90d8109ac380ff022115424a72b4f7f683c 100644 (file)
@@ -15,27 +15,20 @@ SectionDevice."Mic" {
 
                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"
-
-               cset "name='Mono ADC Capture 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"
 
                cset "name='Internal Mic Switch' off"
-
-               cset "name='Mono ADC MIXL ADC1 Switch' off"
-               cset "name='Mono ADC MIXR ADC1 Switch' off"
-
-               cset "name='Mono ADC Capture Switch' off"
-
        ]
 
        Value {
index 172d90961de00b43647f6b8655a854df21be2609..ebd2b9c50e5158b4550e0663ebb9b13e75625215 100644 (file)
@@ -15,27 +15,20 @@ SectionDevice."Mic" {
 
                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"
-
-               cset "name='Mono ADC Capture 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 BST3 Switch' off"
                cset "name='RECMIXR BST3 Switch' off"
 
                cset "name='Internal Mic Switch' off"
-
-               cset "name='Mono ADC MIXL ADC1 Switch' off"
-               cset "name='Mono ADC MIXR ADC1 Switch' off"
-
-               cset "name='Mono ADC Capture Switch' off"
        ]
 
        Value {