# Use case Configuration for MAX98089 on LG Optimus 4X HD/Vu P880/P895

SectionDevice."Speaker" {
	Comment "Speaker"

	ConflictingDevice [
		"Earpiece"
	]

	EnableSequence [
		cset "name='Speaker Switch' on"
		cset "name='Int Spk Switch' on"

		cset "name='Left SPK Mixer Left DAC1 Switch' on"
		cset "name='Left SPK Mixer Left DAC2 Switch' on"
		cset "name='Left SPK Mixer Right DAC1 Switch' on"
		cset "name='Left SPK Mixer Right DAC2 Switch' on"
	]

	DisableSequence [
		cset "name='Speaker Switch' off"
		cset "name='Int Spk Switch' off"

		cset "name='Left SPK Mixer Left DAC1 Switch' off"
		cset "name='Left SPK Mixer Left DAC2 Switch' off"
		cset "name='Left SPK Mixer Right DAC1 Switch' off"
		cset "name='Left SPK Mixer Right DAC2 Switch' off"
	]

	Value {
		PlaybackPCM "hw:${CardId}"
		PlaybackChannels 2
		PlaybackPriority 100

		PlaybackMixerElem "Speaker"
	}
}

SectionDevice."Earpiece" {
	Comment "Earpiece"

	ConflictingDevice [
		"Speaker"
	]

	EnableSequence [
		cset "name='Receiver Switch' on"
		cset "name='Earpiece Switch' on"

		cset "name='Left REC Mixer Left DAC1 Switch' on"
		cset "name='Left REC Mixer Left DAC2 Switch' on"
		cset "name='Left REC Mixer Right DAC1 Switch' on"
		cset "name='Left REC Mixer Right DAC2 Switch' on"

		cset "name='Right REC Mixer Left DAC1 Switch' on"
		cset "name='Right REC Mixer Left DAC2 Switch' on"
		cset "name='Right REC Mixer Right DAC1 Switch' on"
		cset "name='Right REC Mixer Right DAC2 Switch' on"
	]

	DisableSequence [
		cset "name='Receiver Switch' off"
		cset "name='Earpiece Switch' off"

		cset "name='Left REC Mixer Left DAC1 Switch' off"
		cset "name='Left REC Mixer Left DAC2 Switch' off"
		cset "name='Left REC Mixer Right DAC1 Switch' off"
		cset "name='Left REC Mixer Right DAC2 Switch' off"

		cset "name='Right REC Mixer Left DAC1 Switch' off"
		cset "name='Right REC Mixer Left DAC2 Switch' off"
		cset "name='Right REC Mixer Right DAC1 Switch' off"
		cset "name='Right REC Mixer Right DAC2 Switch' off"
	]

	Value {
		PlaybackPCM "hw:${CardId}"
		PlaybackChannels 2
		PlaybackPriority 200

		PlaybackMixerElem "Receiver"
	}
}

SectionDevice."Mic1" {
	Comment "Internal Microphone"

	EnableSequence [
		# Main MIC
		cset "name='Internal Mic 1 Switch' on"
		cset "name='DAI1 ADC Filter' fc=258/fs=16k"

		cset "name='Left ADC Mixer MIC1 Switch' on"
		cset "name='Right ADC Mixer MIC1 Switch' on"

		# Secondary MIC
		cset "name='Int Mic Switch' on"
		cset "name='Internal Mic 2 Switch' on"

		cset "name='Left ADC Mixer MIC2 Switch' on"
		cset "name='Right ADC Mixer MIC2 Switch' on"
	]

	DisableSequence [
		# Main MIC
		cset "name='Internal Mic 1 Switch' off"
		cset "name='DAI1 ADC Filter' off"

		cset "name='Left ADC Mixer MIC1 Switch' off"
		cset "name='Right ADC Mixer MIC1 Switch' off"

		# Secondary MIC
		cset "name='Int Mic Switch' off"
		cset "name='Internal Mic 2 Switch' off"

		cset "name='Left ADC Mixer MIC2 Switch' off"
		cset "name='Right ADC Mixer MIC2 Switch' off"
	]

	Value {
		CapturePCM "hw:${CardId}"
		CaptureChannels 2
		CapturePriority 200
	}
}
