
SectionVerb {
	# ALSA PCM
	Value {
		TQ "HiFi"
	}

	Include.e.File "/codecs/rt5645/EnableSeq.conf"
	Include.d.File "/codecs/rt5645/DisableSeq.conf"

	If.Controls {
		Condition {
			Type ControlExists
			Control "name='media0_in Gain 0 Switch'"
		}
		Before.EnableSequence "0"
		True {
			Include.pe.File "/platforms/bytcr/PlatformEnableSeq.conf"
			Include.pd.File "/platforms/bytcr/PlatformDisableSeq.conf"
		}
	}

	EnableSequence [
		cset "name='Speaker HWEQ' 1,164,237,135,1,165,0,0,1,166,237,135,1,167,0,0,1,192,30,196,1,193,0,0,1,194,30,196,1,195,0,0,1,196,31,180,1,197,0,75,1,198,31,180,1,199,31,180,1,200,0,75,1,201,31,180,0,177,51,224"
		cset "name='DAC1 Playback Volume' 77,77"
		cset "name='Speaker ClassD Playback Volume' 4"
		cset "name='I2S2 Func Switch' off"
		cset "name='RT5650 IF1 ADC Mux' 0"
	]
}

SectionDevice."Speaker" {
	Comment "Speaker"

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

	ConflictingDevice [
		"Headphones"
	]

	Include.spk.File "/codecs/rt5645/SpeakerEnableSeq.conf"

	DisableSequence [
		cset "name='Ext Spk Switch' off"
		cset "name='Speaker Channel Switch' off"
	]
}

SectionDevice."Headphones" {
	Comment "Headphones"

	Value {
		PlaybackPCM "hw:${CardId}"
		PlaybackPriority 200
		JackControl "Headphone Jack"
		JackHWMute "Speaker"
	}

	ConflictingDevice [
		"Speaker"
	]

	Include.hse.File "/codecs/rt5645/HeadphonesEnableSeq.conf"

	DisableSequence [
		cset "name='Headphone Switch' off"
		cset "name='Headphone Channel Switch' off"
	]
}

SectionDevice."Mic1" {
	Comment "Internal Microphone"

	Value {
		CapturePCM "hw:${CardId}"
		CapturePriority 100
	}

	EnableSequence [
		cset "name='Int Mic Switch' on"
		cset "name='Sto1 ADC MIXL ADC2 Switch' on"
		cset "name='Sto1 ADC MIXR ADC2 Switch' on"
	]

	DisableSequence [
		cset "name='Sto1 ADC MIXL ADC2 Switch' off"
		cset "name='Sto1 ADC MIXR ADC2 Switch' off"
		cset "name='Int Mic Switch' off"
	]
}

SectionDevice."Mic2" {
	Comment "Headset Microphone"

	Value {
		CapturePCM "hw:${CardId}"
		CapturePriority 200
		JackControl "Headset Mic Jack"
		JackHWMute "Mic1"
	}

	Include.hsmice.File "/codecs/rt5645/HSMicEnableSeq.conf"

	EnableSequence [
		cset "name='IN1 Boost' 1"
	]

	Include.hsmicd.File "/codecs/rt5645/HSMicDisableSeq.conf"

	DisableSequence [
		cset "name='IN1 Boost' 0"
	]
}
