diff mbox series

[alsa-ucm-conf,1/2] bytcr-wm5102: Add support for speakers connected to HPOUT2

Message ID 20231021211614.115152-1-hdegoede@redhat.com (mailing list archive)
State New, archived
Headers show
Series [alsa-ucm-conf,1/2] bytcr-wm5102: Add support for speakers connected to HPOUT2 | expand

Commit Message

Hans de Goede Oct. 21, 2023, 9:16 p.m. UTC
On the Lenovo Yoga Tab 3 YT3-X90 the speaker amplifiers are connected
to the HPOUT2 output pins instead of the the SPK output pins.

Check for "cfg-spk:hpout2" in the components string which indicates
this setup and add a ucm2/codecs/wm5102/HPOut2-Speaker.conf file
for this setup.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 ucm2/Intel/bytcr-wm5102/HiFi.conf      | 11 ++++++++++-
 ucm2/codecs/wm5102/EnableSeq.conf      |  2 ++
 ucm2/codecs/wm5102/HPOut2-Speaker.conf | 22 ++++++++++++++++++++++
 3 files changed, 34 insertions(+), 1 deletion(-)
 create mode 100644 ucm2/codecs/wm5102/HPOut2-Speaker.conf

Comments

Jaroslav Kysela Oct. 31, 2023, 3:40 p.m. UTC | #1
On 21. 10. 23 23:16, Hans de Goede wrote:
> On the Lenovo Yoga Tab 3 YT3-X90 the speaker amplifiers are connected
> to the HPOUT2 output pins instead of the the SPK output pins.
> 
> Check for "cfg-spk:hpout2" in the components string which indicates
> this setup and add a ucm2/codecs/wm5102/HPOut2-Speaker.conf file
> for this setup.
> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Thanks. Applied.

				Jaroslav
diff mbox series

Patch

diff --git a/ucm2/Intel/bytcr-wm5102/HiFi.conf b/ucm2/Intel/bytcr-wm5102/HiFi.conf
index 1269868..2afc757 100644
--- a/ucm2/Intel/bytcr-wm5102/HiFi.conf
+++ b/ucm2/Intel/bytcr-wm5102/HiFi.conf
@@ -21,7 +21,16 @@  SectionVerb {
 	}
 }
 
-Include.spk.File "/codecs/wm5102/Speaker.conf"
+If.spk {
+	Condition {
+		Type String
+		Haystack "${CardComponents}"
+		Needle "cfg-spk:hpout2"
+	}
+	True.Include.hpout2.File "/codecs/wm5102/HPOut2-Speaker.conf"
+	False.Include.spk.File "/codecs/wm5102/Speaker.conf"
+}
+
 Include.hp.File "/codecs/wm5102/HeadPhones.conf"
 Include.mic.File "/codecs/wm5102/IN3-InternalMic.conf"
 Include.headset.File "/codecs/wm5102/IN1-HeadsetMic.conf"
diff --git a/ucm2/codecs/wm5102/EnableSeq.conf b/ucm2/codecs/wm5102/EnableSeq.conf
index 6a857a2..87cb3bb 100644
--- a/ucm2/codecs/wm5102/EnableSeq.conf
+++ b/ucm2/codecs/wm5102/EnableSeq.conf
@@ -4,6 +4,8 @@  EnableSequence [
 	cset "name='SPKOUTR Input 1' AIF1RX2"
 	cset "name='HPOUT1L Input 1' AIF1RX1"
 	cset "name='HPOUT1R Input 1' AIF1RX2"
+	cset "name='HPOUT2L Input 1' AIF1RX1"
+	cset "name='HPOUT2R Input 1' AIF1RX2"
 
 	# Both mics are quite soft by default, boost then
 	cset "name='IN1L Volume' 28"
diff --git a/ucm2/codecs/wm5102/HPOut2-Speaker.conf b/ucm2/codecs/wm5102/HPOut2-Speaker.conf
new file mode 100644
index 0000000..375f9ba
--- /dev/null
+++ b/ucm2/codecs/wm5102/HPOut2-Speaker.conf
@@ -0,0 +1,22 @@ 
+SectionDevice."Speaker" {
+	Comment "Speakers"
+
+	Value {
+		PlaybackPriority 100
+		PlaybackPCM "hw:${CardId}"
+	}
+
+	ConflictingDevice [
+		"Headphones"
+	]
+
+	EnableSequence [
+		cset "name='HPOUT2 Digital Switch' on"
+		cset "name='Speaker Switch' on"
+	]
+
+	DisableSequence [
+		cset "name='HPOUT2 Digital Switch' off"
+		cset "name='Speaker Switch' off"
+	]
+}