Blame SOURCES/alsa-ucm-git.patch

f29710
From 33be660e4b1e75c19d5332556c3d2636dd3344bf Mon Sep 17 00:00:00 2001
f29710
From: Jaroslav Kysela <perex@perex.cz>
f29710
Date: Mon, 2 Nov 2020 16:44:51 +0100
f29710
Subject: [PATCH 01/24] fix the ucm2/codecs/hda/hdmi.conf use
f29710
f29710
The mentioned commit (dcef48f13d) removed the index for the IEC958 on/off
f29710
control which made the HDMI 2+ outputs silent.
f29710
f29710
Fixes: dcef48f13d ("HDA-Intel: add support for AMD acp microphone devices")
f29710
BugLink: https://github.com/alsa-project/alsa-lib/issues/95
f29710
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
f29710
---
f29710
 ucm2/HDA-Intel/Hdmi.conf   | 8 +++++++-
f29710
 ucm2/codecs/hda/hdmi.conf  | 4 ++--
f29710
 ucm2/sof-hda-dsp/Hdmi.conf | 3 +++
f29710
 3 files changed, 12 insertions(+), 3 deletions(-)
f29710
c4a1f5
diff --git a/ucm2/HDA-Intel/Hdmi.conf b/ucm2/HDA-Intel/Hdmi.conf
c4a1f5
index c8b6e77..c533e49 100644
c4a1f5
--- a/ucm2/HDA-Intel/Hdmi.conf
c4a1f5
+++ b/ucm2/HDA-Intel/Hdmi.conf
c4a1f5
@@ -6,6 +6,7 @@ If.hdmi1 {
c4a1f5
 		Define {
c4a1f5
 			HdmiNum 1
c4a1f5
 			HdmiPCM 3
c4a1f5
+			HdmiCtlIndex 0
c4a1f5
 			HdmiPrio 1100
c4a1f5
 		}
c4a1f5
 		Include.hdmi1.File "/codecs/hda/hdmi.conf"
c4a1f5
@@ -18,6 +19,7 @@ If.hdmi2 {
c4a1f5
 		Define {
c4a1f5
 			HdmiNum 2
c4a1f5
 			HdmiPCM 7
c4a1f5
+			HdmiCtlIndex 1
c4a1f5
 			HdmiPrio 1200
c4a1f5
 		}
c4a1f5
 		Include.hdmi2.File "/codecs/hda/hdmi.conf"
c4a1f5
@@ -30,6 +32,7 @@ If.hdmi3 {
c4a1f5
 		Define {
c4a1f5
 			HdmiNum 3
c4a1f5
 			HdmiPCM 8
c4a1f5
+			HdmiCtlIndex 2
c4a1f5
 			HdmiPrio 1300
c4a1f5
 		}
c4a1f5
 		Include.hdmi3.File "/codecs/hda/hdmi.conf"
c4a1f5
@@ -42,6 +45,7 @@ If.hdmi4 {
c4a1f5
 		Define {
c4a1f5
 			HdmiNum 4
c4a1f5
 			HdmiPCM 9
c4a1f5
+			HdmiCtlIndex 3
c4a1f5
 			HdmiPrio 1400
c4a1f5
 		}
c4a1f5
 		Include.hdmi4.File "/codecs/hda/hdmi.conf"
c4a1f5
@@ -54,6 +58,7 @@ If.hdmi5 {
c4a1f5
 		Define {
c4a1f5
 			HdmiNum 5
c4a1f5
 			HdmiPCM 10
c4a1f5
+			HdmiCtlIndex 4
c4a1f5
 			HdmiPrio 1500
c4a1f5
 		}
c4a1f5
 		Include.hdmi5.File "/codecs/hda/hdmi.conf"
c4a1f5
@@ -66,8 +71,9 @@ If.hdmi6 {
c4a1f5
 		Define {
c4a1f5
 			HdmiNum 6
c4a1f5
 			HdmiPCM 11
c4a1f5
+			HdmiCtlIndex 5
c4a1f5
 			HdmiPrio 1600
c4a1f5
 		}
c4a1f5
-		Include.hdmi5.File "/codecs/hda/hdmi.conf"
c4a1f5
+		Include.hdmi6.File "/codecs/hda/hdmi.conf"
c4a1f5
 	}
c4a1f5
 }
c4a1f5
diff --git a/ucm2/codecs/hda/hdmi.conf b/ucm2/codecs/hda/hdmi.conf
f29710
index ba80fef..32a77f4 100644
c4a1f5
--- a/ucm2/codecs/hda/hdmi.conf
c4a1f5
+++ b/ucm2/codecs/hda/hdmi.conf
f29710
@@ -8,11 +8,11 @@ If.hdmi {
f29710
 			Comment "HDMI${var:HdmiNum} Output"
c4a1f5
 
c4a1f5
 			EnableSequence [
c4a1f5
-				cset "name='IEC958 Playback Switch' on"
c4a1f5
+				cset "name='IEC958 Playback Switch',index=${var:HdmiCtlIndex} on"
c4a1f5
 			]
c4a1f5
 
c4a1f5
 			DisableSequence [
c4a1f5
-				cset "name='IEC958 Playback Switch' off"
c4a1f5
+				cset "name='IEC958 Playback Switch',index=${var:HdmiCtlIndex} off"
c4a1f5
 			]
c4a1f5
 
c4a1f5
 			Value {
c4a1f5
diff --git a/ucm2/sof-hda-dsp/Hdmi.conf b/ucm2/sof-hda-dsp/Hdmi.conf
c4a1f5
index 7b777d1..1726567 100644
c4a1f5
--- a/ucm2/sof-hda-dsp/Hdmi.conf
c4a1f5
+++ b/ucm2/sof-hda-dsp/Hdmi.conf
c4a1f5
@@ -6,6 +6,7 @@ If.hdmi1 {
c4a1f5
 		Define {
c4a1f5
 			HdmiNum 1
c4a1f5
 			HdmiPCM 3
c4a1f5
+			HdmiCtlIndex 0
c4a1f5
 			HdmiPrio 500
c4a1f5
 		}
c4a1f5
 		Include.hdmi1.File "/codecs/hda/hdmi.conf"
c4a1f5
@@ -18,6 +19,7 @@ If.hdmi2 {
c4a1f5
 		Define {
c4a1f5
 			HdmiNum 2
c4a1f5
 			HdmiPCM 4
c4a1f5
+			HdmiCtlIndex 1
c4a1f5
 			HdmiPrio 600
c4a1f5
 		}
c4a1f5
 		Include.hdmi2.File "/codecs/hda/hdmi.conf"
c4a1f5
@@ -30,6 +32,7 @@ If.hdmi3 {
c4a1f5
 		Define {
c4a1f5
 			HdmiNum 3
c4a1f5
 			HdmiPCM 5
c4a1f5
+			HdmiCtlIndex 2
c4a1f5
 			HdmiPrio 700
c4a1f5
 		}
c4a1f5
 		Include.hdmi3.File "/codecs/hda/hdmi.conf"
f29710
-- 
f29710
2.29.2
f29710
f29710
f29710
From f8c2428ccc42488c5e96801cce9f7e28080ecb71 Mon Sep 17 00:00:00 2001
f29710
From: Jaroslav Kysela <perex@perex.cz>
f29710
Date: Mon, 2 Nov 2020 18:15:14 +0100
f29710
Subject: [PATCH 02/24] codecs/hda/hdmi.conf - add DisplayPort to the device
f29710
 description (Comment)
f29710
f29710
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
f29710
---
f29710
 ucm2/codecs/hda/hdmi.conf | 2 +-
f29710
 1 file changed, 1 insertion(+), 1 deletion(-)
f29710
f29710
diff --git a/ucm2/codecs/hda/hdmi.conf b/ucm2/codecs/hda/hdmi.conf
f29710
index 32a77f4..c7b7ba4 100644
f29710
--- a/ucm2/codecs/hda/hdmi.conf
f29710
+++ b/ucm2/codecs/hda/hdmi.conf
f29710
@@ -5,7 +5,7 @@ If.hdmi {
c4a1f5
 	}
f29710
 	True {
f29710
 		SectionDevice."HDMI${var:HdmiNum}" {
f29710
-			Comment "HDMI${var:HdmiNum} Output"
f29710
+			Comment "HDMI / DisplayPort ${var:HdmiNum} Output"
c4a1f5
 
f29710
 			EnableSequence [
f29710
 				cset "name='IEC958 Playback Switch',index=${var:HdmiCtlIndex} on"
f29710
-- 
f29710
2.29.2
f29710
f29710
f29710
From 334b12e9a796cddf70779b68418ee7ad52ba1d14 Mon Sep 17 00:00:00 2001
f29710
From: Jaroslav Kysela <perex@perex.cz>
f29710
Date: Mon, 16 Nov 2020 11:48:05 +0100
f29710
Subject: [PATCH 03/24] sof-soundwire: use the codecs/hda/hdmi.conf macro
f29710
f29710
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
f29710
---
f29710
 ucm2/sof-soundwire/Hdmi.conf | 83 ++++++++++--------------------------
f29710
 1 file changed, 22 insertions(+), 61 deletions(-)
f29710
c4a1f5
diff --git a/ucm2/sof-soundwire/Hdmi.conf b/ucm2/sof-soundwire/Hdmi.conf
c4a1f5
index d0ba790..d5ee9c6 100644
c4a1f5
--- a/ucm2/sof-soundwire/Hdmi.conf
c4a1f5
+++ b/ucm2/sof-soundwire/Hdmi.conf
c4a1f5
@@ -1,79 +1,40 @@
c4a1f5
-# Use case Configuration for sof-soundwire card
c4a1f5
+# Use case Configuration for sof-soundwire
c4a1f5
 
c4a1f5
 If.hdmi1 {
c4a1f5
-	Condition {
c4a1f5
-		Type ControlExists
c4a1f5
-		Control "iface=CARD,name='HDMI/DP,pcm=5 Jack'"
c4a1f5
-	}
c4a1f5
+	Condition { Type String Empty "" }
c4a1f5
 	True {
c4a1f5
-		SectionDevice."HDMI1" {
c4a1f5
-			Comment "HDMI1/DP1 Output"
c4a1f5
-
c4a1f5
-			EnableSequence [
c4a1f5
-				cset "name='IEC958 Playback Switch' on"
c4a1f5
-			]
c4a1f5
-
c4a1f5
-			DisableSequence [
c4a1f5
-				cset "name='IEC958 Playback Switch' off"
c4a1f5
-			]
c4a1f5
-
c4a1f5
-			Value {
c4a1f5
-				PlaybackPriority 500
c4a1f5
-				PlaybackPCM "hw:${CardId},5"
c4a1f5
-				JackControl "HDMI/DP,pcm=5 Jack"
c4a1f5
-			}
c4a1f5
+		Define {
c4a1f5
+			HdmiNum 1
c4a1f5
+			HdmiPCM 5
c4a1f5
+			HdmiCtlIndex 0
c4a1f5
+			HdmiPrio 500
c4a1f5
 		}
c4a1f5
+		Include.hdmi1.File "/codecs/hda/hdmi.conf"
c4a1f5
 	}
c4a1f5
 }
c4a1f5
 
c4a1f5
 If.hdmi2 {
c4a1f5
-	Condition {
c4a1f5
-		Type ControlExists
c4a1f5
-		Control "iface=CARD,name='HDMI/DP,pcm=6 Jack'"
c4a1f5
-	}
c4a1f5
+	Condition { Type String Empty "" }
c4a1f5
 	True {
c4a1f5
-		SectionDevice."HDMI2" {
c4a1f5
-			Comment "HDMI2/DP2 Output"
c4a1f5
-
c4a1f5
-			EnableSequence [
c4a1f5
-				cset "name='IEC958 Playback Switch',index=1 on"
c4a1f5
-			]
c4a1f5
-
c4a1f5
-			DisableSequence [
c4a1f5
-				cset "name='IEC958 Playback Switch',index=1 off"
c4a1f5
-			]
c4a1f5
-
c4a1f5
-			Value {
c4a1f5
-				PlaybackPriority 600
c4a1f5
-				PlaybackPCM "hw:${CardId},6"
c4a1f5
-				JackControl "HDMI/DP,pcm=6 Jack"
c4a1f5
-			}
c4a1f5
+		Define {
c4a1f5
+			HdmiNum 2
c4a1f5
+			HdmiPCM 6
c4a1f5
+			HdmiCtlIndex 1
c4a1f5
+			HdmiPrio 600
c4a1f5
 		}
c4a1f5
+		Include.hdmi2.File "/codecs/hda/hdmi.conf"
c4a1f5
 	}
c4a1f5
 }
c4a1f5
 
c4a1f5
 If.hdmi3 {
c4a1f5
-	Condition {
c4a1f5
-		Type ControlExists
c4a1f5
-		Control "iface=CARD,name='HDMI/DP,pcm=7 Jack'"
c4a1f5
-	}
c4a1f5
+	Condition { Type String Empty "" }
c4a1f5
 	True {
c4a1f5
-		SectionDevice."HDMI3" {
c4a1f5
-			Comment "HDMI3/DP3 Output"
c4a1f5
-
c4a1f5
-			EnableSequence [
c4a1f5
-				cset "name='IEC958 Playback Switch',index=2 on"
c4a1f5
-			]
c4a1f5
-
c4a1f5
-			DisableSequence [
c4a1f5
-				cset "name='IEC958 Playback Switch',index=2 off"
c4a1f5
-			]
c4a1f5
-
c4a1f5
-			Value {
c4a1f5
-				PlaybackPriority 700
c4a1f5
-				PlaybackPCM "hw:${CardId},7"
c4a1f5
-				JackControl "HDMI/DP,pcm=7 Jack"
c4a1f5
-			}
c4a1f5
+		Define {
c4a1f5
+			HdmiNum 3
c4a1f5
+			HdmiPCM 7
c4a1f5
+			HdmiCtlIndex 2
c4a1f5
+			HdmiPrio 700
c4a1f5
 		}
c4a1f5
+		Include.hdmi3.File "/codecs/hda/hdmi.conf"
c4a1f5
 	}
c4a1f5
 }
f29710
-- 
f29710
2.29.2
f29710
f29710
f29710
From 6889736b917eed89c4d775824efd8655400e27e3 Mon Sep 17 00:00:00 2001
f29710
From: Jaroslav Kysela <perex@perex.cz>
f29710
Date: Mon, 7 Dec 2020 09:33:30 +0100
f29710
Subject: [PATCH 04/24] Revert "ucm2: HDA/acp - add Capture simple mixer
f29710
 element to the ACP Mic device"
f29710
f29710
This reverts commit 3320b1ac804595d6c145c1ad7af85917182a3c98.
f29710
f29710
This solution does not work. The mute state is shared between
f29710
the HDA and AMD ACP in PA, so it may cause the security issue, if
f29710
the users do not set the mute manually.
f29710
f29710
BugLink: https://github.com/alsa-project/alsa-ucm-conf/issues/64
f29710
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
f29710
---
f29710
 ucm2/HDA-Intel/HiFi-acp.conf | 1 -
f29710
 1 file changed, 1 deletion(-)
f29710
f29710
diff --git a/ucm2/HDA-Intel/HiFi-acp.conf b/ucm2/HDA-Intel/HiFi-acp.conf
f29710
index 15eeca5..123ae15 100644
f29710
--- a/ucm2/HDA-Intel/HiFi-acp.conf
f29710
+++ b/ucm2/HDA-Intel/HiFi-acp.conf
f29710
@@ -4,6 +4,5 @@ SectionDevice."Mic1" {
f29710
 	Value {
f29710
 		CapturePriority 100
f29710
 		CapturePCM "hw:${var:AcpCardId}"
f29710
-		CaptureMixerElem "Capture"
f29710
 	}
f29710
 }
f29710
-- 
f29710
2.29.2
f29710
f29710
f29710
From 13420f94a6858e9c3e3a056a7987d9c0db823394 Mon Sep 17 00:00:00 2001
f29710
From: Hans de Goede <hdegoede@redhat.com>
f29710
Date: Sun, 6 Dec 2020 13:47:16 +0100
f29710
Subject: [PATCH 05/24] chtnau8824: Fix mono speaker config not working
f29710
f29710
Fix the Speaker define / var being changed from "Speaker" to "MonoSpeaker"
f29710
not having any effect because the variable gets expanded before the if
f29710
making the change is interpreted.
f29710
f29710
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
f29710
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
f29710
---
f29710
 ucm2/chtnau8824/HiFi.conf | 15 +++++++++++----
f29710
 1 file changed, 11 insertions(+), 4 deletions(-)
f29710
f29710
diff --git a/ucm2/chtnau8824/HiFi.conf b/ucm2/chtnau8824/HiFi.conf
f29710
index 3ccd6b1..d7a5f63 100644
f29710
--- a/ucm2/chtnau8824/HiFi.conf
f29710
+++ b/ucm2/chtnau8824/HiFi.conf
f29710
@@ -34,8 +34,15 @@ SectionVerb {
f29710
 	}
f29710
 }
f29710
 
f29710
-Include.spk.File "/codecs/nau8824/${var:Speaker}.conf"
f29710
-Include.hp.File "/codecs/nau8824/HeadPhones.conf"
f29710
+# The includes using $vars in there path must be conditional otherwise the
f29710
+# $var gets expanded before the other If-s above can change the vars.
f29710
+If.cfg-includes {
f29710
+	Condition { Type String Empty "" }
f29710
+	True {
f29710
+		Include.spk.File "/codecs/nau8824/${var:Speaker}.conf"
f29710
+		Include.hp.File "/codecs/nau8824/HeadPhones.conf"
f29710
 
f29710
-Include.mic.File "/codecs/nau8824/InternalMic.conf"
f29710
-Include.hsmic.File "/codecs/nau8824/HeadsetMic.conf"
f29710
+		Include.mic.File "/codecs/nau8824/InternalMic.conf"
f29710
+		Include.hsmic.File "/codecs/nau8824/HeadsetMic.conf"
f29710
+	}
f29710
+}
f29710
-- 
f29710
2.29.2
f29710
f29710
f29710
From 7db718571440b13045ebb3150a71745033ff5c0c Mon Sep 17 00:00:00 2001
f29710
From: Hans de Goede <hdegoede@redhat.com>
f29710
Date: Sun, 6 Dec 2020 13:47:17 +0100
f29710
Subject: [PATCH 06/24] chtnau8824: Add support for laptops using stereo DMICs
f29710
f29710
The Medion E2228T uses a NAU8824 codec combined with stereo
f29710
DMICs, add support for this.
f29710
f29710
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
f29710
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
f29710
---
f29710
 ucm2/chtnau8824/HiFi.conf        | 16 +++++++++++++++-
f29710
 ucm2/codecs/nau8824/DMIC1_2.conf | 30 ++++++++++++++++++++++++++++++
f29710
 2 files changed, 45 insertions(+), 1 deletion(-)
f29710
 create mode 100644 ucm2/codecs/nau8824/DMIC1_2.conf
f29710
f29710
diff --git a/ucm2/chtnau8824/HiFi.conf b/ucm2/chtnau8824/HiFi.conf
f29710
index d7a5f63..105f360 100644
f29710
--- a/ucm2/chtnau8824/HiFi.conf
f29710
+++ b/ucm2/chtnau8824/HiFi.conf
f29710
@@ -1,4 +1,5 @@
f29710
 Define.Speaker "Speaker"
f29710
+Define.Mic "InternalMic"
f29710
 
f29710
 If.cfg-mspk {
f29710
 	Condition {
f29710
@@ -11,6 +12,19 @@ If.cfg-mspk {
f29710
 	}
f29710
 }
f29710
 
f29710
+If.cfg-mic {
f29710
+	Condition {
f29710
+		Type RegexMatch
f29710
+		String "${CardLongName}"
f29710
+		# Medion E22??T models put DMIC in their product version
f29710
+		# when using DMICs
f29710
+		Regex "(MEDION-E22..T.*-DMIC-)"
f29710
+	}
f29710
+	True {
f29710
+		Define.Mic "DMIC1_2"
f29710
+	}
f29710
+}
f29710
+
f29710
 SectionVerb {
f29710
 
f29710
 	Value {
f29710
@@ -42,7 +56,7 @@ If.cfg-includes {
f29710
 		Include.spk.File "/codecs/nau8824/${var:Speaker}.conf"
f29710
 		Include.hp.File "/codecs/nau8824/HeadPhones.conf"
f29710
 
f29710
-		Include.mic.File "/codecs/nau8824/InternalMic.conf"
f29710
+		Include.mic.File "/codecs/nau8824/${var:Mic}.conf"
f29710
 		Include.hsmic.File "/codecs/nau8824/HeadsetMic.conf"
f29710
 	}
f29710
 }
f29710
diff --git a/ucm2/codecs/nau8824/DMIC1_2.conf b/ucm2/codecs/nau8824/DMIC1_2.conf
f29710
new file mode 100644
f29710
index 0000000..f54f671
f29710
--- /dev/null
f29710
+++ b/ucm2/codecs/nau8824/DMIC1_2.conf
f29710
@@ -0,0 +1,30 @@
f29710
+# Stereo DMICs on the DMIC1 and DMIC2 inputs
f29710
+
f29710
+SectionDevice."Mic" {
f29710
+	Comment "Internal Digital Microphones"
f29710
+
f29710
+	Value {
f29710
+		CapturePriority 200
f29710
+		CapturePCM "hw:${CardId}"
f29710
+	}
f29710
+
f29710
+	ConflictingDevice [
f29710
+		"Headset"
f29710
+	]
f29710
+
f29710
+	EnableSequence [
f29710
+		# Note needs to be swapped / swap is deliberate!
f29710
+		cset "name='ADC CH0 Select' 1"
f29710
+		cset "name='ADC CH1 Select' 0"
f29710
+
f29710
+		cset "name='Int Mic Switch' on"
f29710
+		cset "name='DMIC1 Enable Switch' on"
f29710
+		cset "name='DMIC2 Enable Switch' on"
f29710
+	]
f29710
+
f29710
+	DisableSequence [
f29710
+		cset "name='Int Mic Switch' off"
f29710
+		cset "name='DMIC1 Enable Switch' off"
f29710
+		cset "name='DMIC2 Enable Switch' off"
f29710
+	]
f29710
+}
f29710
-- 
f29710
2.29.2
f29710
f29710
f29710
From dacfe2fc7b41b800f4f379ce4b1722462b97cab2 Mon Sep 17 00:00:00 2001
f29710
From: Hans de Goede <hdegoede@redhat.com>
f29710
Date: Sun, 6 Dec 2020 13:47:18 +0100
f29710
Subject: [PATCH 07/24] chtnau8824: Boost analog mic volumes a bit
f29710
f29710
Both Mic1 (internal analog mic) and Mic2 (headset mic) are a bit soft
f29710
with the current settings, boost their volumes a bit.
f29710
f29710
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
f29710
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
f29710
---
f29710
 ucm2/codecs/nau8824/EnableSeq.conf | 4 ++--
f29710
 1 file changed, 2 insertions(+), 2 deletions(-)
f29710
f29710
diff --git a/ucm2/codecs/nau8824/EnableSeq.conf b/ucm2/codecs/nau8824/EnableSeq.conf
f29710
index 433e8e2..3650d06 100644
f29710
--- a/ucm2/codecs/nau8824/EnableSeq.conf
f29710
+++ b/ucm2/codecs/nau8824/EnableSeq.conf
f29710
@@ -7,8 +7,8 @@ EnableSequence [
f29710
 	cset "name='DMIC2 Enable Switch' off"
f29710
 	cset "name='DMIC3 Enable Switch' off"
f29710
 	cset "name='DMIC4 Enable Switch' off"
f29710
-	cset "name='MIC1 Volume' 10"
f29710
-	cset "name='MIC2 Volume' 10"
f29710
+	cset "name='MIC1 Volume' 14"
f29710
+	cset "name='MIC2 Volume' 14"
f29710
 	# Button Configuration
f29710
 	cset "name='THD for key media' 10"
f29710
 	cset "name='THD for key voice command' 16"
f29710
-- 
f29710
2.29.2
f29710
f29710
f29710
From 263bd26b1216c933db3d216197a78678d0f8610e Mon Sep 17 00:00:00 2001
f29710
From: Libin Yang <libin.yang@intel.com>
f29710
Date: Thu, 19 Nov 2020 20:01:30 +0800
f29710
Subject: [PATCH 08/24] rt715: init: setup ADC07 to a proper volume
f29710
f29710
This patch initiates 'rt715 ADC 07 Capture Volume' to a proper volume.
f29710
f29710
Signed-off-by: Libin Yang <libin.yang@intel.com>
f29710
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
f29710
---
f29710
 ucm2/codecs/rt715/init.conf | 1 +
f29710
 1 file changed, 1 insertion(+)
f29710
f29710
diff --git a/ucm2/codecs/rt715/init.conf b/ucm2/codecs/rt715/init.conf
f29710
index 6e07b2d..15a0571 100644
f29710
--- a/ucm2/codecs/rt715/init.conf
f29710
+++ b/ucm2/codecs/rt715/init.conf
f29710
@@ -7,4 +7,5 @@ BootSequence [
f29710
 	cset "name='rt715 ADC 25 Mux' 4"
f29710
 	cset "name='rt715 ADC 27 Capture Switch' 1"
f29710
 	cset "name='rt715 ADC 07 Capture Switch' 1"
f29710
+	cset "name='rt715 ADC 07 Capture Volume' 58"
f29710
 ]
f29710
-- 
f29710
2.29.2
f29710
f29710
f29710
From cf267cce6d553d4d436c166c23d3befc5476acef Mon Sep 17 00:00:00 2001
f29710
From: Hui Wang <hui.wang@canonical.com>
f29710
Date: Thu, 29 Oct 2020 13:34:02 +0800
f29710
Subject: [PATCH 09/24] sof-hda-dsp: Set Master Playback Switch on in the
f29710
 BootSequence
f29710
f29710
Otherwise, the audio output will be muted by default if there is no
f29710
/var/lib/alsa/asound.state. I have experienced this issue When newly
f29710
install an OS.
f29710
f29710
Signed-off-by: Hui Wang <hui.wang@canonical.com>
f29710
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
f29710
---
f29710
 ucm2/HDA-Intel/init.conf          | 1 +
f29710
 ucm2/sof-hda-dsp/sof-hda-dsp.conf | 1 +
f29710
 2 files changed, 2 insertions(+)
f29710
f29710
diff --git a/ucm2/HDA-Intel/init.conf b/ucm2/HDA-Intel/init.conf
f29710
index 1a351a9..6310eb3 100644
f29710
--- a/ucm2/HDA-Intel/init.conf
f29710
+++ b/ucm2/HDA-Intel/init.conf
f29710
@@ -15,6 +15,7 @@ If.master {
f29710
 	}
f29710
 	True.BootSequence [
f29710
 		cset "name='Master Playback Volume' 60%"
f29710
+		cset "name='Master Playback Switch' on"
f29710
 	]
f29710
 }
f29710
 
f29710
diff --git a/ucm2/sof-hda-dsp/sof-hda-dsp.conf b/ucm2/sof-hda-dsp/sof-hda-dsp.conf
f29710
index c8069a6..79b54a9 100644
f29710
--- a/ucm2/sof-hda-dsp/sof-hda-dsp.conf
f29710
+++ b/ucm2/sof-hda-dsp/sof-hda-dsp.conf
f29710
@@ -24,6 +24,7 @@ If.master {
f29710
 	}
f29710
 	True.BootSequence [
f29710
 		cset "name='Master Playback Volume' 60%"
f29710
+		cset "name='Master Playback Switch' on"
f29710
 	]
f29710
 }
f29710
 
f29710
-- 
f29710
2.29.2
f29710
f29710
f29710
From 5405544752c18153acc310ee7e4a4bacda040dca Mon Sep 17 00:00:00 2001
f29710
From: Kai-Heng Feng <kai.heng.feng@canonical.com>
f29710
Date: Thu, 27 Aug 2020 21:18:13 +0800
f29710
Subject: [PATCH 10/24] HDA-Intel/HiFi-dual: Add EnableSequence and
f29710
 DisableSequence for Speaker and Headphones
f29710
f29710
BugLink: https://github.com/alsa-project/alsa-ucm-conf/pull/48
f29710
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
f29710
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
f29710
---
f29710
 ucm2/HDA-Intel/HiFi-dual.conf | 16 ++++++++++++++++
f29710
 1 file changed, 16 insertions(+)
f29710
f29710
diff --git a/ucm2/HDA-Intel/HiFi-dual.conf b/ucm2/HDA-Intel/HiFi-dual.conf
f29710
index cff948e..bacfd80 100644
f29710
--- a/ucm2/HDA-Intel/HiFi-dual.conf
f29710
+++ b/ucm2/HDA-Intel/HiFi-dual.conf
f29710
@@ -27,6 +27,14 @@ SectionDevice."Speaker" {
f29710
 		PlaybackMixerElem "Speaker"
f29710
 	}
f29710
 
f29710
+	EnableSequence [
f29710
+		cset "name='Speaker Playback Switch' on"
f29710
+	]
f29710
+
f29710
+	DisableSequence [
f29710
+		cset "name='Speaker Playback Switch' off"
f29710
+	]
f29710
+
f29710
 	ConflictingDevice [
f29710
 		"Headphones"
f29710
 	]
f29710
@@ -54,6 +62,14 @@ SectionDevice."Headphones" {
f29710
 		JackHWMute "Speaker"
f29710
 	}
f29710
 
f29710
+	EnableSequence [
f29710
+		cset "name='Headphone Playback Switch' on"
f29710
+	]
f29710
+
f29710
+	DisableSequence [
f29710
+		cset "name='Headphone Playback Switch' off"
f29710
+	]
f29710
+
f29710
 	ConflictingDevice [
f29710
 		"Speaker"
f29710
 	]
f29710
-- 
f29710
2.29.2
f29710
f29710
f29710
From 5947daef124c84fae511233248196576dfbfab7c Mon Sep 17 00:00:00 2001
f29710
From: Jaroslav Kysela <perex@perex.cz>
f29710
Date: Wed, 16 Dec 2020 08:55:04 +0100
f29710
Subject: [PATCH 11/24] HDA-Intel/HiFi-dual: Add BootSequence and disable
f29710
 playback channels in verb init
f29710
f29710
BugLink: https://github.com/alsa-project/alsa-ucm-conf/pull/48
f29710
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
f29710
---
f29710
 ucm2/HDA-Intel/HDAudio-DualCodecs.conf | 12 ++++++++++++
f29710
 ucm2/HDA-Intel/HiFi-dual.conf          |  2 ++
f29710
 2 files changed, 14 insertions(+)
f29710
f29710
diff --git a/ucm2/HDA-Intel/HDAudio-DualCodecs.conf b/ucm2/HDA-Intel/HDAudio-DualCodecs.conf
f29710
index 8aaabd0..6fd7bd1 100644
f29710
--- a/ucm2/HDA-Intel/HDAudio-DualCodecs.conf
f29710
+++ b/ucm2/HDA-Intel/HDAudio-DualCodecs.conf
f29710
@@ -4,3 +4,15 @@ SectionUseCase."HiFi" {
f29710
 	File "HiFi-dual.conf"
f29710
 	Comment "Default"
f29710
 }
f29710
+
f29710
+BootSequence [
f29710
+	cset "name='Headphone Playback Volume' 60%"
f29710
+	cset "name='Headphone Playback Switch' off"
f29710
+	cset "name='Speaker Playback Volume' 60%"
f29710
+	cset "name='Speaker Playback Switch' on"
f29710
+	cset "name='Front Playback Volume' 100%"
f29710
+	cset "name='Front Playback Switch' on"
f29710
+	cset "name='Rear-Panel Capture Volume' 100%"
f29710
+	cset "name='Rear-Panel Capture Switch' on"
f29710
+	cset "name='Input Source' Rear Mic"
f29710
+]
f29710
diff --git a/ucm2/HDA-Intel/HiFi-dual.conf b/ucm2/HDA-Intel/HiFi-dual.conf
f29710
index bacfd80..f2c6915 100644
f29710
--- a/ucm2/HDA-Intel/HiFi-dual.conf
f29710
+++ b/ucm2/HDA-Intel/HiFi-dual.conf
f29710
@@ -8,6 +8,8 @@ SectionVerb {
f29710
 		cset "name='Front Playback Switch' on"
f29710
 		cset "name='Rear-Panel Capture Volume' 100%"
f29710
 		cset "name='Rear-Panel Capture Switch' on"
f29710
+		cset "name='Headphone Playback Switch' off"
f29710
+		cset "name='Speaker Playback Switch' off"
f29710
 	]
f29710
 
f29710
 	DisableSequence [
f29710
-- 
f29710
2.29.2
f29710
f29710
f29710
From 5634db4be3ed435f3e59f30a71c3c3711162929d Mon Sep 17 00:00:00 2001
f29710
From: Jian-Hong Pan <jhp@endlessos.org>
f29710
Date: Tue, 15 Dec 2020 16:54:03 +0800
f29710
Subject: [PATCH 12/24] chtrt5645: Enable Internal MIC of ECS EF20EA
f29710
f29710
The ECS EF20EA uses a digital mic connected to the dmic2 pin, rather
f29710
then the default analog mic.
f29710
f29710
1 [chtrt5645      ]: chtrt5645 - chtrt5645
f29710
                     Standard-EF20EA-1.0
f29710
f29710
Add a card long name match for this, so that the right config is used.
f29710
f29710
BugLink: https://github.com/alsa-project/alsa-ucm-conf/pull/68
f29710
Signed-off-by: Jian-Hong Pan <jhp@endlessos.org>
f29710
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
f29710
---
f29710
 ucm2/chtrt5645/HiFi.conf | 2 +-
f29710
 1 file changed, 1 insertion(+), 1 deletion(-)
f29710
f29710
diff --git a/ucm2/chtrt5645/HiFi.conf b/ucm2/chtrt5645/HiFi.conf
f29710
index 10b0a1c..30fad50 100644
f29710
--- a/ucm2/chtrt5645/HiFi.conf
f29710
+++ b/ucm2/chtrt5645/HiFi.conf
f29710
@@ -18,7 +18,7 @@ If.cfg-dmic2 {
f29710
 	Condition {
f29710
 		Type RegexMatch
f29710
 		String "${CardLongName}"
f29710
-		Regex "(LENOVO.*LenovoMIIX320|MEDION.*Wingman)"
f29710
+		Regex "(LENOVO.*LenovoMIIX320|MEDION.*Wingman|Standard-EF20EA-1.0)"
f29710
 	}
f29710
 	True {
f29710
 		Define.AnalogMic ""
f29710
-- 
f29710
2.29.2
f29710
f29710
f29710
From bdd05ac3396a3a09f3818aaa9157eb7ef07676d6 Mon Sep 17 00:00:00 2001
f29710
From: Hans de Goede <hdegoede@redhat.com>
f29710
Date: Sat, 9 Jan 2021 22:02:51 +0100
f29710
Subject: [PATCH 13/24] bytcr-rt5640: Add support for devices without speakers
f29710
 and/or an internal mic
f29710
f29710
There are kernel patches pending upstream for the bytcr-rt5640 machine-driver
f29710
to support devices without speakers and/or an internal mic.
f29710
f29710
Since the UCM profile already conditionally loads the speaker and
f29710
internal-mic codec include files, these will simply get skipped in this
f29710
case, so this almost works with the current UCM profile without changes.
f29710
f29710
The only troublesome part is the ConflictingDevice sections in the codec
f29710
HeadPhones.conf and HeadsetMic.conf files, which refer to resp. a "Speaker"
f29710
and a "Mic" device. Without any of the speaker or mic codec conf files
f29710
being included there will not by any "Speaker" / "Mic" devices leading
f29710
to an error while parsing the HeadPhones.conf / HeadsetMic.conf files.
f29710
f29710
This commit makes the ConflictingDevice section conditional, fixing this.
f29710
f29710
Cc: Rasmus Porsager <rasmus@beat.dk>
f29710
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
f29710
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
f29710
---
f29710
 ucm2/bytcr-rt5640/HiFi-Components.conf | 28 +++++++++++++++++++++-----
f29710
 ucm2/bytcr-rt5640/HiFi-LongName.conf   | 28 +++++++++++++++++++++-----
f29710
 ucm2/codecs/rt5640/HeadPhones.conf     | 14 ++++++++++---
f29710
 ucm2/codecs/rt5640/HeadsetMic.conf     | 14 ++++++++++---
f29710
 4 files changed, 68 insertions(+), 16 deletions(-)
f29710
f29710
diff --git a/ucm2/bytcr-rt5640/HiFi-Components.conf b/ucm2/bytcr-rt5640/HiFi-Components.conf
f29710
index 2ce4f59..a76b42d 100644
f29710
--- a/ucm2/bytcr-rt5640/HiFi-Components.conf
f29710
+++ b/ucm2/bytcr-rt5640/HiFi-Components.conf
f29710
@@ -1,10 +1,16 @@
f29710
+Define.HaveSpeaker ""
f29710
+Define.HaveInternalMic ""
f29710
+
f29710
 If.spk {
f29710
 	Condition {
f29710
 		Type String
f29710
 		Haystack "${CardComponents}"
f29710
 		Needle "cfg-spk:2"
f29710
 	}
f29710
-	True.Include.spk.File "/codecs/rt5640/Speaker.conf"
f29710
+	True {
f29710
+		Include.spk.File "/codecs/rt5640/Speaker.conf"
f29710
+		Define.HaveSpeaker "yes"
f29710
+	}
f29710
 }
f29710
 
f29710
 If.mono {
f29710
@@ -13,7 +19,10 @@ If.mono {
f29710
 		Haystack "${CardComponents}"
f29710
 		Needle "cfg-spk:1"
f29710
 	}
f29710
-	True.Include.mspk.File "/codecs/rt5640/MonoSpeaker.conf"
f29710
+	True {
f29710
+		Include.mspk.File "/codecs/rt5640/MonoSpeaker.conf"
f29710
+		Define.HaveSpeaker "yes"
f29710
+	}
f29710
 }
f29710
 
f29710
 Include.hs.File "/codecs/rt5640/HeadPhones.conf"
f29710
@@ -24,7 +33,10 @@ If.dmic1 {
f29710
 		Haystack "${CardComponents}"
f29710
 		Needle "cfg-mic:dmic1"
f29710
 	}
f29710
-	True.Include.dmic.File "/codecs/rt5640/DigitalMics.conf"
f29710
+	True {
f29710
+		Include.dmic.File "/codecs/rt5640/DigitalMics.conf"
f29710
+		Define.HaveInternalMic "yes"
f29710
+	}
f29710
 }
f29710
 
f29710
 If.in1 {
f29710
@@ -33,7 +45,10 @@ If.in1 {
f29710
 		Haystack "${CardComponents}"
f29710
 		Needle "cfg-mic:in1"
f29710
 	}
f29710
-	True.Include.mic1.File "/codecs/rt5640/IN1-InternalMic.conf"
f29710
+	True {
f29710
+		Include.mic1.File "/codecs/rt5640/IN1-InternalMic.conf"
f29710
+		Define.HaveInternalMic "yes"
f29710
+	}
f29710
 }
f29710
 
f29710
 If.in3 {
f29710
@@ -42,7 +57,10 @@ If.in3 {
f29710
 		Haystack "${CardComponents}"
f29710
 		Needle "cfg-mic:in3"
f29710
 	}
f29710
-	True.Include.mic3.File "/codecs/rt5640/IN3-InternalMic.conf"
f29710
+	True {
f29710
+		Include.mic3.File "/codecs/rt5640/IN3-InternalMic.conf"
f29710
+		Define.HaveInternalMic "yes"
f29710
+	}
f29710
 }
f29710
 
f29710
 Include.hsmic.File "/codecs/rt5640/HeadsetMic.conf"
f29710
diff --git a/ucm2/bytcr-rt5640/HiFi-LongName.conf b/ucm2/bytcr-rt5640/HiFi-LongName.conf
f29710
index c07f153..6cb5556 100644
f29710
--- a/ucm2/bytcr-rt5640/HiFi-LongName.conf
f29710
+++ b/ucm2/bytcr-rt5640/HiFi-LongName.conf
f29710
@@ -1,10 +1,16 @@
f29710
+Define.HaveSpeaker ""
f29710
+Define.HaveInternalMic ""
f29710
+
f29710
 If.spk {
f29710
 	Condition {
f29710
 		Type String
f29710
 		Haystack "${CardLongName}"
f29710
 		Needle "-stereo-spk"
f29710
 	}
f29710
-	True.Include.spk.File "/codecs/rt5640/Speaker.conf"
f29710
+	True {
f29710
+		Include.spk.File "/codecs/rt5640/Speaker.conf"
f29710
+		Define.HaveSpeaker "yes"
f29710
+	}
f29710
 }
f29710
 
f29710
 If.mono {
f29710
@@ -13,7 +19,10 @@ If.mono {
f29710
 		Haystack "${CardLongName}"
f29710
 		Needle "-mono-spk"
f29710
 	}
f29710
-	True.Include.mspk.File "/codecs/rt5640/MonoSpeaker.conf"
f29710
+	True {
f29710
+		Include.mspk.File "/codecs/rt5640/MonoSpeaker.conf"
f29710
+		Define.HaveSpeaker "yes"
f29710
+	}
f29710
 }
f29710
 
f29710
 Include.hs.File "/codecs/rt5640/HeadPhones.conf"
f29710
@@ -24,7 +33,10 @@ If.dmic1 {
f29710
 		Haystack "${CardLongName}"
f29710
 		Needle "-dmic1-mic"
f29710
 	}
f29710
-	True.Include.dmic.File "/codecs/rt5640/DigitalMics.conf"
f29710
+	True {
f29710
+		Include.dmic.File "/codecs/rt5640/DigitalMics.conf"
f29710
+		Define.HaveInternalMic "yes"
f29710
+	}
f29710
 }
f29710
 
f29710
 If.in1 {
f29710
@@ -33,7 +45,10 @@ If.in1 {
f29710
 		Haystack "${CardLongName}"
f29710
 		Needle "-in1-mic"
f29710
 	}
f29710
-	True.Include.mic1.File "/codecs/rt5640/IN1-InternalMic.conf"
f29710
+	True {
f29710
+		Include.mic1.File "/codecs/rt5640/IN1-InternalMic.conf"
f29710
+		Define.HaveInternalMic "yes"
f29710
+	}
f29710
 }
f29710
 
f29710
 If.in3 {
f29710
@@ -42,7 +57,10 @@ If.in3 {
f29710
 		Haystack "${CardLongName}"
f29710
 		Needle "-in3-mic"
f29710
 	}
f29710
-	True.Include.mic3.File "/codecs/rt5640/IN3-InternalMic.conf"
f29710
+	True {
f29710
+		Include.mic3.File "/codecs/rt5640/IN3-InternalMic.conf"
f29710
+		Define.HaveInternalMic "yes"
f29710
+	}
f29710
 }
f29710
 
f29710
 Include.hsmic.File "/codecs/rt5640/HeadsetMic.conf"
f29710
diff --git a/ucm2/codecs/rt5640/HeadPhones.conf b/ucm2/codecs/rt5640/HeadPhones.conf
f29710
index 42151d6..b7707e5 100644
f29710
--- a/ucm2/codecs/rt5640/HeadPhones.conf
f29710
+++ b/ucm2/codecs/rt5640/HeadPhones.conf
f29710
@@ -1,9 +1,17 @@
f29710
 SectionDevice."Headphones" {
f29710
 	Comment "Headphones"
f29710
 
f29710
-	ConflictingDevice [
f29710
-		"Speaker"
f29710
-	]
f29710
+	If.have-spk {
f29710
+		Condition {
f29710
+			Type String
f29710
+			Empty "${var:HaveSpeaker}"
f29710
+		}
f29710
+		False {
f29710
+			ConflictingDevice [
f29710
+				"Speaker"
f29710
+			]
f29710
+		}
f29710
+	}
f29710
 
f29710
 	EnableSequence [
f29710
  		cset "name='DAC MIXL INF1 Switch'  on"
f29710
diff --git a/ucm2/codecs/rt5640/HeadsetMic.conf b/ucm2/codecs/rt5640/HeadsetMic.conf
f29710
index 7a8dfb8..f88b611 100644
f29710
--- a/ucm2/codecs/rt5640/HeadsetMic.conf
f29710
+++ b/ucm2/codecs/rt5640/HeadsetMic.conf
f29710
@@ -1,9 +1,17 @@
f29710
 SectionDevice."Headset" {
f29710
 	Comment "Headset Microphone"
f29710
 
f29710
-	ConflictingDevice [
f29710
-		"Mic"
f29710
-	]
f29710
+	If.have-mic {
f29710
+		Condition {
f29710
+			Type String
f29710
+			Empty "${var:HaveInternalMic}"
f29710
+		}
f29710
+		False {
f29710
+			ConflictingDevice [
f29710
+				"Mic"
f29710
+			]
f29710
+		}
f29710
+	}
f29710
 
f29710
 	EnableSequence [
f29710
 		cset "name='Headset Mic Switch' on"
f29710
-- 
f29710
2.29.2
f29710
f29710
f29710
From cd02791e9360bcfa2cd4bed40cf5ddabb378ef93 Mon Sep 17 00:00:00 2001
f29710
From: Hans de Goede <hdegoede@redhat.com>
f29710
Date: Sat, 9 Jan 2021 22:02:52 +0100
f29710
Subject: [PATCH 14/24] rt5640: Move standard DAC setup to EnableSeq.conf
f29710
f29710
No matter which output is used, we always need to setup the standard
f29710
DAC config. Move this to the shared EnableSeq.conf to avoid having
f29710
to duplicate it in various places.
f29710
f29710
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
f29710
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
f29710
---
f29710
 ucm2/codecs/rt5640/EnableSeq.conf   | 6 ++++++
f29710
 ucm2/codecs/rt5640/HeadPhones.conf  | 6 ------
f29710
 ucm2/codecs/rt5640/MonoSpeaker.conf | 6 ------
f29710
 ucm2/codecs/rt5640/Speaker.conf     | 6 ------
f29710
 4 files changed, 6 insertions(+), 18 deletions(-)
f29710
f29710
diff --git a/ucm2/codecs/rt5640/EnableSeq.conf b/ucm2/codecs/rt5640/EnableSeq.conf
f29710
index cbf4038..145a23b 100644
f29710
--- a/ucm2/codecs/rt5640/EnableSeq.conf
f29710
+++ b/ucm2/codecs/rt5640/EnableSeq.conf
f29710
@@ -1,5 +1,11 @@
f29710
 EnableSequence [
f29710
 	# RT5640 default output routing
f29710
+	cset "name='DAC MIXL INF1 Switch' on"
f29710
+	cset "name='DAC MIXR INF1 Switch' on"
f29710
+	cset "name='Stereo DAC MIXL DAC L1 Switch' on"
f29710
+	cset "name='Stereo DAC MIXR DAC R1 Switch' on"
f29710
+	cset "name='Stereo DAC MIXL DAC L2 Switch' on"
f29710
+	cset "name='Stereo DAC MIXR DAC R2 Switch' on"
f29710
 	cset "name='OUT MIXL DAC L1 Switch'  on"
f29710
 	cset "name='OUT MIXR DAC R1 Switch'  on"
f29710
 
f29710
diff --git a/ucm2/codecs/rt5640/HeadPhones.conf b/ucm2/codecs/rt5640/HeadPhones.conf
f29710
index b7707e5..a9e4d20 100644
f29710
--- a/ucm2/codecs/rt5640/HeadPhones.conf
f29710
+++ b/ucm2/codecs/rt5640/HeadPhones.conf
f29710
@@ -14,12 +14,6 @@ SectionDevice."Headphones" {
f29710
 	}
f29710
 
f29710
 	EnableSequence [
f29710
- 		cset "name='DAC MIXL INF1 Switch'  on"
f29710
- 		cset "name='DAC MIXR INF1 Switch'  on"
f29710
- 		cset "name='Stereo DAC MIXL DAC L1 Switch'  on"
f29710
- 		cset "name='Stereo DAC MIXR DAC R1 Switch'  on"
f29710
-		cset "name='Stereo DAC MIXL DAC L2 Switch'  on"
f29710
- 		cset "name='Stereo DAC MIXR DAC R2 Switch'  on"
f29710
  		cset "name='HPO MIX HPVOL Switch'  on"
f29710
  		cset "name='Headphone Switch'  on"
f29710
 		cset "name='HP Channel Switch' on"
f29710
diff --git a/ucm2/codecs/rt5640/MonoSpeaker.conf b/ucm2/codecs/rt5640/MonoSpeaker.conf
f29710
index ddc7ba8..23cf34c 100644
f29710
--- a/ucm2/codecs/rt5640/MonoSpeaker.conf
f29710
+++ b/ucm2/codecs/rt5640/MonoSpeaker.conf
f29710
@@ -6,12 +6,6 @@ SectionDevice."Speaker" {
f29710
 	]
f29710
 
f29710
 	EnableSequence [
f29710
-		cset "name='DAC MIXL INF1 Switch' on"
f29710
-		cset "name='DAC MIXR INF1 Switch' on"
f29710
-		cset "name='Stereo DAC MIXL DAC L1 Switch' on"
f29710
-		cset "name='Stereo DAC MIXR DAC R1 Switch' on"
f29710
-		cset "name='Stereo DAC MIXL DAC L2 Switch'  on"
f29710
-		cset "name='Stereo DAC MIXR DAC R2 Switch'  on"
f29710
 		cset "name='SPK MIXL DAC L1 Switch' on"
f29710
 		cset "name='SPK MIXR DAC R1 Switch' on"
f29710
 		cset "name='SPOL MIX SPKVOL L Switch' on"
f29710
diff --git a/ucm2/codecs/rt5640/Speaker.conf b/ucm2/codecs/rt5640/Speaker.conf
f29710
index 411cd13..422cfdf 100644
f29710
--- a/ucm2/codecs/rt5640/Speaker.conf
f29710
+++ b/ucm2/codecs/rt5640/Speaker.conf
f29710
@@ -6,12 +6,6 @@ SectionDevice."Speaker" {
f29710
 	]
f29710
 
f29710
 	EnableSequence [
f29710
-		cset "name='DAC MIXL INF1 Switch' on"
f29710
-		cset "name='DAC MIXR INF1 Switch' on"
f29710
-		cset "name='Stereo DAC MIXL DAC L1 Switch' on"
f29710
-		cset "name='Stereo DAC MIXR DAC R1 Switch' on"
f29710
-		cset "name='Stereo DAC MIXL DAC L2 Switch'  on"
f29710
- 		cset "name='Stereo DAC MIXR DAC R2 Switch'  on"
f29710
 		cset "name='SPK MIXL DAC L1 Switch' on"
f29710
 		cset "name='SPK MIXR DAC R1 Switch' on"
f29710
 		cset "name='SPOL MIX SPKVOL L Switch' on"
f29710
-- 
f29710
2.29.2
f29710
f29710
f29710
From 95587ae8b75134c4bbc2cec0181e5d529826c9c4 Mon Sep 17 00:00:00 2001
f29710
From: Jaroslav Kysela <perex@perex.cz>
f29710
Date: Thu, 14 Jan 2021 18:31:24 +0100
f29710
Subject: [PATCH 15/24] bytcr-rt5640: fix the execution order
f29710
f29710
The includes must be run _after_ defines. The Include directives
f29710
have precedence. Put everything to If compound.
f29710
f29710
Fixes: bdd05ac339 ("bytcr-rt5640: Add support for devices without speakers and/or an internal mic")
f29710
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
f29710
---
f29710
 ucm2/bytcr-rt5640/HiFi-Components.conf | 10 ++++++++--
f29710
 ucm2/bytcr-rt5640/HiFi-LongName.conf   | 10 ++++++++--
f29710
 2 files changed, 16 insertions(+), 4 deletions(-)
f29710
f29710
diff --git a/ucm2/bytcr-rt5640/HiFi-Components.conf b/ucm2/bytcr-rt5640/HiFi-Components.conf
f29710
index a76b42d..1999717 100644
f29710
--- a/ucm2/bytcr-rt5640/HiFi-Components.conf
f29710
+++ b/ucm2/bytcr-rt5640/HiFi-Components.conf
f29710
@@ -25,7 +25,10 @@ If.mono {
f29710
 	}
f29710
 }
f29710
 
f29710
-Include.hs.File "/codecs/rt5640/HeadPhones.conf"
f29710
+If.hp {
f29710
+	Condition { Type String Empty "" }
f29710
+	True.Include.hs.File "/codecs/rt5640/HeadPhones.conf"
f29710
+}
f29710
 
f29710
 If.dmic1 {
f29710
 	Condition {
f29710
@@ -63,4 +66,7 @@ If.in3 {
f29710
 	}
f29710
 }
f29710
 
f29710
-Include.hsmic.File "/codecs/rt5640/HeadsetMic.conf"
f29710
+If.hsmic {
f29710
+	Condition { Type String Empty "" }
f29710
+	True.Include.hsmic.File "/codecs/rt5640/HeadsetMic.conf"
f29710
+}
f29710
diff --git a/ucm2/bytcr-rt5640/HiFi-LongName.conf b/ucm2/bytcr-rt5640/HiFi-LongName.conf
f29710
index 6cb5556..34acef8 100644
f29710
--- a/ucm2/bytcr-rt5640/HiFi-LongName.conf
f29710
+++ b/ucm2/bytcr-rt5640/HiFi-LongName.conf
f29710
@@ -25,7 +25,10 @@ If.mono {
f29710
 	}
f29710
 }
f29710
 
f29710
-Include.hs.File "/codecs/rt5640/HeadPhones.conf"
f29710
+If.hp {
f29710
+	Condition { Type String Empty "" }
f29710
+	True.Include.hs.File "/codecs/rt5640/HeadPhones.conf"
f29710
+}
f29710
 
f29710
 If.dmic1 {
f29710
 	Condition {
f29710
@@ -63,4 +66,7 @@ If.in3 {
f29710
 	}
f29710
 }
f29710
 
f29710
-Include.hsmic.File "/codecs/rt5640/HeadsetMic.conf"
f29710
+If.hsmic {
f29710
+	Condition { Type String Empty "" }
f29710
+	True.Include.hsmic.File "/codecs/rt5640/HeadsetMic.conf"
f29710
+}
f29710
-- 
f29710
2.29.2
f29710
f29710
f29710
From 09e5271401480297c2c9c0b753df9705123a1af1 Mon Sep 17 00:00:00 2001
f29710
From: Jaroslav Kysela <perex@perex.cz>
f29710
Date: Thu, 14 Jan 2021 11:03:56 +0100
f29710
Subject: [PATCH 16/24] ucm2: add initial configuration for TRX40 Gigabyte
f29710
 Aorus Master Audio
f29710
f29710
BugLink: https://github.com/alsa-project/alsa-ucm-conf/pull/25
f29710
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
f29710
---
f29710
 ...Gigabyte-Aorus-Master-Front-Headphone.conf |  1 +
f29710
 ...Gigabyte-Aorus-Master-Main-Audio-HiFi.conf | 61 +++++++++++++++++++
f29710
 .../Gigabyte-Aorus-Master-Main-Audio.conf     |  6 ++
f29710
 3 files changed, 68 insertions(+)
f29710
 create mode 120000 ucm2/USB-Audio/Gigabyte-Aorus-Master-Front-Headphone.conf
f29710
 create mode 100644 ucm2/USB-Audio/Gigabyte-Aorus-Master-Main-Audio-HiFi.conf
f29710
 create mode 100644 ucm2/USB-Audio/Gigabyte-Aorus-Master-Main-Audio.conf
f29710
f29710
diff --git a/ucm2/USB-Audio/Gigabyte-Aorus-Master-Front-Headphone.conf b/ucm2/USB-Audio/Gigabyte-Aorus-Master-Front-Headphone.conf
f29710
new file mode 120000
f29710
index 0000000..1376437
f29710
--- /dev/null
f29710
+++ b/ucm2/USB-Audio/Gigabyte-Aorus-Master-Front-Headphone.conf
f29710
@@ -0,0 +1 @@
f29710
+../module/lib/linked.conf
f29710
\ No newline at end of file
f29710
diff --git a/ucm2/USB-Audio/Gigabyte-Aorus-Master-Main-Audio-HiFi.conf b/ucm2/USB-Audio/Gigabyte-Aorus-Master-Main-Audio-HiFi.conf
f29710
new file mode 100644
f29710
index 0000000..5c24165
f29710
--- /dev/null
f29710
+++ b/ucm2/USB-Audio/Gigabyte-Aorus-Master-Main-Audio-HiFi.conf
f29710
@@ -0,0 +1,61 @@
f29710
+Define.SecondaryCardId "$${CardIdByName:Aorus Master Front Headphone}"
f29710
+
f29710
+SectionDevice."Speaker" {
f29710
+	Comment "Speakers"
f29710
+	Value {
f29710
+	       PlaybackChannels 8
f29710
+	       PlaybackPriority 200
f29710
+	       PlaybackPCM "hw:${CardId}"
f29710
+	       JackControl "Line Out Jack"
f29710
+	       PlaybackMixerElem "Line Out"
f29710
+	}
f29710
+}
f29710
+
f29710
+SectionDevice."Headphones" {
f29710
+	Comment "Front Headphones"
f29710
+	Value {
f29710
+		PlaybackPriority 300
f29710
+		PlaybackPCM "hw:${var:SecondaryCardId}"
f29710
+		JackCTL "hw:${var:SecondaryCardId}"
f29710
+		JackControl "Headphone - Output Jack"
f29710
+	}
f29710
+}
f29710
+
f29710
+SectionDevice."SPDIF" {
f29710
+	Comment "S/PDIF Out"
f29710
+	Value {
f29710
+		PlaybackPriority 100
f29710
+		PlaybackPCM "hw:${CardId},1"
f29710
+		# PlaybackMixerElem "IEC958"
f29710
+	}
f29710
+}
f29710
+
f29710
+SectionDevice."Line" {
f29710
+	Comment "Line In"
f29710
+	Value {
f29710
+		CapturePriority 100
f29710
+		CapturePCM "hw:${CardId}"
f29710
+		JackControl "Line Jack"
f29710
+		CaptureMixerElem "Line"
f29710
+	}
f29710
+}
f29710
+
f29710
+SectionDevice."Mic1" {
f29710
+	Comment "Microphone"
f29710
+	Value {
f29710
+		CapturePriority 200
f29710
+		CapturePCM "hw:${CardId},1"
f29710
+		JackControl "Mic Jack"
f29710
+		CaptureMixerElem "Mic"
f29710
+	}
f29710
+}
f29710
+
f29710
+SectionDevice."Mic2" {
f29710
+	Comment "Front Microphone"
f29710
+	Value {
f29710
+		CapturePriority 300
f29710
+		CapturePCM "hw:${CardId},2"
f29710
+		JackControl "Front Mic Jack"
f29710
+		CaptureMixerElem "Front Mic"
f29710
+	}
f29710
+}
f29710
diff --git a/ucm2/USB-Audio/Gigabyte-Aorus-Master-Main-Audio.conf b/ucm2/USB-Audio/Gigabyte-Aorus-Master-Main-Audio.conf
f29710
new file mode 100644
f29710
index 0000000..656b989
f29710
--- /dev/null
f29710
+++ b/ucm2/USB-Audio/Gigabyte-Aorus-Master-Main-Audio.conf
f29710
@@ -0,0 +1,6 @@
f29710
+Syntax 3
f29710
+Comment "Gigabyte Aorus Integrated Audio"
f29710
+SectionUseCase."HiFi" {
f29710
+	File "Gigabyte-Aorus-Master-Main-Audio-HiFi.conf"
f29710
+	Comment "Default Alsa Profile"
f29710
+}
f29710
-- 
f29710
2.29.2
f29710
f29710
f29710
From 062e4710c524283c5d11cbf99931b24c6d963f98 Mon Sep 17 00:00:00 2001
f29710
From: Marijn Suijten <marijns95@gmail.com>
f29710
Date: Thu, 14 Jan 2021 14:11:50 +0100
f29710
Subject: [PATCH 17/24] USB-Audio/ALC1220: Bump analog Speaker priority over
f29710
 S/PDIF
f29710
f29710
The `S/PDIF` port does not have any jack sensing, and with a priority
f29710
higher than the `Speakers` it will always be selected by default instead
f29710
of the `Speakers` even if unplugged.
f29710
f29710
Swapping the priorities around allows analog `Speakers` to be selected
f29710
first, _if_ they are plugged in. Otherwise `S/PDIF` is used.
f29710
f29710
Signed-off-by: Marijn Suijten <marijns95@gmail.com>
f29710
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
f29710
---
f29710
 ucm2/USB-Audio/Realtek-ALC1220-VB-Desktop-HiFi.conf | 4 ++--
f29710
 1 file changed, 2 insertions(+), 2 deletions(-)
f29710
f29710
diff --git a/ucm2/USB-Audio/Realtek-ALC1220-VB-Desktop-HiFi.conf b/ucm2/USB-Audio/Realtek-ALC1220-VB-Desktop-HiFi.conf
f29710
index 344db83..cbf7154 100644
f29710
--- a/ucm2/USB-Audio/Realtek-ALC1220-VB-Desktop-HiFi.conf
f29710
+++ b/ucm2/USB-Audio/Realtek-ALC1220-VB-Desktop-HiFi.conf
f29710
@@ -2,7 +2,7 @@ SectionDevice."Speaker" {
f29710
 	Comment "Speakers"
f29710
 	Value {
f29710
 	       PlaybackChannels 8
f29710
-	       PlaybackPriority 100
f29710
+	       PlaybackPriority 200
f29710
 	       PlaybackPCM "hw:${CardId}"
f29710
 	       JackControl "Speaker Jack"
f29710
 	       PlaybackMixerElem "Speaker"
f29710
@@ -22,7 +22,7 @@ SectionDevice."Headphones" {
f29710
 SectionDevice."SPDIF" {
f29710
 	Comment "S/PDIF Out"
f29710
 	Value {
f29710
-		PlaybackPriority 200
f29710
+		PlaybackPriority 100
f29710
 		PlaybackPCM "hw:${CardId},2"
f29710
 		PlaybackMixerElem "IEC958"
f29710
 	}
f29710
-- 
f29710
2.29.2
f29710
f29710
f29710
From 8e875c9467cc72e53e53104b07d5515f3ef0a779 Mon Sep 17 00:00:00 2001
f29710
From: Jaroslav Kysela <perex@perex.cz>
f29710
Date: Fri, 15 Jan 2021 14:03:35 +0100
f29710
Subject: [PATCH 18/24] USB-Audio/ALC1220: fix indentation for Speaker device
f29710
f29710
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
f29710
---
f29710
 ucm2/USB-Audio/Realtek-ALC1220-VB-Desktop-HiFi.conf | 10 +++++-----
f29710
 1 file changed, 5 insertions(+), 5 deletions(-)
f29710
f29710
diff --git a/ucm2/USB-Audio/Realtek-ALC1220-VB-Desktop-HiFi.conf b/ucm2/USB-Audio/Realtek-ALC1220-VB-Desktop-HiFi.conf
f29710
index cbf7154..0d75384 100644
f29710
--- a/ucm2/USB-Audio/Realtek-ALC1220-VB-Desktop-HiFi.conf
f29710
+++ b/ucm2/USB-Audio/Realtek-ALC1220-VB-Desktop-HiFi.conf
f29710
@@ -1,11 +1,11 @@
f29710
 SectionDevice."Speaker" {
f29710
 	Comment "Speakers"
f29710
 	Value {
f29710
-	       PlaybackChannels 8
f29710
-	       PlaybackPriority 200
f29710
-	       PlaybackPCM "hw:${CardId}"
f29710
-	       JackControl "Speaker Jack"
f29710
-	       PlaybackMixerElem "Speaker"
f29710
+		PlaybackChannels 8
f29710
+		PlaybackPriority 200
f29710
+		PlaybackPCM "hw:${CardId}"
f29710
+		JackControl "Speaker Jack"
f29710
+		PlaybackMixerElem "Speaker"
f29710
 	}
f29710
 }
f29710
 
f29710
-- 
f29710
2.29.2
f29710
f29710
f29710
From 5503703ab95d5ed40b1da138016777bb5429190e Mon Sep 17 00:00:00 2001
f29710
From: Jaroslav Kysela <perex@perex.cz>
f29710
Date: Fri, 15 Jan 2021 14:55:53 +0100
f29710
Subject: [PATCH 19/24] USB-Audio: fix indentation in
f29710
 Gigabyte-Aorus-Master-Main-Audio-HiFi.conf
f29710
f29710
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
f29710
---
f29710
 .../Gigabyte-Aorus-Master-Main-Audio-HiFi.conf         | 10 +++++-----
f29710
 1 file changed, 5 insertions(+), 5 deletions(-)
f29710
f29710
diff --git a/ucm2/USB-Audio/Gigabyte-Aorus-Master-Main-Audio-HiFi.conf b/ucm2/USB-Audio/Gigabyte-Aorus-Master-Main-Audio-HiFi.conf
f29710
index 5c24165..37800fb 100644
f29710
--- a/ucm2/USB-Audio/Gigabyte-Aorus-Master-Main-Audio-HiFi.conf
f29710
+++ b/ucm2/USB-Audio/Gigabyte-Aorus-Master-Main-Audio-HiFi.conf
f29710
@@ -3,11 +3,11 @@ Define.SecondaryCardId "$${CardIdByName:Aorus Master Front Headphone}"
f29710
 SectionDevice."Speaker" {
f29710
 	Comment "Speakers"
f29710
 	Value {
f29710
-	       PlaybackChannels 8
f29710
-	       PlaybackPriority 200
f29710
-	       PlaybackPCM "hw:${CardId}"
f29710
-	       JackControl "Line Out Jack"
f29710
-	       PlaybackMixerElem "Line Out"
f29710
+		PlaybackChannels 8
f29710
+		PlaybackPriority 200
f29710
+		PlaybackPCM "hw:${CardId}"
f29710
+		JackControl "Line Out Jack"
f29710
+		PlaybackMixerElem "Line Out"
f29710
 	}
f29710
 }
f29710
 
f29710
-- 
f29710
2.29.2
f29710
f29710
f29710
From eaa5eacd3e068471537888dee627751dc35e714a Mon Sep 17 00:00:00 2001
f29710
From: Hans de Goede <hdegoede@redhat.com>
f29710
Date: Wed, 16 Dec 2020 16:38:37 +0100
f29710
Subject: [PATCH 20/24] chtnau8824: Add a SST define/variable
f29710
f29710
Add a SST define which gets set to "yes" when using the SST driver
f29710
and to "" when not using the SST driver;
f29710
f29710
And decide if platforms/bytcr/PlatformEnableSeq.conf should be included
f29710
or not based on this.
f29710
f29710
This is a preparation patch for adding SOF support.
f29710
f29710
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
f29710
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
f29710
---
f29710
 ucm2/chtnau8824/HiFi.conf | 19 +++++++++++++++----
f29710
 1 file changed, 15 insertions(+), 4 deletions(-)
f29710
f29710
diff --git a/ucm2/chtnau8824/HiFi.conf b/ucm2/chtnau8824/HiFi.conf
f29710
index 105f360..b36588f 100644
f29710
--- a/ucm2/chtnau8824/HiFi.conf
f29710
+++ b/ucm2/chtnau8824/HiFi.conf
f29710
@@ -1,5 +1,16 @@
f29710
 Define.Speaker "Speaker"
f29710
 Define.Mic "InternalMic"
f29710
+Define.SST "yes"
f29710
+
f29710
+If.Controls {
f29710
+	Condition {
f29710
+		Type ControlExists
f29710
+		Control "name='media0_in Gain 0 Switch'"
f29710
+	}
f29710
+	False {
f29710
+		Define.SST ""
f29710
+	}
f29710
+}
f29710
 
f29710
 If.cfg-mspk {
f29710
 	Condition {
f29710
@@ -33,12 +44,12 @@ SectionVerb {
f29710
 
f29710
 	Include.e.File "/codecs/nau8824/EnableSeq.conf"
f29710
 
f29710
-	If.Controls {
f29710
+	If.SST {
f29710
 		Condition {
f29710
-			Type ControlExists
f29710
-			Control "name='media0_in Gain 0 Switch'"
f29710
+			Type String
f29710
+			Empty "${var:SST}"
f29710
 		}
f29710
-		True {
f29710
+		False {
f29710
 			Include.pe {
f29710
 				File "/platforms/bytcr/PlatformEnableSeq.conf"
f29710
 				Before.EnableSequence "0"
f29710
-- 
f29710
2.29.2
f29710
f29710
f29710
From 4e0369b4fcebde195a38d5b90c73b08f28e0047a Mon Sep 17 00:00:00 2001
f29710
From: Takashi Iwai <tiwai@suse.de>
f29710
Date: Thu, 21 Jan 2021 11:15:02 +0100
f29710
Subject: [PATCH 21/24] kblrt5660: Fix file permissions
f29710
f29710
The exec bit was set wrongly on those files.  Fix them.
f29710
f29710
Signed-off-by: Takashi Iwai <tiwai@suse.de>
f29710
---
f29710
 ucm2/kblrt5660/Hdmi1.conf     | 0
f29710
 ucm2/kblrt5660/Hdmi2.conf     | 0
f29710
 ucm2/kblrt5660/HiFi.conf      | 0
f29710
 ucm2/kblrt5660/kblrt5660.conf | 0
f29710
 4 files changed, 0 insertions(+), 0 deletions(-)
f29710
 mode change 100755 => 100644 ucm2/kblrt5660/Hdmi1.conf
f29710
 mode change 100755 => 100644 ucm2/kblrt5660/Hdmi2.conf
f29710
 mode change 100755 => 100644 ucm2/kblrt5660/HiFi.conf
f29710
 mode change 100755 => 100644 ucm2/kblrt5660/kblrt5660.conf
f29710
f29710
diff --git a/ucm2/kblrt5660/Hdmi1.conf b/ucm2/kblrt5660/Hdmi1.conf
f29710
old mode 100755
f29710
new mode 100644
f29710
diff --git a/ucm2/kblrt5660/Hdmi2.conf b/ucm2/kblrt5660/Hdmi2.conf
f29710
old mode 100755
f29710
new mode 100644
f29710
diff --git a/ucm2/kblrt5660/HiFi.conf b/ucm2/kblrt5660/HiFi.conf
f29710
old mode 100755
f29710
new mode 100644
f29710
diff --git a/ucm2/kblrt5660/kblrt5660.conf b/ucm2/kblrt5660/kblrt5660.conf
f29710
old mode 100755
f29710
new mode 100644
f29710
-- 
f29710
2.29.2
f29710
f29710
f29710
From 96e1c19a6bcc1e353f677966d4d93399204af0ec Mon Sep 17 00:00:00 2001
f29710
From: Hans de Goede <hdegoede@redhat.com>
f29710
Date: Wed, 16 Dec 2020 16:38:38 +0100
f29710
Subject: [PATCH 22/24] chtnau8824: Add support for using the SOF driver
f29710
f29710
The old (and currently the default) SST driver uses TDM 4 slots 24 bit
f29710
as wire format to the codec. Where as the new SOF driver uses standard
f29710
I2S 2 channel 24 bit.
f29710
f29710
Normally this should not impact the UCM settings, but on the NAU8824
f29710
the "DAC Right Channel Source" mixer setting must be set to 1 when
f29710
using TDM 4 slots and to 0 when using I2S 2 channel mode.
f29710
f29710
Getting this wrong (in either case) results in the right channel not
f29710
outputting any sound.
f29710
f29710
This commit introduces a RightOutputChannel variable which gets
f29710
set to 0/1 depending on the driver and then uses that for the
f29710
"DAC Right Channel Source" mixer setting so that we do the right
f29710
thing depending on the driver.
f29710
f29710
This has been tested on the following devices:
f29710
f29710
Medion E2215T:    Stereo speakers, analog mic
f29710
Medion E2228T:    Stereo speakers, stereo digital mics
f29710
Cube iWork 8 Air: Mono speaker, analog mic
f29710
f29710
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
f29710
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
f29710
---
f29710
 ucm2/chtnau8824/HiFi.conf          | 2 ++
f29710
 ucm2/codecs/nau8824/EnableSeq.conf | 2 +-
f29710
 2 files changed, 3 insertions(+), 1 deletion(-)
f29710
f29710
diff --git a/ucm2/chtnau8824/HiFi.conf b/ucm2/chtnau8824/HiFi.conf
f29710
index b36588f..c3d830d 100644
f29710
--- a/ucm2/chtnau8824/HiFi.conf
f29710
+++ b/ucm2/chtnau8824/HiFi.conf
f29710
@@ -1,6 +1,7 @@
f29710
 Define.Speaker "Speaker"
f29710
 Define.Mic "InternalMic"
f29710
 Define.SST "yes"
f29710
+Define.RightOutputChannel 1
f29710
 
f29710
 If.Controls {
f29710
 	Condition {
f29710
@@ -9,6 +10,7 @@ If.Controls {
f29710
 	}
f29710
 	False {
f29710
 		Define.SST ""
f29710
+		Define.RightOutputChannel 0
f29710
 	}
f29710
 }
f29710
 
f29710
diff --git a/ucm2/codecs/nau8824/EnableSeq.conf b/ucm2/codecs/nau8824/EnableSeq.conf
f29710
index 3650d06..660856f 100644
f29710
--- a/ucm2/codecs/nau8824/EnableSeq.conf
f29710
+++ b/ucm2/codecs/nau8824/EnableSeq.conf
f29710
@@ -1,7 +1,7 @@
f29710
 EnableSequence [
f29710
 	# Playback TDM configuration
f29710
 	cset "name='DACL Channel Source' 0"
f29710
-	cset "name='DACR Channel Source' 1"
f29710
+	cset "name='DACR Channel Source' ${var:RightOutputChannel}"
f29710
 	# Input Configuration
f29710
 	cset "name='DMIC1 Enable Switch' off"
f29710
 	cset "name='DMIC2 Enable Switch' off"
f29710
-- 
f29710
2.29.2
f29710
f29710
f29710
From 3bea51c3188257c5bc0eaaed922d1f714e3508c7 Mon Sep 17 00:00:00 2001
f29710
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
f29710
Date: Thu, 21 Jan 2021 14:38:26 -0600
f29710
Subject: [PATCH 23/24] sof-hda-dsp: update handling of cfg-dmics strings
f29710
f29710
Existing platforms can have 1,2,3 or 4 microphones. The SOF firmware
f29710
will generate 2 or 4 channels. Since by default CaptureChannels is 2,
f29710
we need to add the case for cfg-dmics = 3.
f29710
f29710
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
f29710
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
f29710
---
f29710
 ucm2/sof-hda-dsp/HiFi.conf | 6 +++---
f29710
 1 file changed, 3 insertions(+), 3 deletions(-)
f29710
f29710
diff --git a/ucm2/sof-hda-dsp/HiFi.conf b/ucm2/sof-hda-dsp/HiFi.conf
f29710
index a250331..2c02c15 100644
f29710
--- a/ucm2/sof-hda-dsp/HiFi.conf
f29710
+++ b/ucm2/sof-hda-dsp/HiFi.conf
f29710
@@ -16,9 +16,9 @@ SectionDevice."Mic1" {
f29710
 		CapturePCM "hw:${CardId},6"
f29710
 		If.chn {
f29710
 			Condition {
f29710
-				Type String
f29710
-				Haystack "${CardComponents}"
f29710
-				Needle "cfg-dmics:4"
f29710
+				Type RegexMatch
f29710
+				Regex "cfg-dmics:[34]"
f29710
+				String "${CardComponents}"
f29710
 			}
f29710
 			True {
f29710
 				CaptureChannels 4
f29710
-- 
f29710
2.29.2
f29710
f29710
f29710
From 889c5b9809f1635005d77871bb9abc09df6a3cc3 Mon Sep 17 00:00:00 2001
f29710
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
f29710
Date: Thu, 21 Jan 2021 14:44:05 -0600
f29710
Subject: [PATCH 24/24] sof-soundwire: add support for dmics
f29710
f29710
the pinmux allows for SoundWire to be used on e.g. link0 and link1,
f29710
and the rest of the pins can be assigned for dmic usages.
f29710
f29710
We currently don't track this capability which means users don't see a
f29710
capture device, e.g. on HP Spectre x360.
f29710
f29710
The sof_sdw machine driver was modified to report the cfg-dmics
f29710
string, possible values are 0..4.
f29710
f29710
BugLink: https://github.com/thesofproject/linux/issues/2700
f29710
BugLink: https://github.com/alsa-project/alsa-ucm-conf/pull/75
f29710
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
f29710
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
f29710
---
f29710
 ucm2/sof-soundwire/dmic.conf          | 21 +++++++++++++++++++++
f29710
 ucm2/sof-soundwire/sof-soundwire.conf |  5 +++++
f29710
 2 files changed, 26 insertions(+)
f29710
 create mode 100644 ucm2/sof-soundwire/dmic.conf
f29710
f29710
diff --git a/ucm2/sof-soundwire/dmic.conf b/ucm2/sof-soundwire/dmic.conf
f29710
new file mode 100644
f29710
index 0000000..1f704a5
f29710
--- /dev/null
f29710
+++ b/ucm2/sof-soundwire/dmic.conf
f29710
@@ -0,0 +1,21 @@
f29710
+SectionDevice."Mic" {
f29710
+	Comment "Digital Microphone"
f29710
+
f29710
+	Value {
f29710
+		CapturePriority 100
f29710
+		CapturePCM "hw:${CardId},3"
f29710
+		If.chn {
f29710
+			Condition {
f29710
+				Type RegexMatch
f29710
+				Regex "[34]"
f29710
+				String "${var:Mics1}"
f29710
+			}
f29710
+			True {
f29710
+				CaptureChannels 4
f29710
+			}
f29710
+		}
f29710
+		CaptureMixerElem "Dmic0"
f29710
+		CaptureVolume "Dmic0 Capture Volume"
f29710
+		CaptureSwitch "Dmic0 Capture Switch"
f29710
+	}
f29710
+}
f29710
diff --git a/ucm2/sof-soundwire/sof-soundwire.conf b/ucm2/sof-soundwire/sof-soundwire.conf
f29710
index 2ba44be..ec8b01e 100644
f29710
--- a/ucm2/sof-soundwire/sof-soundwire.conf
f29710
+++ b/ucm2/sof-soundwire/sof-soundwire.conf
f29710
@@ -11,6 +11,7 @@ Define {
f29710
 	SpeakerAmps1 "0"
f29710
 	HeadsetCodec1 ""
f29710
 	MicCodec1 ""
f29710
+	Mics1 "0"
f29710
 }
f29710
 
f29710
 DefineRegex {
f29710
@@ -34,6 +35,10 @@ DefineRegex {
f29710
 		Regex " mic:([a-z0-9]+)"
f29710
 		String "${CardComponents}"
f29710
 	}
f29710
+	Mics {
f29710
+		Regex " cfg-mics:([1-9][0-9]*)"
f29710
+		String "${CardComponents}"
f29710
+	}
f29710
 }
f29710
 
f29710
 If.hs_init {
f29710
-- 
f29710
2.29.2
f29710