Define.MainCardId "rockchipes8388"

SectionVerb {
	EnableSequence [
		exec "/usr/bin/logger -t UCM -p info HiFi_dvt:SectionVerb:EnableSequence"
		cdev "hw:${var:MainCardId}"
		cset "name='Speaker Switch' off"
		cset "name='Main Mic Switch' off"
		cset "name='Headphone Switch' off"
		cset "name='Headset Mic Switch' off"
	]
}

SectionDevice."Headphones" {
	Comment "Headphones"

	EnableSequence [
		exec "/usr/bin/logger -t UCM -p info HiFi_dvt:Headphones:EnableSequence"
		cdev "hw:${var:MainCardId}"
		cset "name='Headphone Switch' on"
	]

	DisableSequence [
		exec "/usr/bin/logger -t UCM -p info HiFi_dvt:Headphones:DisableSequence"
		cdev "hw:${var:MainCardId}"
		cset "name='Headphone Switch' off"
	]

	Value {
		PlaybackPriority 200
		PlaybackPCM "hw:${var:MainCardId}"
		PlaybackMasterElem "PCM Volume"
		PlaybackVolume "PCM Volume"
		PlaybackSwitch "Headphone Switch"
		JackControl "Headphone Jack"
		JackHWMute "Speaker"
	}
}

SectionDevice."Headset" {
	Comment "Headset"

	EnableSequence [
		exec "/usr/bin/logger -t UCM -p info HiFi_dvt:Headset:EnableSequence"
		cdev "hw:${var:MainCardId}"
		cset "name='Headphone Switch' on"
		cset "name='Headset Mic Switch' on"
	]

	DisableSequence [
		exec "/usr/bin/logger -t UCM -p info HiFi_dvt:Headset:DisableSequence"
		cdev "hw:${var:MainCardId}"
		cset "name='Headphone Switch' off"
		cset "name='Headset Mic Switch' off"
	]

	Value {
		CapturePriority 200
		CapturePCM "hw:${var:MainCardId}"
		#CaptureMasterElem "Capture Digital"
		CaptureVolume "Capture Digital Volume"
		CaptureSwitch "Headset Mic Switch"
		JackControl "Headset Mic Jack"
	}
}
