# 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"

		# switch vbc control to arm
		cset "name='VBC Switch' 2"

		#DAC gain
		cset "name='DACL Playback Volume' 7"
		cset "name='DACR Playback Volume' 7"
		cset "name='Digital FM Function' 1"
		cset "name='AD IISMUX' 2"
                cset "name='DA1 ADDFM MUX' 1"
                cset "name='DA0 ADDFM MUX' 1"

		cset "name='VBC DACL DG Switch' 0"
		cset "name='VBC DACR DG Switch' 0"



	]

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

		# sprdphone path
                cset "name='DA1 ADDFM MUX' 0"
                cset "name='DA0 ADDFM MUX' 0"
		cset "name='AD IISMUX' 0"
		cset "name='Digital FM Function' 0"

	]

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

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

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

	EnableSequence [

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

		# gain setting
		cset "name='SPKL Playback Volume' 6"
		cset "name='SPKR Playback Volume' 6"



		# sprdphone speaker playback path
		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='Speaker Function' 0"
		cset "name='SPKL Mixer DACLSPKL Switch' 0"
		cset "name='SPKL Mixer DACRSPKL Switch' 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"

		#gain setting
		cset "name='HPL Playback Volume' 13"
		cset "name='HPL Playback Volume' 13"


		# sprdphone playback path
		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='HeadPhone Function' 0"
		cset "name='HPL Mixer DACLHPL Switch' 0"
		cset "name='HPR Mixer DACRHPR Switch' 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"

		# gain setting
		cset "name='EAR Playback Volume' 10"


		# 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"
	}
}
