]> git.alsa-project.org Git - alsa-ucm-conf.git/commitdiff
conf/ucm: Add UCM profile for cht-bsw-rt5672 boards
authorHans de Goede <hdegoede@redhat.com>
Sat, 31 Aug 2019 14:58:41 +0000 (16:58 +0200)
committerJaroslav Kysela <perex@perex.cz>
Fri, 27 Sep 2019 08:30:53 +0000 (10:30 +0200)
Add an UCM profile for Intel boards with a RT5672 codec.

Re-use the existing platform enable and disable sequences for BYT/CHT SST
support and add a codecs/rt5672 dir with codec specific enable / disable
sequences for the various inputs and outputs.

This is partly based on earlier work done here:
https://github.com/plbossart/UCM/tree/master/cht-bsw-rt5672

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
ucm/cht-bsw-rt5672/HiFi.conf [new file with mode: 0644]
ucm/cht-bsw-rt5672/cht-bsw-rt5672.conf [new file with mode: 0644]
ucm/codecs/rt5672/DMIC1.conf [new file with mode: 0644]
ucm/codecs/rt5672/DMIC2.conf [new file with mode: 0644]
ucm/codecs/rt5672/EnableSeq.conf [new file with mode: 0644]
ucm/codecs/rt5672/HeadPhones.conf [new file with mode: 0644]
ucm/codecs/rt5672/HeadsetMic.conf [new file with mode: 0644]
ucm/codecs/rt5672/MonoSpeaker.conf [new file with mode: 0644]
ucm/codecs/rt5672/Speaker.conf [new file with mode: 0644]

diff --git a/ucm/cht-bsw-rt5672/HiFi.conf b/ucm/cht-bsw-rt5672/HiFi.conf
new file mode 100644 (file)
index 0000000..b83099d
--- /dev/null
@@ -0,0 +1,27 @@
+# Adapted from https://github.com/plbossart/UCM/tree/master/cht-bsw-rt5672
+
+SectionVerb {
+       EnableSequence [
+               cdev "hw:chtbswrt5672"
+               <platforms/bytcr/PlatformEnableSeq.conf>
+               <codecs/rt5672/EnableSeq.conf>
+       ]
+
+       DisableSequence [
+               cdev "hw:chtbswrt5672"
+               <platforms/bytcr/PlatformDisableSeq.conf>
+       ]
+
+       Value {
+               PlaybackPCM "hw:chtbswrt5672"
+               CapturePCM "hw:chtbswrt5672"
+       }
+}
+
+<codecs/rt5672/Speaker.conf>
+<codecs/rt5672/MonoSpeaker.conf>
+<codecs/rt5672/HeadPhones.conf>
+
+<codecs/rt5672/DMIC1.conf>
+<codecs/rt5672/DMIC2.conf>
+<codecs/rt5672/HeadsetMic.conf>
diff --git a/ucm/cht-bsw-rt5672/cht-bsw-rt5672.conf b/ucm/cht-bsw-rt5672/cht-bsw-rt5672.conf
new file mode 100644 (file)
index 0000000..c79024d
--- /dev/null
@@ -0,0 +1,6 @@
+# Adapted from https://github.com/plbossart/UCM/tree/master/cht-bsw-rt5672
+
+SectionUseCase."HiFi" {
+       File "HiFi.conf"
+       Comment "Play HiFi quality Music"
+}
diff --git a/ucm/codecs/rt5672/DMIC1.conf b/ucm/codecs/rt5672/DMIC1.conf
new file mode 100644 (file)
index 0000000..9a8db1a
--- /dev/null
@@ -0,0 +1,28 @@
+SectionDevice."DigitalMic-DMIC1" {
+       Comment "Internal Digital Microphone on DMIC1"
+
+       ConflictingDevice [
+               "DigitalMic-DMIC2"
+               "HeadsetMic"
+       ]
+
+       EnableSequence [
+               cdev "hw:chtbswrt5672"
+               cset "name='Int Mic Switch' on"
+               cset "name='Stereo1 DMIC Mux' DMIC1"
+               cset "name='Stereo1 ADC 2 Mux' DMIC"
+               cset "name='Sto1 ADC MIXL ADC2 Switch' on"
+               cset "name='Sto1 ADC MIXR ADC2 Switch' on"
+       ]
+
+       DisableSequence [
+               cdev "hw:chtbswrt5672"
+               cset "name='Int Mic Switch' off"
+               cset "name='Sto1 ADC MIXL ADC2 Switch' off"
+               cset "name='Sto1 ADC MIXR ADC2 Switch' off"
+       ]
+
+       Value {
+               CaptureChannels 2
+       }
+}
diff --git a/ucm/codecs/rt5672/DMIC2.conf b/ucm/codecs/rt5672/DMIC2.conf
new file mode 100644 (file)
index 0000000..b960436
--- /dev/null
@@ -0,0 +1,28 @@
+SectionDevice."DigitalMic-DMIC2" {
+       Comment "Internal Digital Microphone on DMIC2"
+
+       ConflictingDevice [
+               "DigitalMic-DMIC1"
+               "HeadsetMic"
+       ]
+
+       EnableSequence [
+               cdev "hw:chtbswrt5672"
+               cset "name='Int Mic Switch' on"
+               cset "name='Stereo1 DMIC Mux' DMIC2"
+               cset "name='Stereo1 ADC 2 Mux' DMIC"
+               cset "name='Sto1 ADC MIXL ADC2 Switch' on"
+               cset "name='Sto1 ADC MIXR ADC2 Switch' on"
+       ]
+
+       DisableSequence [
+               cdev "hw:chtbswrt5672"
+               cset "name='Int Mic Switch' off"
+               cset "name='Sto1 ADC MIXL ADC2 Switch' off"
+               cset "name='Sto1 ADC MIXR ADC2 Switch' off"
+       ]
+
+       Value {
+               CaptureChannels 2
+       }
+}
diff --git a/ucm/codecs/rt5672/EnableSeq.conf b/ucm/codecs/rt5672/EnableSeq.conf
new file mode 100644 (file)
index 0000000..bd4f357
--- /dev/null
@@ -0,0 +1,48 @@
+# Playback (I2S1)
+
+# common
+cset "name='DAC1 L Mux' IF1 DAC"
+cset "name='DAC1 R Mux' IF1 DAC"
+cset "name='DAC1 MIXL DAC1 Switch' on"
+cset "name='DAC1 MIXR DAC1 Switch' on"
+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"
+
+# speaker
+cset "name='PDM1 L Mux' Stereo DAC"
+cset "name='PDM1 R Mux' Stereo DAC"
+
+# headphone
+cset "name='HPOVOL MIXL DAC1 Switch' on"
+cset "name='HPOVOL MIXR DAC1 Switch' on"
+cset "name='HPO MIX HPVOL Switch' on"
+
+# line out
+# cset "name='OUT MIXL DAC L1 Switch' on"
+# cset "name='OUT MIXR DAC R1 Switch' on"
+# cset "name='LOUT MIX OUTMIX L Switch' on"
+# cset "name='LOUT MIX OUTMIX R Switch' on"
+
+# 47=0dB, 0.375 dB/step
+cset "name='ADC Capture Volume' 47"
+cset "name='ADC Capture Switch' on"
+
+# Headset mic is quite soft, boost it a bit, 1 = 20dB which is the first
+# available boost step
+cset "name='IN1 Boost Volume' 1"
+
+# Start with all outputs / inputs disabled
+cset "name='Ext Spk Switch' off"
+cset "name='Headphone Switch' off"
+cset "name='Int Mic Switch' off"
+cset "name='Headset Mic Switch' off"
+cset "name='Sto1 ADC MIXL ADC1 Switch' off"
+cset "name='Sto1 ADC MIXR ADC1 Switch' off"
+cset "name='Sto1 ADC MIXL ADC2 Switch' off"
+cset "name='Sto1 ADC MIXR ADC2 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"
diff --git a/ucm/codecs/rt5672/HeadPhones.conf b/ucm/codecs/rt5672/HeadPhones.conf
new file mode 100644 (file)
index 0000000..cb8aad2
--- /dev/null
@@ -0,0 +1,23 @@
+SectionDevice."Headphones" {
+       Comment "Headphones"
+
+       ConflictingDevice [
+               "Speaker"
+               "MonoSpeaker"
+       ]
+
+       EnableSequence [
+               cdev "hw:chtbswrt5672"
+               cset "name='Headphone Switch' on"
+       ]
+
+       DisableSequence [
+               cdev "hw:chtbswrt5672"
+               cset "name='Headphone Switch' off"
+       ]
+
+       Value {
+               PlaybackChannels "2"
+               JackControl "Headphone Jack"
+       }
+}
diff --git a/ucm/codecs/rt5672/HeadsetMic.conf b/ucm/codecs/rt5672/HeadsetMic.conf
new file mode 100644 (file)
index 0000000..cc6d8d5
--- /dev/null
@@ -0,0 +1,38 @@
+SectionDevice."HeadsetMic" {
+       Comment "Headset Microphone"
+
+       ConflictingDevice [
+               "DigitalMic-DMIC1"
+               "DigitalMic-DMIC2"
+       ]
+
+       EnableSequence [
+               cdev "hw:chtbswrt5672"
+               cset "name='Headset Mic Switch' on"
+               cset "name='RECMIXL BST1 Switch' on"
+               cset "name='RECMIXR BST1 Switch' on"
+               cset "name='Sto1 ADC MIXL ADC1 Switch' on"
+               cset "name='Sto1 ADC MIXR ADC1 Switch' on"
+               # For unknown reasons the headset mic sound is only recorded
+               # on the left channel, we tweak the data-stream reception to
+               # use the left samples for both slots, so that we get a stereo
+               # stream with the mic sound on both channels
+               cset "name='codec_in rx deinterleaver codec_in0_1' 1"
+       ]
+
+       DisableSequence [
+               cdev "hw:chtbswrt5672"
+               cset "name='Headset Mic Switch' off"
+               cset "name='RECMIXL BST1 Switch' off"
+               cset "name='RECMIXR BST1 Switch' off"
+               cset "name='Sto1 ADC MIXL ADC1 Switch' off"
+               cset "name='Sto1 ADC MIXR ADC1 Switch' off"
+               # Undo data-stream reception mono-mix workaround
+               cset "name='codec_in rx deinterleaver codec_in0_1' 2"
+       ]
+
+       Value {
+               CaptureChannels "2"
+               JackControl "Headset Mic Jack"
+       }
+}
diff --git a/ucm/codecs/rt5672/MonoSpeaker.conf b/ucm/codecs/rt5672/MonoSpeaker.conf
new file mode 100644 (file)
index 0000000..828a115
--- /dev/null
@@ -0,0 +1,26 @@
+SectionDevice."MonoSpeaker" {
+       Comment "Mono Speaker"
+
+       ConflictingDevice [
+               "Speaker"
+               "Headphones"
+       ]
+
+       EnableSequence [
+               cdev "hw:chtbswrt5672"
+               cset "name='Stereo DAC MIXR DAC R1 Switch' off"
+               cset "name='Stereo DAC MIXL DAC R1 Switch' on"
+               cset "name='Ext Spk Switch' on"
+       ]
+
+       DisableSequence [
+               cdev "hw:chtbswrt5672"
+               cset "name='Ext Spk Switch' off"
+               cset "name='Stereo DAC MIXL DAC R1 Switch' off"
+               cset "name='Stereo DAC MIXR DAC R1 Switch' on"
+       ]
+
+       Value {
+               PlaybackChannels "2"
+       }
+}
diff --git a/ucm/codecs/rt5672/Speaker.conf b/ucm/codecs/rt5672/Speaker.conf
new file mode 100644 (file)
index 0000000..f9291e5
--- /dev/null
@@ -0,0 +1,22 @@
+SectionDevice."Speaker" {
+       Comment "Speakers"
+
+       ConflictingDevice [
+               "MonoSpeaker"
+               "Headphones"
+       ]
+
+       EnableSequence [
+               cdev "hw:chtbswrt5672"
+               cset "name='Ext Spk Switch' on"
+       ]
+
+       DisableSequence [
+               cdev "hw:chtbswrt5672"
+               cset "name='Ext Spk Switch' off"
+       ]
+
+       Value {
+               PlaybackChannels "2"
+       }
+}