[PATCH alsa-ucm-conf] ucm2: bytcr-rt5640: Add support for swapped speakers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Some BYTCR x86 tablets with a rt5640 codec have their speakers
swapped. This is indicated by the kernel by setting cfg-spk:swapped
in the components string. Add support for this.

Signed-off-by: Hans de Goede <hdegoede@xxxxxxxxxx>
---
 ucm2/Intel/bytcr-rt5640/HiFi.conf | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/ucm2/Intel/bytcr-rt5640/HiFi.conf b/ucm2/Intel/bytcr-rt5640/HiFi.conf
index fd1906c..7e10db5 100644
--- a/ucm2/Intel/bytcr-rt5640/HiFi.conf
+++ b/ucm2/Intel/bytcr-rt5640/HiFi.conf
@@ -70,6 +70,7 @@ If.spk {
 
 		SectionDevice."Speaker" {
 			EnableSequence [
+				cset "name='DAC IF1 Data Switch' Normal"
 				cset "name='Speaker Switch' on"
 			]
 
@@ -91,6 +92,31 @@ If.mono {
 
 		SectionDevice."Speaker" {
 			EnableSequence [
+				cset "name='DAC IF1 Data Switch' Normal"
+				cset "name='Speaker Switch' on"
+			]
+
+			DisableSequence [
+				cset "name='Speaker Switch' off"
+			]
+		}
+	}
+}
+
+# Note this direcly looks at CardComponents since this is never set
+# by HiFi-LongName.conf
+If.swapped {
+	Condition {
+		Type String
+		Haystack "${CardComponents}"
+		Needle "cfg-spk:swapped"
+	}
+	True {
+		Include.spk.File "/codecs/rt5640/Speaker.conf"
+
+		SectionDevice."Speaker" {
+			EnableSequence [
+				cset "name='DAC IF1 Data Switch' Swap"
 				cset "name='Speaker Switch' on"
 			]
 
@@ -108,6 +134,7 @@ If.hp {
 
 		SectionDevice."Headphones" {
 			EnableSequence [
+				cset "name='DAC IF1 Data Switch' Normal"
 				cset "name='Headphone Switch' on"
 			]
 
@@ -125,6 +152,7 @@ If.hp2 {
 
 		SectionDevice."Headphones2" {
 			EnableSequence [
+				cset "name='DAC IF1 Data Switch' Normal"
 				cset "name='Line Out Switch' on"
 			]
 
-- 
2.41.0




[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux