alsa-ucm-conf/0017-sof-soundwire-rewrite-for-syntax-3.patch
Takashi Iwai 899638c0ac Accepting request 835804 from home:tiwai:test:sdw
- Update from alsa-ucm-conf git (commit 3048ff7b15a9):
  mainly for adding the support for sof-soundwire (bsc#1176200):
  0001-bytcr-rt5640-Fix-DMIC1-not-working-when-connected-ov.patch
  0002-bytcr-rt5651-Fix-high-noise-level-soft-input-on-DMIC.patch
  0003-chtrt5645-Add-ASUSTeKCOMPUTERINC.-T101HA-1.0.conf-sy.patch
  0004-sof-hda-dsp-don-t-fail-if-Auto-Mute-control-is-not-p.patch
  0005-ucm2-use-Include-Syntax-3.patch
  0006-chtrt5645-merge-all-possible-configurations-to-HiFi..patch
  0007-cht-bsw-rt5672-merge-all-possible-configurations-to-.patch
  0008-chtnau8824-merge-all-possible-configurations-to-HiFi.patch
  0009-ucm.conf-add-support-for-the-kernel-module-name-tree.patch
  0010-sof-hda-dsp-make-Headphone-Playback-Switch-condition.patch
  0011-sof-hda-dsp-add-initial-kcontrol-values.patch
  0012-sof-hda-dsp-make-the-boot-init-optional-for-all-cont.patch
  0013-bdw-rt5677-add-support-for-legacy-and-SOF-drivers.patch
  0014-broadwell-rt286-add-SOF-support.patch
  0015-sof-soundwire-initial-UCM2-version.patch
  0016-sof-soundwire-cleanups-recommended-by-the-ucm-valida.patch
  0017-sof-soundwire-rewrite-for-syntax-3.patch
  0018-sof-hda-dsp-fix-the-device-order-Hdmi-devices.patch
  0019-HDA-Intel-add-support-for-AMD-acp-microphone-devices.patch
  0020-DAISY-I2S-move-to-Samsung-snow-snow.conf.patch
  0021-DB410c-move-to-Qualcomm-apq8016-sbc.patch
  0022-DB820c-DB845c-move-to-Qualcomm-tree.patch
  0023-PAZ00-tegraalc5632-move-to-Tegra-alc5632-tree.patch
  0024-VEYRON-I2C-move-to-Rockchip-max98090-tree.patch
  0025-Pandaboard-ES-move-to-OMAP-abe-twl6040-tree.patch
  0026-GoogleNyan-move-to-Tegra-max98090.patch
  0027-SDP4430-Move-to-OMAP-abe-twl6040-SDP4430-tree.patch
  0028-Fix-invalid-Regex-Type-in-various-Condition-blocks.patch

OBS-URL: https://build.opensuse.org/request/show/835804
OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/alsa-ucm-conf?expand=0&rev=17
2020-09-21 11:44:29 +00:00

881 lines
21 KiB
Diff

From 4734c44b38cd36588c774a4f52aa899ae5ad7fc4 Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <perex@perex.cz>
Date: Wed, 24 Jun 2020 12:24:45 +0200
Subject: [PATCH 17/51] sof-soundwire: rewrite for 'syntax 3'
The codec/ sequences must not have the platform specific checks.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
---
ucm2/codecs/rt5682/init.conf | 38 ++++++++----------
ucm2/codecs/rt700/init.conf | 24 ++++--------
ucm2/codecs/rt711/init.conf | 24 ++++--------
ucm2/codecs/rt715/init.conf | 25 ++++--------
ucm2/sof-soundwire/HiFi.conf | 33 +++++++++++++---
ucm2/sof-soundwire/RT1308-1.conf | 22 -----------
ucm2/sof-soundwire/RT1308-2.conf | 29 --------------
ucm2/sof-soundwire/RT1308.conf | 30 ---------------
ucm2/sof-soundwire/RT5682.conf | 60 -----------------------------
ucm2/sof-soundwire/RT700.conf | 72 -----------------------------------
ucm2/sof-soundwire/RT711.conf | 49 ------------------------
ucm2/sof-soundwire/RT715.conf | 30 ---------------
ucm2/sof-soundwire/rt1308-2.conf | 22 +++++++++++
ucm2/sof-soundwire/rt1308-4.conf | 29 ++++++++++++++
ucm2/sof-soundwire/rt5682.conf | 50 ++++++++++++++++++++++++
ucm2/sof-soundwire/rt700.conf | 62 ++++++++++++++++++++++++++++++
ucm2/sof-soundwire/rt711.conf | 39 +++++++++++++++++++
ucm2/sof-soundwire/rt715.conf | 20 ++++++++++
ucm2/sof-soundwire/sof-soundwire.conf | 54 +++++++++++++++++++++++---
19 files changed, 338 insertions(+), 374 deletions(-)
delete mode 100644 ucm2/sof-soundwire/RT1308-1.conf
delete mode 100644 ucm2/sof-soundwire/RT1308-2.conf
delete mode 100644 ucm2/sof-soundwire/RT1308.conf
delete mode 100644 ucm2/sof-soundwire/RT5682.conf
delete mode 100644 ucm2/sof-soundwire/RT700.conf
delete mode 100644 ucm2/sof-soundwire/RT711.conf
delete mode 100644 ucm2/sof-soundwire/RT715.conf
create mode 100644 ucm2/sof-soundwire/rt1308-2.conf
create mode 100644 ucm2/sof-soundwire/rt1308-4.conf
create mode 100644 ucm2/sof-soundwire/rt5682.conf
create mode 100644 ucm2/sof-soundwire/rt700.conf
create mode 100644 ucm2/sof-soundwire/rt711.conf
create mode 100644 ucm2/sof-soundwire/rt715.conf
diff --git a/ucm2/codecs/rt5682/init.conf b/ucm2/codecs/rt5682/init.conf
index d819febf1e06..11ce9dbf0c17 100644
--- a/ucm2/codecs/rt5682/init.conf
+++ b/ucm2/codecs/rt5682/init.conf
@@ -1,24 +1,16 @@
# RT5682 specific volume control settings
-If.RT5682init {
- Condition {
- Type String
- Haystack "${CardComponents}"
- Needle "hs:rt5682"
- }
- True {
- BootSequence [
- cset "name='rt5682 Stereo1 DAC MIXL DAC L1 Switch' 1"
- cset "name='rt5682 Stereo1 DAC MIXR DAC R1 Switch' 1"
- cset "name='rt5682 DAC L Mux' 1"
- cset "name='rt5682 DAC R Mux' 1"
- cset "name='rt5682 IF1 01 ADC Swap Mux' 2"
- cset "name='rt5682 CBJ Boost Volume' 3"
- cset "name='rt5682 Stereo1 ADC L Mux' 0"
- cset "name='rt5682 Stereo1 ADC R Mux' 0"
- cset "name='rt5682 Stereo1 ADC L1 Mux' 1"
- cset "name='rt5682 Stereo1 ADC R1 Mux' 1"
- cset "name='rt5682 Stereo1 ADC MIXL ADC2 Switch' 0"
- cset "name='rt5682 Stereo1 ADC MIXR ADC2 Switch' 0"
- ]
- }
-}
+
+BootSequence [
+ cset "name='rt5682 Stereo1 DAC MIXL DAC L1 Switch' 1"
+ cset "name='rt5682 Stereo1 DAC MIXR DAC R1 Switch' 1"
+ cset "name='rt5682 DAC L Mux' 1"
+ cset "name='rt5682 DAC R Mux' 1"
+ cset "name='rt5682 IF1 01 ADC Swap Mux' 2"
+ cset "name='rt5682 CBJ Boost Volume' 3"
+ cset "name='rt5682 Stereo1 ADC L Mux' 0"
+ cset "name='rt5682 Stereo1 ADC R Mux' 0"
+ cset "name='rt5682 Stereo1 ADC L1 Mux' 1"
+ cset "name='rt5682 Stereo1 ADC R1 Mux' 1"
+ cset "name='rt5682 Stereo1 ADC MIXL ADC2 Switch' 0"
+ cset "name='rt5682 Stereo1 ADC MIXR ADC2 Switch' 0"
+]
diff --git a/ucm2/codecs/rt700/init.conf b/ucm2/codecs/rt700/init.conf
index c5be34fc6250..406e2cb3053d 100644
--- a/ucm2/codecs/rt700/init.conf
+++ b/ucm2/codecs/rt700/init.conf
@@ -1,17 +1,9 @@
# RT700 specific volume control settings
-If.rt700init {
- Condition {
- Type String
- Haystack "${CardComponents}"
- Needle "hs:rt700"
- }
- True {
- BootSequence [
- cset "name='DAC Front Playback Volume' 87"
- cset "name='HPO Mux' 'Front'"
- cset "name='ADC 09 Capture Volume' 63"
- cset "name='ADC 22 Mux' 'MIC2'"
- cset "name='AMIC Volume' 1"
- ]
- }
-}
+
+BootSequence [
+ cset "name='DAC Front Playback Volume' 87"
+ cset "name='HPO Mux' 'Front'"
+ cset "name='ADC 09 Capture Volume' 63"
+ cset "name='ADC 22 Mux' 'MIC2'"
+ cset "name='AMIC Volume' 1"
+]
diff --git a/ucm2/codecs/rt711/init.conf b/ucm2/codecs/rt711/init.conf
index c2b86296fa9e..f3cea28cd4d4 100644
--- a/ucm2/codecs/rt711/init.conf
+++ b/ucm2/codecs/rt711/init.conf
@@ -1,17 +1,9 @@
# RT711 specific volume control settings
-If.rt711init {
- Condition {
- Type String
- Haystack "${CardComponents}"
- Needle "hs:rt711"
- }
- True {
- BootSequence [
- cset "name='rt711 DAC Surr Playback Volume' 87"
- cset "name='rt711 ADC 08 Capture Volume' 63"
- cset "name='rt711 ADC 23 Mux' 'MIC2'"
- cset "name='rt711 ADC 08 Capture Switch' 1"
- cset "name='rt711 AMIC Volume' 1"
- ]
- }
-}
+
+BootSequence [
+ cset "name='rt711 DAC Surr Playback Volume' 87"
+ cset "name='rt711 ADC 08 Capture Volume' 63"
+ cset "name='rt711 ADC 23 Mux' 'MIC2'"
+ cset "name='rt711 ADC 08 Capture Switch' 1"
+ cset "name='rt711 AMIC Volume' 1"
+]
diff --git a/ucm2/codecs/rt715/init.conf b/ucm2/codecs/rt715/init.conf
index 745f4712ebc4..6e07b2df5a79 100644
--- a/ucm2/codecs/rt715/init.conf
+++ b/ucm2/codecs/rt715/init.conf
@@ -1,19 +1,10 @@
# RT715 specific volume control settings
-If.RT715init {
- Condition {
- Type String
- Haystack "${CardComponents}"
- Needle "mic:rt715"
- }
- True {
- BootSequence [
- cset "name='rt715 DMIC3 Boost' 2"
- cset "name='rt715 DMIC4 Boost' 2"
- cset "name='rt715 ADC 24 Mux' 3"
- cset "name='rt715 ADC 25 Mux' 4"
- cset "name='rt715 ADC 27 Capture Switch' 1"
- cset "name='rt715 ADC 07 Capture Switch' 1"
- ]
- }
-}
+BootSequence [
+ cset "name='rt715 DMIC3 Boost' 2"
+ cset "name='rt715 DMIC4 Boost' 2"
+ cset "name='rt715 ADC 24 Mux' 3"
+ cset "name='rt715 ADC 25 Mux' 4"
+ cset "name='rt715 ADC 27 Capture Switch' 1"
+ cset "name='rt715 ADC 07 Capture Switch' 1"
+]
diff --git a/ucm2/sof-soundwire/HiFi.conf b/ucm2/sof-soundwire/HiFi.conf
index 457cf6748346..f2240e8e31a8 100644
--- a/ucm2/sof-soundwire/HiFi.conf
+++ b/ucm2/sof-soundwire/HiFi.conf
@@ -1,8 +1,31 @@
# Use case Configuration for sof-soundwire card
-<sof-soundwire/RT700.conf>
-<sof-soundwire/RT711.conf>
-<sof-soundwire/RT5682.conf>
-<sof-soundwire/RT1308.conf>
-<sof-soundwire/RT715.conf>
+SectionVerb {
+ Value.TQ "HiFi"
+}
+
+If.spkdev {
+ Condition {
+ Type String
+ Empty "${var:SpeakerCodec1}"
+ }
+ False.Include.spkdev.File "/sof-soundwire/${var:SpeakerCodec1}-${var:SpeakerChannels1}.conf"
+}
+
+If.micdev {
+ Condition {
+ Type String
+ Empty "${var:MicCodec1}"
+ }
+ False.Include.micdev.File "/sof-soundwire/${var:MicCodec1}.conf"
+}
+
+If.hsdev {
+ Condition {
+ Type String
+ Empty "${var:HeadsetCodec1}"
+ }
+ False.Include.hsdev.File "/sof-soundwire/${var:HeadsetCodec1}.conf"
+}
+
<sof-soundwire/Hdmi.conf>
diff --git a/ucm2/sof-soundwire/RT1308-1.conf b/ucm2/sof-soundwire/RT1308-1.conf
deleted file mode 100644
index 6da5b7e30a5f..000000000000
--- a/ucm2/sof-soundwire/RT1308-1.conf
+++ /dev/null
@@ -1,22 +0,0 @@
-# Use case Configuration for sof-soundwire card
-
-SectionDevice."Speaker" {
- Comment "Speaker"
-
- EnableSequence [
- cset "name='rt1308-1 DAC L Switch' 1"
- cset "name='rt1308-1 DAC R Switch' 1"
- cset "name='Speaker Switch' on"
- ]
-
- DisableSequence [
- cset "name='rt1308-1 DAC L Switch' 0"
- cset "name='rt1308-1 DAC R Switch' 0"
- cset "name='Speaker Switch' off"
- ]
-
- Value {
- PlaybackPriority 100
- PlaybackPCM "hw:${CardId},2"
- }
-}
diff --git a/ucm2/sof-soundwire/RT1308-2.conf b/ucm2/sof-soundwire/RT1308-2.conf
deleted file mode 100644
index f88cb819d6a3..000000000000
--- a/ucm2/sof-soundwire/RT1308-2.conf
+++ /dev/null
@@ -1,29 +0,0 @@
-# Use case Configuration for sof-soundwire card
-
-SectionDevice."Speaker" {
- Comment "Speaker"
-
- EnableSequence [
- cset "name='rt1308-1 RX Channel Select' LL"
- cset "name='rt1308-2 RX Channel Select' RR"
-
- cset "name='rt1308-1 DAC L Switch' 1"
- cset "name='rt1308-1 DAC R Switch' 1"
- cset "name='rt1308-2 DAC L Switch' 1"
- cset "name='rt1308-2 DAC R Switch' 1"
- cset "name='Speaker Switch' on"
- ]
-
- DisableSequence [
- cset "name='rt1308-1 DAC L Switch' 0"
- cset "name='rt1308-1 DAC R Switch' 0"
- cset "name='rt1308-2 DAC L Switch' 0"
- cset "name='rt1308-2 DAC R Switch' 0"
- cset "name='Speaker Switch' off"
- ]
-
- Value {
- PlaybackPriority 100
- PlaybackPCM "hw:${CardId},2"
- }
-}
diff --git a/ucm2/sof-soundwire/RT1308.conf b/ucm2/sof-soundwire/RT1308.conf
deleted file mode 100644
index f8e36a3e20a4..000000000000
--- a/ucm2/sof-soundwire/RT1308.conf
+++ /dev/null
@@ -1,30 +0,0 @@
-# Use case Configuration for sof-soundwire card
-# alsaucm -c sof-soundwire set _verb HiFi set _enadev Speaker
-
-If.RT1308 {
- Condition {
- Type String
- Haystack "${CardComponents}"
- Needle "spk:rt1308"
- }
- True {
-
- If.2ch {
- Condition {
- Type String
- Haystack "${CardComponents}"
- Needle "cfg-spk:2"
- }
- True {
-
-<sof-soundwire/RT1308-1.conf>
-
- }
- False {
-
-<sof-soundwire/RT1308-2.conf>
-
- }
- }
- }
-}
diff --git a/ucm2/sof-soundwire/RT5682.conf b/ucm2/sof-soundwire/RT5682.conf
deleted file mode 100644
index 95a251dbe4fa..000000000000
--- a/ucm2/sof-soundwire/RT5682.conf
+++ /dev/null
@@ -1,60 +0,0 @@
-# Use case Configuration for sof-soundwire card
-
-If.RT5682 {
- Condition {
- Type String
- Haystack "${CardComponents}"
- Needle "hs:rt5682"
- }
- True {
-
- SectionDevice."Headphones" {
- Comment "Headphones"
-
- EnableSequence [
- cset "name='Headphone Switch' on"
- cset "name='rt5682 HPOL Playback Switch' 1"
- cset "name='rt5682 HPOR Playback Switch' 1"
- ]
-
- DisableSequence [
- cset "name='rt5682 HPOL Playback Switch' 0"
- cset "name='rt5682 HPOR Playback Switch' 0"
- cset "name='Headphone Switch' off"
-
- ]
-
- Value {
- PlaybackPriority 200
- PlaybackPCM "hw:${CardId}"
- JackControl "Headphone Jack"
- }
- }
-
- SectionDevice."Headset" {
- Comment "Headset Microphone"
-
- EnableSequence [
- cset "name='Headset Mic Switch' on"
- cset "name='rt5682 STO1 ADC Capture Switch' 1"
- cset "name='rt5682 RECMIX1L CBJ Switch' 1"
- cset "name='rt5682 Stereo1 ADC MIXL ADC1 Switch' 1"
- cset "name='rt5682 Stereo1 ADC MIXR ADC1 Switch' 1"
- ]
-
- DisableSequence [
- cset "name='rt5682 STO1 ADC Capture Switch' 0"
- cset "name='rt5682 RECMIX1L CBJ Switch' 0"
- cset "name='rt5682 Stereo1 ADC MIXL ADC1 Switch' 0"
- cset "name='rt5682 Stereo1 ADC MIXR ADC1 Switch' 0"
- cset "name='Headset Mic Switch' off"
- ]
-
- Value {
- CapturePriority 200
- CapturePCM "hw:${CardId},1"
- JackControl "Headset Mic Jack"
- }
- }
- }
-}
diff --git a/ucm2/sof-soundwire/RT700.conf b/ucm2/sof-soundwire/RT700.conf
deleted file mode 100644
index d2df46377710..000000000000
--- a/ucm2/sof-soundwire/RT700.conf
+++ /dev/null
@@ -1,72 +0,0 @@
-# Use case Configuration for sof-soundwire card
-
-If.RT700 {
- Condition {
- Type String
- Haystack "${CardComponents}"
- Needle "hs:rt700"
- }
- True {
-
- SectionDevice."Headphones" {
- Comment "Headphones"
-
- ConflictingDevice [
- "Speaker"
- ]
-
- EnableSequence [
- cset "name='Headphones Switch' on"
- ]
-
- DisableSequence [
- cset "name='Headphones Switch' off"
- ]
-
- Value {
- PlaybackPriority 200
- PlaybackPCM "hw:${CardId}"
- JackControl "Headphone Jack"
- }
- }
-
- SectionDevice."Speaker" {
- Comment "Speaker"
-
- ConflictingDevice [
- "Headphones"
- ]
-
- EnableSequence [
- cset "name='Speaker Switch' on"
- ]
-
- DisableSequence [
- cset "name='Speaker Switch' off"
- ]
-
- Value {
- PlaybackPriority 100
- PlaybackPCM "hw:${CardId}"
- }
- }
-
- SectionDevice."Headset" {
- Comment "Headset Microphone"
-
- EnableSequence [
- cset "name='ADC 09 Capture Switch' 1"
- ]
-
- DisableSequence [
- cset "name='ADC 09 Capture Switch' 0"
- ]
-
- Value {
- CapturePriority 200
- CapturePCM "hw:${CardId},1"
- JackControl "Headset Mic Jack"
- }
- }
- }
-}
diff --git a/ucm2/sof-soundwire/RT711.conf b/ucm2/sof-soundwire/RT711.conf
deleted file mode 100644
index 12b48ed4b4a8..000000000000
--- a/ucm2/sof-soundwire/RT711.conf
+++ /dev/null
@@ -1,49 +0,0 @@
-# Use case Configuration for sof-soundwire card
-
-If.RT711 {
- Condition {
- Type String
- Haystack "${CardComponents}"
- Needle "hs:rt711"
- }
- True {
-
- 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"
- }
- }
- }
-}
diff --git a/ucm2/sof-soundwire/RT715.conf b/ucm2/sof-soundwire/RT715.conf
deleted file mode 100644
index d1734adc4fb5..000000000000
--- a/ucm2/sof-soundwire/RT715.conf
+++ /dev/null
@@ -1,30 +0,0 @@
-# Use case Configuration for sof-soundwire card
-
-If.RT715 {
- Condition {
- Type String
- Haystack "${CardComponents}"
- Needle "mic:rt715"
- }
- True {
-
- SectionDevice."Mic" {
- Comment "SoundWire microphones"
-
- EnableSequence [
- cset "name='PGA5.0 5 Master Capture Switch' 1"
- ]
-
- DisableSequence [
- cset "name='PGA5.0 5 Master Capture Switch' 0"
- ]
-
- Value {
- CapturePriority 100
- CapturePCM "hw:${CardId},4"
- CaptureSwitch "PGA5.0 5 Master Capture Switch"
- CaptureVolume "PGA5.0 5 Master Capture Volume"
- }
- }
- }
-}
diff --git a/ucm2/sof-soundwire/rt1308-2.conf b/ucm2/sof-soundwire/rt1308-2.conf
new file mode 100644
index 000000000000..6da5b7e30a5f
--- /dev/null
+++ b/ucm2/sof-soundwire/rt1308-2.conf
@@ -0,0 +1,22 @@
+# Use case Configuration for sof-soundwire card
+
+SectionDevice."Speaker" {
+ Comment "Speaker"
+
+ EnableSequence [
+ cset "name='rt1308-1 DAC L Switch' 1"
+ cset "name='rt1308-1 DAC R Switch' 1"
+ cset "name='Speaker Switch' on"
+ ]
+
+ DisableSequence [
+ cset "name='rt1308-1 DAC L Switch' 0"
+ cset "name='rt1308-1 DAC R Switch' 0"
+ cset "name='Speaker Switch' off"
+ ]
+
+ Value {
+ PlaybackPriority 100
+ PlaybackPCM "hw:${CardId},2"
+ }
+}
diff --git a/ucm2/sof-soundwire/rt1308-4.conf b/ucm2/sof-soundwire/rt1308-4.conf
new file mode 100644
index 000000000000..f88cb819d6a3
--- /dev/null
+++ b/ucm2/sof-soundwire/rt1308-4.conf
@@ -0,0 +1,29 @@
+# Use case Configuration for sof-soundwire card
+
+SectionDevice."Speaker" {
+ Comment "Speaker"
+
+ EnableSequence [
+ cset "name='rt1308-1 RX Channel Select' LL"
+ cset "name='rt1308-2 RX Channel Select' RR"
+
+ cset "name='rt1308-1 DAC L Switch' 1"
+ cset "name='rt1308-1 DAC R Switch' 1"
+ cset "name='rt1308-2 DAC L Switch' 1"
+ cset "name='rt1308-2 DAC R Switch' 1"
+ cset "name='Speaker Switch' on"
+ ]
+
+ DisableSequence [
+ cset "name='rt1308-1 DAC L Switch' 0"
+ cset "name='rt1308-1 DAC R Switch' 0"
+ cset "name='rt1308-2 DAC L Switch' 0"
+ cset "name='rt1308-2 DAC R Switch' 0"
+ cset "name='Speaker Switch' off"
+ ]
+
+ Value {
+ PlaybackPriority 100
+ PlaybackPCM "hw:${CardId},2"
+ }
+}
diff --git a/ucm2/sof-soundwire/rt5682.conf b/ucm2/sof-soundwire/rt5682.conf
new file mode 100644
index 000000000000..092ac9c89012
--- /dev/null
+++ b/ucm2/sof-soundwire/rt5682.conf
@@ -0,0 +1,50 @@
+# Use case Configuration for sof-soundwire card
+
+SectionDevice."Headphones" {
+ Comment "Headphones"
+
+ EnableSequence [
+ cset "name='Headphone Switch' on"
+ cset "name='rt5682 HPOL Playback Switch' 1"
+ cset "name='rt5682 HPOR Playback Switch' 1"
+ ]
+
+ DisableSequence [
+ cset "name='rt5682 HPOL Playback Switch' 0"
+ cset "name='rt5682 HPOR Playback Switch' 0"
+ cset "name='Headphone Switch' off"
+
+ ]
+
+ Value {
+ PlaybackPriority 200
+ PlaybackPCM "hw:${CardId}"
+ JackControl "Headphone Jack"
+ }
+}
+
+SectionDevice."Headset" {
+ Comment "Headset Microphone"
+
+ EnableSequence [
+ cset "name='Headset Mic Switch' on"
+ cset "name='rt5682 STO1 ADC Capture Switch' 1"
+ cset "name='rt5682 RECMIX1L CBJ Switch' 1"
+ cset "name='rt5682 Stereo1 ADC MIXL ADC1 Switch' 1"
+ cset "name='rt5682 Stereo1 ADC MIXR ADC1 Switch' 1"
+ ]
+
+ DisableSequence [
+ cset "name='rt5682 STO1 ADC Capture Switch' 0"
+ cset "name='rt5682 RECMIX1L CBJ Switch' 0"
+ cset "name='rt5682 Stereo1 ADC MIXL ADC1 Switch' 0"
+ cset "name='rt5682 Stereo1 ADC MIXR ADC1 Switch' 0"
+ cset "name='Headset Mic Switch' off"
+ ]
+
+ Value {
+ CapturePriority 200
+ CapturePCM "hw:${CardId},1"
+ JackControl "Headset Mic Jack"
+ }
+}
diff --git a/ucm2/sof-soundwire/rt700.conf b/ucm2/sof-soundwire/rt700.conf
new file mode 100644
index 000000000000..ab647f7f9670
--- /dev/null
+++ b/ucm2/sof-soundwire/rt700.conf
@@ -0,0 +1,62 @@
+# Use case Configuration for sof-soundwire card
+
+SectionDevice."Headphones" {
+ Comment "Headphones"
+
+ ConflictingDevice [
+ "Speaker"
+ ]
+
+ EnableSequence [
+ cset "name='Headphones Switch' on"
+ ]
+
+ DisableSequence [
+ cset "name='Headphones Switch' off"
+ ]
+
+ Value {
+ PlaybackPriority 200
+ PlaybackPCM "hw:${CardId}"
+ JackControl "Headphone Jack"
+ }
+}
+
+SectionDevice."Speaker" {
+ Comment "Speaker"
+
+ ConflictingDevice [
+ "Headphones"
+ ]
+
+ EnableSequence [
+ cset "name='Speaker Switch' on"
+ ]
+
+ DisableSequence [
+ cset "name='Speaker Switch' off"
+ ]
+
+ Value {
+ PlaybackPriority 100
+ PlaybackPCM "hw:${CardId}"
+ }
+}
+
+SectionDevice."Headset" {
+ Comment "Headset Microphone"
+
+ EnableSequence [
+ cset "name='ADC 09 Capture Switch' 1"
+ ]
+
+ DisableSequence [
+ cset "name='ADC 09 Capture Switch' 0"
+ ]
+
+ Value {
+ CapturePriority 200
+ CapturePCM "hw:${CardId},1"
+ JackControl "Headset Mic Jack"
+ }
+}
diff --git a/ucm2/sof-soundwire/rt711.conf b/ucm2/sof-soundwire/rt711.conf
new file mode 100644
index 000000000000..5300cf99797b
--- /dev/null
+++ b/ucm2/sof-soundwire/rt711.conf
@@ -0,0 +1,39 @@
+# 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"
+ }
+}
diff --git a/ucm2/sof-soundwire/rt715.conf b/ucm2/sof-soundwire/rt715.conf
new file mode 100644
index 000000000000..7b8ca594aa43
--- /dev/null
+++ b/ucm2/sof-soundwire/rt715.conf
@@ -0,0 +1,20 @@
+# Use case Configuration for sof-soundwire card
+
+SectionDevice."Mic" {
+ Comment "SoundWire microphones"
+
+ EnableSequence [
+ cset "name='PGA5.0 5 Master Capture Switch' 1"
+ ]
+
+ DisableSequence [
+ cset "name='PGA5.0 5 Master Capture Switch' 0"
+ ]
+
+ Value {
+ CapturePriority 100
+ CapturePCM "hw:${CardId},4"
+ CaptureSwitch "PGA5.0 5 Master Capture Switch"
+ CaptureVolume "PGA5.0 5 Master Capture Volume"
+ }
+}
diff --git a/ucm2/sof-soundwire/sof-soundwire.conf b/ucm2/sof-soundwire/sof-soundwire.conf
index 565f2b5092da..fe43d5f81d57 100644
--- a/ucm2/sof-soundwire/sof-soundwire.conf
+++ b/ucm2/sof-soundwire/sof-soundwire.conf
@@ -1,11 +1,55 @@
-Syntax 2
+Syntax 3
SectionUseCase."HiFi" {
File "HiFi.conf"
Comment "Play HiFi quality Music"
}
-<codecs/rt5682/init.conf>
-<codecs/rt700/init.conf>
-<codecs/rt711/init.conf>
-<codecs/rt715/init.conf>
+Define {
+ SpeakerCodec1 ""
+ SpeakerChannels1 "2"
+ SpeakerAmps1 "0"
+ HeadsetCodec1 ""
+ MicCodec1 ""
+}
+
+DefineRegex {
+ SpeakerCodec {
+ Regex " spk:([a-z0-9]+)"
+ String "${CardComponents}"
+ }
+ SpeakerChannels {
+ Regex " cfg-spk:([0-9]+)"
+ String "${CardComponents}"
+ }
+ SpeakerAmps {
+ Regex " cfg-amp:([0-9]+)"
+ String "${CardComponents}"
+ }
+ HeadsetCodec {
+ Regex " hs:([a-z0-9]+)"
+ String "${CardComponents}"
+ }
+ MicCodec {
+ Regex " mic:([a-z0-9]+)"
+ String "${CardComponents}"
+ }
+}
+
+If.hs_init {
+ Condition {
+ Type Regex
+ Regex "(rt5682|rt700|rt711)"
+ String "${var:HeadsetCodec1}"
+ }
+ True.Include.hs_init.File "/codecs/${var:HeadsetCodec1}/init.conf"
+}
+
+If.mic_init {
+ Condition {
+ Type Regex
+ Regex "(rt715)"
+ String "${var:MicCodec1}"
+ }
+ True.Include.mic_init.File "/codecs/${var:MicCodec1}/init.conf"
+}
--
2.16.4