+++ /dev/null
-cs42l43-spk+cs35l56
\ No newline at end of file
+++ /dev/null
-# cs42l43+cs35l56 specific control settings
-#
-# Arguments:
-# Amp - amplifier number 1-8
-#
-DefineMacro.cs35l56spkInit.If.0 {
- Condition {
- Type ControlExists
- Control "name='AMP${var:__Amp} Speaker Switch'"
- }
- True {
- LibraryConfig.remap.Config.ctl.default.map {
- "name='cs42l43 Speaker Playback Switch'" {
- "name='AMP${var:__Amp} Speaker Switch'".vindex.0 0
- }
- }
- FixedBootSequence [
- cset "name='AMP${var:__Amp} Speaker Switch' 0"
- ]
- Macro [{ SetLED { LED="speaker" Action="attach" CtlId="AMP${var:__Amp} Speaker Switch" } }]
- }
-}
-
-LibraryConfig.remap.Config {
- ctl.default.map {
- "name='cs42l43 Speaker Playback Switch'" {
- "name='cs42l43 Speaker Digital Switch'".vindex.0 [ 0 1 ]
- }
- }
-}
-
-Macro [
- { SetLED { LED="speaker" Action="attach" CtlId="cs42l43 Speaker Digital Switch" } }
- { cs35l56spkInit { Amp 1 } }
- { cs35l56spkInit { Amp 2 } }
- { cs35l56spkInit { Amp 3 } }
- { cs35l56spkInit { Amp 4 } }
- { cs35l56spkInit { Amp 5 } }
- { cs35l56spkInit { Amp 6 } }
- { cs35l56spkInit { Amp 7 } }
- { cs35l56spkInit { Amp 8 } }
-]
-# cs42l43-spk specific control settings
+# cs42l43-spk settings
-LibraryConfig.remap.Config {
- ctl.default.map {
- "name='cs42l43 Speaker Playback Switch'" {
- "name='cs42l43 Speaker Digital Switch'".vindex.0 0
- "name='cs42l43 Speaker Digital Switch'".vindex.1 1
+If.no_amp {
+ # cs42l43-spk specific control settings without amplifier
+ Condition {
+ Type String
+ Empty "${var:SpeakerAmp1}"
+ }
+ True {
+ LibraryConfig.remap.Config {
+ ctl.default.map {
+ "name='cs42l43 Speaker Playback Switch'" {
+ "name='cs42l43 Speaker Digital Switch'".vindex.0 0
+ "name='cs42l43 Speaker Digital Switch'".vindex.1 1
+ }
+ }
}
+ Macro [{ SetLED { LED="speaker" Action="attach" CtlId="cs42l43 Speaker Digital Switch" } }]
}
}
-Macro [
- { SetLED { LED="speaker" Action="attach" CtlId="cs42l43 Speaker Digital Switch" } }
-]
\ No newline at end of file
+If.cs35l56_amp {
+ # cs42l43+cs35l56 specific control settings
+ Condition {
+ Type String
+ String1 "${var:SpeakerAmp1}"
+ String2 "cs35l56"
+ }
+
+ True {
+ #
+ # Arguments:
+ # Amp - amplifier number 1-8
+ #
+ DefineMacro.cs35l56spkInit.If.0 {
+ Condition {
+ Type ControlExists
+ Control "name='AMP${var:__Amp} Speaker Switch'"
+ }
+ True {
+ LibraryConfig.remap.Config.ctl.default.map {
+ "name='cs42l43 Speaker Playback Switch'" {
+ "name='AMP${var:__Amp} Speaker Switch'".vindex.0 0
+ }
+ }
+ FixedBootSequence [
+ cset "name='AMP${var:__Amp} Speaker Switch' 0"
+ ]
+ Macro [{ SetLED { LED="speaker" Action="attach" CtlId="AMP${var:__Amp} Speaker Switch" } }]
+ }
+ }
+
+ LibraryConfig.remap.Config {
+ ctl.default.map {
+ "name='cs42l43 Speaker Playback Switch'" {
+ "name='cs42l43 Speaker Digital Switch'".vindex.0 [ 0 1 ]
+ }
+ }
+ }
+
+ Macro [
+ { SetLED { LED="speaker" Action="attach" CtlId="cs42l43 Speaker Digital Switch" } }
+ { cs35l56spkInit { Amp 1 } }
+ { cs35l56spkInit { Amp 2 } }
+ { cs35l56spkInit { Amp 3 } }
+ { cs35l56spkInit { Amp 4 } }
+ { cs35l56spkInit { Amp 5 } }
+ { cs35l56spkInit { Amp 6 } }
+ { cs35l56spkInit { Amp 7 } }
+ { cs35l56spkInit { Amp 8 } }
+ ]
+ }
+}
+++ /dev/null
-cs42l43-spk.conf
\ No newline at end of file
+++ /dev/null
-cs42l43-spk.conf
\ No newline at end of file
+++ /dev/null
-# Use case Configuration for sof-soundwire card
-
-#
-# Arguments:
-# Amp - amplifier number (1,2 etc.)
-# Sel - channel selection (L,R R,L L,L R,R L,L+R R,L+R L+R,L L+R,R L+R,L+R)
-#
-DefineMacro.rt1320spk {
- EnableSequence [
- cset "name='rt1320-${var:__Amp} RX Channel Select' ${var:__Sel}"
- cset "name='rt1320-${var:__Amp} OT23 L Switch' 1"
- cset "name='rt1320-${var:__Amp} OT23 R Switch' 1"
- ]
- DisableSequence [
- cset "name='rt1320-${var:__Amp} OT23 L Switch' 0"
- cset "name='rt1320-${var:__Amp} OT23 R Switch' 0"
- ]
-}
-
-DefineMacro.rt1320AmpNum.If.0 {
- Condition {
- Type ControlExists
- Control "name='rt1320-2 OT23 L Switch'"
- }
- True {
- Macro.num1.rt1320spk { Amp 1 Sel "L,L" }
- Macro.num2.rt1320spk { Amp 2 Sel "R,R" }
- }
- False {
- Macro.num1.rt1320spk { Amp 1 Sel "L,R" }
- }
-}
-
-SectionDevice."Speaker" {
- Comment "Speaker"
-
- Macro.num1.rt1320AmpNum { }
-
- EnableSequence [
- cset "name='Speaker Switch' on"
- ]
-
- DisableSequence [
- cset "name='Speaker Switch' off"
- ]
-
- Value {
- PlaybackPriority 100
- PlaybackPCM "hw:${CardId},2"
- }
-}
# Use case Configuration for sof-soundwire card
+#
+# Arguments:
+# Amp - amplifier number (1,2 etc.)
+# Sel - channel selection (L,R R,L L,L R,R L,L+R R,L+R L+R,L L+R,R L+R,L+R)
+#
+DefineMacro.rt1320spk {
+ EnableSequence [
+ cset "name='rt1320-${var:__Amp} RX Channel Select' ${var:__Sel}"
+ cset "name='rt1320-${var:__Amp} OT23 L Switch' 1"
+ cset "name='rt1320-${var:__Amp} OT23 R Switch' 1"
+ ]
+ DisableSequence [
+ cset "name='rt1320-${var:__Amp} OT23 L Switch' 0"
+ cset "name='rt1320-${var:__Amp} OT23 R Switch' 0"
+ ]
+}
+
+DefineMacro.rt1320AmpNum.If.0 {
+ Condition {
+ Type ControlExists
+ Control "name='rt1320-2 OT23 L Switch'"
+ }
+ True {
+ Macro.num1.rt1320spk { Amp 1 Sel "L,L" }
+ Macro.num2.rt1320spk { Amp 2 Sel "R,R" }
+ }
+ False {
+ Macro.num1.rt1320spk { Amp 1 Sel "L,R" }
+ }
+}
+
If.codec_spk {
Condition {
Type RegexMatch
String "${var:SpeakerCodec1}"
}
True {
+ If.amp {
+ Condition {
+ Type String
+ String1 "${var:SpeakerAmp1}"
+ String2 "rt1320"
+ }
+ True.Macro.num1.rt1320AmpNum { }
+ }
+
SectionDevice."Speaker" {
Comment "Speaker"
+++ /dev/null
-# Use case Configuration for sof-soundwire card
-
-#
-# Arguments:
-# Amp - amplifier number (1,2 etc.)
-# Sel - channel selection (L,R R,L L,L R,R L,L+R R,L+R L+R,L L+R,R L+R,L+R)
-#
-DefineMacro.rt1320spk {
- EnableSequence [
- cset "name='rt1320-${var:__Amp} RX Channel Select' ${var:__Sel}"
- cset "name='rt1320-${var:__Amp} OT23 L Switch' 1"
- cset "name='rt1320-${var:__Amp} OT23 R Switch' 1"
- ]
- DisableSequence [
- cset "name='rt1320-${var:__Amp} OT23 L Switch' 0"
- cset "name='rt1320-${var:__Amp} OT23 R Switch' 0"
- ]
-}
-
-DefineMacro.rt1320AmpNum.If.0 {
- Condition {
- Type ControlExists
- Control "name='rt1320-2 OT23 L Switch'"
- }
- True {
- Macro.num1.rt1320spk { Amp 1 Sel "L,L" }
- Macro.num2.rt1320spk { Amp 2 Sel "R,R" }
- }
- False {
- Macro.num1.rt1320spk { Amp 1 Sel "L,R" }
- }
-}
-
-SectionDevice."Speaker" {
- Comment "Speaker"
-
- Macro.num1.rt1320AmpNum { }
-
- EnableSequence [
- cset "name='Speaker Switch' on"
- ]
-
- DisableSequence [
- cset "name='Speaker Switch' off"
- ]
-
- Value {
- PlaybackPriority 100
- PlaybackPCM "hw:${CardId},2"
- }
-}
# Use case Configuration for sof-soundwire card
+#
+# Arguments:
+# Amp - amplifier number (1,2 etc.)
+# Sel - channel selection (L,R R,L L,L R,R L,L+R R,L+R L+R,L L+R,R L+R,L+R)
+#
+DefineMacro.rt1320spk {
+ EnableSequence [
+ cset "name='rt1320-${var:__Amp} RX Channel Select' ${var:__Sel}"
+ cset "name='rt1320-${var:__Amp} OT23 L Switch' 1"
+ cset "name='rt1320-${var:__Amp} OT23 R Switch' 1"
+ ]
+ DisableSequence [
+ cset "name='rt1320-${var:__Amp} OT23 L Switch' 0"
+ cset "name='rt1320-${var:__Amp} OT23 R Switch' 0"
+ ]
+}
+
+DefineMacro.rt1320AmpNum.If.0 {
+ Condition {
+ Type ControlExists
+ Control "name='rt1320-2 OT23 L Switch'"
+ }
+ True {
+ Macro.num1.rt1320spk { Amp 1 Sel "L,L" }
+ Macro.num2.rt1320spk { Amp 2 Sel "R,R" }
+ }
+ False {
+ Macro.num1.rt1320spk { Amp 1 Sel "L,R" }
+ }
+}
+
If.codecmic {
Condition {
Type RegexMatch
String "${var:SpeakerCodec1}"
}
True {
+ If.amp {
+ Condition {
+ Type String
+ String1 "${var:SpeakerAmp1}"
+ String2 "rt1320"
+ }
+ True.Macro.num1.rt1320AmpNum { }
+ }
+
SectionDevice."Speaker" {
Comment "Speaker"
Define {
SpeakerCodec1 ""
+ SpeakerAmp1 ""
SpeakerChannels1 "2"
SpeakerAmps1 "0"
HeadsetCodec1 ""
If.old_multi_spk {
Condition {
Type RegexMatch
- Regex "(spk:cs42l43-spk .*spk:cs35l56( |$))|(spk:cs35l56 .*spk:cs42l43-spk( |$))"
+ Regex "(spk:cs42l43-spk .*spk:cs35l56( |$))|(spk:cs35l56 .*spk:cs42l43-spk( |$))|(spk:cs35l56\\+cs42l43-spk( |$))"
String "${CardComponents}"
}
True.Define.SpeakerCodec1 "cs42l43-spk+cs35l56"
}
+# for speaker, do codec+amplifier split
+If.spk_amp_split1.Append.DefineRegex.SpeakerSplit {
+ Regex "([a-z0-9-]+)\\+([a-z0-9-]+)"
+ String "${var:SpeakerCodec1}"
+}
+If.spk_amp_split2 {
+ Condition { Type String Empty "${var:-SpeakerSplit1}" }
+ False.Define {
+ SpeakerCodec1 "${var:SpeakerSplit1}"
+ SpeakerAmp1 "${var:SpeakerSplit2}"
+ }
+}
+
# set default file variables after regex evaluation
If.codec_default.Append.Define {
SpeakerCodecFile "${var:SpeakerCodec1}"
False.If.filter {
Condition {
Type RegexMatch
- Regex "(${var:MultiCodecRegex}|tas2783|rt1318|cs42l43-spk(\\+cs35l56)?|cs35l56((-bridge)|(\\+cs42l43-spk))?)"
+ Regex "(${var:MultiCodecRegex}|tas2783|rt1318|cs42l43-spk|cs35l56(-bridge)?)"
String "${var:SpeakerCodecFile}"
}
True.Include.a.File "/codecs/${var:SpeakerCodecFile}/init.conf"