# Use case Configuration for sof-soundwire card
#
-# Everest Semiconductor ES9356 (SDCA) - headset (UAJ) function.
+# Everest Semiconductor ES9356 (SDCA) - a single device providing the headset
+# (UAJ), the speaker (SmartAmp) and the internal DMIC (SmartMic) functions.
#
# On AMD ACP6.3 SDCA boards the PCM layout of this codec is:
# device 0: headset playback, device 1: headset capture,
# device 2: speaker playback, device 4: internal DMIC capture.
-SectionDevice."Headphones" {
- Comment "Headphones"
+If.codec_spk {
+ Condition {
+ Type RegexMatch
+ Regex "(es9356(-spk)?)"
+ String "${var:SpeakerCodec1}"
+ }
+ True {
+ SectionDevice."Speaker" {
+ Comment "Speaker"
- ConflictingDevice [
- "Speaker"
- ]
+ ConflictingDevice [
+ "Headphones"
+ ]
- EnableSequence [
- cset "name='Headphone Switch' on"
- ]
+ EnableSequence [
+ cset "name='Speaker Switch' on"
+ ]
- DisableSequence [
- cset "name='Headphone Switch' off"
- ]
+ DisableSequence [
+ cset "name='Speaker Switch' off"
+ ]
- Value {
- PlaybackPriority 200
- PlaybackPCM "hw:${CardId}"
- JackControl "Headphone Jack"
+ Value {
+ PlaybackPriority 100
+ PlaybackPCM "hw:${CardId},2"
+ }
+ }
}
}
-SectionDevice."Headset" {
- Comment "Headset Microphone"
+If.codec_hs {
+ Condition {
+ Type RegexMatch
+ Regex "(es9356(-sdca)?)"
+ String "${var:HeadsetCodec1}"
+ }
+ True {
+ SectionDevice."Headphones" {
+ Comment "Headphones"
+
+ ConflictingDevice [
+ "Speaker"
+ ]
+
+ EnableSequence [
+ cset "name='Headphone Switch' on"
+ ]
+
+ DisableSequence [
+ cset "name='Headphone Switch' off"
+ ]
+
+ Value {
+ PlaybackPriority 200
+ PlaybackPCM "hw:${CardId}"
+ JackControl "Headphone Jack"
+ }
+ }
+
+ SectionDevice."Headset" {
+ Comment "Headset Microphone"
- ConflictingDevice [
- "Mic"
- ]
+ ConflictingDevice [
+ "Mic"
+ ]
- EnableSequence [
- cset "name='Headset Mic Switch' on"
- ]
+ EnableSequence [
+ cset "name='Headset Mic Switch' on"
+ ]
+
+ DisableSequence [
+ cset "name='Headset Mic Switch' off"
+ ]
+
+ Value {
+ CapturePriority 200
+ CapturePCM "hw:${CardId},1"
+ JackControl "Headset Mic Jack"
+ }
+ }
+ }
+}
+
+If.codec_mic {
+ Condition {
+ Type RegexMatch
+ # guard with '=' to avoid empty or es9356-spk matching
+ Regex "=(es9356(-sdca|-dmic)?)="
+ String "=${var:MicCodec1}="
+ }
+ True {
+ SectionDevice."Mic" {
+ Comment "Internal Microphone"
- DisableSequence [
- cset "name='Headset Mic Switch' off"
- ]
+ ConflictingDevice [
+ "Headset"
+ ]
- Value {
- CapturePriority 200
- CapturePCM "hw:${CardId},1"
- JackControl "Headset Mic Jack"
+ Value {
+ CapturePriority 100
+ CapturePCM "hw:${CardId},4"
+ }
+ }
}
}
Mics1 "0"
Iec61937Pcms1 ""
MultiCodec1 ""
- MultiCodecRegex "rt712|rt713|rt721|rt722|rt1320"
+ MultiCodecRegex "rt712|rt713|rt721|rt722|rt1320|es9356"
}
DefineRegex {
Condition {
Type RegexMatch
# guard with "=" to avoid empty string matching
- Regex "=(${var:__CodecId}(-sdca)?)="
+ Regex "=(${var:__CodecId}(-sdca|-spk)?)="
String "=${var:SpeakerCodec1}="
}
True.Define.SpeakerCodecFile "${var:__CodecId}"
Macro.rt721.MultiCodecInit "CodecId=rt721"
Macro.rt722.MultiCodecInit "CodecId=rt722"
Macro.rt1320.MultiCodecInit "CodecId=rt1320"
+ Macro.es9356.MultiCodecInit "CodecId=es9356"
}
}