diff --git a/codecs/max98357a/speaker.conf b/codecs/max98357a/speaker.conf index 1f01172..4847e43 100644 --- a/codecs/max98357a/speaker.conf +++ b/codecs/max98357a/speaker.conf @@ -1,9 +1,18 @@ +If.custompcm { + Condition { + Type String + Empty "$${var:max98357apcm}" + } + False.Define.pcm ${var:max98357apcm} + True.Define.pcm 0 +} + SectionDevice."Speaker" { Comment "Speaker" Value { PlaybackPriority 100 - PlaybackPCM "hw:${CardId},0" + PlaybackPCM "hw:${CardId},${var:pcm}" } EnableSequence [ cset "name='Spk Switch' on" diff --git a/sof-rt5682/HiFi.conf b/sof-rt5682/HiFi.conf index 265bef8..5923423 100644 --- a/sof-rt5682/HiFi.conf +++ b/sof-rt5682/HiFi.conf @@ -1,5 +1,3 @@ -# TODO: deal with the pcm numbers on cml being different - # headset codecs If.rt5682 { diff --git a/sof-rt5682/platform.conf b/sof-rt5682/platform.conf index 627a249..77ed870 100644 --- a/sof-rt5682/platform.conf +++ b/sof-rt5682/platform.conf @@ -7,7 +7,8 @@ If.cml { String2 "Google_Hatch" } True { - Define.cml y + Define.max98357apcm 5 + Define.rt5682pcm 0 Define.dmicpcm 1 Define.hdmi hdmi234 } @@ -20,7 +21,6 @@ If.tgl { String2 "Google_Volteer" } True { - Define.tgl y Define.dmicpcm 99 Define.hdmi hdmi2345 } @@ -34,7 +34,6 @@ If.jsl { String "$${sys:class/dmi/id/product_name}" } True { - Define.jsl y Define.dmicpcm 5 Define.hdmi hdmi234 } @@ -47,7 +46,6 @@ If.adl { String "$${sys:class/dmi/id/product_family}" } True { - Define.adl y Define.dmicpcm 99 Define.hdmi hdmi2345 } diff --git a/sof-rt5682/rt5682-headset.conf b/sof-rt5682/rt5682-headset.conf index 868f670..fa19eef 100644 --- a/sof-rt5682/rt5682-headset.conf +++ b/sof-rt5682/rt5682-headset.conf @@ -1,9 +1,18 @@ +If.custompcm { + Condition { + Type String + Empty "$${var:rt5682pcm}" + } + False.Define.pcm ${var:rt5682pcm} + True.Define.pcm 1 +} + SectionDevice."Headphones" { Comment "Headphones" Value { PlaybackPriority 200 - PlaybackPCM "hw:${CardId},1" + PlaybackPCM "hw:${CardId},${var:pcm}" PlaybackMixerElem "DAC1" JackControl "Headphone Jack" }