# Use case Configuration for SPRD DOLPHIN HiFi audio playback and capture


######### Main Verb Config #################

SectionVerb {

	EnableSequence [
		# Set sprdphone device for following cset commands
		cdev "hw:sprdphone"

		# DAC->Headphone
		cset "name='HeadPhone Playback Volume' 12"

		#DAC->Speaker
		cset "name='Master Playback Volume' 12"
		cset "name='Inter PA Playback Volume' 12"

		#DAC->Earpiece
		cset "name='Ear Boost Volume' 1"

		#ADC ->(main mic)
		cset "name='Capture Volume' 12"
		cset "name='Mic Boost Volume' 1"
		cset "name='Line Playback Volume' 12"
		cset "name='LineinRec Capture Volume' 8"

		#line playback path
		cset "name='ADCL Mixer AILADCL Switch' 1"
		cset "name='ADCR Mixer AIRADCR Switch' 1"
		cset "name='Line Function' 1"
	]

	DisableSequence [
		# Set sprdphone device for following cset commands
		cdev "hw:sprdphone"

		#line playback path
		cset "name='ADCL Mixer AILADCL Switch' 0"
                cset "name='ADCR Mixer AIRADCR Switch' 0"
		cset "name='Line Function' 0"


	]

	# ALSA PCM
	Value {
		TQ "FM"
		# ALSA PCM device for HiFi
		PlaybackPCM "hw:sprdphone,0"
		CapturePCM "hw:sprdphone,0"
	}
}

########### Speaker Device Options ################

SectionDevice."Speaker" {
	Comment "sprdphone Speaker playback"

	EnableSequence [

		# Set sprdphone device for following cset commands
		cdev "hw:sprdphone"

		# sprdphone speaker playback path
		cset "name='SPKL Mixer ADCLSPKL Switch' 1"
		cset "name='SPKL Mixer ADCRSPKL Switch' 1"
		cset "name='SPKL Mixer DACLSPKL Switch' 1"
		cset "name='SPKL Mixer DACRSPKL Switch' 1"
		cset "name='Speaker Function' 1"
	]

	DisableSequence [

		# Set sprdphone device for following cset commands
		cdev "hw:sprdphone"

		# sprdphone path
		cset "name='SPKL Mixer ADCLSPKL Switch' 0"
		cset "name='SPKL Mixer ADCRSPKL Switch' 0"
		cset "name='SPKL Mixer DACLSPKL Switch' 0"
		cset "name='SPKL Mixer DACRSPKL Switch' 0"
		cset "name='Speaker Function' 0"
	]

	Value {
		# Default ALSA volume gain and mute kcontrols
		PlaybackPCM "hw:sprdphone,0"
		PlaybackChannels "2"
	}
}

###### Headphones Devices Options ############

SectionDevice."Headphones" {
	Comment "SPRD DOLPHIN 3.5mm Headphones playback"

	EnableSequence [

		# Set sprdphone device for following cset commands
		cdev "hw:sprdphone"

		# sprdphone playback path
		cset "name='HPL Mixer ADCLHPL Switch' 1"
		cset "name='HPR Mixer ADCRHPR Switch' 1"
		cset "name='HPL Mixer DACLHPL Switch' 1"
		cset "name='HPR Mixer DACRHPR Switch' 1"
		cset "name='HeadPhone Function' 1"
	]

	DisableSequence [

		# Set sprdphone device for following cset commands
		cdev "hw:sprdphone"

		# sprdphone playback path
		cset "name='HPL Mixer ADCLHPL Switch' 0"
		cset "name='HPR Mixer ADCRHPR Switch' 0"
		cset "name='HPL Mixer DACLHPL Switch' 0"
		cset "name='HPR Mixer DACRHPR Switch' 0"
		cset "name='HeadPhone Function' 0"
	]

	Value {
		# Default ALSA volume gain and mute kcontrols
		PlaybackPCM "hw:sprdphone,0"
		PlaybackChannels "2"
	}
}

########### Earpiece Device Options ################

SectionDevice."Earpiece" {
	Comment "Earpiece playback"

	EnableSequence [

		# Set sprdphone device for following cset commands
		cdev "hw:sprdphone"

		# sprdphone playback path
		cset "name='Earpiece Function' 1"
	]

	DisableSequence [

		# Set sprdphone device for following cset commands
		cdev "hw:sprdphone"

		# sprdphone playback path
		cset "name='Earpiece Function' 0"
	]

	Value {
		# Default ALSA volume gain and mute kcontrols
		PlaybackPCM "hw:sprdphone,0"
		PlaybackChannels "2"
	}
}







########### Line In Capture Device ################

SectionDevice."Line-capture" {
	Comment "Line in Capture"

	EnableSequence [

		# Set sprdphone device for following cset commands
		cdev "hw:sprdphone"

		# sprdphone playback path
		cset "name='Linein Rec Function' 1"
	]

	DisableSequence [

		# Set sprdphone device for following cset commands
		cdev "hw:sprdphone"

		# sprdphone capture path
		cset "name='Linein Rec Function' 0"
	]

	Value {
		# Default ALSA volume gain and mute kcontrols
		CapturePCM "hw:sprdphone,0"
		CaptureChannels "2"
	}
}
