aboutsummaryrefslogtreecommitdiff
path: root/ucm2/codecs/rt5651
diff options
context:
space:
mode:
Diffstat (limited to 'ucm2/codecs/rt5651')
-rw-r--r--ucm2/codecs/rt5651/DigitalMic.conf27
-rw-r--r--ucm2/codecs/rt5651/EnableSeq.conf56
-rw-r--r--ucm2/codecs/rt5651/HeadPhones-swapped.conf39
-rw-r--r--ucm2/codecs/rt5651/HeadPhones.conf30
-rw-r--r--ucm2/codecs/rt5651/IN1-InternalMic.conf31
-rw-r--r--ucm2/codecs/rt5651/IN12-InternalMic.conf35
-rw-r--r--ucm2/codecs/rt5651/IN2-HeadsetMic.conf32
-rw-r--r--ucm2/codecs/rt5651/IN2-InternalMic.conf31
-rw-r--r--ucm2/codecs/rt5651/IN3-HeadsetMic.conf32
-rw-r--r--ucm2/codecs/rt5651/MonoSpeaker.conf47
-rw-r--r--ucm2/codecs/rt5651/Speaker.conf29
11 files changed, 389 insertions, 0 deletions
diff --git a/ucm2/codecs/rt5651/DigitalMic.conf b/ucm2/codecs/rt5651/DigitalMic.conf
new file mode 100644
index 0000000..7a0c4d4
--- /dev/null
+++ b/ucm2/codecs/rt5651/DigitalMic.conf
@@ -0,0 +1,27 @@
+SectionDevice."DigitalMic" {
+ Comment "Internal Digital Microphone"
+
+ ConflictingDevice [
+ "InternalMic-IN1"
+ "InternalMic-IN2"
+ "InternalMic-IN12"
+ "HeadsetMic-IN2"
+ "HeadsetMic-IN3"
+ ]
+
+ EnableSequence [
+ cset "name='Stereo1 ADC MIXL ADC2 Switch' on"
+ cset "name='Stereo1 ADC MIXR ADC2 Switch' on"
+ cset "name='Internal Mic Switch' on"
+ ]
+
+ DisableSequence [
+ cset "name='Stereo1 ADC MIXL ADC2 Switch' off"
+ cset "name='Stereo1 ADC MIXR ADC2 Switch' off"
+ cset "name='Internal Mic Switch' off"
+ ]
+
+ Value {
+ CaptureChannels 2
+ }
+}
diff --git a/ucm2/codecs/rt5651/EnableSeq.conf b/ucm2/codecs/rt5651/EnableSeq.conf
new file mode 100644
index 0000000..9c1386f
--- /dev/null
+++ b/ucm2/codecs/rt5651/EnableSeq.conf
@@ -0,0 +1,56 @@
+# default state
+cset "name='HPO MIX DAC1 Switch' on"
+cset "name='HPO MIX HPVOL Switch' off"
+cset "name='HPO L Playback Switch' off"
+cset "name='HPO R Playback Switch' off"
+cset "name='HPOVOL L Switch' on"
+cset "name='HPOVOL R Switch' on"
+cset "name='LOUT MIX DAC L1 Switch' on"
+cset "name='LOUT MIX DAC R1 Switch' on"
+cset "name='IF1 ASRC Switch' on"
+cset "name='LOUT L Playback Switch' off"
+cset "name='LOUT R Playback Switch' off"
+cset "name='Stereo DAC MIXL DAC L1 Switch' on"
+cset "name='Stereo DAC MIXL DAC R1 Switch' off"
+cset "name='Stereo DAC MIXR DAC L1 Switch' off"
+cset "name='Stereo DAC MIXR DAC R1 Switch' on"
+cset "name='Stereo1 ADC MIXL ADC1 Switch' off"
+cset "name='Stereo1 ADC MIXR ADC1 Switch' off"
+cset "name='Stereo1 ADC MIXL ADC2 Switch' off"
+cset "name='Stereo1 ADC MIXR ADC2 Switch' off"
+cset "name='Stereo2 ADC MIXL ADC1 Switch' off"
+cset "name='Stereo2 ADC MIXR ADC1 Switch' off"
+cset "name='Stereo2 ADC MIXL ADC2 Switch' off"
+cset "name='Stereo2 ADC MIXR ADC2 Switch' off"
+cset "name='Headphone Switch' off"
+cset "name='Speaker Switch' off"
+
+# volumes
+cset "name='OUT Playback Volume' 31"
+cset "name='HP Playback Volume' 31"
+cset "name='DAC1 Playback Volume' 175"
+cset "name='IN Capture Volume' 23"
+# 47=0dB, 0.375 dB/step, set it to 6 dB to help with soft mics
+cset "name='ADC Capture Volume' 63"
+cset "name='ADC Capture Switch' on"
+# Set ADC Boost Gain to 3dB higher vals result in too much noise
+cset "name='ADC Boost Gain' 1"
+# Set IN1, IN2 and IN3 internal mic boost to 1
+cset "name='IN1 Boost' 1"
+cset "name='IN2 Boost' 1"
+cset "name='IN3 Boost' 1"
+
+# input
+cset "name='Stereo1 ADC L1 Mux' ADC"
+cset "name='Stereo1 ADC R1 Mux' ADC"
+cset "name='Stereo1 ADC L2 Mux' DMIC"
+cset "name='Stereo1 ADC R2 Mux' DMIC"
+cset "name='RECMIXL BST1 Switch' off"
+cset "name='RECMIXR BST1 Switch' off"
+cset "name='RECMIXL BST3 Switch' off"
+cset "name='RECMIXR BST3 Switch' off"
+cset "name='RECMIXL BST2 Switch' off"
+cset "name='RECMIXR BST2 Switch' off"
+cset "name='Headset Mic Switch' off"
+cset "name='Internal Mic Switch' off"
+cset "name='Line In Switch' off"
diff --git a/ucm2/codecs/rt5651/HeadPhones-swapped.conf b/ucm2/codecs/rt5651/HeadPhones-swapped.conf
new file mode 100644
index 0000000..f5260a3
--- /dev/null
+++ b/ucm2/codecs/rt5651/HeadPhones-swapped.conf
@@ -0,0 +1,39 @@
+SectionDevice."Headphones" {
+ Comment "Headphones"
+
+ ConflictingDevice [
+ "Speaker"
+ "MonoSpeaker"
+ ]
+
+ EnableSequence [
+ # Swap left and right
+ cset "name='Stereo DAC MIXL DAC R1 Switch' on"
+ cset "name='Stereo DAC MIXL DAC L1 Switch' off"
+ cset "name='Stereo DAC MIXR DAC L1 Switch' on"
+ cset "name='Stereo DAC MIXR DAC R1 Switch' off"
+
+ cset "name='Headphone Switch' on"
+ cset "name='HPO L Playback Switch' on"
+ cset "name='HPO R Playback Switch' on"
+ # Done after turning the HP on to keep the bias and clk on
+ cset "name='Speaker Switch' off"
+ cset "name='LOUT L Playback Switch' off"
+ cset "name='LOUT R Playback Switch' off"
+ ]
+
+ DisableSequence [
+ # Disabling the HP switches is done by the Speaker EnableSeq
+
+ # Unswap left and right
+ cset "name='Stereo DAC MIXL DAC L1 Switch' on"
+ cset "name='Stereo DAC MIXL DAC R1 Switch' off"
+ cset "name='Stereo DAC MIXR DAC R1 Switch' on"
+ cset "name='Stereo DAC MIXR DAC L1 Switch' off"
+ ]
+
+ Value {
+ PlaybackChannels "2"
+ JackControl "Headphone Jack"
+ }
+}
diff --git a/ucm2/codecs/rt5651/HeadPhones.conf b/ucm2/codecs/rt5651/HeadPhones.conf
new file mode 100644
index 0000000..0a87b32
--- /dev/null
+++ b/ucm2/codecs/rt5651/HeadPhones.conf
@@ -0,0 +1,30 @@
+SectionDevice."Headphones" {
+ Comment "Headphones"
+
+ ConflictingDevice [
+ "Speaker"
+ "MonoSpeaker"
+ ]
+
+ EnableSequence [
+ cset "name='Headphone Switch' on"
+ cset "name='HPO L Playback Switch' on"
+ cset "name='HPO R Playback Switch' on"
+ # Done after turning the HP on to keep the bias and clk on
+ cset "name='Speaker Switch' off"
+ cset "name='LOUT L Playback Switch' off"
+ cset "name='LOUT R Playback Switch' off"
+ ]
+
+ DisableSequence [
+ # This is done by the Speaker EnableSequence, so that the
+ # Platform Clock and BIAS do not temporarily get turned off
+ # as that breaks audio-streams which are playing when
+ # switching between Speaker/Headphone
+ ]
+
+ Value {
+ PlaybackChannels "2"
+ JackControl "Headphone Jack"
+ }
+}
diff --git a/ucm2/codecs/rt5651/IN1-InternalMic.conf b/ucm2/codecs/rt5651/IN1-InternalMic.conf
new file mode 100644
index 0000000..01b786e
--- /dev/null
+++ b/ucm2/codecs/rt5651/IN1-InternalMic.conf
@@ -0,0 +1,31 @@
+SectionDevice."InternalMic-IN1" {
+ Comment "Internal Microphone on IN1"
+
+ ConflictingDevice [
+ "DigitalMic"
+ "InternalMic-IN2"
+ "InternalMic-IN12"
+ "HeadsetMic-IN2"
+ "HeadsetMic-IN3"
+ ]
+
+ EnableSequence [
+ cset "name='Internal Mic Switch' on"
+ cset "name='RECMIXL BST1 Switch' on"
+ cset "name='RECMIXR BST1 Switch' on"
+ cset "name='Stereo1 ADC MIXL ADC1 Switch' on"
+ cset "name='Stereo1 ADC MIXR ADC1 Switch' on"
+ ]
+
+ DisableSequence [
+ cset "name='Stereo1 ADC MIXL ADC1 Switch' off"
+ cset "name='Stereo1 ADC MIXR ADC1 Switch' off"
+ cset "name='Internal Mic Switch' off"
+ cset "name='RECMIXL BST1 Switch' off"
+ cset "name='RECMIXR BST1 Switch' off"
+ ]
+
+ Value {
+ CaptureChannels "2"
+ }
+}
diff --git a/ucm2/codecs/rt5651/IN12-InternalMic.conf b/ucm2/codecs/rt5651/IN12-InternalMic.conf
new file mode 100644
index 0000000..44cc53a
--- /dev/null
+++ b/ucm2/codecs/rt5651/IN12-InternalMic.conf
@@ -0,0 +1,35 @@
+SectionDevice."InternalMic-IN12" {
+ Comment "Internal Microphones on IN1 and IN2"
+
+ ConflictingDevice [
+ "DigitalMic"
+ "InternalMic-IN1"
+ "InternalMic-IN2"
+ "HeadsetMic-IN2"
+ "HeadsetMic-IN3"
+ ]
+
+ EnableSequence [
+ cset "name='Internal Mic Switch' on"
+ cset "name='RECMIXL BST1 Switch' on"
+ cset "name='RECMIXR BST1 Switch' on"
+ cset "name='RECMIXL BST2 Switch' on"
+ cset "name='RECMIXR BST2 Switch' on"
+ cset "name='Stereo1 ADC MIXL ADC1 Switch' on"
+ cset "name='Stereo1 ADC MIXR ADC1 Switch' on"
+ ]
+
+ DisableSequence [
+ cset "name='Stereo1 ADC MIXL ADC1 Switch' off"
+ cset "name='Stereo1 ADC MIXR ADC1 Switch' off"
+ cset "name='Internal Mic Switch' off"
+ cset "name='RECMIXL BST1 Switch' off"
+ cset "name='RECMIXR BST1 Switch' off"
+ cset "name='RECMIXL BST2 Switch' off"
+ cset "name='RECMIXR BST2 Switch' off"
+ ]
+
+ Value {
+ CaptureChannels "2"
+ }
+}
diff --git a/ucm2/codecs/rt5651/IN2-HeadsetMic.conf b/ucm2/codecs/rt5651/IN2-HeadsetMic.conf
new file mode 100644
index 0000000..177f70b
--- /dev/null
+++ b/ucm2/codecs/rt5651/IN2-HeadsetMic.conf
@@ -0,0 +1,32 @@
+SectionDevice."HeadsetMic-IN2" {
+ Comment "Headset Microphone on IN2"
+
+ ConflictingDevice [
+ "DigitalMic"
+ "InternalMic-IN1"
+ "InternalMic-IN2"
+ "InternalMic-IN12"
+ "HeadsetMic-IN3"
+ ]
+
+ EnableSequence [
+ cset "name='Headset Mic Switch' on"
+ cset "name='RECMIXL BST2 Switch' on"
+ cset "name='RECMIXR BST2 Switch' on"
+ cset "name='Stereo1 ADC MIXL ADC1 Switch' on"
+ cset "name='Stereo1 ADC MIXR ADC1 Switch' on"
+ ]
+
+ DisableSequence [
+ cset "name='Stereo1 ADC MIXL ADC1 Switch' off"
+ cset "name='Stereo1 ADC MIXR ADC1 Switch' off"
+ cset "name='Headset Mic Switch' off"
+ cset "name='RECMIXL BST2 Switch' off"
+ cset "name='RECMIXR BST2 Switch' off"
+ ]
+
+ Value {
+ CaptureChannels "2"
+ JackControl "Headset Mic Jack"
+ }
+}
diff --git a/ucm2/codecs/rt5651/IN2-InternalMic.conf b/ucm2/codecs/rt5651/IN2-InternalMic.conf
new file mode 100644
index 0000000..611ca6c
--- /dev/null
+++ b/ucm2/codecs/rt5651/IN2-InternalMic.conf
@@ -0,0 +1,31 @@
+SectionDevice."InternalMic-IN2" {
+ Comment "Internal Microphone on IN2"
+
+ ConflictingDevice [
+ "DigitalMic"
+ "InternalMic-IN1"
+ "InternalMic-IN12"
+ "HeadsetMic-IN2"
+ "HeadsetMic-IN3"
+ ]
+
+ EnableSequence [
+ cset "name='Internal Mic Switch' on"
+ cset "name='RECMIXL BST2 Switch' on"
+ cset "name='RECMIXR BST2 Switch' on"
+ cset "name='Stereo1 ADC MIXL ADC1 Switch' on"
+ cset "name='Stereo1 ADC MIXR ADC1 Switch' on"
+ ]
+
+ DisableSequence [
+ cset "name='Stereo1 ADC MIXL ADC1 Switch' off"
+ cset "name='Stereo1 ADC MIXR ADC1 Switch' off"
+ cset "name='Internal Mic Switch' off"
+ cset "name='RECMIXL BST2 Switch' off"
+ cset "name='RECMIXR BST2 Switch' off"
+ ]
+
+ Value {
+ CaptureChannels "2"
+ }
+}
diff --git a/ucm2/codecs/rt5651/IN3-HeadsetMic.conf b/ucm2/codecs/rt5651/IN3-HeadsetMic.conf
new file mode 100644
index 0000000..3231e78
--- /dev/null
+++ b/ucm2/codecs/rt5651/IN3-HeadsetMic.conf
@@ -0,0 +1,32 @@
+SectionDevice."HeadsetMic-IN3" {
+ Comment "Headset Microphone on IN3"
+
+ ConflictingDevice [
+ "DigitalMic"
+ "InternalMic-IN1"
+ "InternalMic-IN2"
+ "InternalMic-IN12"
+ "HeadsetMic-IN2"
+ ]
+
+ EnableSequence [
+ cset "name='Headset Mic Switch' on"
+ cset "name='RECMIXL BST3 Switch' on"
+ cset "name='RECMIXR BST3 Switch' on"
+ cset "name='Stereo1 ADC MIXL ADC1 Switch' on"
+ cset "name='Stereo1 ADC MIXR ADC1 Switch' on"
+ ]
+
+ DisableSequence [
+ cset "name='Stereo1 ADC MIXL ADC1 Switch' off"
+ cset "name='Stereo1 ADC MIXR ADC1 Switch' off"
+ cset "name='Headset Mic Switch' off"
+ cset "name='RECMIXL BST3 Switch' off"
+ cset "name='RECMIXR BST3 Switch' off"
+ ]
+
+ Value {
+ CaptureChannels "2"
+ JackControl "Headset Mic Jack"
+ }
+}
diff --git a/ucm2/codecs/rt5651/MonoSpeaker.conf b/ucm2/codecs/rt5651/MonoSpeaker.conf
new file mode 100644
index 0000000..c2276c6
--- /dev/null
+++ b/ucm2/codecs/rt5651/MonoSpeaker.conf
@@ -0,0 +1,47 @@
+SectionDevice."MonoSpeaker" {
+ Comment "Mono Speaker"
+
+ ConflictingDevice [
+ "Speaker"
+ "Headphones"
+ ]
+
+ EnableSequence [
+ # On most (all?) devices with a single / mono speaker an
+ # amplifier with a differential input connected between LOUT
+ # right and left is used. We deal with this by silencing the
+ # right output and mixing left + right to the left output.
+ #
+ # An alternative approach for devices using the differential
+ # setup would be to set bit 15 of register 5 in the codec,
+ # which turns the stereo unbalanced line out into a mono
+ # balanced line out.
+ #
+ # This possibility was discovered after we already shipped the
+ # current solution and the current solution has the advantage
+ # of also working on devices which only use LOUT left in
+ # unbalanced mode. The net result is the same for devices using
+ # the differential setup, so we just stick with what we have.
+ cset "name='Stereo DAC MIXR DAC R1 Switch' off"
+ cset "name='Stereo DAC MIXL DAC R1 Switch' on"
+
+ cset "name='Speaker Switch' on"
+ cset "name='LOUT L Playback Switch' on"
+ # Done after turning the speaker on to keep the bias and clk on
+ cset "name='Headphone Switch' off"
+ cset "name='HPO L Playback Switch' off"
+ cset "name='HPO R Playback Switch' off"
+ ]
+
+ DisableSequence [
+ # Disabling the switches is done by the Speaker EnableSeq
+
+ # Undo mono mapping
+ cset "name='Stereo DAC MIXL DAC R1 Switch' off"
+ cset "name='Stereo DAC MIXR DAC R1 Switch' on"
+ ]
+
+ Value {
+ PlaybackChannels "2"
+ }
+}
diff --git a/ucm2/codecs/rt5651/Speaker.conf b/ucm2/codecs/rt5651/Speaker.conf
new file mode 100644
index 0000000..463d13b
--- /dev/null
+++ b/ucm2/codecs/rt5651/Speaker.conf
@@ -0,0 +1,29 @@
+SectionDevice."Speaker" {
+ Comment "Speakers"
+
+ ConflictingDevice [
+ "MonoSpeaker"
+ "Headphones"
+ ]
+
+ EnableSequence [
+ cset "name='Speaker Switch' on"
+ cset "name='LOUT L Playback Switch' on"
+ cset "name='LOUT R Playback Switch' on"
+ # Done after turning the speaker on to keep the bias and clk on
+ cset "name='Headphone Switch' off"
+ cset "name='HPO L Playback Switch' off"
+ cset "name='HPO R Playback Switch' off"
+ ]
+
+ DisableSequence [
+ # This is done by the Headphones EnableSequence, so that the
+ # Platform Clock and BIAS do not temporarily get turned off
+ # as that breaks audio-streams which are playing when
+ # switching between Speaker/Headphone
+ ]
+
+ Value {
+ PlaybackChannels "2"
+ }
+}