diff mbox series

[alsa-ucm-conf,v3,2/2] sof-soundwire: Add basic support for basic cs35l56 configurations

Message ID 20231206164612.1362203-2-ckeepax@opensource.cirrus.com
State New
Headers show
Series [alsa-ucm-conf,v3,1/2] sof-soundwire: Add basic support for cs42l43 | expand

Commit Message

Charles Keepax Dec. 6, 2023, 4:46 p.m. UTC
cs35l56 is a boosted speaker amp, add UCM support for configurations
with up to 8 amps.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
---

Changes since v2:
 - Rebased on top of conversion of the Realtek amps.
 - Add a macro for each amp to simplify things a bit.

Thanks,
Charles

 ucm2/sof-soundwire/cs35l56.conf | 41 +++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)
 create mode 100644 ucm2/sof-soundwire/cs35l56.conf
diff mbox series

Patch

diff --git a/ucm2/sof-soundwire/cs35l56.conf b/ucm2/sof-soundwire/cs35l56.conf
new file mode 100644
index 0000000..7eca3fd
--- /dev/null
+++ b/ucm2/sof-soundwire/cs35l56.conf
@@ -0,0 +1,41 @@ 
+# Use case Configuration for sof-soundwire card
+
+#
+# Arguments:
+#   Amp - Amp number 1-8
+#
+
+DefineMacro.cs42l43spk {
+	If.amppresent {
+		Condition {
+			Type ControlExists
+			Control "name='AMP${var:__Amp} Speaker Switch'"
+		}
+		True {
+			EnableSequence [
+				cset "name='AMP${var:__Amp} Speaker Switch' 1"
+			]
+			DisableSequence [
+				cset "name='AMP${var:__Amp} Speaker Switch' 0"
+			]
+		}
+	}
+}
+
+SectionDevice."Speaker" {
+	Comment "Speaker"
+
+	Macro.num1.cs42l43spk { Amp 1 }
+	Macro.num2.cs42l43spk { Amp 2 }
+	Macro.num3.cs42l43spk { Amp 3 }
+	Macro.num4.cs42l43spk { Amp 4 }
+	Macro.num5.cs42l43spk { Amp 5 }
+	Macro.num6.cs42l43spk { Amp 6 }
+	Macro.num7.cs42l43spk { Amp 7 }
+	Macro.num8.cs42l43spk { Amp 8 }
+
+	Value {
+		PlaybackPriority 100
+		PlaybackPCM "hw:${CardId},2"
+	}
+}