From 22782b92671401d81cfb1018ce6e65b706ca1b3d Mon Sep 17 00:00:00 2001 From: Clayton Craft Date: Wed, 29 Jun 2022 15:23:23 -0700 Subject: [PATCH] ucm2: add profile for the Librem 5 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tested-by: Guido Günther --- ucm2/NXP/iMX8/Librem_5/HiFi.conf | 151 ++++++++++++++++++++++++++ ucm2/NXP/iMX8/Librem_5/Librem 5.conf | 25 +++++ ucm2/conf.d/simple-card/Librem 5.conf | 1 + 3 files changed, 177 insertions(+) create mode 100644 ucm2/NXP/iMX8/Librem_5/HiFi.conf create mode 100644 ucm2/NXP/iMX8/Librem_5/Librem 5.conf create mode 120000 ucm2/conf.d/simple-card/Librem 5.conf diff --git a/ucm2/NXP/iMX8/Librem_5/HiFi.conf b/ucm2/NXP/iMX8/Librem_5/HiFi.conf new file mode 100644 index 00000000..55eabe32 --- /dev/null +++ b/ucm2/NXP/iMX8/Librem_5/HiFi.conf @@ -0,0 +1,151 @@ +SectionVerb { + EnableSequence [ + disdevall "" + ] + + Value.TQ "HiFi" +} + +SectionDevice."Handset" { + Comment "Handset" + + ConflictingDevice [ + "Headphones" + "Speaker" + ] + + EnableSequence [ + cset "name='Speaker Switch' off,on" + cset "name='DAC L/R Swap Switch' on" + cset "name='DAC Monomix Switch' on" + cset "name='SPKOUTR PGA' DAC" + cset "name='Speaker Boost Volume' 2" + ] + + DisableSequence [ + cset "name='Speaker Switch' off,off" + cset "name='DAC L/R Swap Switch' off" + cset "name='DAC Monomix Switch' off" + cset "name='SPKOUTR PGA' Mixer" + ] + + Value { + PlaybackPriority "100" + PlaybackVolume "name='Speaker Volume'" + PlaybackSwitch "name='Speaker Switch'" + PlaybackMixerElem "Speaker" + PlaybackPCM "hw:${CardId}" + } +} + +SectionDevice."Speaker" { + Comment "Speaker" + + ConflictingDevice [ + "Handset" + "Headphones" + ] + + EnableSequence [ + cset "name='Speaker Switch' on,off" + cset "name='DAC Monomix Switch' on" + cset "name='SPKOUTL PGA' DAC" + cset "name='Speaker Boost Volume' 6" + ] + + DisableSequence [ + cset "name='Speaker Switch' off,off" + cset "name='DAC Monomix Switch' off" + cset "name='SPKOUTL PGA' Mixer" + ] + + Value { + PlaybackPriority "500" + PlaybackVolume "name='Speaker Volume'" + PlaybackSwitch "name='Speaker Switch'" + PlaybackMixerElem "Speaker" + PlaybackPCM "hw:${CardId}" + } +} + +SectionDevice."Headphones" { + Comment "Headphones" + + ConflictingDevice [ + "Handset" + "Speaker" + ] + + EnableSequence [ + cset "name='Headphone Switch' on,on" + cset "name='HPOUTL PGA' 0 unmute" + cset "name='HPOUTR PGA' 0 unmute" + ] + + DisableSequence [ + cset "name='Headphone Switch' off off" + cset "name='HPOUTL PGA' 0 mute" + cset "name='HPOUTR PGA' 0 mute" + ] + + Value { + PlaybackPriority "1000" + PlaybackVolume "name='Headphone Volume'" + PlaybackSwitch "name='Headphone Switch'" + PlaybackMixerElem "Headphone" + PlaybackPCM "hw:${CardId}" + JackControl "Headphones Jack" + } +} + +SectionDevice."Mic" { + Comment "Internal Microphone" + + ConflictingDevice [ + "Headset" + ] + + EnableSequence [ + cset "name='ADC L/R Swap Switch' on" + cset "name='Input Mode' Digital" + ] + + DisableSequence [ + cset "name='ADC L/R Swap Switch' off" + ] + + Value { + CapturePriority "500" + CaptureVolume "name='Digital Capture Volume'" + CaptureMixerElem "Digital" + CapturePCM "hw:${CardId}" + } +} + +SectionDevice."Headset" { + Comment "Headset Microphone" + + ConflictingDevice [ + "Mic" + ] + + EnableSequence [ + cset "name='Input Mode' Analog" + cset "name='MIXINR PGA Switch' on,on" + cset "name='Capture Switch' on,on" + ] + + DisableSequence [ + cset "name='Capture Switch' off,off" + cset "name='MIXINR PGA Switch' off,off" + cset "name='Input Mode' Digital" + ] + + Value { + CapturePriority "100" + CaptureVolume "name='Capture Volume'" + CaptureMixerElem "Capture" + CapturePCM "hw:${CardId}" + JackControl "Headphones Jack" + } +} diff --git a/ucm2/NXP/iMX8/Librem_5/Librem 5.conf b/ucm2/NXP/iMX8/Librem_5/Librem 5.conf new file mode 100644 index 00000000..4d7dbd65 --- /dev/null +++ b/ucm2/NXP/iMX8/Librem_5/Librem 5.conf @@ -0,0 +1,25 @@ +Syntax 2 + +SectionUseCase."HiFi" { + File "HiFi.conf" + Comment "Default" +} + +BootSequence [ + cset "name='Digital Playback Volume' 100,100" + cset "name='MIXINL IN2L Switch' off" + cset "name='MIXINL IN3L Switch' off" + cset "name='MIXINR IN2R Switch' off" + cset "name='MIXINR IN3R Switch' off" + cset "name='INPGAR IN1R Switch' off" + cset "name='INPGAR IN2R Switch' off" + cset "name='INPGAR IN3R Switch' on" + cset "name='INPGAR IN4R Switch' off" + cset "name='INPGAL IN1L Switch' off" + cset "name='INPGAL IN2L Switch' off" + cset "name='INPGAL IN3L Switch' off" + cset "name='INPGAL IN4L Switch' off" + cset "name='Input Mixer Switch' off,on" + cset "name='SPKOUTL PGA' Mixer" + cset "name='SPKOUTR PGA' Mixer" +] diff --git a/ucm2/conf.d/simple-card/Librem 5.conf b/ucm2/conf.d/simple-card/Librem 5.conf new file mode 120000 index 00000000..c6879422 --- /dev/null +++ b/ucm2/conf.d/simple-card/Librem 5.conf @@ -0,0 +1 @@ +../../NXP/iMX8/Librem_5/Librem 5.conf \ No newline at end of file