# Use case for devices on rockchip,rt5640-codec card.

SectionVerb {
	EnableSequence [
		cdev "hw:rockchiprt5640c"
	]

	DisableSequence [
		cdev "hw:rockchiprt5640c"
	]
}

SectionDevice."Headphone".0 {
	Comment "Headphone Playback"

	EnableSequence [
		cdev "hw:rockchiprt5640c"

		cset "name='HPO MIX DAC2 Switch' 1"
		cset "name='HP L Playback Switch' 1"
		cset "name='HP R Playback Switch"' 1"
	]

	DisableSequence [
		cdev "hw:rockchiprt5640c"

		cset "name='HP R Playback Switch"' 0"
		cset "name='HPO MIX DAC2 Switch' 0"
		cset "name='HP L Playback Switch' 0"
	]

	Value {
		PlaybackPCM "hw:rockchiprt5640c"
		PlaybackChannels "2"
		PlaybackPriority "2"
		# JackControl "Headphone Jack"
		# JackHWMute "Headphone"
	}
}

SectionDevice."Speaker".0 {
	Comment "Speaker Playback"

	EnableSequence [
		cdev "hw:rockchiprt5640c"

		cset "name='DAI select' 1:2|2:1"
		cset "name='Mono DAC Playback Volume' 175"
		cset "name='DAC2 Playback Switch' 1"
		cset "name='Mono DAC MIXL DAC L2 Switch' 1"
		cset "name='Mono DAC MIXR DAC R2 Switch' 1"
	]

	DisableSequence [
		cdev "hw:rockchiprt5640c"
		cset "name='Mono DAC Playback Volume' 0"
		cset "name='DAC2 Playback Switch' 0"
		cset "name='Mono DAC MIXL DAC L2 Switch' 0"
		cset "name='Mono DAC MIXR DAC R2 Switch' 0"

	]

	Value {
		PlaybackPCM "hw:rockchiprt5640c"
		PlaybackChannels "2"
		PlaybackPriority "2"
		# JackControl "Headphone Jack"
		# JackHWMute "Headphone"
	}
}

SectionDevice."Mic".0 {
	Comment "Internal Microphone"

	Value {
		CaptureChannels "2"
		CapturePriority "150"
	}

	EnableSequence [
		cdev "hw:rockchiprt5640c"

		cset "name='DAI select' 1:2|2:1"
		cset "name='RECMIXR BST3 Switch' 0"
		cset "name='RECMIXR BST1 Switch' 1"
		cset "name='Stereo1 ADC R1 Mux' 1"
		cset "name='Mono ADC R1 Mux' ADCR"
		cset "name='Mono ADC MIXR ADC1 Switch' 1"
		cset "name='IN1 Boost' 5"
		cset "name='Mono ADC Capture Volume' 60"
	]

	DisableSequence [
		cdev "hw:rockchiprt5640c"
	]
}

SectionDevice."HSMic".1 {
	Comment "Headset Microphone"

	Value {
		CaptureChannels "2"
		# JackControl "Headphone Jack"
		# JackHWMute "Mic"
	}

	EnableSequence [
		cdev "hw:rockchiprt5640c"
	]

	DisableSequence [
		cdev "hw:rockchiprt5640c"
	]
}

