#
# Based on OFW N8010XXUDNE4_N8010OXADNE4_HOME @ /etc/tinyucm.conf in the system.img
# 

SectionVerb {
	EnableSequence [
		# Default all outputs off
		cset "name='HP Switch' 0"
		cset "name='SPK Switch' 0"
		cset "name='RCV Switch' 0"
		cset "name='LINE Switch' 0"
		cset "name='HDMI Switch' 0"

		# Default all inputs off
		cset "name='Main Mic Switch' 0"
		cset "name='Sub Mic Switch' 0"
		cset "name='Headset Mic Switch' 0"
	]
	DisableSequence [
	]
	Value {
		TQ HiFi
	}
}

SectionDevice."Speaker" {
        Comment "Speaker"

        EnableSequence [
                cset "name='SPK Switch' 1"
		cset "name='Speaker Boost Volume' 6"
		cset "name='AIF1DAC1 EQ Switch' 1"
        ]

        DisableSequence [
                cset "name='SPK Switch' 0"
		cset "name='Speaker Boost Volume' 0"
		cset "name='AIF1DAC1 EQ Switch' 0"
        ]

        Value {
		PlaybackVolume "Speaker Volume"
		PlaybackSwitch "SPK Switch"
		PlaybackPriority 100
		PlaybackPCM "hw:${CardId}"
        }

}

SectionDevice."Headphones" {
        Comment "Headphones"

        EnableSequence [
                cset "name='HP Switch' 1"
        ]

        DisableSequence [
                cset "name='HP Switch' 0"
        ]

        Value {
		PlaybackVolume "Headphone Volume"
		PlaybackSwitch "HP Switch"
		PlaybackPriority 150
		PlaybackPCM "hw:${CardId}"
        }
}

SectionDevice."HeadsetMic" {
        Comment "Headset Microphone"

        EnableSequence [
		cset "name='Headset Mic Switch' 1"
		cset "name='AIF1ADCL Source' Right"
		cset "name='AIF1ADCR Source' Right"
		cset "name='MIXINR IN1R Switch' 1"
		cset "name='AIF2DAC2L Mixer Left Sidetone Switch' 0"
		cset "name='AIF2DAC2L Mixer Right Sidetone Switch' 1"
		cset "name='AIF2DAC2R Mixer Left Sidetone Switch' 0"
		cset "name='AIF2DAC2R Mixer Right Sidetone Switch' 1"
		cset "name='Sub Mic Switch' 1"
        ]

        DisableSequence [
		cset "name='Headset Mic Switch' 0"
		cset "name='Sub Mic Switch' 0"
		cset "name='MIXINR IN1R Switch' 0"
        ]

        Value {
                CaptureVolume "IN2L Volume"
		CapturePriority 150
		CapturePCM "hw:${CardId}"
        }

}

SectionDevice."InternalMic" {
        Comment "Microphone"

        EnableSequence [
		cset "name='Main Mic Switch' 1"
		cset "name='AIF1ADCL Source' Left"
		cset "name='AIF1ADCR Source' Left"
		cset "name='MIXINL IN1L Switch' 1"
		cset "name='AIF2DAC2L Mixer Left Sidetone Switch' 1"
		cset "name='AIF2DAC2L Mixer Right Sidetone Switch' 0"
		cset "name='AIF2DAC2R Mixer Left Sidetone Switch' 1"
		cset "name='AIF2DAC2R Mixer Right Sidetone Switch' 0"
        ]

        DisableSequence [
		cset "name='Main Mic Switch' 0"
		cset "name='MIXINL IN1L Switch' 0"
		cset "name='AIF1ADC1L DRC Switch' 0"
		cset "name='AIF1ADC1 HPF Switch' 0"
        ]

        Value {
		CaptureVolume "IN1L Volume"
		CapturePriority 100
		CapturePCM "hw:${CardId}"
        }

}

## currently not supported by kernel drivers ##

#SectionDevice."AUX Digital Out" {
#	Comment "HDMI Audio"
#
#	EnableSequence [
#		cset "name='LINEOUT1N Switch' 1",
#		cset "name='LINEOUT1P Switch' 1",
#		cset "name='HDMI Switch' 1",
#	]
#
#	DisableSequence [
#		cset "name='LINEOUT1N Switch' 0",
#		cset "name='LINEOUT1P Switch' 0",
#		cset "name='HDMI Switch' 0",
#	]
#}

#SectionDevice."Analogue Dock Out" {
#	Comment "Dock Headset"
#
#	EnableSequence [
#		cset "name='LINEOUT2N Switch' 1",
#		cset "name='LINEOUT2P Switch' 1",
#		cset "name='AIF1DACL Source' Right",
#		cset "name='AIF1DACR Source' Left",
#		cset "name='LINE Switch' 1",
#		cset "name='LineoutSwitch Mode' 1",
#	]
#
#	DisableSequence [
#		cset "name='LineoutSwitch Mode' 0",
#		cset "name='LINEOUT2N Switch' 0",
#		cset "name='LINEOUT2P Switch' 0",
#		cset "name='LINE Switch' 0",
#	]
#}