From 7c9f5fcbd097c6ffab6955984169a843ed7bb84d Mon Sep 17 00:00:00 2001 From: WeirdTreeThing Date: Sat, 11 Nov 2023 18:25:39 -0500 Subject: [PATCH] sof-rt5682: Add platform detection and set dmic pcm --- sof-rt5682/HiFi.conf | 40 ++++++++++++++++---------------- sof-rt5682/platform.conf | 49 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+), 20 deletions(-) create mode 100644 sof-rt5682/platform.conf diff --git a/sof-rt5682/HiFi.conf b/sof-rt5682/HiFi.conf index 2ea36bd..f9085e5 100644 --- a/sof-rt5682/HiFi.conf +++ b/sof-rt5682/HiFi.conf @@ -106,26 +106,26 @@ Macro [ } ] -#SectionDevice."Mic" { -# Comment "Internal Microphone" -# -# Value { -# CapturePrioirty 100 -# CapturePCM "hw:${CardId},99" -# CaptureChannels 4 -# } -# Macro.pcm_split.SplitPCMDevice { -# Name "dmic_stereo_in" -# Direction Capture -# Device 99 -# HWChannels 4 -# Channels 2 -# Channel0 2 -# Channel1 3 -# ChannelPos0 FL -# ChannelPos1 FR -# } -#} +SectionDevice."Mic" { + Comment "Internal Microphone" + + Value { + CapturePrioirty 100 + CapturePCM "hw:${CardId},99" + CaptureChannels 4 + } + Macro.pcm_split.SplitPCMDevice { + Name "dmic_stereo_in" + Direction Capture + Device ${var:dmicpcm} + HWChannels 4 + Channels 2 + Channel0 0 + Channel1 1 + ChannelPos0 FL + ChannelPos1 FR + } +} # TODO: detect hdmi configuration diff --git a/sof-rt5682/platform.conf b/sof-rt5682/platform.conf new file mode 100644 index 0000000..f20e214 --- /dev/null +++ b/sof-rt5682/platform.conf @@ -0,0 +1,49 @@ +# platform detection + +If.cml { + Condition { + Type String + String1 "${sys:class/dmi/id/product_family}" + String2 "Google_Hatch" + } + True [ + Define.cml y + Define.dmicpcm 1 + ] +} + +If.tgl { + Condition { + Type String + String1 "${sys:class/dmi/id/product_family}" + String2 "Google_Volteer" + } + True [ + Define.tgl y + Define.dmicpcm 99 + ] +} + +If.jsl { + Condition { + Type String + String1 "${sys:class/dmi/id/product_family}" + String2 "Google_Dedede" + } + True [ + Define.jsl y + Define.dmicpcm 5 + ] +} + +If.adl { + Condition { + Type RegexMatch + Regex "^Google_(Brya|Brask|Nissa)$" + String "${sys:class/dmi/id/product_family}" + } + True [ + Define.adl y + Define.dmicpcm 99 + ] +}