Syntax 6

SectionUseCase."HiFi" {
	File "/Intel/sof-essx8336/HiFi.conf"
	Comment "Play and record HiFi quality Music"
}

# the kcontrols initial values, which will be set by `alsactl init`

BootSequence [
	# Set DAC vol
	cset "name='DAC Playback Volume' 70%"

	# Set capture vol
	cset "name='ADC Capture Volume' 70%"
]

# Setup muxes / switches
If.lhmix_switch {
	Condition {
		Type ControlExists
		Control "name='Left Headphone Mixer Left DAC Switch'"
	}
	True.BootSequence [
		cset "name='Left Headphone Mixer Left DAC Switch' on"
	]
}

If.rhmix_switch {
	Condition {
		Type ControlExists
		Control "name='Right Headphone Mixer Right DAC Switch'"
	}
	True.BootSequence [
		cset "name='Right Headphone Mixer Right DAC Switch' on"
	]
}

# Set digital mix mux to "dmic disable"
# That doesn't affect dmic, but other values mute headset mic
If.dmicmux {
	Condition {
		Type ControlExists
		Control "name='Digital Mic Mux'"
	}
	True.BootSequence [
		cset "name='Digital Mic Mux' dmic disable"
	]
}

# Set HP vol to 0 dB
If.hpvolume {
	Condition {
		Type ControlExists
		Control "name='Headphone Playback Volume'"
	}
	True.BootSequence [
		cset "name='Headphone Playback Volume' 100%"
		cset "name='Headphone Mixer Volume' 100%"
	]
}

# Disable Auto Level Control
If.alccapture {
	Condition {
		Type ControlExists
		Control "name='ALC Capture Switch'"
	}
	True.BootSequence [
		cset "name='ALC Capture Switch' off"
	]

	False.BootSequence [
		cset "name='ALC Switch' off"
	]
}

# LDATA TO LDAC, RDATA TO RDAC
If.dacmux {
	Condition {
		Type ControlExists
		Control "name='DAC Source Mux'"
	}
	True.BootSequence [
		cset "name='DAC Source Mux' 0"
	]
}

Define.DeviceDmic ""

If.devdmic {
	Condition {
		Type String
		Haystack "${CardComponents}"
		Needle "cfg-dmics:"
	}
	True.Define.DeviceDmic "Mic"
}


If.dmic {
	Condition {
		Type String
		Empty "${var:DeviceDmic}"
	}
	False.If.Dmic0 {
		Condition {
			Type ControlExists
			Control "name='Dmic0 Capture Volume'"
		}
		True.BootSequence [
			cset "name='Dmic0 Capture Volume' 70%"
			cset "name='Dmic0 Capture Switch' on"
		]
	}
}

