Blame SOURCES/alsa-ucm-git.patch

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