# Use case Configuration for sof-soundwire card

SectionDevice."Mic" {
	Comment "Microphones"

	If.hs_present {
		Condition {
			Type String
			Haystack "${var:HeadsetCodec1}"
			Needle "cs42l43"
		}
		True.ConflictingDevice [
			"Headset"
		]
	}

	DisableSequence [
		cset "name='cs42l43 DP1TX1 Input' 'None'"
		cset "name='cs42l43 DP1TX2 Input' 'None'"
	]

	If.CS42L43B {
		Condition {
			Type ControlExists
			Control "name='cs42l43 Decimator 5 Switch'"
		}
		True {
			EnableSequence [
				cset "name='cs42l43 DP1TX1 Input' 'Decimator 5'"
				cset "name='cs42l43 DP1TX2 Input' 'Decimator 6'"
				cset "name='cs42l43 DP1TX3 Input' 'Decimator 3'"
				cset "name='cs42l43 DP1TX4 Input' 'Decimator 4'"
			]

			DisableSequence [
				cset "name='cs42l43 DP1TX3 Input' 'None'"
				cset "name='cs42l43 DP1TX4 Input' 'None'"
			]
		}
		False {
			EnableSequence [
				cset "name='cs42l43 DP1TX1 Input' 'Decimator 3'"
				cset "name='cs42l43 DP1TX2 Input' 'Decimator 4'"
			]
		}
	}

	Value {
		CapturePriority 100
		CapturePCM "hw:${CardId},4"
		CaptureMixer "default:${CardId}"
		CaptureMixerElem "cs42l43 Microphone"
	}
}
