# Use case Configuration for sof-soundwire card

SectionDevice."Speaker" {
	Comment	"Speaker"

	If.lrswitch {
		Condition {
			Type ControlExists
			Control "name='rt1316-1 DAC L Switch'"
		}
		True {
			EnableSequence [
				cset "name='rt1316-1 RX Channel Select' L,L"
				cset "name='rt1316-2 RX Channel Select' R,R"
				cset "name='rt1316-1 DAC L Switch' 1"
				cset "name='rt1316-1 DAC R Switch' 1"
				cset "name='rt1316-2 DAC L Switch' 1"
				cset "name='rt1316-2 DAC R Switch' 1"
				cset "name='Speaker Switch' on"
			]

			DisableSequence [
				cset "name='rt1316-1 DAC L Switch' 0"
				cset "name='rt1316-1 DAC R Switch' 0"
				cset "name='rt1316-2 DAC L Switch' 0"
				cset "name='rt1316-2 DAC R Switch' 0"
				cset "name='Speaker Switch' off"
			]
		}
		False {
			EnableSequence [
				cset "name='rt1316-1 RX Channel Select' L,L"
				cset "name='rt1316-2 RX Channel Select' R,R"
				cset "name='rt1316-1 DAC Switch' 1"
				cset "name='rt1316-2 DAC Switch' 1"
				cset "name='Speaker Switch' on"
			]

			DisableSequence [
				cset "name='rt1316-1 DAC Switch' 0"
				cset "name='rt1316-2 DAC Switch' 0"
				cset "name='Speaker Switch' off"
			]
		}
	}

	Value {
	      PlaybackPriority 100
	      PlaybackPCM "hw:${CardId},2"
	}
}
