SectionDevice."HeadsetMic" {
	Comment "Headset Microphone"

	ConflictingDevice [
		"DigitalMic-DMIC1"
		"DigitalMic-DMIC2"
	]

	EnableSequence [
		cset "name='Headset Mic Switch' on"
        	cset "name='RECMIXL BST1 Switch' on"
		cset "name='RECMIXR BST1 Switch' on"
		cset "name='Sto1 ADC MIXL ADC1 Switch' on"
		cset "name='Sto1 ADC MIXR ADC1 Switch' on"
		# For unknown reasons the headset mic sound is only recorded
		# on the left channel, we tweak the data-stream reception to
		# use the left samples for both slots, so that we get a stereo
		# stream with the mic sound on both channels
		cset "name='codec_in rx deinterleaver codec_in0_1' 1"
	]

	DisableSequence [
		cset "name='Headset Mic Switch' off"
        	cset "name='RECMIXL BST1 Switch' off"
		cset "name='RECMIXR BST1 Switch' off"
		cset "name='Sto1 ADC MIXL ADC1 Switch' off"
		cset "name='Sto1 ADC MIXR ADC1 Switch' off"
		# Undo data-stream reception mono-mix workaround
		cset "name='codec_in rx deinterleaver codec_in0_1' 2"
	]

	Value {
		CaptureChannels "2"
		JackControl "Headset Mic Jack"
	}
}
