# Use case Configuration for Nexus 7
# Adapted to Ubuntu Touch by David Henningsson <david.henningsson@canonical.com>

SectionDevice."Speaker" {
	Comment "Speakers"

	ConflictingDevice [
		"Headphones"
	]

	EnableSequence [
		cset "name='SPO Switch' on"
		cset "name='Speaker Playback Switch' on"
		cset "name='Speaker Switch' on"
	]

	DisableSequence [
		cset "name='Speaker Switch' off"
		cset "name='Speaker Playback Switch' off"
		cset "name='SPO Switch' off"
	]

	Value {
		PlaybackPriority 100
		PlaybackPCM "hw:${CardId}"
		PlaybackMixerElem "DAC0"
		PlaybackMasterElem "Master"
	}
}

SectionDevice."Headphones" {
	Comment "Headphones"

	ConflictingDevice [
		"Speaker"
	]

	EnableSequence [
		cset "name='HPO L Switch' on"
		cset "name='HPO R Switch' on"
		cset "name='Headphone Jack Switch' on"
	]

	DisableSequence [
		cset "name='Headphone Jack Switch' off"
		cset "name='HPO L Switch' off"
		cset "name='HPO R Switch' off"
	]

	Value {
		PlaybackPriority 200
		PlaybackPCM "hw:${CardId}"
		PlaybackMixerElem "DAC0"
		PlaybackMasterElem "Master"
		JackDev "rt286-jack"
		JackControl "Headphone Jack"
	}
}

SectionDevice."Mic" {
	Comment "Internal Microphone"

	ConflictingDevice [
		"Headset"
	]

	EnableSequence [
		cset "name='ADC 0 Mux' 2"
	]

	Value {
		CapturePriority 100
		CapturePCM "hw:${CardId}"
		CaptureMixerElem "ADC0"
		CaptureMasterElem "Mic"
	}
}

SectionDevice."Headset" {
	Comment "Headset Microphone"

	ConflictingDevice [
		"Mic"
	]

	EnableSequence [
		cset "name='ADC 0 Mux' 0"
		cset "name='AMIC Volume' 3"
	]

	DisableSequence [
		cset "name='AMIC Volume' 0"
	]

	Value {
		CapturePriority 200
		CapturePCM "hw:${CardId}"
		CaptureMixerElem "ADC0"
		CaptureMasterElem "Mic"
		JackDev "rt286-jack"
		JackControl "Mic Jack"
	}
}
