# RT1318 specific switch control settings

Define.SpeakerMixerElem "rt1318-1 DAC"

If.twoAmpsStereoToOne {
	Condition {
		Type RegexMatch
		Regex "2"
		String "${var:SpeakerAmps}"
	}
	True {
		Define.SpeakerMixerElem "rt1318 DAC"
		LibraryConfig.remap.Config {
			ctl.default.map {
				"name='rt1318 DAC Playback Switch'" {
					"name='rt1318-1 DAC Switch'".vindex.0 [ 0 1 ]
					"name='rt1318-2 DAC Switch'".vindex.1 [ 0 1 ]
				}
			}
		}
	}
}

If.oneAmp {
	Condition {
		Type ControlExists
		Control "name='rt1318-1 DAC Switch'"
	}
	True {
		FixedBootSequence [
			exec "-/sbin/modprobe snd_ctl_led"
			sysw "-/class/sound/ctl-led/speaker/card${CardNumber}/attach:rt1318-1 DAC Switch"
		]
	}
}

If.twoAmps {
	Condition {
		Type ControlExists
		Control "name='rt1318-2 DAC Switch'"
	}
	True {
		FixedBootSequence [
			sysw "-/class/sound/ctl-led/speaker/card${CardNumber}/attach:rt1318-2 DAC Switch"
		]
	}
}
