alsa-ucm-conf/0019-HDA-Intel-add-support-for-AMD-acp-microphone-devices.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

674 lines
14 KiB
Diff

From dcef48f13d4f5db79b006755074940b94730a883 Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <perex@perex.cz>
Date: Wed, 24 Jun 2020 13:39:07 +0200
Subject: [PATCH 19/51] HDA-Intel: add support for AMD acp microphone devices
- move the generic HDA code from sof-hda-dsp to HDA-Intel
- add generic codecs/hda/hdmi.conf
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
---
ucm2/HDA-Intel/HDA-Capture-value.conf | 4 +
ucm2/HDA-Intel/HDA-Intel.conf | 28 +++++++
ucm2/HDA-Intel/Hdmi.conf | 37 +++++++++
ucm2/HDA-Intel/HiFi-acp.conf | 8 ++
ucm2/HDA-Intel/HiFi-analog.conf | 133 +++++++++++++++++++++++++++++++
ucm2/HDA-Intel/HiFi.conf | 32 ++++++++
ucm2/HDA-Intel/init.conf | 39 +++++++++
ucm2/codecs/hda/hdmi.conf | 25 ++++++
ucm2/module/lib/linked.conf | 3 +
ucm2/module/snd_acp3x_rn.conf | 1 +
ucm2/sof-hda-dsp/HDA-Capture-value.conf | 4 -
ucm2/sof-hda-dsp/Hdmi.conf | 78 +++++-------------
ucm2/sof-hda-dsp/HiFi.conf | 135 +-------------------------------
13 files changed, 331 insertions(+), 196 deletions(-)
create mode 100644 ucm2/HDA-Intel/HDA-Capture-value.conf
create mode 100644 ucm2/HDA-Intel/HDA-Intel.conf
create mode 100644 ucm2/HDA-Intel/Hdmi.conf
create mode 100644 ucm2/HDA-Intel/HiFi-acp.conf
create mode 100644 ucm2/HDA-Intel/HiFi-analog.conf
create mode 100644 ucm2/HDA-Intel/HiFi.conf
create mode 100644 ucm2/HDA-Intel/init.conf
create mode 100644 ucm2/codecs/hda/hdmi.conf
create mode 100644 ucm2/module/lib/linked.conf
create mode 120000 ucm2/module/snd_acp3x_rn.conf
delete mode 100644 ucm2/sof-hda-dsp/HDA-Capture-value.conf
diff --git a/ucm2/HDA-Intel/HDA-Capture-value.conf b/ucm2/HDA-Intel/HDA-Capture-value.conf
new file mode 100644
index 000000000000..2f1316ab753f
--- /dev/null
+++ b/ucm2/HDA-Intel/HDA-Capture-value.conf
@@ -0,0 +1,4 @@
+CapturePCM "hw:${CardId}"
+CaptureMixerElem "Capture"
+CaptureVolume "Capture Volume"
+CaptureSwitch "Capture Switch"
diff --git a/ucm2/HDA-Intel/HDA-Intel.conf b/ucm2/HDA-Intel/HDA-Intel.conf
new file mode 100644
index 000000000000..109eea6454aa
--- /dev/null
+++ b/ucm2/HDA-Intel/HDA-Intel.conf
@@ -0,0 +1,28 @@
+Syntax 3
+
+Define.Use "" # a non-empty string to use UCM configuration for HDA devices
+
+Define.AcpCardId "$${CardIdByName:acp}"
+
+If.acp {
+ Condition {
+ Type String
+ Empty "${var:AcpCardId}"
+ }
+ False.Define.Use y
+}
+
+If.use {
+ Condition {
+ Type String
+ Empty "${var:Use}"
+ }
+ False {
+ SectionUseCase."HiFi" {
+ File "HiFi.conf"
+ Comment "Play HiFi quality Music"
+ }
+
+ Include.init.File "/HDA-Intel/init.conf"
+ }
+}
diff --git a/ucm2/HDA-Intel/Hdmi.conf b/ucm2/HDA-Intel/Hdmi.conf
new file mode 100644
index 000000000000..8b1843b91e6b
--- /dev/null
+++ b/ucm2/HDA-Intel/Hdmi.conf
@@ -0,0 +1,37 @@
+# Use case Configuration for sof-hda-dsp
+
+If.hdmi1 {
+ Condition { Type String Empty "" }
+ True {
+ Define {
+ HdmiNum 1
+ HdmiPCM 3
+ HdmiPrio 500
+ }
+ Include.hdmi1.File "/codecs/hda/hdmi.conf"
+ }
+}
+
+If.hdmi2 {
+ Condition { Type String Empty "" }
+ True {
+ Define {
+ HdmiNum 2
+ HdmiPCM 7
+ HdmiPrio 600
+ }
+ Include.hdmi2.File "/codecs/hda/hdmi.conf"
+ }
+}
+
+If.hdmi3 {
+ Condition { Type String Empty "" }
+ True {
+ Define {
+ HdmiNum 3
+ HdmiPCM 8
+ HdmiPrio 700
+ }
+ Include.hdmi3.File "/codecs/hda/hdmi.conf"
+ }
+}
diff --git a/ucm2/HDA-Intel/HiFi-acp.conf b/ucm2/HDA-Intel/HiFi-acp.conf
new file mode 100644
index 000000000000..123ae15f0406
--- /dev/null
+++ b/ucm2/HDA-Intel/HiFi-acp.conf
@@ -0,0 +1,8 @@
+SectionDevice."Mic1" {
+ Comment "Digital Microphone"
+
+ Value {
+ CapturePriority 100
+ CapturePCM "hw:${var:AcpCardId}"
+ }
+}
diff --git a/ucm2/HDA-Intel/HiFi-analog.conf b/ucm2/HDA-Intel/HiFi-analog.conf
new file mode 100644
index 000000000000..1143a6758f87
--- /dev/null
+++ b/ucm2/HDA-Intel/HiFi-analog.conf
@@ -0,0 +1,133 @@
+# Generic HDA devices for analog I/O
+
+SectionDevice."Headphones" {
+ Comment "Headphones"
+
+ If.headphone_switch {
+ Condition {
+ Type ControlExists
+ Control "name='Headphone Playback Switch'"
+ }
+ True {
+ EnableSequence [
+ cset "name='Headphone Playback Switch' on"
+ ]
+ DisableSequence [
+ cset "name='Headphone Playback Switch' off"
+ ]
+ }
+ }
+
+ Value {
+ PlaybackPriority 200
+ PlaybackPCM "hw:${CardId}"
+ PlaybackMixerElem "Headphone"
+ PlaybackMasterElem "Master"
+ PlaybackVolume "Headphone Playback Volume"
+ PlaybackSwitch "Headphone Playback Switch"
+ If.jack {
+ Condition {
+ Type ControlExists
+ Control "iface=CARD,name='Headphone Mic Jack'"
+ }
+ True {
+ JackControl "Headphone Mic Jack"
+ }
+ False {
+ JackControl "Headphone Jack"
+ }
+ }
+ }
+}
+
+SectionDevice."Speaker" {
+ Comment "Speaker"
+
+ If.seq {
+ Condition {
+ Type ControlExists
+ Control "name='Bass Speaker Playback Switch'"
+ }
+ True {
+ EnableSequence [
+ cset "name='Speaker Playback Switch' on"
+ cset "name='Bass Speaker Playback Switch' on"
+ ]
+
+ DisableSequence [
+ cset "name='Speaker Playback Switch' off"
+ cset "name='Bass Speaker Playback Switch' off"
+ ]
+ }
+ False {
+ EnableSequence [
+ cset "name='Speaker Playback Switch' on"
+ ]
+
+ DisableSequence [
+ cset "name='Speaker Playback Switch' off"
+ ]
+ }
+ }
+
+ Value {
+ PlaybackPriority 100
+ PlaybackPCM "hw:${CardId}"
+ PlaybackMixerElem "Speaker"
+ PlaybackMasterElem "Master"
+ PlaybackVolume "Speaker Playback Volume"
+ PlaybackSwitch "Speaker Playback Switch"
+ }
+}
+
+If.monomic {
+ Condition {
+ Type ControlExists
+ Control "name='Input Source'"
+ ControlEnum "Headphone Mic"
+ }
+ True {
+ SectionDevice."Mic2" {
+ Comment "Headphones Stereo Microphone"
+
+ ConflictingDevice [
+ "Headset"
+ ]
+
+ EnableSequence [
+ cset "name='Input Source' 'Headphone Mic'"
+ ]
+
+ Value {
+ CapturePriority 200
+ Include.value.File "/HDA-Intel/HDA-Capture-value.conf"
+ JackControl "Headphone Mic Jack"
+ }
+ }
+
+ SectionDevice."Headset" {
+ Comment "Headset Mono Microphone"
+
+ EnableSequence [
+ cset "name='Input Source' 'Headset Mic'"
+ ]
+
+ Value {
+ CapturePriority 300
+ Include.value.File "/HDA-Intel/HDA-Capture-value.conf"
+ JackControl "Headphone Mic Jack"
+ }
+ }
+ }
+ False {
+ SectionDevice."Mic2" {
+ Comment "Headphones Stereo Microphone"
+
+ Value {
+ CapturePriority 200
+ Include.value.File "/HDA-Intel/HDA-Capture-value.conf"
+ JackControl "Mic Jack"
+ }
+ }
+ }
+}
diff --git a/ucm2/HDA-Intel/HiFi.conf b/ucm2/HDA-Intel/HiFi.conf
new file mode 100644
index 000000000000..2d18c9ed627a
--- /dev/null
+++ b/ucm2/HDA-Intel/HiFi.conf
@@ -0,0 +1,32 @@
+# Use case Configuration for sof-hda-dsp
+
+SectionVerb {
+ Value.TQ "HiFi"
+}
+
+If.analog {
+ Condition {
+ Type ControlExists
+ Control "name='Master Playback Switch'"
+ }
+ True.Include.analog.File "/HDA-Intel/HiFi-analog.conf"
+}
+
+If.hdmi {
+ Condition { Type String Empty "" }
+ True.Include.hdmi.File "/HDA-Intel/Hdmi.conf"
+}
+
+If.acp {
+ Condition {
+ Type String
+ Empty "${var:AcpCardId}"
+ }
+ True {
+ RenameDevice."Mic1" "Mic"
+ }
+ False.Include.acp {
+ Before.SectionDevice "Mic1"
+ File "/HDA-Intel/HiFi-acp.conf"
+ }
+}
diff --git a/ucm2/HDA-Intel/init.conf b/ucm2/HDA-Intel/init.conf
new file mode 100644
index 000000000000..1a351a9cb3d5
--- /dev/null
+++ b/ucm2/HDA-Intel/init.conf
@@ -0,0 +1,39 @@
+If.amute {
+ Condition {
+ Type ControlExists
+ Control "name='Auto-Mute Mode'"
+ }
+ True.BootSequence [
+ cset "name='Auto-Mute Mode' off"
+ ]
+}
+
+If.master {
+ Condition {
+ Type ControlExists
+ Control "name='Master Playback Volume'"
+ }
+ True.BootSequence [
+ cset "name='Master Playback Volume' 60%"
+ ]
+}
+
+If.speaker {
+ Condition {
+ Type ControlExists
+ Control "name='Speaker Playback Volume'"
+ }
+ True.BootSequence [
+ cset "name='Speaker Playback Volume' 60%"
+ ]
+}
+
+If.headphone {
+ Condition {
+ Type ControlExists
+ Control "name='Headphone Playback Volume'"
+ }
+ True.BootSequence [
+ cset "name='Headphone Playback Volume' 60%"
+ ]
+}
diff --git a/ucm2/codecs/hda/hdmi.conf b/ucm2/codecs/hda/hdmi.conf
new file mode 100644
index 000000000000..c22f61521756
--- /dev/null
+++ b/ucm2/codecs/hda/hdmi.conf
@@ -0,0 +1,25 @@
+If.hdmi {
+ Condition {
+ Type ControlExists
+ Control "iface=CARD,name='HDMI/DP,pcm=${var:HdmiPCM} Jack'"
+ }
+ True {
+ SectionDevice."HDMI${var:HdmiNum}" {
+ Comment "HDMI${var:HdmiNum}/${var:HdmiNum} Output"
+
+ EnableSequence [
+ cset "name='IEC958 Playback Switch' on"
+ ]
+
+ DisableSequence [
+ cset "name='IEC958 Playback Switch' off"
+ ]
+
+ Value {
+ PlaybackPriority "${var:HdmiPrio}"
+ PlaybackPCM "hw:${CardId},${var:HdmiPCM}"
+ JackControl "HDMI/DP,pcm=${var:HdmiPCM} Jack"
+ }
+ }
+ }
+}
diff --git a/ucm2/module/lib/linked.conf b/ucm2/module/lib/linked.conf
new file mode 100644
index 000000000000..d7656a8806f1
--- /dev/null
+++ b/ucm2/module/lib/linked.conf
@@ -0,0 +1,3 @@
+ValueDefaults {
+ Linked 1
+}
diff --git a/ucm2/module/snd_acp3x_rn.conf b/ucm2/module/snd_acp3x_rn.conf
new file mode 120000
index 000000000000..b56794a7bc1f
--- /dev/null
+++ b/ucm2/module/snd_acp3x_rn.conf
@@ -0,0 +1 @@
+lib/linked.conf
\ No newline at end of file
diff --git a/ucm2/sof-hda-dsp/HDA-Capture-value.conf b/ucm2/sof-hda-dsp/HDA-Capture-value.conf
deleted file mode 100644
index 2f1316ab753f..000000000000
--- a/ucm2/sof-hda-dsp/HDA-Capture-value.conf
+++ /dev/null
@@ -1,4 +0,0 @@
-CapturePCM "hw:${CardId}"
-CaptureMixerElem "Capture"
-CaptureVolume "Capture Volume"
-CaptureSwitch "Capture Switch"
diff --git a/ucm2/sof-hda-dsp/Hdmi.conf b/ucm2/sof-hda-dsp/Hdmi.conf
index 6f2c4aa99db2..480e2d6f4203 100644
--- a/ucm2/sof-hda-dsp/Hdmi.conf
+++ b/ucm2/sof-hda-dsp/Hdmi.conf
@@ -1,79 +1,37 @@
# Use case Configuration for sof-hda-dsp
If.hdmi1 {
- Condition {
- Type ControlExists
- Control "iface=CARD,name='HDMI/DP,pcm=3 Jack'"
- }
+ Condition { Type String Empty "" }
True {
- SectionDevice."HDMI1" {
- Comment "HDMI1/DP1 Output"
-
- EnableSequence [
- cset "name='IEC958 Playback Switch' on"
- ]
-
- DisableSequence [
- cset "name='IEC958 Playback Switch' off"
- ]
-
- Value {
- PlaybackPriority 500
- PlaybackPCM "hw:${CardId},3"
- JackControl "HDMI/DP,pcm=3 Jack"
- }
+ Define {
+ HdmiNum 1
+ HdmiPCM 3
+ HdmiPrio 500
}
+ Include.hdmi1.File "/codec/hda/hdmi.conf"
}
}
If.hdmi2 {
- Condition {
- Type ControlExists
- Control "iface=CARD,name='HDMI/DP,pcm=4 Jack'"
- }
+ Condition { Type String Empty "" }
True {
- SectionDevice."HDMI2" {
- Comment "HDMI2/DP2 Output"
-
- EnableSequence [
- cset "name='IEC958 Playback Switch',index=1 on"
- ]
-
- DisableSequence [
- cset "name='IEC958 Playback Switch',index=1 off"
- ]
-
- Value {
- PlaybackPriority 600
- PlaybackPCM "hw:${CardId},4"
- JackControl "HDMI/DP,pcm=4 Jack"
- }
+ Define {
+ HdmiNum 2
+ HdmiPCM 4
+ HdmiPrio 600
}
+ Include.hdmi2.File "/codec/hda/hdmi.conf"
}
}
If.hdmi3 {
- Condition {
- Type ControlExists
- Control "iface=CARD,name='HDMI/DP,pcm=5 Jack'"
- }
+ Condition { Type String Empty "" }
True {
- SectionDevice."HDMI3" {
- Comment "HDMI3/DP3 Output"
-
- EnableSequence [
- cset "name='IEC958 Playback Switch',index=2 on"
- ]
-
- DisableSequence [
- cset "name='IEC958 Playback Switch',index=2 off"
- ]
-
- Value {
- PlaybackPriority 700
- PlaybackPCM "hw:${CardId},5"
- JackControl "HDMI/DP,pcm=5 Jack"
- }
+ Define {
+ HdmiNum 3
+ HdmiPCM 5
+ HdmiPrio 700
}
+ Include.hdmi3.File "/codec/hda/hdmi.conf"
}
}
diff --git a/ucm2/sof-hda-dsp/HiFi.conf b/ucm2/sof-hda-dsp/HiFi.conf
index 62358e26edb5..0f221b79ce21 100644
--- a/ucm2/sof-hda-dsp/HiFi.conf
+++ b/ucm2/sof-hda-dsp/HiFi.conf
@@ -4,138 +4,9 @@ SectionVerb {
Value.TQ "HiFi"
}
-SectionDevice."Headphones" {
- Comment "Headphones"
+<HDA-Intel/HiFi-analog.conf>
- If.headphone_switch {
- Condition {
- Type ControlExists
- Control "name='Headphone Playback Switch'"
- }
- True {
- EnableSequence [
- cset "name='Headphone Playback Switch' on"
- ]
- DisableSequence [
- cset "name='Headphone Playback Switch' off"
- ]
- }
- }
-
- Value {
- PlaybackPriority 200
- PlaybackPCM "hw:${CardId}"
- PlaybackMixerElem "Headphone"
- PlaybackMasterElem "Master"
- PlaybackVolume "Headphone Playback Volume"
- PlaybackSwitch "Headphone Playback Switch"
- If.jack {
- Condition {
- Type ControlExists
- Control "iface=CARD,name='Headphone Mic Jack'"
- }
- True {
- JackControl "Headphone Mic Jack"
- }
- False {
- JackControl "Headphone Jack"
- }
- }
- }
-}
-
-SectionDevice."Speaker" {
- Comment "Speaker"
-
- If.seq {
- Condition {
- Type ControlExists
- Control "name='Bass Speaker Playback Switch'"
- }
- True {
- EnableSequence [
- cset "name='Speaker Playback Switch' on"
- cset "name='Bass Speaker Playback Switch' on"
- ]
-
- DisableSequence [
- cset "name='Speaker Playback Switch' off"
- cset "name='Bass Speaker Playback Switch' off"
- ]
- }
- False {
- EnableSequence [
- cset "name='Speaker Playback Switch' on"
- ]
-
- DisableSequence [
- cset "name='Speaker Playback Switch' off"
- ]
- }
- }
-
- Value {
- PlaybackPriority 100
- PlaybackPCM "hw:${CardId}"
- PlaybackMixerElem "Speaker"
- PlaybackMasterElem "Master"
- PlaybackVolume "Speaker Playback Volume"
- PlaybackSwitch "Speaker Playback Switch"
- }
-}
-
-If.monomic {
- Condition {
- Type ControlExists
- Control "name='Input Source'"
- ControlEnum "Headphone Mic"
- }
- After.SectionDevice "Mic1"
- True {
- SectionDevice."Mic2" {
- Comment "Headphones Stereo Microphone"
-
- ConflictingDevice [
- "Headset"
- ]
-
- EnableSequence [
- cset "name='Input Source' 'Headphone Mic'"
- ]
-
- Value {
- CapturePriority 200
- Include.value.File "HDA-Capture-value.conf"
- JackControl "Headphone Mic Jack"
- }
- }
-
- SectionDevice."Headset" {
- Comment "Headset Mono Microphone"
-
- EnableSequence [
- cset "name='Input Source' Headset Mic"
- ]
-
- Value {
- CapturePriority 300
- Include.value.File "HDA-Capture-value.conf"
- JackControl "Headphone Mic Jack"
- }
- }
- }
- False {
- SectionDevice."Mic2" {
- Comment "Headphones Stereo Microphone"
-
- Value {
- CapturePriority 200
- Include.value.File "HDA-Capture-value.conf"
- JackControl "Mic Jack"
- }
- }
- }
-}
+If.monomic.After.SectionDevice "Mic1"
SectionDevice."Mic1" {
Comment "Digital Microphone"
@@ -172,4 +43,4 @@ SectionDevice."Mic1" {
}
}
-<sof-hda-dsp/Hdmi.conf>
+<HDA-Intel/Hdmi.conf>
--
2.16.4