SectionVerb {
	EnableSequence [
		disdevall ""
	]

	Value.TQ "HiFi"
}

SectionDevice."Handset" {
	Comment "Handset"

	ConflictingDevice [
		"Headphones"
		"Speaker"
	]

	EnableSequence [
		cset "name='Speaker Switch' off,on"
		cset "name='DAC L/R Swap Switch' on"
		cset "name='DAC Monomix Switch' on"
		cset "name='SPKOUTR PGA' DAC"
		cset "name='Speaker Boost Volume' 2"
	]

	DisableSequence [
		cset "name='Speaker Switch' off,off"
		cset "name='DAC L/R Swap Switch' off"
		cset "name='DAC Monomix Switch' off"
		cset "name='SPKOUTR PGA' Mixer"
	]

	Value {
		PlaybackPriority "100"
		PlaybackVolume "name='Speaker Volume'"
		PlaybackSwitch "name='Speaker Switch'"
		PlaybackMixerElem "Speaker"
		PlaybackPCM "hw:${CardId}"
	}
}

SectionDevice."Speaker" {
	Comment "Speaker"

	ConflictingDevice [
		"Handset"
		"Headphones"
	]

	EnableSequence [
		cset "name='Speaker Switch' on,off"
		cset "name='DAC Monomix Switch' on"
		cset "name='SPKOUTL PGA' DAC"
		cset "name='Speaker Boost Volume' 6"
	]

	DisableSequence [
		cset "name='Speaker Switch' off,off"
		cset "name='DAC Monomix Switch' off"
		cset "name='SPKOUTL PGA' Mixer"
	]

	Value {
		PlaybackPriority "500"
		PlaybackVolume "name='Speaker Volume'"
		PlaybackSwitch "name='Speaker Switch'"
		PlaybackMixerElem "Speaker"
		PlaybackPCM "hw:${CardId}"
	}
}

SectionDevice."Headphones" {
	Comment "Headphones"

	ConflictingDevice [
		"Handset"
		"Speaker"
	]

	EnableSequence [
		cset "name='Headphone Switch' on,on"
		cset "name='HPOUTL PGA' 0 unmute"
		cset "name='HPOUTR PGA' 0 unmute"
	]

	DisableSequence [
		cset "name='Headphone Switch' off off"
		cset "name='HPOUTL PGA' 0 mute"
		cset "name='HPOUTR PGA' 0 mute"
	]

	Value {
		PlaybackPriority "1000"
		PlaybackVolume "name='Headphone Volume'"
		PlaybackSwitch "name='Headphone Switch'"
		PlaybackMixerElem "Headphone"
		PlaybackPCM "hw:${CardId}"
		JackControl "Headphones Jack"
	}
}

SectionDevice."Mic" {
	Comment "Internal Microphone"

	ConflictingDevice [
		"Headset"
	]

	EnableSequence [
		cset "name='ADC L/R Swap Switch' on"
		cset "name='Input Mode' Digital"
	]

	DisableSequence [
		cset "name='ADC L/R Swap Switch' off"
	]

	Value {
		CapturePriority "500"
		CaptureVolume "name='Digital Capture Volume'"
		CaptureMixerElem "Digital"
		CapturePCM "hw:${CardId}"
	}
}

SectionDevice."Headset" {
	Comment "Headset Microphone"

	ConflictingDevice [
		"Mic"
	]

	EnableSequence [
		cset "name='Input Mode' Analog"
		cset "name='MIXINR PGA Switch' on,on"
		cset "name='Capture Switch' on,on"
	]

	DisableSequence [
		cset "name='Capture Switch' off,off"
		cset "name='MIXINR PGA Switch' off,off"
		cset "name='Input Mode' Digital"
	]

	Value {
		CapturePriority "100"
		CaptureVolume "name='Capture Volume'"
		CaptureMixerElem "Capture"
		CapturePCM "hw:${CardId}"
		JackControl "Headphones Jack"
	}
}
