Syntax 6

Comment "Vangogh internal card"

#
# Macro CtlRemapMonoToStereoVolSw - join two mono controls into one stereo
#
# Arguments:
#   Type - Volume or Switch
#   Stereo - Name of the stereo control to be created
#   MonoL - Name of the mono control to be used as Left channel
#   MonoR - Name of the mono control to be used as Right channel
#
DefineMacro.CtlRemapMonoToStereoVolSw {
	LibraryConfig.remap.Config {
		ctl.default.map."name='${var:__Stereo} ${var:__Type}'" {
			"name='${var:__MonoL} ${var:__Type}'".vindex.0 0
			"name='${var:__MonoR} ${var:__Type}'".vindex.1 0
		}
	}
}

#
# Currently restricted to Steam Deck hardware.
#
If.jupiter {
	Condition {
		Type String
		String1 "Jupiter"
		String2 "${sys:devices/virtual/dmi/id/product_name}"
	}
	True {
		SectionUseCase."HiFi" {
			File "/AMD/acp5x/HiFi.conf"
			Comment "Default"
		}

		BootSequence [
			cset "name='Digital Playback Volume' 252"
			cset "name='Left Analog PCM Volume' 17"
			cset "name='Right Analog PCM Volume' 17"
			cset "name='Left Digital PCM Volume' 870"
			cset "name='Right Digital PCM Volume' 870"
			cset "name='Headphone Volume' 2"
			cset "name='Digital Playback Volume' 192"
			cset "name='Mic Volume' 252"
			cset "name='Frontend PGA Volume' 27"
		]

		Include.card-init.File "/lib/card-init.conf"
		Include.ctl-remap.File "/lib/ctl-remap.conf"
	}
}

#
# Currently restricted to Steam Deck OLED hardware.
#
If.galileo {
	Condition {
		Type String
		String1 "Galileo"
		String2 "${sys:devices/virtual/dmi/id/product_name}"
	}
	True {
		SectionUseCase."HiFi" {
			If.upstream {
				Condition {
					Type ControlExists
					Control "name='Left Analog PCM Volume'"
				}
				True.File "HiFi-upstream.conf"
				False.File "HiFi.conf"
			}
			Comment "Default"
		}

		BootSequence [
			cset "name='Digital Playback Volume' 252"
			cset "name='Left Analog PCM Volume' 17"
			cset "name='Right Analog PCM Volume' 17"
			cset "name='Left Digital PCM Volume' 870"
			cset "name='Right Digital PCM Volume' 870"
			cset "name='Headphone Volume' 2"
			cset "name='Digital Playback Volume' 192"
			cset "name='Mic Volume' 252"
			cset "name='Frontend PGA Volume' 27"
		]

		Include.card-init.File "/lib/card-init.conf"
		Include.ctl-remap.File "/lib/ctl-remap.conf"
	}
}
