# Use case Configuration for sof-soundwire card

#
# Arguments:
#   ForAmps - regex filter for var:SpeakerAmps
#   Amp - amplifier number 1-8
#
DefineMacro.cs42l43spk.If.0 {
	Condition {
		Type RegexMatch
		Regex "${var:__ForAmps}"
		String "${var:SpeakerAmps}"
	}
	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 { ForAmps "[1-8]" Amp 1 }
	Macro.num2.cs42l43spk { ForAmps "[2-8]" Amp 2 }
	Macro.num3.cs42l43spk { ForAmps "[3-8]" Amp 3 }
	Macro.num4.cs42l43spk { ForAmps "[4-8]" Amp 4 }
	Macro.num5.cs42l43spk { ForAmps "[5-8]" Amp 5 }
	Macro.num6.cs42l43spk { ForAmps "[6-8]" Amp 6 }
	Macro.num7.cs42l43spk { ForAmps "[78]" Amp 7 }
	Macro.num8.cs42l43spk { ForAmps "8" Amp 8 }

	Value {
		PlaybackPriority 100
		PlaybackPCM "hw:${CardId},2"
	}
}
