# Use case configuration for DB410c board.
# Author: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

SectionVerb {

	EnableSequence [
	]

	DisableSequence [
	]

	# ALSA PCM
	Value {
		# ALSA PCM device for HiFi
		PlaybackPCM "plughw:0,1"
		CapturePCM "plughw:0,2"
	}
}


SectionDevice."Speaker" {
	Comment "Speaker playback"

	ConflictingDevice [
		"Headphones"
		"Earpiece"
	]

	EnableSequence [
		cdev "hw:0"
		cset "name='SPK DAC Switch' 1"
		cset "name='RX3 MIX1 INP1' RX1"
		## gain to  0dB
		cset "name='RX3 Digital Volume' 128"
	]

	DisableSequence [
		cdev "hw:0"
		cset "name='SPK DAC Switch' 0"
		cset "name='RX3 MIX1 INP1' ZERO"
	]

	Value {
		PlaybackChannels "2"
	}
}


SectionDevice."Headphones" {
	Comment "Headphones playback"

	ConflictingDevice [
		"Speaker"
		"Earpiece"
	]
	EnableSequence [
		cdev "hw:0"
		cset "name='RX1 MIX1 INP1' RX1"
		cset "name='RX2 MIX1 INP1' RX2"
		cset "name='RDAC2 MUX' RX2"
		cset "name='HPHL' 1"
		cset "name='HPHR' 1"
		## gain to  0dB
		cset "name='RX1 Digital Volume' 128"
		## gain to  0dB
		cset "name='RX2 Digital Volume' 128"
	]

	DisableSequence [
		cdev "hw:0"
		cset "name='RX1 Digital Volume' 0"
		cset "name='RX2 Digital Volume' 0"
		cset "name='HPHL' 0"
		cset "name='HPHR' 0"
		cset "name='RDAC2 MUX' ZERO"
		cset "name='RX1 MIX1 INP1' ZERO"
		cset "name='RX2 MIX1 INP1' ZERO"
	]

	Value {
		PlaybackChannels "2"
	}
}

SectionDevice."Earpiece" {
	Comment "Earpiece playback"

	ConflictingDevice [
		"Speaker"
		"Headphones"
	]
	EnableSequence [
		cdev "hw:0"
	]

	DisableSequence [
		cdev "hw:0"
	]

	Value {
		PlaybackChannels "2"
	}
}

SectionDevice."Handset" {
	Comment "Headset Microphone"

	EnableSequence [
		cdev "hw:0"
		cset "name='DEC1 MUX' ADC2"
		cset "name='CIC1 MUX' AMIC"
		cset "name='ADC2 Volume' 8"
		cset "name='ADC2 MUX' INP2"
	]

	DisableSequence [
		cdev "hw:0"
		cset "name='ADC2 MUX' ZERO"
		cset "name='ADC2 Volume' 0"
		cset "name='DEC1 MUX' ZERO"
	]

	Value {
		CaptureChannels "2"
	}
}

SectionDevice."Primarymic" {
	Comment "Primary Microphone"

	EnableSequence [
		cdev "hw:0"
		cset "name='DEC1 MUX' ADC1"
		cset "name='CIC1 MUX' AMIC"
		cset "name='ADC1 Volume' 8"
	]

	DisableSequence [
		cdev "hw:0"
		cset "name='DEC1 MUX' ZERO"
		cset "name='ADC1 Volume' 0"
	]

	Value {
		CaptureChannels "2"
	}
}

SectionDevice."Secondarymic" {
	Comment "Secondary Microphone"

	EnableSequence [
		cdev "hw:0"
		cset "name='DEC1 MUX' ADC2"
		cset "name='CIC1 MUX' AMIC"
		cset "name='ADC2 Volume' 8"
		cset "name='ADC2 MUX' INP2"
	]

	DisableSequence [
		cdev "hw:0"
		cset "name='DEC1 MUX' ZERO"
		cset "name='ADC2 Volume' 0"
		cset "name='ADC2 MUX' ZERO"
	]

	Value {
		CaptureChannels "2"
	}
}

SectionDevice."DMIC" {
	Comment "Digital Microphone"

	EnableSequence [
		cdev "hw:0"
		cset "name='DEC1 MUX' DMIC1"
		cset "name='CIC1 MUX' DMIC"
	]

	DisableSequence [
		cdev "hw:0"
		cset "name='DEC1 MUX' ZERO"
	]

	Value {
		CaptureChannels "2"
	}
}
