From e84b8e05e326ecb0f9d83ff9298cb48fa9e0e3f2 Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bossart Date: Mon, 13 Apr 2020 10:48:33 -0500 Subject: [PATCH] sof-bytcht-rt5645: reuse legacy settings Just test if controls for the legacy driver are available Signed-off-by: Pierre-Louis Bossart Signed-off-by: Jaroslav Kysela --- ucm2/chtrt5645/HiFi-dmic1.conf | 55 ++++++++++++++----- ucm2/chtrt5645/HiFi-dmic2.conf | 55 ++++++++++++++----- .../HiFi-mono-speaker-analog-mic.conf | 55 ++++++++++++++----- ucm2/chtrt5645/HiFi.conf | 55 ++++++++++++++----- 4 files changed, 160 insertions(+), 60 deletions(-) diff --git a/ucm2/chtrt5645/HiFi-dmic1.conf b/ucm2/chtrt5645/HiFi-dmic1.conf index c7e12c9..4e9ada8 100644 --- a/ucm2/chtrt5645/HiFi-dmic1.conf +++ b/ucm2/chtrt5645/HiFi-dmic1.conf @@ -4,21 +4,46 @@ SectionVerb { TQ "HiFi" } - EnableSequence [ - - - - cset "name='Stereo1 ADC1 Mux' 1" - cset "name='I2S2 Func Switch' on" - # 3/12 the headphone mic tends to be quite loud - cset "name='IN1 Boost' 3" - # 8/8 the internal analog mic tends to be quite soft - cset "name='IN2 Boost' 8" - ] - - DisableSequence [ - - ] + If.Controls { + Condition { + Type ControlExists + Control "name='media0_in Gain 0 Switch'" + } + True { + EnableSequence [ + + + + cset "name='Stereo1 ADC1 Mux' 1" + cset "name='I2S2 Func Switch' on" + # 3/12 the headphone mic tends to be quite loud + cset "name='IN1 Boost' 3" + # 8/8 the internal analog mic tends to be quite soft + cset "name='IN2 Boost' 8" + ] + + DisableSequence [ + + + ] + } + False { + EnableSequence [ + + + cset "name='Stereo1 ADC1 Mux' 1" + cset "name='I2S2 Func Switch' on" + # 3/12 the headphone mic tends to be quite loud + cset "name='IN1 Boost' 3" + # 8/8 the internal analog mic tends to be quite soft + cset "name='IN2 Boost' 8" + ] + + DisableSequence [ + + ] + } + } } SectionDevice."Speaker" { diff --git a/ucm2/chtrt5645/HiFi-dmic2.conf b/ucm2/chtrt5645/HiFi-dmic2.conf index 95fedb3..aa2a87b 100644 --- a/ucm2/chtrt5645/HiFi-dmic2.conf +++ b/ucm2/chtrt5645/HiFi-dmic2.conf @@ -4,21 +4,46 @@ SectionVerb { TQ "HiFi" } - EnableSequence [ - - - - cset "name='Stereo1 ADC1 Mux' 1" - cset "name='I2S2 Func Switch' on" - # 3/12 the headphone mic tends to be quite loud - cset "name='IN1 Boost' 3" - # 8/8 the internal analog mic tends to be quite soft - cset "name='IN2 Boost' 8" - ] - - DisableSequence [ - - ] + If.Controls { + Condition { + Type ControlExists + Control "name='media0_in Gain 0 Switch'" + } + True { + EnableSequence [ + + + + cset "name='Stereo1 ADC1 Mux' 1" + cset "name='I2S2 Func Switch' on" + # 3/12 the headphone mic tends to be quite loud + cset "name='IN1 Boost' 3" + # 8/8 the internal analog mic tends to be quite soft + cset "name='IN2 Boost' 8" + ] + + DisableSequence [ + + + ] + } + False { + EnableSequence [ + + + cset "name='Stereo1 ADC1 Mux' 1" + cset "name='I2S2 Func Switch' on" + # 3/12 the headphone mic tends to be quite loud + cset "name='IN1 Boost' 3" + # 8/8 the internal analog mic tends to be quite soft + cset "name='IN2 Boost' 8" + ] + + DisableSequence [ + + ] + } + } } SectionDevice."Speaker" { diff --git a/ucm2/chtrt5645/HiFi-mono-speaker-analog-mic.conf b/ucm2/chtrt5645/HiFi-mono-speaker-analog-mic.conf index f6180a4..fc8244e 100644 --- a/ucm2/chtrt5645/HiFi-mono-speaker-analog-mic.conf +++ b/ucm2/chtrt5645/HiFi-mono-speaker-analog-mic.conf @@ -4,21 +4,46 @@ SectionVerb { TQ "HiFi" } - EnableSequence [ - - - - cset "name='Stereo1 ADC1 Mux' 1" - cset "name='I2S2 Func Switch' on" - # 3/12 the headphone mic tends to be quite loud - cset "name='IN1 Boost' 3" - # 8/8 the internal analog mic tends to be quite soft - cset "name='IN2 Boost' 8" - ] - - DisableSequence [ - - ] + If.Controls { + Condition { + Type ControlExists + Control "name='media0_in Gain 0 Switch'" + } + True { + EnableSequence [ + + + + cset "name='Stereo1 ADC1 Mux' 1" + cset "name='I2S2 Func Switch' on" + # 3/12 the headphone mic tends to be quite loud + cset "name='IN1 Boost' 3" + # 8/8 the internal analog mic tends to be quite soft + cset "name='IN2 Boost' 8" + ] + + DisableSequence [ + + + ] + } + False { + EnableSequence [ + + + cset "name='Stereo1 ADC1 Mux' 1" + cset "name='I2S2 Func Switch' on" + # 3/12 the headphone mic tends to be quite loud + cset "name='IN1 Boost' 3" + # 8/8 the internal analog mic tends to be quite soft + cset "name='IN2 Boost' 8" + ] + + DisableSequence [ + + ] + } + } } SectionDevice."Speaker" { diff --git a/ucm2/chtrt5645/HiFi.conf b/ucm2/chtrt5645/HiFi.conf index 116d456..dd6328c 100644 --- a/ucm2/chtrt5645/HiFi.conf +++ b/ucm2/chtrt5645/HiFi.conf @@ -4,21 +4,46 @@ SectionVerb { TQ "HiFi" } - EnableSequence [ - - - - cset "name='Stereo1 ADC1 Mux' 1" - cset "name='I2S2 Func Switch' on" - # 3/12 the headphone mic tends to be quite loud - cset "name='IN1 Boost' 3" - # 8/8 the internal analog mic tends to be quite soft - cset "name='IN2 Boost' 8" - ] - - DisableSequence [ - - ] + If.Controls { + Condition { + Type ControlExists + Control "name='media0_in Gain 0 Switch'" + } + True { + EnableSequence [ + + + + cset "name='Stereo1 ADC1 Mux' 1" + cset "name='I2S2 Func Switch' on" + # 3/12 the headphone mic tends to be quite loud + cset "name='IN1 Boost' 3" + # 8/8 the internal analog mic tends to be quite soft + cset "name='IN2 Boost' 8" + ] + + DisableSequence [ + + + ] + } + False { + EnableSequence [ + + + cset "name='Stereo1 ADC1 Mux' 1" + cset "name='I2S2 Func Switch' on" + # 3/12 the headphone mic tends to be quite loud + cset "name='IN1 Boost' 3" + # 8/8 the internal analog mic tends to be quite soft + cset "name='IN2 Boost' 8" + ] + + DisableSequence [ + + ] + } + } } SectionDevice."Speaker" { -- 2.47.1