OSDN Git Service

ucm2: soundwire: add basic settings for SDCA devices
authorLibin Yang <libin.yang@intel.com>
Sun, 7 Feb 2021 04:30:58 +0000 (12:30 +0800)
committerJaroslav Kysela <perex@perex.cz>
Thu, 15 Apr 2021 10:41:01 +0000 (12:41 +0200)
Add support for rt711-sdca, rt1316 and rt715-sdca (aka rt714).

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Libin Yang <libin.yang@intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
ucm2/codecs/rt711-sdca/init.conf [new file with mode: 0644]
ucm2/codecs/rt715-sdca/init.conf [new file with mode: 0644]
ucm2/sof-soundwire/rt1316-1.conf [new file with mode: 0644]
ucm2/sof-soundwire/rt1316-2.conf [new file with mode: 0644]
ucm2/sof-soundwire/rt711-sdca.conf [new file with mode: 0644]
ucm2/sof-soundwire/rt715-sdca.conf [new file with mode: 0644]
ucm2/sof-soundwire/sof-soundwire.conf

diff --git a/ucm2/codecs/rt711-sdca/init.conf b/ucm2/codecs/rt711-sdca/init.conf
new file mode 100644 (file)
index 0000000..3149233
--- /dev/null
@@ -0,0 +1,8 @@
+# RT711-sdca specific volume control settings
+
+BootSequence [
+       cset "name='rt711 FU05 Playback Volume' 87"
+       cset "name='rt711 ADC 22 Mux' 'MIC2'"
+       cset "name='rt711 FU0F Capture Volume' 57"
+       cset "name='rt711 FU0F Capture Switch' 1"
+]
diff --git a/ucm2/codecs/rt715-sdca/init.conf b/ucm2/codecs/rt715-sdca/init.conf
new file mode 100644 (file)
index 0000000..8506de1
--- /dev/null
@@ -0,0 +1,9 @@
++# RT715-sdca (aka RT714) specific volume control settings
+
+BootSequence [
+       cset "name='rt714 FU0A Capture Switch' 0"
+       cset "name='rt714 ADC 22 Mux' 'DMIC3'"
+       cset "name='rt714 ADC 23 Mux' 'DMIC4'"
+       cset "name='rt714 FU02 Capture Switch' 1"
+       cset "name='rt714 FU02 Capture Volume' 124"
+]
diff --git a/ucm2/sof-soundwire/rt1316-1.conf b/ucm2/sof-soundwire/rt1316-1.conf
new file mode 100644 (file)
index 0000000..f442a79
--- /dev/null
@@ -0,0 +1,22 @@
+# Use case Configuration for sof-soundwire card
+
+SectionDevice."Speaker" {
+       Comment "Speaker"
+
+       EnableSequence [
+               cset "name='rt1316-1 DAC L Switch' 1"
+               cset "name='rt1316-1 DAC R Switch' 1"
+               cset "name='Speaker Switch' on"
+       ]
+
+       DisableSequence [
+               cset "name='rt1316-1 DAC L Switch' 0"
+               cset "name='rt1316-1 DAC R Switch' 0"
+               cset "name='Speaker Switch' off"
+       ]
+
+       Value {
+             PlaybackPriority 100
+             PlaybackPCM "hw:${CardId},2"
+       }
+}
diff --git a/ucm2/sof-soundwire/rt1316-2.conf b/ucm2/sof-soundwire/rt1316-2.conf
new file mode 100644 (file)
index 0000000..f2fd9ab
--- /dev/null
@@ -0,0 +1,29 @@
+# Use case Configuration for sof-soundwire card
+
+SectionDevice."Speaker" {
+       Comment "Speaker"
+
+       EnableSequence [
+               cset "name='rt1316-1 RX Channel Select' L,L"
+               cset "name='rt1316-2 RX Channel Select' R,R"
+
+               cset "name='rt1316-1 DAC L Switch' 1"
+               cset "name='rt1316-1 DAC R Switch' 1"
+               cset "name='rt1316-2 DAC L Switch' 1"
+               cset "name='rt1316-2 DAC R Switch' 1"
+               cset "name='Speaker Switch' on"
+       ]
+
+       DisableSequence [
+               cset "name='rt1316-1 DAC L Switch' 0"
+               cset "name='rt1316-1 DAC R Switch' 0"
+               cset "name='rt1316-2 DAC L Switch' 0"
+               cset "name='rt1316-2 DAC R Switch' 0"
+               cset "name='Speaker Switch' off"
+       ]
+
+       Value {
+             PlaybackPriority 100
+             PlaybackPCM "hw:${CardId},2"
+       }
+}
diff --git a/ucm2/sof-soundwire/rt711-sdca.conf b/ucm2/sof-soundwire/rt711-sdca.conf
new file mode 100644 (file)
index 0000000..3d47163
--- /dev/null
@@ -0,0 +1,40 @@
+# Use case Configuration for sof-soundwire card
+
+SectionDevice."Headphones" {
+       Comment "Headphones"
+
+       EnableSequence [
+               cset "name='Headphone Switch' on"
+       ]
+
+       DisableSequence [
+               cset "name='Headphone Switch' off"
+       ]
+
+       Value {
+             PlaybackPriority 200
+             PlaybackPCM "hw:${CardId}"
+             JackControl "Headphone Jack"
+       }
+}
+
+SectionDevice."Headset" {
+       Comment "Headset Microphone"
+
+       EnableSequence [
+               cset "name='PGA2.0 2 Master Capture Switch' 1"
+       ]
+
+       DisableSequence [
+               cset "name='PGA2.0 2 Master Capture Switch' 0"
+       ]
+
+       Value {
+               CapturePriority 200
+               CapturePCM "hw:${CardId},1"
+               JackControl "Headset Mic Jack"
+               CaptureSwitch "PGA2.0 2 Master Capture Switch"
+               CaptureVolume "PGA2.0 2 Master Capture Volume"
+               CaptureMixerElem "PGA2.0 2 Master"
+       }
+}
diff --git a/ucm2/sof-soundwire/rt715-sdca.conf b/ucm2/sof-soundwire/rt715-sdca.conf
new file mode 100644 (file)
index 0000000..6e481e1
--- /dev/null
@@ -0,0 +1,21 @@
+# Use case Configuration for sof-soundwire card
+
+SectionDevice."Mic" {
+       Comment "SoundWire microphones"
+
+       EnableSequence [
+               cset "name='rt714 FU02 Capture Switch' 1"
+       ]
+
+       DisableSequence [
+               cset "name='rt714 FU02 Capture Switch' 0"
+       ]
+
+       Value {
+             CapturePriority 100
+             CapturePCM "hw:${CardId},4"
+             CaptureSwitch "rt714 FU02 Capture Switch"
+             CaptureVolume "rt714 FU02 Capture Volume"
+             CaptureMixerElem "rt714 FU02"
+       }
+}
index ec8b01e..52ce2f0 100644 (file)
@@ -16,7 +16,7 @@ Define {
 
 DefineRegex {
        SpeakerCodec {
-               Regex " spk:([a-z0-9]+)"
+               Regex " spk:([a-z0-9]+(-sdca)?)"
                String "${CardComponents}"
        }
        SpeakerChannels {
@@ -28,11 +28,11 @@ DefineRegex {
                String "${CardComponents}"
        }
        HeadsetCodec {
-               Regex " hs:([a-z0-9]+)"
+               Regex " hs:([a-z0-9]+(-sdca)?)"
                String "${CardComponents}"
        }
        MicCodec {
-               Regex " mic:([a-z0-9]+)"
+               Regex " mic:([a-z0-9]+(-sdca)?)"
                String "${CardComponents}"
        }
        Mics {
@@ -44,7 +44,7 @@ DefineRegex {
 If.hs_init {
        Condition {
                Type RegexMatch
-               Regex "(rt5682|rt700|rt711)"
+               Regex "(rt5682|rt700|rt711(-sdca)?)"
                String "${var:HeadsetCodec1}"
        }
        True.Include.hs_init.File "/codecs/${var:HeadsetCodec1}/init.conf"
@@ -53,7 +53,7 @@ If.hs_init {
 If.mic_init {
        Condition {
                Type RegexMatch
-               Regex "(rt715)"
+               Regex "(rt715(-sdca)?)"
                String "${var:MicCodec1}"
        }
        True.Include.mic_init.File "/codecs/${var:MicCodec1}/init.conf"