OSDN Git Service

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)
commitb1fd392b11e0e05165fe0ee00036c6849e1c037d
treed7dac30ca60b0cf123b92281f8acec4e642cf709
parent7c0d4a6d5baef825377e4087aa6342b4bd3f7444
codecs/rt5640: Cleanup: unify Stereo / Mono ADC handling

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