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

SectionVerb {

	# ALSA PCM
	Value {
		# ALSA PCM device for HiFi
		PlaybackPCM "hw:${CardId}"
		CapturePCM "hw:${CardId}"
	}
}

SectionDevice."Headphones" {
	Comment "Headphones playback"

	ConflictingDevice [
		"Speaker"
	]

	EnableSequence [
		cset "name='Master Playback Volume' 30"
		cset "name='HPO L Switch' on"
		cset "name='HPO R Switch' on"
		cset "name='Headphone Jack Switch' on"
		cset "name='DAC0 Playback Volume' 100"
	]

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

	Value {
		PlaybackChannels "2"
		JackDev "rt286-jack"
		JackControl "Headphone Jack"
		JackHWMute "Speaker"
	}
}

SectionDevice."Speaker" {
	Comment "Speaker playback"

	ConflictingDevice [
		"Headphones"
	]

	EnableSequence [
		cset "name='Master Playback Volume' 30"
		cset "name='DAC0 Playback Volume' 127"
		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' 0"
	]

	Value {
		PlaybackChannels "2"
	}
}

SectionDevice."Handset" {
	Comment "Handset Microphone"

	ConflictingDevice [
		"Mainmic"
	]

	EnableSequence [
		cset "name='Mic Capture Volume' 28"
		cset "name='ADC 0 Mux' 0"
		cset "name='ADC0 Capture Switch' on"
		cset "name='ADC0 Capture Volume' 127"
		cset "name='AMIC Volume' 1"
	]

	DisableSequence [
		cset "name='ADC0 Capture Switch' off"
	]

	Value {
		CaptureChannels "2"
		JackDev "rt286-jack"
		JackControl "Mic Jack"
		JackHWMute "Mainmic"
	}
}

SectionDevice."Mainmic" {
	Comment "Main Microphone"

	ConflictingDevice [
		"Handset"
	]

	EnableSequence [
		cset "name='Mic Capture Volume' 30"
		cset "name='ADC 0 Mux' 2"
		cset "name='ADC0 Capture Switch' on"
		cset "name='ADC0 Capture Volume' 127"
	]

	DisableSequence [
		cset "name='ADC0 Capture Switch' off"
	]

	Value {
		CaptureChannels "2"
	}
}
