SectionDevice."Headphones" {
	Comment "Headphones"

	ConflictingDevice [
		"Speaker"
	]

	EnableSequence [
		# Swap left and right
		cset "name='Stereo DAC MIXL DAC R1 Switch' on"
		cset "name='Stereo DAC MIXL DAC L1 Switch' off"
		cset "name='Stereo DAC MIXR DAC L1 Switch' on"
		cset "name='Stereo DAC MIXR DAC R1 Switch' off"

		cset "name='Headphone Switch' on"
		cset "name='HPO L Playback Switch' on"
		cset "name='HPO R Playback Switch' on"
		# Done after turning the HP on to keep the bias and clk on
		cset "name='Speaker Switch' off"
		cset "name='LOUT L Playback Switch' off"
		cset "name='LOUT R Playback Switch' off"
	]

	DisableSequence [
		# Disabling the HP switches is done by the Speaker EnableSeq

		# Unswap left and right
		cset "name='Stereo DAC MIXL DAC L1 Switch' on"
		cset "name='Stereo DAC MIXL DAC R1 Switch' off"
		cset "name='Stereo DAC MIXR DAC R1 Switch' on"
		cset "name='Stereo DAC MIXR DAC L1 Switch' off"
	]

	Value {
		PlaybackPriority 200
		PlaybackPCM "hw:${CardId}"
		JackControl "Headphone Jack"
	}
}
