#!/bin/sh
# do not change the adc & dac source of AIF2
alsa_amixer cset name="AIF2DACL Source" "0"
alsa_amixer cset name="AIF2DACR Source" "0"
alsa_amixer cset name="AIF2ADCL Source" "0"
alsa_amixer cset name="AIF2ADCR Source" "1"

# AIF1->DAC1
alsa_amixer cset name="DAC1 Switch" "1"

# general
alsa_amixer cset name="IN1L ZC Switch" "0"
alsa_amixer cset name="IN1R ZC Switch" "0"
alsa_amixer cset name="IN2L ZC Switch" "0"
alsa_amixer cset name="IN2R ZC Switch" "0"
alsa_amixer cset name="Output ZC Switch" "0"
alsa_amixer cset name="Speaker ZC Switch" "0"
alsa_amixer cset name="Headphone ZC Switch" "0"

# AIF1->DAC1
alsa_amixer cset name="DAC1L Mixer AIF1.1 Switch" "1"
alsa_amixer cset name="DAC1R Mixer AIF1.1 Switch" "1"
alsa_amixer cset name="DAC1 Switch" "1"

# ADC->AIF2
alsa_amixer cset name="AIF2DAC2L Mixer Left Sidetone Switch" "1"
alsa_amixer cset name="AIF2DAC2L Mixer Right Sidetone Switch" "0"
alsa_amixer cset name="AIF2DAC2R Mixer Left Sidetone Switch" "0"
alsa_amixer cset name="AIF2DAC2R Mixer Right Sidetone Switch" "1"
alsa_amixer cset name="DAC2 Left Sidetone Volume" "12"
alsa_amixer cset name="DAC2 Right Sidetone Volume" "12"
alsa_amixer cset name="DAC2 Switch" "1"

# DAC1->HP
alsa_amixer cset name="Left Headphone Mux" "Mixer"
alsa_amixer cset name="Right Headphone Mux" "Mixer"

# DAC1->SPKL/R->SPKL/R Boost->SPK
alsa_amixer cset name="SPKL DAC1 Switch" "1"
alsa_amixer cset name="SPKR DAC1 Switch" "1"
alsa_amixer cset name="SPKL Boost SPKL Switch" "1"
alsa_amixer cset name="SPKL Boost SPKR Switch" "1"
alsa_amixer cset name="SPKR Boost SPKL Switch" "0"
alsa_amixer cset name="SPKR Boost SPKR Switch" "1"
alsa_amixer cset name="Speaker Mixer Volume" "3"

# DAC->Output mixer->Earpiece
alsa_amixer cset name="Left Output Mixer DAC Switch" "1"
alsa_amixer cset name="Right Output Mixer DAC Switch" "1"
alsa_amixer cset name="Earpiece Mixer Left Output Switch" "1"
alsa_amixer cset name="Earpiece Mixer Right Output Switch" "1"
alsa_amixer cset name="Earpiece Switch" "1"

# LINEOUT
alsa_amixer cset name="LINEOUT2N Mixer Left Output Switch" "1"
alsa_amixer cset name="LINEOUT2P Mixer Right Output Switch" "1"
alsa_amixer cset name="LINEOUT1N Mixer Right Output Switch" "1"
alsa_amixer cset name="LINEOUT1P Mixer Left Output Switch" "1"

# Input mixer->ADC->AIF1.1
alsa_amixer cset name="AIF1ADC1L Mixer ADC/DMIC Switch" "1"
alsa_amixer cset name="AIF1ADC1R Mixer ADC/DMIC Switch" "1"

# Main Mic->IN1LP/N->Input Mixer with +30dB at mixer
alsa_amixer cset name="IN1L PGA IN1LP Switch" "1"
alsa_amixer cset name="IN1L PGA IN1LN Switch" "1"
alsa_amixer cset name="MIXINL IN1L Volume" "1"
alsa_amixer cset name="IN1L Switch" "1"

# Sub Mic->IN1RP/N->Input Mixer with +30dB at mixer
alsa_amixer cset name="IN1R PGA IN1RP Switch" "1"
alsa_amixer cset name="IN1R PGA IN1RN Switch" "1"
alsa_amixer cset name="MIXINR IN1R Volume" "1"
alsa_amixer cset name="IN1R Switch" "1"

# FM Radio->IN2RP/N->Input Mixer with +30dB at mixer
alsa_amixer cset name="IN2R PGA IN2RP Switch" "1"
alsa_amixer cset name="IN2R PGA IN2RN Switch" "1"
alsa_amixer cset name="MIXINR IN2R Volume" "1"
alsa_amixer cset name="IN2R Switch" "1"

# Ear Mic->IN2LP/N->Input Mixer with +30dB at mixer
alsa_amixer cset name="IN2L PGA IN2LP Switch" "1"
alsa_amixer cset name="IN2L PGA IN2LN Switch" "1"
alsa_amixer cset name="MIXINL IN2L Volume" "1"
alsa_amixer cset name="IN2L Switch" "1"

# Input mixer->ADC->AIF1
alsa_amixer cset name="AIF1ADC1L Mixer ADC/DMIC Switch" "1"
alsa_amixer cset name="AIF1ADC1R Mixer ADC/DMIC Switch" "1"
alsa_amixer cset name="ADCL Mux" "ADC"
# HPF on to take out some bounce
alsa_amixer cset name="Sidetone HPF Switch" "0"

# Work around core issue
alsa_amixer cset name="ADCL Mux" "DMIC"
alsa_amixer cset name="ADCL Mux" "ADC"
alsa_amixer cset name="ADCR Mux" "DMIC"
alsa_amixer cset name="ADCR Mux" "ADC"

# AIF2ADCDAT to AIF3ADC mux
alsa_amixer cset name="AIF3ADC Mux" "1"

# Default all outputs off
alsa_amixer cset name="HP Switch" "0"
alsa_amixer cset name="SPK Switch" "0"
alsa_amixer cset name="RCV Switch" "0"
alsa_amixer cset name="LINE Switch" "0"
alsa_amixer cset name="HDMI Switch" "0"

# Default all inputs off
alsa_amixer cset name="Main Mic Switch" "0"
alsa_amixer cset name="Sub Mic Switch" "0"
alsa_amixer cset name="Headset Mic Switch" "0"
alsa_amixer cset name="FM In Switch" "0"

# EQ Switches
alsa_amixer cset name="AIF1DAC1 EQ Switch" "1"
alsa_amixer cset name="AIF1DAC1 EQ1 Volume" "9"
alsa_amixer cset name="AIF1DAC1 EQ2 Volume" "7"
alsa_amixer cset name="AIF1DAC1 EQ3 Volume" "10"
alsa_amixer cset name="AIF1DAC1 EQ4 Volume" "13"
alsa_amixer cset name="AIF1DAC1 EQ5 Volume" "12"

