--- /dev/null
+SectionVerb {
+ EnableSequence [
+ cdev "hw:bytchtes8316"
+ <platforms/bytcr/PlatformEnableSeq.conf>
+ <codecs/es8316/EnableSeq.conf>
+ ]
+
+ DisableSequence [
+ cdev "hw:bytchtes8316"
+ <platforms/bytcr/PlatformDisableSeq.conf>
+ ]
+
+ Value {
+ PlaybackPCM "hw:bytchtes8316"
+ CapturePCM "hw:bytchtes8316"
+ }
+}
+
+<codecs/es8316/Speaker.conf>
+<codecs/es8316/MonoSpeaker.conf>
+<codecs/es8316/HeadPhones.conf>
+
+<codecs/es8316/IN1-InternalMic.conf>
+<codecs/es8316/IN2-InternalMic.conf>
+<codecs/es8316/IN1-HeadsetMic.conf>
+<codecs/es8316/IN2-HeadsetMic.conf>
--- /dev/null
+SectionUseCase."HiFi" {
+ File "HiFi.conf"
+ Comment "Play HiFi quality Music"
+}
+
+SectionDefaults [
+ cdev "hw:bytchtes8316"
+]
--- /dev/null
+# 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"
--- /dev/null
+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"
+ }
+}
--- /dev/null
+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"
+ }
+}
--- /dev/null
+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"
+ }
+}
--- /dev/null
+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"
+ }
+}
--- /dev/null
+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"
+ }
+}
--- /dev/null
+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"
+ }
+}
--- /dev/null
+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"
+ }
+}