From 1b2d1ddcd7a016569ad5cbc7170160132cb85d38 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Thu, 3 Jan 2019 14:50:14 +0100 Subject: [PATCH] conf/ucm: Add UCM profile for bytcht-es8316 boards Add an UCM profile for Bay Trail and Cherry Trail boards with an ES8316 codec. Re-use the existing platform enable and disable sequences for BYT/CHT SST support and add a codecs/es8316 dir with codec specific enable / disable sequences for the various inputs and outputs. Signed-off-by: Hans de Goede Signed-off-by: Jaroslav Kysela --- ucm/bytcht-es8316/HiFi.conf | 26 +++++++++++++++++ ucm/bytcht-es8316/bytcht-es8316.conf | 8 ++++++ ucm/codecs/es8316/EnableSeq.conf | 19 ++++++++++++ ucm/codecs/es8316/HeadPhones.conf | 24 ++++++++++++++++ ucm/codecs/es8316/IN1-HeadsetMic.conf | 25 ++++++++++++++++ ucm/codecs/es8316/IN1-InternalMic.conf | 24 ++++++++++++++++ ucm/codecs/es8316/IN2-HeadsetMic.conf | 25 ++++++++++++++++ ucm/codecs/es8316/IN2-InternalMic.conf | 24 ++++++++++++++++ ucm/codecs/es8316/MonoSpeaker.conf | 40 ++++++++++++++++++++++++++ ucm/codecs/es8316/Speaker.conf | 22 ++++++++++++++ 10 files changed, 237 insertions(+) create mode 100644 ucm/bytcht-es8316/HiFi.conf create mode 100644 ucm/bytcht-es8316/bytcht-es8316.conf create mode 100644 ucm/codecs/es8316/EnableSeq.conf create mode 100644 ucm/codecs/es8316/HeadPhones.conf create mode 100644 ucm/codecs/es8316/IN1-HeadsetMic.conf create mode 100644 ucm/codecs/es8316/IN1-InternalMic.conf create mode 100644 ucm/codecs/es8316/IN2-HeadsetMic.conf create mode 100644 ucm/codecs/es8316/IN2-InternalMic.conf create mode 100644 ucm/codecs/es8316/MonoSpeaker.conf create mode 100644 ucm/codecs/es8316/Speaker.conf diff --git a/ucm/bytcht-es8316/HiFi.conf b/ucm/bytcht-es8316/HiFi.conf new file mode 100644 index 0000000..7af3daa --- /dev/null +++ b/ucm/bytcht-es8316/HiFi.conf @@ -0,0 +1,26 @@ +SectionVerb { + EnableSequence [ + cdev "hw:bytchtes8316" + + + ] + + DisableSequence [ + cdev "hw:bytchtes8316" + + ] + + Value { + PlaybackPCM "hw:bytchtes8316" + CapturePCM "hw:bytchtes8316" + } +} + + + + + + + + + diff --git a/ucm/bytcht-es8316/bytcht-es8316.conf b/ucm/bytcht-es8316/bytcht-es8316.conf new file mode 100644 index 0000000..e77e297 --- /dev/null +++ b/ucm/bytcht-es8316/bytcht-es8316.conf @@ -0,0 +1,8 @@ +SectionUseCase."HiFi" { + File "HiFi.conf" + Comment "Play HiFi quality Music" +} + +SectionDefaults [ + cdev "hw:bytchtes8316" +] diff --git a/ucm/codecs/es8316/EnableSeq.conf b/ucm/codecs/es8316/EnableSeq.conf new file mode 100644 index 0000000..551b79b --- /dev/null +++ b/ucm/codecs/es8316/EnableSeq.conf @@ -0,0 +1,19 @@ +# Disable all inputs / outputs +cset "name='Speaker Switch' off" +cset "name='Headphone Switch' off" +cset "name='Headset Mic Switch' off" +cset "name='Internal Mic Switch' off" + +# Set HP vol to 0 dB (3/3) +cset "name='Headphone Playback Volume' 3" +# Set HP mixer vol to -6 dB (4/7) louder does not work +cset "name='Headphone Mixer Volume' 4" +# Set DAC vol to 0 dB (192/192) +cset "name='DAC Playback Volume' 192" +# Set ADC vold to 0 dB (10/10) +cset "name='ADC PGA Gain Volume' 10" + +# Setup muxes / switches +cset "name='Left Headphone Mixer Left DAC Switch' on" +cset "name='Right Headphone Mixer Right DAC Switch' on" +cset "name='ALC Capture Switch' on" diff --git a/ucm/codecs/es8316/HeadPhones.conf b/ucm/codecs/es8316/HeadPhones.conf new file mode 100644 index 0000000..ff13ef1 --- /dev/null +++ b/ucm/codecs/es8316/HeadPhones.conf @@ -0,0 +1,24 @@ +SectionDevice."Headphones" { + Comment "Headphones" + + ConflictingDevice [ + "Speaker" + "MonoSpeaker" + ] + + EnableSequence [ + cdev "hw:bytchtes8316" + cset "name='Headphone Switch' on" + ] + + DisableSequence [ + cdev "hw:bytchtes8316" + cset "name='Headphone Switch' off" + ] + + Value { + PlaybackChannels "2" + JackControl "Headphone Jack" + JackHWMute "Speaker MonoSpeaker" + } +} diff --git a/ucm/codecs/es8316/IN1-HeadsetMic.conf b/ucm/codecs/es8316/IN1-HeadsetMic.conf new file mode 100644 index 0000000..0501646 --- /dev/null +++ b/ucm/codecs/es8316/IN1-HeadsetMic.conf @@ -0,0 +1,25 @@ +SectionDevice."HeadsetMic-IN1" { + Comment "Headset Microphone on IN1" + + ConflictingDevice [ + "InternalMic-IN1" + "InternalMic-IN2" + "HeadsetMic-IN2" + ] + + EnableSequence [ + cdev "hw:bytchtes8316" + cset "name='Differential Mux' lin1-rin1" + cset "name='Headset Mic Switch' on" + ] + + DisableSequence [ + cdev "hw:bytchtes8316" + cset "name='Headset Mic Switch' off" + ] + + Value { + CaptureChannels "2" + JackControl "Headset Mic Jack" + } +} diff --git a/ucm/codecs/es8316/IN1-InternalMic.conf b/ucm/codecs/es8316/IN1-InternalMic.conf new file mode 100644 index 0000000..5386fda --- /dev/null +++ b/ucm/codecs/es8316/IN1-InternalMic.conf @@ -0,0 +1,24 @@ +SectionDevice."InternalMic-IN1" { + Comment "Internal Microphone on IN1" + + ConflictingDevice [ + "InternalMic-IN2" + "HeadsetMic-IN1" + "HeadsetMic-IN2" + ] + + EnableSequence [ + cdev "hw:bytchtes8316" + cset "name='Differential Mux' lin1-rin1" + cset "name='Internal Mic Switch' on" + ] + + DisableSequence [ + cdev "hw:bytchtes8316" + cset "name='Internal Mic Switch' off" + ] + + Value { + CaptureChannels "2" + } +} diff --git a/ucm/codecs/es8316/IN2-HeadsetMic.conf b/ucm/codecs/es8316/IN2-HeadsetMic.conf new file mode 100644 index 0000000..229e7e7 --- /dev/null +++ b/ucm/codecs/es8316/IN2-HeadsetMic.conf @@ -0,0 +1,25 @@ +SectionDevice."HeadsetMic-IN2" { + Comment "Headset Microphone on IN2" + + ConflictingDevice [ + "InternalMic-IN1" + "InternalMic-IN2" + "HeadsetMic-IN1" + ] + + EnableSequence [ + cdev "hw:bytchtes8316" + cset "name='Differential Mux' lin2-rin2" + cset "name='Headset Mic Switch' on" + ] + + DisableSequence [ + cdev "hw:bytchtes8316" + cset "name='Headset Mic Switch' off" + ] + + Value { + CaptureChannels "2" + JackControl "Headset Mic Jack" + } +} diff --git a/ucm/codecs/es8316/IN2-InternalMic.conf b/ucm/codecs/es8316/IN2-InternalMic.conf new file mode 100644 index 0000000..59892fd --- /dev/null +++ b/ucm/codecs/es8316/IN2-InternalMic.conf @@ -0,0 +1,24 @@ +SectionDevice."InternalMic-IN2" { + Comment "Internal Microphone on IN2" + + ConflictingDevice [ + "InternalMic-IN1" + "HeadsetMic-IN1" + "HeadsetMic-IN2" + ] + + EnableSequence [ + cdev "hw:bytchtes8316" + cset "name='Differential Mux' lin2-rin2" + cset "name='Internal Mic Switch' on" + ] + + DisableSequence [ + cdev "hw:bytchtes8316" + cset "name='Internal Mic Switch' off" + ] + + Value { + CaptureChannels "2" + } +} diff --git a/ucm/codecs/es8316/MonoSpeaker.conf b/ucm/codecs/es8316/MonoSpeaker.conf new file mode 100644 index 0000000..b1a95a5 --- /dev/null +++ b/ucm/codecs/es8316/MonoSpeaker.conf @@ -0,0 +1,40 @@ +SectionDevice."MonoSpeaker" { + Comment "Mono Speaker" + + ConflictingDevice [ + "Speaker" + "Headphones" + ] + + EnableSequence [ + cdev "hw:bytchtes8316" + + # BYT/CHT devices with an ES8316 codec use a single speaker + # connected between the headhpone LOUT and ROUT pins, expecting + # the output to be in a mono differential mode. Presumably this + # is done to use the power of both the left and right headphone + # amplifier channels to allow the speaker to be louder. + # + # The ES8316 codec does not have a differential output mode, but + # we can emulate one by making both channels output the exact + # same signal by setting the "DAC Mono Mix Switch", combined + # with setting the "Playback Polarity" control to "R Invert", + # which applies a 180 degrees phase inversion to the right chan. + cset "name='DAC Mono Mix Switch' on" + cset "name='Playback Polarity' 1" + + cset "name='Speaker Switch' on" + ] + + DisableSequence [ + cdev "hw:bytchtes8316" + cset "name='Speaker Switch' off" + # DAC settings back to normal for stereo headphones output + cset "name='Playback Polarity' 0" + cset "name='DAC Mono Mix Switch' off" + ] + + Value { + PlaybackChannels "2" + } +} diff --git a/ucm/codecs/es8316/Speaker.conf b/ucm/codecs/es8316/Speaker.conf new file mode 100644 index 0000000..f0894c7 --- /dev/null +++ b/ucm/codecs/es8316/Speaker.conf @@ -0,0 +1,22 @@ +SectionDevice."Speaker" { + Comment "Speakers" + + ConflictingDevice [ + "MonoSpeaker" + "Headphones" + ] + + EnableSequence [ + cdev "hw:bytchtes8316" + cset "name='Speaker Switch' on" + ] + + DisableSequence [ + cdev "hw:bytchtes8316" + cset "name='Speaker Switch' off" + ] + + Value { + PlaybackChannels "2" + } +} -- 2.47.1