asoc: es755: codec power & latency optimizations
Srinivas Anne [Sat, 22 Aug 2015 01:14:30 +0000 (18:14 -0700)]
FW version: M90.5.2.12_B61231_NVidia_Hawkeye_MCFFillIn_STREAM.bin

Change Summary:
Audience mainline driver escore 1.5.0
DSP-bypass route for audio playback over headset/headphone.
enabled MP_sleep state during audio playback over headset/headphone
Warm-up latency optimizations
fixed capture latency regression
disable wired accessory detection during LP0
playback latency optimizations

Change-Id: Ib55046b864b8b79284eb5568f07195c75fe50e81
Signed-off-by: Srinivas Anne <sanne@nvidia.com>
Reviewed-on: http://git-master/r/830908
GVS: Gerrit_Virtual_Submit
Reviewed-by: Pierre Gervais <pgervais@nvidia.com>

33 files changed:
firmware/audience/es755/audience-es755-fw.bin
sound/soc/codecs/audience/Kconfig
sound/soc/codecs/audience/Makefile
sound/soc/codecs/audience/adnc-sensorhub-api.h [deleted file]
sound/soc/codecs/audience/es-a300-reg.h
sound/soc/codecs/audience/es-a300.c
sound/soc/codecs/audience/es-d300-route.c
sound/soc/codecs/audience/es-d300-route.h
sound/soc/codecs/audience/es-d300.c
sound/soc/codecs/audience/es-d300.h
sound/soc/codecs/audience/es755-access.h
sound/soc/codecs/audience/es755.c [changed mode: 0755->0644]
sound/soc/codecs/audience/es755.h [changed mode: 0755->0644]
sound/soc/codecs/audience/escore-cdev.c
sound/soc/codecs/audience/escore-i2c.c
sound/soc/codecs/audience/escore-i2c.h
sound/soc/codecs/audience/escore-i2s.c
sound/soc/codecs/audience/escore-list.c
sound/soc/codecs/audience/escore-pm.c
sound/soc/codecs/audience/escore-slim.c
sound/soc/codecs/audience/escore-spi.c
sound/soc/codecs/audience/escore-spi.h
sound/soc/codecs/audience/escore-uart-common.c
sound/soc/codecs/audience/escore-uart-common.h
sound/soc/codecs/audience/escore-uart.c
sound/soc/codecs/audience/escore-version.h
sound/soc/codecs/audience/escore-vs.c
sound/soc/codecs/audience/escore-vs.h
sound/soc/codecs/audience/escore.c
sound/soc/codecs/audience/escore.h [changed mode: 0755->0644]
sound/soc/codecs/audience/esxxx.h [new file with mode: 0644]
sound/soc/codecs/audience/mq100-sensorhub.h [deleted file]
sound/soc/tegra-alt/tegra_t210ref_mobile_es755_alt.c

index e31ae30..2457c3c 100644 (file)
Binary files a/firmware/audience/es755/audience-es755-fw.bin and b/firmware/audience/es755/audience-es755-fw.bin differ
index 6d9529b..b347d61 100644 (file)
@@ -11,6 +11,17 @@ config SND_SOC_ES705_ESCORE
          * SLIMbus + SLIMbus and UART
          * I2C+I2S and SPI
 
+config SND_SOC_ES804_ESCORE
+        bool "eS804_escore"
+       select SND_SOC_ES_VS
+       ---help---
+         Enable support for Audience eS705 audio chip escore
+         Possible control+data and high bandwidth bus combinations:
+         * I2C+I2S and UART
+         * SPI+I2S and UART
+         * SLIMbus + SLIMbus and UART
+         * I2C+I2S and SPI
+
 config SND_SOC_ES704_ESCORE
        bool "eS704_escore"
        select SND_SOC_ES_VS
@@ -33,31 +44,41 @@ config SND_SOC_ES755
          * SLIMbus + SLIMbus and UART
          * I2C+I2S and SPI
 
-config MQ100_SENSOR_HUB
-        bool "mq100"
-       ---help---
-         Enable support for Audience Sensorhub interface
-         Possible control and high bandwidth bus combinations:
-         * I2C + UART
-         * I2C + SPI
-         * SPI
-         * UART
-
 config SND_SOC_ES705_EXTCLK_OVER_GPIO
        bool "Enable External Clock Control Over GPIO"
        ---help---
          This will enable external clock ON/OFF over GPIO
 
-config SND_SOC_ES705_CLOCK_INDEX
-       depends on (SND_SOC_ES705 || SND_SOC_ES705_ESCORE || SND_SOC_ES704_ESCORE || MQ100_SENSOR_HUB)
-       prompt "Audience es705 clock's index"
-       int
-       default 8
+config SND_SOC_ES854
+       bool "eS854"
+       select SND_SOC_ES_VS
        ---help---
-         Defines Audience es705 clock's index.
-         Supported clocks indexes
-         * 0 for 9600 MHz
-         * 8 for 19200 MHz
+         Enable support for Audience eS854 audio chip
+         Possible control+data and high bandwidth bus combinations:
+         * I2C+I2S and UART
+         * SPI+I2S and UART
+
+config SND_SOC_N100
+       bool "VS support for Multisensory SoC"
+       select SND_SOC_ES_VS
+       ---help---
+         Enable VQ support for multisensory
+
+config SND_SOC_ES857
+       bool "eS857"
+       select SND_SOC_ES_VS
+       ---help---
+         Enable support for Audience eS857 audio chip
+         Possible control+data and high bandwidth bus combinations:
+         * I2C+I2S and UART
+         * SPI+I2S and UART
+
+config OSP_SENSORHUB
+        bool "Escore support for Sensorhub"
+       ---help---
+         This will enable sensor hub configuration
+         OSP is Open Sensor Platform framework.
+         Audience sensorhub is compliant to OSP framework.
 
 # Legacy config options for eS705
 
@@ -154,31 +175,16 @@ config SND_SOC_ES705_UART_WAKEUP
        Ebabling this feature uses UART TX of host to wakeup eS705
        instead of wakeup gpio.
 
-config MQ100_SENSOR_HUB
-        bool "MQ100 Sensor driver support"
-               depends on SND_SOC_ES705_ESCORE
-       ---help---
-         This will enable MQ100 sensor hub configuration
 
 config SND_SOC_ES705_EXTCLK_OVER_GPIO
        bool "Enable External Clock Control Over GPIO"
        ---help---
-         This will enable external clock ON/OFF over GPIO
-
-config SND_SOC_ES705_CLOCK_INDEX
-       depends on (SND_SOC_ES705 || SND_SOC_ES705_ESCORE || SND_SOC_ES704_ESCORE)
-       prompt "Audience es705 clock's index"
-       int
-       default 8
-       ---help---
-         Defines Audience es705 clock's index.
-         Supported clocks indexes
-         * 0 for 9600 MHz
-         * 8 for 19200 MHz
+         This will enable external clock ON/OFF over 
+         GPIO
 
 # Options for escore infrastructure
 
-if SND_SOC_ES325 || SND_SOC_ES515 || SND_SOC_ES755 || SND_SOC_ES705_ESCORE || SND_SOC_ES704_ESCORE || MQ100_SENSOR_HUB
+if SND_SOC_ES325 || SND_SOC_ES515 || SND_SOC_ES755 || SND_SOC_ES705_ESCORE || SND_SOC_ES704_ESCORE || SND_SOC_ES804_ESCORE  || OSP_SENSORHUB || SND_SOC_ES854 || SND_SOC_ES857
 
 config SND_SOC_ES_I2S
        tristate
@@ -188,7 +194,9 @@ choice
        default SND_SOC_ES_SLIM
 
 config SND_SOC_ES_SLIM
-       bool "SLIMbus based codec" if SLIMBUS
+       bool "SLIMbus based codec"
+       select SLIMBUS
+       select MFD_CORE
        ---help---
          This enables SLIMbus as control interface
          as well as data interface to communicate
@@ -232,7 +240,7 @@ endchoice
 endif
 
 # High bandwidth bus support
-if SND_SOC_325 || SND_SOC_ES515 || SND_SOC_ES755 || SND_SOC_ES705_ESCORE || SND_SOC_ES704_ESCORE || MQ100_SENSOR_HUB
+if SND_SOC_325 || SND_SOC_ES515 || SND_SOC_ES755 || SND_SOC_ES705_ESCORE || SND_SOC_ES804_ESCORE ||SND_SOC_ES704_ESCORE || OSP_SENSORHUB || SND_SOC_ES854 || SND_SOC_ES857
 choice
        prompt "High Bandwidth Transport"
        default SND_SOC_ES_HIGH_BW_BUS_DEFAULT
@@ -280,37 +288,7 @@ config SND_SOC_ES_HIGH_BW_BUS_UART
 endchoice
 endif
 
-if SND_SOC_ES755 || SND_SOC_ES705_ESCORE || SND_SOC_ES704_ESCORE
-
-choice
-        prompt "Runtime Power Management mode"
-       default SND_SOC_ES_RUNTIME_SUSPEND_MODE_SLEEP
-       ---help---
-       There are two configuration modes for
-       runtime suspend case.
-       1. Sleep mode
-       2. CVQ suspend mode
-
-config SND_SOC_ES_RUNTIME_SUSPEND_MODE_SLEEP
-        bool "Normal Suspend"
-       ---help---
-       In this mode, chip will be put in normal
-       sleep mode i.e. sleep (for Audience DSPs
-       or MP sleep mode (for Audience Codecs)
-       when runtime suspend is called.
-
-config SND_SOC_ES_RUNTIME_SUSPEND_MODE_CVQ
-        bool "CVQ Suspend"
-       ---help---
-       In this mode, chip will be put in CVQ
-       suspend mode when runtime suspend is
-       called. Chip can be bought in normal mode
-       by speaking keyword or from resume.
-
-endchoice
-endif
-
-if SND_SOC_ES_HIGH_BW_BUS_UART && (SND_SOC_ES755 || SND_SOC_ES705 || SND_SOC_ES705_ESCORE || SND_SOC_ES704_ESCORE || MQ100_SENSOR_HUB)
+if SND_SOC_ES_HIGH_BW_BUS_UART && (SND_SOC_ES755 || SND_SOC_ES705 || SND_SOC_ES705_ESCORE || SND_SOC_ES704_ESCORE || SND_SOC_ES804_ESCORE || SND_SOC_ES854 || SND_SOC_ES857)
 
 config SND_SOC_ES_UART_SBL_BAUD
        prompt "UART baud rate for SBL mode"
@@ -358,7 +336,7 @@ config SND_SOC_ES_UART_VS_BAUD
          * 3072000
 
 config SND_SOC_ES_UARTHS_BAUD
-       depends on SND_SOC_ES_HIGH_BW_BUS_UART && (SND_SOC_ES755 || SND_SOC_ES705 || SND_SOC_ES705_ESCORE || SND_SOC_ES704_ESCORE || MQ100_SENSOR_HUB)
+       depends on SND_SOC_ES_HIGH_BW_BUS_UART && (SND_SOC_ES755 || SND_SOC_ES705 || SND_SOC_ES705_ESCORE ||SND_SOC_ES804_ESCORE|| SND_SOC_ES704_ESCORE || OSP_SENSORHUB || SND_SOC_ES854 || SND_SOC_ES857)
        prompt "UART baud rate for firmware download"
        int
        default 3000000
@@ -436,7 +414,7 @@ endchoice
 
 config SND_SOC_ES_VS
         bool "Voice Sense feature"
-       depends on SND_SOC_ES705 || SND_SOC_ES705_ESCORE || SND_SOC_ES704_ESCORE || SND_SOC_ES755 || SND_SOC_ES325
+       depends on SND_SOC_ES705 || SND_SOC_ES705_ESCORE || SND_SOC_ES804_ESCORE || SND_SOC_ES704_ESCORE || SND_SOC_ES755 || SND_SOC_ES325 || SND_SOC_ES854 || SND_SOC_ES857 || SND_SOC_N100
        ---help---
        This allows to select VS feature
 
@@ -471,4 +449,35 @@ config SND_SOC_ES_GPIO_A
        API Interrupt interface allows utilization of interrupt mode
        functionality:
 
+config SND_SOC_ES_VS_STREAMING
+        bool "VS Wakeup Streaming Mode"
+       depends on (SND_SOC_ES804_ESCORE || SND_SOC_ES705_ESCORE || SND_SOC_ES755 || SND_SOC_ES854 || SND_SOC_ES857)
+       ---help---
+       This adds support for VS streaming power state.
+       On VS wakeup the firmware wakes up in the VS
+       streaming mode. Post streaming the state has to
+       be switched to Normal mode.
+
+config SND_SOC_ES_AVOID_REPEAT_FW_DOWNLOAD
+        bool "Reduce Repeated Fw download across Power Transition"
+       depends on (SND_SOC_ES804_ESCORE || SND_SOC_ES705_ESCORE || SND_SOC_ES755 || SND_SOC_ES854 || SND_SOC_ES857)
+       ---help---
+       This adds support for reducing the number of FW
+       Download. In the New PCR platform, if a power
+       transition is done from NS --> VS with no Sleep
+       state in between, the FW Download needs to be
+       done only for the First Transition. Later on, we
+       only need to send Power transition Command. This
+       however is nullified if the chip enters Sleep state
+       any time in the middle
+
+config SND_SOC_ES_SPI_WRITE_DMA_MODE
+        bool "SPI Write When DMA mode enabled"
+       depends on (SND_SOC_ES_SPI || SND_SOC_ES_HIGH_BW_BUS_SPI)
+       ---help---
+       This adds support for spi write using DMA mode settings as DMA mode
+       expects kernel virtual address which has a mapping in physical memory.
+       This flag is mainly to be used when writing the buffer given by
+       user space.
+       E.g. Firmware download,Write Data Block from /etc/firmware.
 endmenu
index a96c95e..afed75f 100644 (file)
@@ -1,5 +1,7 @@
 snd-soc-es705-escore-objs := es705_escore.o escore-pm.o escore.o escore-list.o
 snd-soc-es755-objs := es755.o escore.o escore-pm.o escore-list.o es-d300.o es-a300.o es-d300-route.o
+snd-soc-es854-objs := es755.o escore.o escore-pm.o escore-list.o es-d300.o es-a350.o es-d300-route.o
+snd-soc-es857-objs := es755.o escore.o escore-pm.o escore-list.o es-d300.o es-a375.o es-d300-route.o
 snd-soc-escore-slim-objs += escore-slim.o
 snd-soc-escore-i2s-objs += escore-i2s.o
 snd-soc-escore-i2c-objs += escore-i2c.o
@@ -8,14 +10,19 @@ snd-soc-escore-cdev-objs += escore-cdev.o
 snd-soc-escore-uart-objs += escore-uart.o escore-uart-common.o
 snd-soc-escore-vs-objs += escore-vs.o
 snd-soc-es-spi-sensor-hub-objs := es705-sensorhub-demo.o
-adnc-mq100-sensorhub-objs := mq100-sensorhub.o escore-pm.o escore.o escore-list.o
+snd-soc-esn100-objs := es-n100.o
+escore-only-objs := escore.o escore-pm.o escore-list.o
 
 obj-$(CONFIG_SND_SOC_ES705_ESCORE)     += snd-soc-es705-escore.o
+obj-$(CONFIG_SND_SOC_ES804_ESCORE)     += snd-soc-es705-escore.o
 obj-$(CONFIG_SND_SOC_ES704_ESCORE)     += snd-soc-es705-escore.o
 obj-$(CONFIG_SND_SOC_ES325)    += snd-soc-es325.o
 obj-$(CONFIG_SND_SOC_ES515)    += snd-soc-es515.o
 obj-$(CONFIG_SND_SOC_ES755)    += snd-soc-es755.o
-obj-$(CONFIG_MQ100_SENSOR_HUB) += adnc-mq100-sensorhub.o
+obj-$(CONFIG_SND_SOC_ES854)    += snd-soc-es854.o
+obj-$(CONFIG_SND_SOC_N100)     += snd-soc-esn100.o
+obj-$(CONFIG_SND_SOC_ES857)    += snd-soc-es857.o
+obj-$(CONFIG_OSP_SENSORHUB)            += escore-only.o
 
 obj-$(CONFIG_SND_SOC_ES_SLIM)  += snd-soc-escore-slim.o
 ifneq ($(CONFIG_SND_SOC_ES_SLIM),y)
@@ -50,3 +57,4 @@ endif
 obj-$(CONFIG_SND_SOC_ES_CDEV)  += snd-soc-escore-cdev.o
 obj-$(CONFIG_SND_SOC_ES_VS)    += snd-soc-escore-vs.o
 obj-$(CONFIG_SND_SOC_ES_SPI_SENSOR_HUB)        += snd-soc-es-spi-sensor-hub.o
+
diff --git a/sound/soc/codecs/audience/adnc-sensorhub-api.h b/sound/soc/codecs/audience/adnc-sensorhub-api.h
deleted file mode 100644 (file)
index 1850d38..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-#ifndef ADNC_SENSORHUB_API_H
-#define ADNC_SENSORHUB_API_H
-
-
-struct mq100_extension_cb;
-
-/**
- * Register rdb callbacks
- * @param  callbacks - structure containing
- * callbacks from es705 rdb/wdb driver
- * @return
- */
-int mq100_register_extensions
-       (struct mq100_extension_cb *callbacks, void *priv);
-
-/**
- * Note: can we expect all of these
- * functions to be executed in process context?
- */
-struct mq100_extension_cb {
-       /**
-        * cookie using for callbacks
-        */
-       void *priv;
-
-       /**
-        * Callback when firmware has been downloaded, device has been
-        * initialized and is ready for rdb/wdb
-        *
-        * @param  es705_priv - es705 private data. this cookie will be
-        * returned with all calls to es705_wdb
-        * @return on success, a pointer to the callee's private data,
-        *         this cookie must be returned with every other callback
-        *         on failure, return NULL
-        */
-       void * (*probe)(void *es705);
-
-       /**
-        * This function is called when audience driver
-        * has detected the an interrupt from the device
-        * @param priv - cookie returned from probe()
-        */
-       void (*intr)(void *priv);
-
-       /**
-        * Callback whenever the device state changes.
-        * e.g. when firmware has been downloaded
-        * Use MQ100_STATE_XXX values for state param.
-        * @param priv - cookie returned from probe()
-        */
-       void (*status)(void *priv, u8 state);
-};
-
-/*
- * Writes buf to es705 using wdb
- * this function will prepend 0x802F 0xffff
- * @param: buf - wdb data
- * @param: len - length
- * @return: no. of bytes written
- */
-int mq100_wdb(const void *buf, int len);
-
-/* Max Size = PAGE_SIZE * 2 */
-/*
- * Reads buf from es705 using rdb
- * @param:
- * buf - rdb data Max Size supported - 2*PAGE_SIZE
- * Ensure buffer allocated has enough space for rdb
- *
- * buf - buffer pointer
- * id - type specifier
- * len - max. buf size
- *
- * @return: no. of bytes read
- */
-int mq100_rdb(void *buf, int len, int id);
-
-#endif
index 75ce238..d533a1d 100644 (file)
-/*
- * es-a300-reg.h  --  Audience eS755 ALSA SoC Audio driver
- *
- * Copyright 2013 Audience, Inc.
- *
- * Author: Rajat Aggarwal <raggarwal@audience.com>
- *
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
+//***********************************************************************************
+// SCRIPT GENERATED FILE - DO NOT EDIT
+//
+// es-a300-reg.h
+//
+// This file contains the addresses for the codec hardware fields.  Addresses
+// are automatically extracted by script from the codec register spreadsheets.
+//
+// This file generated on 5/22/2015 at 10:58:03 AM
+//
+//***********************************************************************************
 
 #ifndef __ES_A300_REG_H__
 #define __ES_A300_REG_H__
 
 
-/*
- * Register values
- */
-
-/*
- * Power
- */
-
-#define ES_CHIP_CTRL                           0x00
-#define ES_OVERRIDE                            0x01
-#define ES_LDO_CTRL                            0x2B
-#define ES_LDO_ILIM                            0x36
-#define ES_LDO_TRIM                            0x2A
-#define ES_MICBIAS_CTRL                                0x02
-#define ES_MB_TRIM1                            0x34
-#define ES_MB_TRIM2                            0x35
-
-/*
- * Accessory Detection
- */
-
-#define ES_PLUGDET_CTRL                                0x33
-#define ES_BTN_CTRL1                           0x23
-#define ES_BTN_CTRL2                           0x24
-#define ES_BTN_CTRL3                           0x25
-#define ES_BTN_CTRL4                           0x32
-#define ES_ACC_INTERCEPT                       0x0E
-#define ES_PLUG_STAT                           0x3B
-#define ES_BTNDET_STAT                         0x26
-#define ES_INT1_STATE                          0x1F
-#define ES_INT1_MASK                           0x20
-#define ES_INT2_STATE                          0x21
-#define ES_INT2_MASK                           0x22
-
-/*
- * Analog Inputs
- */
-
-#define ES_MIC0_CTRL                           0x03
-#define ES_MIC1_CTRL                           0x05
-#define ES_MIC2_CTRL                           0x08
-#define ES_MICHS_CTRL                          0x0D
-#define ES_AUX_L_CTRL                          0x07
-#define ES_AUX_R_CTRL                          0x09
-#define ES_MIC_TUNE                            0x04
-#define ES_REC_TRIM                            0x06
-
-/*
- * ADC
- */
-
-#define ES_ADC_CTRL                            0x0A
-#define ES_VS_ADC_CTRL                         0x2E
-#define ES_ADC_BIAS_I                          0x2C
-#define ES_ADC_GAIN_DITH                       0x2D
-
-/*
- * Analog Ground Referenced Output
- */
-
-#define ES_HP_L_GAIN                           0x11
-#define ES_HP_L_CTRL                           0x12
-#define ES_HP_R_GAIN                           0x13
-#define ES_HP_R_CTRL                           0x14
-#define ES_HP_CHAIN_TRIM                       0x1D
-#define ES_EP_GAIN                             0x0F
-#define ES_EP_CTRL                             0x10
-#define ES_LO_L_GAIN                           0x19
-#define ES_LO_L_CTRL                           0x1A
-#define ES_LO_R_GAIN                           0x1B
-#define ES_LO_R_CTRL                           0x1C
-#define ES_CLASSG                              0x27
-#define ES_CP_CTRL                             0x1E
-
-/*
- * Loudspeaker Output
- */
-
-#define ES_SPKR_L_GAIN                         0x15
-#define ES_SPKR_L_CTRL                         0x16
-#define ES_SPKR_R_GAIN                         0x17
-#define ES_SPKR_R_CTRL                         0x18
-#define ES_SPKR_DEBUG                          0x28
-#define ES_SPKR_TRIM                           0x29
-#define ES_SPKR_ALC1                           0x30
-#define ES_SPKR_ALC2                           0x31
-
-/*
- * DAC
- */
-
-#define ES_DAC_CTRL                            0x0B
-#define ES_DAC_DEBUG                           0x0C
-
-
-/*
- * Digital
- */
-
-#define ES_DAC_DIG_EN                          0x40
-#define ES_DAC_DIG_CH                          0x41
-#define ES_DAC_DIG_CPF                         0x42
-#define ES_DAC_DIG_I2S1                                0x43
-#define ES_DAC_DIG_I2S2                                0x44
-#define ES_DAC_DIG_FS_SEL                      0x45
-#define ES_DAC_DIG_OS                          0x46
-#define ES_DAC_DIG_CIC                         0x47
-#define ES_DAC_DIG_SDM                         0x48
-#define ES_DAC_DIG_DS                          0x49
-#define ES_DAC_DIG_DRP_FLT_CFF_0               0x4A
-#define ES_DAC_DIG_DRP_FLT_CFF_1               0x4B
-#define ES_DAC_DIG_DRP_FLT_CFB_0               0x4C
-#define ES_DAC_DIG_DRP_FLT_CFB_1               0x4D
-#define ES_DAC_DIG_DRP_FLT_GAIN_0              0x4E
-#define ES_DAC_DIG_DRP_FLT_GAIN_1              0x4F
-#define ES_DAC_DIG_FILT_ER_SAT_FLAG            0x50
-#define ES_SQUELCH_CONTROL                     0x51
-#define ES_SQUELCH_THRESHOLD                   0x52
-#define ES_SQUELCH_TERM_CNT                    0x53
-#define ES_DEM_TERM_CNT                                0x54
-#define ES_DERM_ROT_LVL                                0x55
-
-#define ES_MAX_REGISTER                                0x55
-
-
-
-/*
- * Field Definitions.
- */
-
-/*
- * R0 (0x00) - Chip Control Register
- */
-
-#define ES_CHIP_EN_MASK                        0x01  /* CHIP_EN 1=Enable chip */
-#define ES_CHIP_EN_SHIFT                          0  /* CHIP_EN */
-#define ES_CHIP_EN_WIDTH                          1  /* CHIP_EN */
-#define ES_STANDBY_MASK                                0x02  /* STANDBY 1=Standby*/
-#define ES_STANDBY_SHIFT                          1  /* STANDBY */
-#define ES_STANDBY_WIDTH                          1  /* STANDBY */
-#define ES_LDO1_DIS_MASK                       0x04  /* LDO1_DIS 1=LDO1 OFF*/
-#define ES_LDO1_DIS_SHIFT                         2  /* LDO1_DIS */
-#define ES_LDO1_DIS_WIDTH                         1  /* LDO1_DIS */
-#define ES_LDO3_DIS_MASK                       0x08  /* LDO3_DIS 1=LDO3 OFF*/
-#define ES_LDO3_DIS_SHIFT                         3  /* LDO3_DIS */
-#define ES_LDO3_DIS_WIDTH                         1  /* LDO3_DIS */
-#define ES_LDO2_DIS_MASK                       0x10  /* LDO2_DIS 1=LDO2 OFF*/
-#define ES_LDO2_DIS_SHIFT                         4  /* LDO2_DIS */
-#define ES_LDO2_DIS_WIDTH                         1  /* LDO2_DIS */
-#define ES_DIV_FOR_5_6MHZ_MASK         0x20  /* 1=44.1KHz 0=48KHz */
-#define ES_DIV_FOR_5_6MHZ_SHIFT                   5  /* DIV_FOR_5_6MHZ */
-#define ES_DIV_FOR_5_6MHZ_WIDTH                   1  /* DIV_FOR_5_6MHZ */
-#define ES_SKIP_OUT_CAL_MASK           0x40  /* SKIP_OUT_CAL */
-#define ES_SKIP_OUT_CAL_SHIFT             6  /* SKIP_OUT_CAL */
-#define ES_SKIP_OUT_CAL_WIDTH             1  /* SKIP_OUT_CAL */
-#define ES_RGLTR28_DIS_MASK                    0x80  /* RGLTR28_DIS */
-#define ES_RGLTR28_DIS_SHIFT              7  /* RGLTR28_DIS */
-#define ES_RGLTR28_DIS_WIDTH              1  /* RGLTR28_DIS */
-
-
-/*
- * R1 (0x01) - Override
- */
-
-#define ES_AUTO_TSD_MASK                       0x01  /* AUTO_TSD */
-#define ES_AUTO_TSD_SHIFT                         0  /* AUTO_TSD */
-#define ES_AUTO_TSD_WIDTH                         1  /* AUTO_TSD */
-#define ES_FORCE_VCM_MASK                      0x02  /* FORCE_VCM */
-#define ES_FORCE_VCM_SHIFT                        1  /* FORCE_VCM */
-#define ES_FORCE_VCM_WIDTH                        1  /* FORCE_VCM */
-#define ES_FORCE_LDO1_MASK                     0x04  /* FORCE_LDO1 */
-#define ES_FORCE_LDO1_SHIFT                       2  /* FORCE_LDO1 */
-#define ES_FORCE_LDO1_WIDTH                       1  /* FORCE_LDO1 */
-#define ES_FORCE_LDO3_MASK                     0x08  /* FORCE_LDO3 */
-#define ES_FORCE_LDO3_SHIFT                       3  /* FORCE_LDO3 */
-#define ES_FORCE_LDO3_WIDTH                       1  /* FORCE_LDO3 */
-#define ES_FORCE_LDO2_MASK                     0x10  /* FORCE_LDO2 */
-#define ES_FORCE_LDO2_SHIFT                       4  /* FORCE_LDO2 */
-#define ES_FORCE_LDO2_WIDTH                       1  /* FORCE_LDO2 */
-#define ES_TSD_IGNORE_MASK                     0x20  /* TSD_IGNORE */
-#define ES_TSD_IGNORE_SHIFT                       5  /* TSD_IGNORE */
-#define ES_TSD_IGNORE_WIDTH                       1  /* TSD_IGNORE */
-#define ES_LVLO_IGNORE_MASK                    0x40  /* LVLO_IGNORE */
-#define ES_LVLO_IGNORE_SHIFT              6  /* LVLO_IGNORE */
-#define ES_LVLO_IGNORE_WIDTH              1  /* LVLO_IGNORE */
-#define ES_SD_RING_CLK_MASK                    0x80  /* SD_RING_CLK */
-#define ES_SD_RING_CLK_SHIFT              7  /* SD_RING_CLK */
-#define ES_SD_RING_CLK_WIDTH              1  /* SD_RING_CLK */
-
-
-/*
- * R2 (0x02) - Microphone Bias Control Register
- * Mode 0 => Pulldown
- * Mode 1 => Enable
- * Mode 2 => Hi-Z
- * Mode 3 => Bypass to 1.8V
- */
-
-#define ES_MBIAS0_MODE_MASK                    0x03  /* MBIAS0_MODE */
-#define ES_MBIAS0_MODE_SHIFT                      0  /* MBIAS0_MODE */
-#define ES_MBIAS0_MODE_WIDTH                      2  /* MBIAS0_MODE */
-#define ES_MBIAS1_MODE_MASK                    0x0C  /* MBIAS1_MODE */
-#define ES_MBIAS1_MODE_SHIFT                      2  /* MBIAS1_MODE */
-#define ES_MBIAS1_MODE_WIDTH                      2  /* MBIAS1_MODE */
-#define ES_MBIAS2_MODE_MASK                    0x30  /* MBIAS2_MODE */
-#define ES_MBIAS2_MODE_SHIFT                      4  /* MBIAS2_MODE */
-#define ES_MBIAS2_MODE_WIDTH                      2  /* MBIAS2_MODE */
-#define ES_MBIASHS_MODE_MASK                   0xC0  /* MBIASHS_MODE */
-#define ES_MBIASHS_MODE_SHIFT                     6  /* MBIASHS_MODE */
-#define ES_MBIASHS_MODE_WIDTH                     2  /* MBIASHS_MODE */
-
-
-/*
- * R3 (0x03) - MIC0 CTRL Register
- */
-
-#define ES_MIC0_ON_MASK                                0x01  /* MIC0_ON */
-#define ES_MIC0_ON_SHIFT                          0  /* MIC0_ON */
-#define ES_MIC0_ON_WIDTH                          1  /* MIC0_ON */
-#define ES_MIC0_GAIN_MASK                      0x3E  /* MIC0_GAIN */
-#define ES_MIC0_GAIN_SHIFT                        1  /* MIC0_GAIN */
-#define ES_MIC0_GAIN_WIDTH                        5  /* MIC0_GAIN */
-#define ES_MIC0_GAIN_MAX                       0x14  /* MIC0_GAIN */
-#define ES_MIC0_SE_MASK                                0x40  /* MIC0_SE */
-#define ES_MIC0_SE_SHIFT                          6  /* MIC0_SE */
-#define ES_MIC0_SE_WIDTH                          1  /* MIC0_SE */
-
-
-/*
- * R4 (0x04) - MIC Tune
- * Mode 0 => 100 kOhm input impedance
- * Mode 1 => 50 kOhm input impedance
- * Mode 2 => 25 kOhm input impedance
- * Mode 3 => Attenuate input by 3dB
- */
-
-#define ES_MIC0_ZIN_MODE_MASK                  0x03  /* MIC0_ZIN_MODE */
-#define ES_MIC0_ZIN_MODE_SHIFT                    0  /* MIC0_ZIN_MODE */
-#define ES_MIC0_ZIN_MODE_WIDTH                    2  /* MIC0_ZIN_MODE */
-#define ES_MIC1_ZIN_MODE_MASK                  0x0C  /* MIC1_ZIN_MODE */
-#define ES_MIC1_ZIN_MODE_SHIFT                    2  /* MIC1_ZIN_MODE */
-#define ES_MIC1_ZIN_MODE_WIDTH                    2  /* MIC1_ZIN_MODE */
-#define ES_MIC2_ZIN_MODE_MASK                  0x30  /* MIC2_ZIN_MODE */
-#define ES_MIC2_ZIN_MODE_SHIFT                    4  /* MIC2_ZIN_MODE */
-#define ES_MIC2_ZIN_MODE_WIDTH                    2  /* MIC2_ZIN_MODE */
-#define ES_MICHS_ZIN_MODE_MASK                 0xC0  /* MICHS_ZIN_MODE */
-#define ES_MICHS_ZIN_MODE_SHIFT                           6  /* MICHS_ZIN_MODE */
-#define ES_MICHS_ZIN_MODE_WIDTH                           2  /* MICHS_ZIN_MODE */
-
-
-/*
- * R5 (0x05) - MIC1 CTRL Register
- */
-
-#define ES_MIC1_ON_MASK                                0x01  /* MIC1_ON */
-#define ES_MIC1_ON_SHIFT                          0  /* MIC1_ON */
-#define ES_MIC1_ON_WIDTH                          1  /* MIC1_ON */
-#define ES_MIC1_GAIN_MASK                      0x3E  /* MIC1_GAIN */
-#define ES_MIC1_GAIN_SHIFT                        1  /* MIC1_GAIN */
-#define ES_MIC1_GAIN_WIDTH                        5  /* MIC1_GAIN */
-#define ES_MIC1_GAIN_MAX                       0x14  /* MIC1_GAIN */
-#define ES_MIC1_SE_MASK                                0x40  /* MIC1_SE */
-#define ES_MIC1_SE_SHIFT                          6  /* MIC1_SE */
-#define ES_MIC1_SE_WIDTH                          1  /* MIC1_SE */
-
-
-/*
- * R6 (0x06) - REC TRIM Register
- *
- * Zin Mode 0 => 100 kOhm input impedance
- * Zin Mode 1 => 50 kOhm input impedance
- * Zin Mode 2 => 25 kOhm input impedance
- * Zin Mode 3 => Attenuate input by 3dB
- *
- *  BIAS TRIM 0 => 2.5 uA
- *  BIAS TRIM 1 => 5.0 uA
- *  BIAS TRIM 2 => 0.63 uA
- *  BIAS TRIM 3 => 0.31 uA
- */
-
-#define ES_AUX_ZIN_MODE_MASK           0x03  /* AUX_ZIN_MODE */
-#define ES_AUX_ZIN_MODE_SHIFT             0  /* AUX_ZIN_MODE */
-#define ES_AUX_ZIN_MODE_WIDTH             2  /* AUX_ZIN_MODE */
-#define ES_REC_MUTE_MASK                       0x04  /* REC_MUTE */
-#define ES_REC_MUTE_SHIFT                         2  /* REC_MUTE */
-#define ES_REC_MUTE_WIDTH                         1  /* REC_MUTE */
-#define ES_TRIMDISABLE_MASK                    0x08  /* TRIMDISABLE */
-#define ES_TRIMDISABLE_SHIFT              3  /* TRIMDISABLE */
-#define ES_TRIMDISABLE_WIDTH              1  /* TRIMDISABLE */
-#define ES_FORCE_VCMBUF_MASK           0x10  /* FORCE_VCMBUF */
-#define ES_FORCE_VCMBUF_SHIFT             4  /* FORCE_VCMBUF */
-#define ES_FORCE_VCMBUF_WIDTH             1  /* FORCE_VCMBUF */
-#define ES_HI_PERF_MASK                                0x20  /* HI_PERF */
-#define ES_HI_PERF_SHIFT                          5  /* HI_PERF */
-#define ES_HI_PERF_WIDTH                          1  /* HI_PERF */
-#define ES_I_BIAS_TRIM_MASK                    0xC0  /* I_BIAS_TRIM */
-#define ES_I_BIAS_TRIM_SHIFT              6  /* I_BIAS_TRIM */
-#define ES_I_BIAS_TRIM_WIDTH              2  /* I_BIAS_TRIM */
-
-
-/*
- * R7 (0x07) - AUXL CTRL Register
- */
-
-#define ES_AUXL_ON_MASK                                0x01  /* AUXL_ON */
-#define ES_AUXL_ON_SHIFT                          0  /* AUXL_ON */
-#define ES_AUXL_ON_WIDTH                          1  /* AUXL_ON */
-#define ES_AUXL_GAIN_MASK                      0x3E  /* AUXL_GAIN */
-#define ES_AUXL_GAIN_SHIFT                        1  /* AUXL_GAIN */
-#define ES_AUXL_GAIN_WIDTH                        5  /* AUXL_GAIN */
-#define ES_AUXL_GAIN_MAX                       0x14  /* AUXL_GAIN */
-#define ES_AUX_STEREO_MASK                     0x40  /* AUX_STEREO */
-#define ES_AUX_STEREO_SHIFT                       6  /* AUX_STEREO */
-#define ES_AUX_STEREO_WIDTH                       1  /* AUX_STEREO */
-#define ES_AUX_SWAP_L_R_MASK           0x80  /* AUX_SWAP_L_R */
-#define ES_AUX_SWAP_L_R_SHIFT             7  /* AUX_SWAP_L_R */
-#define ES_AUX_SWAP_L_R_WIDTH             1  /* AUX_SWAP_L_R */
-
-
-/*
- * R8 (0x08) - MIC2 CTRL Register
- */
-
-#define ES_MIC2_ON_MASK                                0x01  /* MIC2_ON */
-#define ES_MIC2_ON_SHIFT                          0  /* MIC2_ON */
-#define ES_MIC2_ON_WIDTH                          1  /* MIC2_ON */
-#define ES_MIC2_GAIN_MASK                      0x3E  /* MIC2_GAIN */
-#define ES_MIC2_GAIN_SHIFT                        1  /* MIC2_GAIN */
-#define ES_MIC2_GAIN_WIDTH                        5  /* MIC2_GAIN */
-#define ES_MIC2_GAIN_MAX                       0x14  /* MIC2_GAIN */
-#define ES_MIC2_SE_MASK                                0x40  /* MIC2_SE */
-#define ES_MIC2_SE_SHIFT                          6  /* MIC2_SE */
-#define ES_MIC2_SE_WIDTH                          1  /* MIC2_SE */
-
-
-/*
- * R9 (0x09) - AUXR CTRL Register
- */
-
-#define ES_AUXR_ON_MASK                                0x01  /* AUXR_ON */
-#define ES_AUXR_ON_SHIFT                          0  /* AUXR_ON */
-#define ES_AUXR_ON_WIDTH                          1  /* AUXR_ON */
-#define ES_AUXR_GAIN_MASK                      0x3E  /* AUXR_GAIN */
-#define ES_AUXR_GAIN_SHIFT                        1  /* AUXR_GAIN */
-#define ES_AUXR_GAIN_WIDTH                        5  /* AUXR_GAIN */
-#define ES_AUXR_GAIN_MAX                       0x14  /* AUXR_GAIN */
-#define ES_AUXR_SE_MASK                                0x40  /* AUXR_SE */
-#define ES_AUXR_SE_SHIFT                          6  /* AUXR_SE */
-#define ES_AUXR_SE_WIDTH                          1  /* AUXR_SE */
-
-
-/*
- * R10 (0x0A) - ADC CTRL Register
- */
-
-#define ES_ADC0_ON_MASK                                0x01  /* ADC0_ON */
-#define ES_ADC0_ON_SHIFT                            0  /* ADC0_ON */
-#define ES_ADC0_ON_WIDTH                            1  /* ADC0_ON */
-#define ES_ADC1_ON_MASK                                0x02  /* ADC1_ON */
-#define ES_ADC1_ON_SHIFT                            1  /* ADC1_ON */
-#define ES_ADC1_ON_WIDTH                            1  /* ADC1_ON */
-#define ES_ADC2_ON_MASK                                0x04  /* ADC2_ON */
-#define ES_ADC2_ON_SHIFT                            2  /* ADC2_ON */
-#define ES_ADC2_ON_WIDTH                            1  /* ADC2_ON */
-#define ES_ADC3_ON_MASK                                0x08  /* ADC3_ON */
-#define ES_ADC3_ON_SHIFT                            3  /* ADC3_ON */
-#define ES_ADC3_ON_WIDTH                            1  /* ADC3_ON */
-#define ES_ADC1_IN_SEL_MASK                    0x10  /* ADC1_IN_SEL */
-#define ES_ADC1_IN_SEL_SHIFT                        4  /* ADC1_IN_SEL */
-#define ES_ADC1_IN_SEL_WIDTH                        1  /* ADC1_IN_SEL */
-#define ES_ADC2_IN_SEL_MASK                    0x20  /* ADC2_IN_SEL */
-#define ES_ADC2_IN_SEL_SHIFT                        5  /* ADC2_IN_SEL */
-#define ES_ADC2_IN_SEL_WIDTH                        1  /* ADC2_IN_SEL */
-#define ES_ADC_MUTE_MASK                       0x40  /* ADC_MUTE */
-#define ES_ADC_MUTE_SHIFT                           6  /* ADC_MUTE */
-#define ES_ADC_MUTE_WIDTH                           1  /* ADC_MUTE */
-#define ES_ADC_GAIN_H_MASK                     0x80  /* ADC_GAIN_H */
-#define ES_ADC_GAIN_H_SHIFT                         7  /* ADC_GAIN_H */
-#define ES_ADC_GAIN_H_WIDTH                         1  /* ADC_GAIN_H */
-
-
-/*
- * R11 (0x0B) - DAC CTRL Register
- */
-
-#define ES_DAC0L_ON                            0x01  /* DAC0L_ON */
-#define ES_DAC0L_ON_MASK                       0x01  /* DAC0L_ON */
-#define ES_DAC0L_ON_SHIFT                           0  /* DAC0L_ON */
-#define ES_DAC0L_ON_WIDTH                           1  /* DAC0L_ON */
-#define ES_DAC0R_ON                            0x02  /* DAC0R_ON */
-#define ES_DAC0R_ON_MASK                       0x02  /* DAC0R_ON */
-#define ES_DAC0R_ON_SHIFT                           1  /* DAC0R_ON */
-#define ES_DAC0R_ON_WIDTH                           1  /* DAC0R_ON */
-#define ES_DAC1L_ON                            0x04  /* DAC1L_ON */
-#define ES_DAC1L_ON_MASK                       0x04  /* DAC1L_ON */
-#define ES_DAC1L_ON_SHIFT                           2  /* DAC1L_ON */
-#define ES_DAC1L_ON_WIDTH                           1  /* DAC1L_ON */
-#define ES_DAC1R_ON                            0x08  /* DAC1R_ON */
-#define ES_DAC1R_ON_MASK                       0x08  /* DAC1R_ON */
-#define ES_DAC1R_ON_SHIFT                           3  /* DAC1R_ON */
-#define ES_DAC1R_ON_WIDTH                           1  /* DAC1R_ON */
-#define ES_SQUELCH_DIS_MASK                    0x40  /* SQUELCH_DIS */
-#define ES_SQUELCH_DIS_SHIFT                        6  /* SQUELCH_DIS */
-#define ES_SQUELCH_DIS_WIDTH                        1  /* SQUELCH_DIS */
-#define ES_DAC_TRIM_DIS_MASK                   0x80  /* DAC_TRIM_DIS */
-#define ES_DAC_TRIM_DIS_SHIFT                       7  /* DAC_TRIM_DIS */
-#define ES_DAC_TRIM_DIS_WIDTH                       1  /* DAC_TRIM_DIS */
-
-
-/*
- * R13 (0x0D) - MICHS CTRL Register
- */
-
-#define ES_MICHS_ON_MASK                               0x01  /* MICHS_ON */
-#define ES_MICHS_ON_SHIFT                         0  /* MICHS_ON */
-#define ES_MICHS_ON_WIDTH                         1  /* MICHS_ON */
-#define ES_MICHS_GAIN_MASK                     0x3E  /* MICHS_GAIN */
-#define ES_MICHS_GAIN_SHIFT                       1  /* MICHS_GAIN */
-#define ES_MICHS_GAIN_WIDTH                       5  /* MICHS_GAIN */
-#define ES_MICHS_GAIN_MAX                      0x14  /* MICHS_GAIN */
-#define ES_MICHS_SE_MASK                               0x40  /* MICHS_SE */
-#define ES_MICHS_SE_SHIFT                         6  /* MICHS_SE */
-#define ES_MICHS_SE_WIDTH                         1  /* MICHS_SE */
-#define ES_MICHS_IN_SEL_MASK                           0x80  /* MICHS_IN_SEL */
-#define ES_MICHS_IN_SEL_SHIFT                     7  /* MICHS_IN_SEL */
-#define ES_MICHS_IN_SEL_WIDTH                     1  /* MICHS_IN_SEL */
-
-
-/*
- * R15 (0x0F) - Earphone Gain Register
- */
-
-#define ES_EP_GAIN_MASK                                0x0F  /* EP_GAIN */
-#define ES_EP_GAIN_SHIFT                            0  /* EP_GAIN */
-#define ES_EP_GAIN_WIDTH                            4  /* EP_GAIN */
-#define ES_EP_GAIN_MAX                         0x0F  /* EP_GAIN */
-#define ES_EP_MUTE                             0x80  /* EP_MUTE */
-#define ES_EP_MUTE_MASK                                0x80  /* EP_MUTE */
-#define ES_EP_MUTE_SHIFT                            7  /* EP_MUTE */
-#define ES_EP_MUTE_WIDTH                            1  /* EP_MUTE */
-
-
-/*
- * R16 (0x10) - Earphone Ctrl Register
- */
-
-#define ES_EP_ON                               0x01  /* EP_ON */
-#define ES_EP_ON_MASK                          0x01  /* EP_ON */
-#define ES_EP_ON_SHIFT                              0  /* EP_ON */
-#define ES_EP_ON_WIDTH                              1  /* EP_ON */
-#define ES_DAC0L_TO_EP                         0x02  /* DAC0L_TO_EP */
-#define ES_DAC0L_TO_EP_MASK                    0x02  /* DAC0L_TO_EP */
-#define ES_DAC0L_TO_EP_SHIFT                        1  /* DAC0L_TO_EP */
-#define ES_DAC0L_TO_EP_WIDTH                        1  /* DAC0L_TO_EP */
-#define ES_AUXL_TO_EP                          0x04  /* AUXL_TO_EP */
-#define ES_AUXL_TO_EP_MASK                     0x04  /* AUXL_TO_EP */
-#define ES_AUXL_TO_EP_SHIFT                         2  /* AUXL_TO_EP */
-#define ES_AUXL_TO_EP_WIDTH                         1  /* AUXL_TO_EP */
-#define ES_EP_M_PD_MASK                                0x10  /* EP_M_PD */
-#define ES_EP_M_PD_SHIFT                                    4  /* EP_M_PD */
-#define ES_EP_M_PD_WIDTH                                    1  /* EP_M_PD */
-#define ES_EP_P_PD_MASK                                0x20  /* EP_P_PD */
-#define ES_EP_P_PD_SHIFT                                    5  /* EP_P_PD */
-#define ES_EP_P_PD_WIDTH                                    1  /* EP_P_PD */
-#define ES_EP_BIAS_CUR_MASK                    0xC0  /* EP_BIAS_CUR */
-#define ES_EP_BIAS_CUR_SHIFT                        6  /* EP_BIAS_CUR */
-#define ES_EP_BIAS_CUR_WIDTH                        2  /* EP_BIAS_CUR */
-
-
-/*
- * R17 (0x11) - Headphone Left Gain Register
- */
-
-#define ES_HPL_GAIN_MASK                       0x0F  /* HPL_GAIN */
-#define ES_HPL_GAIN_SHIFT                         0  /* HPL_GAIN */
-#define ES_HPL_GAIN_WIDTH                         4  /* HPL_GAIN */
-#define ES_HPL_GAIN_MAX                                0x0F  /* HPL_GAIN */
-#define ES_HPL_PD_MASK                         0x10  /* HPL_PD */
-#define ES_HPL_PD_SHIFT                                   4  /* HPL_PD */
-#define ES_HPL_PD_WIDTH                                   1  /* HPL_PD */
-#define ES_HPL_BIAS_CUR_MASK           0x60  /* HPL_BIAS_CUR */
-#define ES_HPL_BIAS_CUR_SHIFT             5  /* HPL_BIAS_CUR */
-#define ES_HPL_BIAS_CUR_WIDTH             2  /* HPL_BIAS_CUR */
-#define ES_HPL_MUTE                            0x80  /* HPL_MUTE */
-#define ES_HPL_MUTE_MASK                       0x80  /* HPL_MUTE */
-#define ES_HPL_MUTE_SHIFT                           7  /* HPL_MUTE */
-#define ES_HPL_MUTE_WIDTH                           1  /* HPL_MUTE */
-
-
-/*
- * R18 (0x12) - Headphone Left Ctrl Register
- */
-
-#define ES_HPL_ON                              0x01  /* HPL_ON */
-#define ES_HPL_ON_MASK                         0x01  /* HPL_ON */
-#define ES_HPL_ON_SHIFT                                     0  /* HPL_ON */
-#define ES_HPL_ON_WIDTH                                     1  /* HPL_ON */
-#define ES_DAC0L_TO_HPL                                0x02  /* DAC0L_TO_HPL */
-#define ES_DAC0L_TO_HPL_MASK                   0x02  /* DAC0L_TO_HPL */
-#define ES_DAC0L_TO_HPL_SHIFT                       1  /* DAC0L_TO_HPL */
-#define ES_DAC0L_TO_HPL_WIDTH                       1  /* DAC0L_TO_HPL */
-#define ES_AUXL_TO_HPL                         0x04  /* AUXL_TO_HPL */
-#define ES_AUXL_TO_HPL_MASK                    0x04  /* AUXL_TO_HPL */
-#define ES_AUXL_TO_HPL_SHIFT                        3  /* AUXL_TO_HPL */
-#define ES_AUXL_TO_HPL_WIDTH                        1  /* AUXL_TO_HPL */
-
-
-/*
- * R19 (0x13) - Headphone Right Gain Register
- */
-
-#define ES_HPR_GAIN_MASK                       0x0F  /* HPR_GAIN */
-#define ES_HPR_GAIN_SHIFT                           0  /* HPR_GAIN */
-#define ES_HPR_GAIN_WIDTH                           4  /* HPR_GAIN */
-#define ES_HPR_GAIN_MAX                                0x0F  /* HPR_GAIN */
-#define ES_HPR_PD_MASK                         0x10  /* HPR_PD */
-#define ES_HPR_PD_SHIFT                                     4  /* HPR_PD */
-#define ES_HPR_PD_WIDTH                                     1  /* HPR_PD */
-#define ES_HPR_BIAS_CUR_MASK                   0x60  /* HPR_BIAS_CUR */
-#define ES_HPR_BIAS_CUR_SHIFT                       5  /* HPR_BIAS_CUR */
-#define ES_HPR_BIAS_CUR_WIDTH                       2  /* HPR_BIAS_CUR */
-#define ES_HPR_MUTE                            0x80  /* HPR_MUTE */
-#define ES_HPR_MUTE_MASK                       0x80  /* HPR_MUTE */
-#define ES_HPR_MUTE_SHIFT                           7  /* HPR_MUTE */
-#define ES_HPR_MUTE_WIDTH                           1  /* HPR_MUTE */
-
-
-/*
- * R20 (0x14) - Headphone Right Ctrl Register
- */
-
-#define ES_HPR_ON                              0x01  /* HPR_ON */
-#define ES_HPR_ON_MASK                         0x01  /* HPR_ON */
-#define ES_HPR_ON_SHIFT                                     0  /* HPR_ON */
-#define ES_HPR_ON_WIDTH                                     1  /* HPR_ON */
-#define ES_DAC0R_TO_HPR                                0x02  /* DAC0R_TO_HPR */
-#define ES_DAC0R_TO_HPR_MASK                   0x02  /* DAC0R_TO_HPR */
-#define ES_DAC0R_TO_HPR_SHIFT                       1  /* DAC0R_TO_HPR */
-#define ES_DAC0R_TO_HPR_WIDTH                       1  /* DAC0R_TO_HPR */
-#define ES_AUXR_TO_HPR                         0x04  /* AUXR_TO_HPR */
-#define ES_AUXR_TO_HPR_MASK                    0x04  /* AUXR_TO_HPR */
-#define ES_AUXR_TO_HPR_SHIFT                        3  /* AUXR_TO_HPR */
-#define ES_AUXR_TO_HPR_WIDTH                        1  /* AUXR_TO_HPR */
-
-
-
-/*
- * R21 (0x15) - Speaker Left Gain Register
- */
-
-#define ES_SPKRL_GAIN_MASK                     0x1F  /* SPKRL_GAIN */
-#define ES_SPKRL_GAIN_SHIFT                         0  /* SPKRL_GAIN */
-#define ES_SPKRL_GAIN_WIDTH                         5  /* SPKRL_GAIN */
-#define ES_SPKRL_GAIN_MAX                              0x1F  /* SPKRL_GAIN */
-#define ES_MONO_EN_MASK                                0x40  /* MONO_EN */
-#define ES_MONO_EN_SHIFT                            6  /* MONO_EN */
-#define ES_MONO_EN_WIDTH                            1  /* MONO_EN */
-#define ES_SPKRL_MUTE                          0x80  /* SPKRL_MUTE */
-#define ES_SPKRL_MUTE_MASK                     0x80  /* SPKRL_MUTE */
-#define ES_SPKRL_MUTE_SHIFT                         7  /* SPKRL_MUTE */
-#define ES_SPKRL_MUTE_WIDTH                         1  /* SPKRL_MUTE */
-
-
-/*
- * R22 (0x16) - Speaker Left Ctrl Register
- */
-
-#define ES_SPKRL_ON                            0x01  /* SPKRL_ON */
-#define ES_SPKRL_ON_MASK                               0x01  /* SPKRL_ON */
-#define ES_SPKRL_ON_SHIFT                                   0  /* SPKRL_ON */
-#define ES_SPKRL_ON_WIDTH                                   1  /* SPKRL_ON */
-#define ES_DAC0L_TO_SPKRL                      0x02  /* DAC0L_TO_SPKRL */
-#define ES_DAC0L_TO_SPKRL_MASK         0x02  /* DAC0L_TO_SPKRL */
-#define ES_DAC0L_TO_SPKRL_SHIFT                     1  /* DAC0L_TO_SPKRL */
-#define ES_DAC0L_TO_SPKRL_WIDTH                     1  /* DAC0L_TO_SPKRL */
-#define ES_DAC1L_TO_SPKRL                      0x04  /* DAC1L_TO_SPKRL */
-#define ES_DAC1L_TO_SPKRL_MASK         0x04  /* DAC1L_TO_SPKRL */
-#define ES_DAC1L_TO_SPKRL_SHIFT                     2  /* DAC1L_TO_SPKRL */
-#define ES_DAC1L_TO_SPKRL_WIDTH                     1  /* DAC1L_TO_SPKRL */
-#define ES_AUXL_TO_SPKRL                       0x08  /* AUXL_TO_SPKRL */
-#define ES_AUXL_TO_SPKRL_MASK          0x08  /* AUXL_TO_SPKRL */
-#define ES_AUXL_TO_SPKRL_SHIFT              3  /* AUXL_TO_SPKRL */
-#define ES_AUXL_TO_SPKRL_WIDTH              1  /* AUXL_TO_SPKRL */
-
-
-/*
- * R23 (0x17) - Speaker Right Gain Register
- */
-
-#define ES_SPKRR_GAIN_MASK                     0x1F  /* SPKRR_GAIN */
-#define ES_SPKRR_GAIN_SHIFT                         0  /* SPKRR_GAIN */
-#define ES_SPKRR_GAIN_WIDTH                         5  /* SPKRR_GAIN */
-#define ES_SPKRR_GAIN_MAX                              0x1F  /* SPKRR_GAIN */
-#define ES_SPKRR_MUTE                          0x80  /* SPKRR_MUTE */
-#define ES_SPKRR_MUTE_MASK                     0x80  /* SPKRR_MUTE */
-#define ES_SPKRR_MUTE_SHIFT                         7  /* SPKRR_MUTE */
-#define ES_SPKRR_MUTE_WIDTH                         1  /* SPKRR_MUTE */
-
-
-/*
- * R24 (0x18) - Speaker Right Ctrl Register
- */
-
-#define ES_SPKRR_ON                            0x01  /* SPKRR_ON */
-#define ES_SPKRR_ON_MASK                       0x01  /* SPKRR_ON */
-#define ES_SPKRR_ON_SHIFT                           0  /* SPKRR_ON */
-#define ES_SPKRR_ON_WIDTH                           1  /* SPKRR_ON */
-#define ES_DAC0R_TO_SPKRR                      0x02  /* DAC0R_TO_SPKRR */
-#define ES_DAC0R_TO_SPKRR_MASK         0x02  /* DAC0R_TO_SPKRR */
-#define ES_DAC0R_TO_SPKRR_SHIFT                     1  /* DAC0R_TO_SPKRR */
-#define ES_DAC0R_TO_SPKRR_WIDTH                     1  /* DAC0R_TO_SPKRR */
-#define ES_DAC1R_TO_SPKRR                      0x04  /* DAC1R_TO_SPKRR */
-#define ES_DAC1R_TO_SPKRR_MASK         0x04  /* DAC1R_TO_SPKRR */
-#define ES_DAC1R_TO_SPKRR_SHIFT                     2  /* DAC1R_TO_SPKRR */
-#define ES_DAC1R_TO_SPKRR_WIDTH                     1  /* DAC1R_TO_SPKRR */
-#define ES_AUXR_TO_SPKRR                       0x08  /* AUXR_TO_SPKRR */
-#define ES_AUXR_TO_SPKRR_MASK          0x08  /* AUXR_TO_SPKRR */
-#define ES_AUXR_TO_SPKRR_SHIFT              3  /* AUXR_TO_SPKRR */
-#define ES_AUXR_TO_SPKRR_WIDTH              1  /* AUXR_TO_SPKRR */
-
-
-/*
- * R25 (0x19) - Line Output Left Gain Register
- */
-
-#define ES_LO_L_GAIN_MASK                      0x0F  /* LO_L_GAIN */
-#define ES_LO_L_GAIN_SHIFT                          0  /* LO_L_GAIN */
-#define ES_LO_L_GAIN_WIDTH                          4  /* LO_L_GAIN */
-#define ES_LO_L_GAIN_MAX                       0x0F  /* LO_L_GAIN */
-#define ES_LO_L_MUTE                           0x80  /* LO_L_MUTE */
-#define ES_LO_L_MUTE_MASK                      0x80  /* LO_L_MUTE */
-#define ES_LO_L_MUTE_SHIFT                          7  /* LO_L_MUTE */
-#define ES_LO_L_MUTE_WIDTH                          1  /* LO_L_MUTE */
-
-/*
- * R26 (0x1A) - Line Output Left Ctrl Register
- */
-
-#define ES_LO_L_ON                             0x01  /* LO_L_ON */
-#define ES_LO_L_ON_MASK                                0x01  /* LO_L_ON */
-#define ES_LO_L_ON_SHIFT                            0  /* LO_L_ON */
-#define ES_LO_L_ON_WIDTH                            1  /* LO_L_ON */
-#define ES_DAC1L_TO_LO_L                       0x02  /* DAC1L_TO_LO_L */
-#define ES_DAC1L_TO_LO_L_MASK                  0x02  /* DAC1L_TO_LO_L */
-#define ES_DAC1L_TO_LO_L_SHIFT                      1  /* DAC1L_TO_LO_L */
-#define ES_DAC1L_TO_LO_L_WIDTH                      1  /* DAC1L_TO_LO_L */
-#define ES_LO_L_STARTUP_PULLDN_MASK            0x20  /* LO_L_STARTUP_PULLDN */
-#define ES_LO_L_STARTUP_PULLDN_SHIFT           5  /* LO_L_STARTUP_PULLDN */
-#define ES_LO_L_STARTUP_PULLDN_WIDTH           1  /* LO_L_STARTUP_PULLDN */
-#define ES_LO_TRIM_DIS                         0x80  /* LO_TRIM_DIS */
-#define ES_LO_TRIM_DIS_MASK                    0x80  /* LO_TRIM_DIS */
-#define ES_LO_TRIM_DIS_SHIFT                        7  /* LO_TRIM_DIS */
-#define ES_LO_TRIM_DIS_WIDTH                        1  /* LO_TRIM_DIS */
-
-
-/*
- * R27 (0x1B) - Line Output Right Gain Register
- */
-
-#define ES_LO_R_GAIN_MASK                      0x0F  /* LO_R_GAIN */
-#define ES_LO_R_GAIN_SHIFT                          0  /* LO_R_GAIN */
-#define ES_LO_R_GAIN_WIDTH                          4  /* LO_R_GAIN */
-#define ES_LO_R_GAIN_MAX                       0x0F  /* LO_R_GAIN */
-#define ES_LO_R_MUTE                           0x80  /* LO_R_MUTE */
-#define ES_LO_R_MUTE_MASK                      0x80  /* LO_R_MUTE */
-#define ES_LO_R_MUTE_SHIFT                          7  /* LO_R_MUTE */
-#define ES_LO_R_MUTE_WIDTH                          1  /* LO_R_MUTE */
-
-
-/*
- * R24 (0x1C) - Line Output Right Ctrl Register
- */
-
-#define ES_LO_R_ON                             0x01  /* LO_R_ON */
-#define ES_LO_R_ON_MASK                                0x01  /* LO_R_ON */
-#define ES_LO_R_ON_SHIFT                            0  /* LO_R_ON */
-#define ES_LO_R_ON_WIDTH                            1  /* LO_R_ON */
-#define ES_DAC1R_TO_LO_R                       0x02  /* DAC1R_TO_LO_R */
-#define ES_DAC1R_TO_LO_R_MASK                  0x02  /* DAC1R_TO_LO_R */
-#define ES_DAC1R_TO_LO_R_SHIFT                      1  /* DAC1R_TO_LO_R */
-#define ES_DAC1R_TO_LO_R_WIDTH                      1  /* DAC1R_TO_LO_R */
-
-/*
- * R33 (0x21) - INT1 STATE
- */
-
-#define ES_THM_SDN_INT_MASK                    0x01  /* THM_SDN_INT */
-#define ES_THM_SDN_INT_SHIFT              0  /* THM_SDN_INT */
-#define ES_THM_SDN_INT_WIDTH              1  /* THM_SDN_INT */
-#define ES_LINEOUT_SC_INT_MASK         0x02  /* LINEOUT_SC_INT */
-#define ES_LINEOUT_SC_INT_SHIFT                   1  /* LINEOUT_SC_INT */
-#define ES_LINEOUT_SC_INT_WIDTH                   1  /* LINEOUT_SC_INT */
-#define ES_SPKR_L_SC_INT_MASK          0x04  /* SPKR_L_SC_INT */
-#define ES_SPKR_L_SC_INT_SHIFT            2  /* SPKR_L_SC_INT */
-#define ES_SPKR_L_SC_INT_WIDTH            1  /* SPKR_L_SC_INT */
-#define ES_SPKR_R_SC_INT_MASK          0x08  /* SPKR_R_SC_INT */
-#define ES_SPKR_R_SC_INT_SHIFT            3  /* SPKR_R_SC_INT */
-#define ES_SPKR_R_SC_INT_WIDTH            1  /* SPKR_R_SC_INT */
-#define ES_HP_SC_INT_MASK                      0x10  /* HP_SC_INT */
-#define ES_HP_SC_INT_SHIFT                4  /* HP_SC_INT */
-#define ES_HP_SC_INT_WIDTH                1  /* HP_SC_INT */
-#define ES_EP_SC_INT_MASK                      0x20  /* EP_SC_INT */
-#define ES_EP_SC_INT_SHIFT                5  /* EP_SC_INT */
-#define ES_EP_SC_INT_WIDTH                1  /* EP_SC_INT */
-
-
-/*
- * R34 (0x22) - INT1 MASK
- */
-
-#define ES_THM_SDN_MASK_MASK                   0x01  /* THM_SDN_MASK */
-#define ES_THM_SDN_MASK_SHIFT             0  /* THM_SDN_MASK */
-#define ES_THM_SDN_MASK_WIDTH             1  /* THM_SDN_MASK */
-#define ES_LINEOUT_SC_MASK_MASK                0x02  /* LINEOUT_SC_MASK */
-#define ES_LINEOUT_SC_MASK_SHIFT                  1  /* LINEOUT_SC_MASK */
-#define ES_LINEOUT_SC_MASK_WIDTH                  1  /* LINEOUT_SC_MASK */
-#define ES_SPKR_L_SC_MASK_MASK         0x04  /* SPKR_L_SC_MASK */
-#define ES_SPKR_L_SC_MASK_SHIFT                   2  /* SPKR_L_SC_MASK */
-#define ES_SPKR_L_SC_MASK_WIDTH                   1  /* SPKR_L_SC_MASK */
-#define ES_SPKR_R_SC_MASK_MASK         0x08  /* SPKR_R_SC_MASK */
-#define ES_SPKR_R_SC_MASK_SHIFT                   3  /* SPKR_R_SC_MASK */
-#define ES_SPKR_R_SC_MASK_WIDTH                   1  /* SPKR_R_SC_MASK */
-#define ES_HP_SC_MASK_MASK                     0x10  /* HP_SC_MASK */
-#define ES_HP_SC_MASK_SHIFT               4  /* HP_SC_MASK */
-#define ES_HP_SC_MASK_WIDTH               1  /* HP_SC_MASK */
-#define ES_EP_SC_MASK_MASK                     0x20  /* EP_SC_MASK */
-#define ES_EP_SC_MASK_SHIFT               5  /* EP_SC_MASK */
-#define ES_EP_SC_MASK_WIDTH               1  /* EP_SC_MASK */
-
-/*
- * R48 (0x30) - SPKR ALC1
- */
-
-#define BYPASS_ALC_MASK        0x80 /* BYPASS_ALC_MASK */
-#define BYPASS_ALC_SHIFT       7    /* BYPASS_ALC_SHIFT */
-#define BYPASS_ALC_WIDTH       1    /* BYPASS_ALC_WIDTH */
-
-/*
- * R52 (0x34) - MB TRIM1
- */
-
-#define ES_LD02_TRIM_MASK              0x3
-#define ES_LD02_TRIM_SHIFT             6
-#define ES_LD02_TRIM_WIDTH             2
-#define ES_MBHS_TRIM_MASK              0x7
-#define ES_MBHS_TRIM_SHIFT             3
-#define ES_MBHS_TRIM_WIDTH             3
-#define ES_MB2_TRIM_MASK               0x7
-#define ES_MB2_TRIM_SHIFT              0
-#define ES_MB2_TRIM_WIDTH              3
-
-/*
- * R53 (0x35) - MB TRIM2
- */
-
-#define ES_LD02_PD_MODE_MASK           0x3
-#define ES_LD02_PD_MODE_SHIFT          6
-#define ES_LD02_PD_MODE_WIDTH          2
-#define ES_MB1_TRIM_MASK               0x7
-#define ES_MB1_TRIM_SHIFT              3
-#define ES_MB1_TRIM_WIDTH              3
-#define ES_MB0_TRIM_MASK               0x7
-#define ES_MB0_TRIM_SHIFT              0
-#define ES_MB0_TRIM_WIDTH              3
-
-/*
- * R60 (0x40) - DAC Digital Enable Register
- */
-
-#define ES_DAC0_LEFT_EN                                0x01  /* DAC0_LEFT_EN */
-#define ES_DAC0_LEFT_EN_MASK                   0x01  /* DAC0_LEFT_EN */
-#define ES_DAC0_LEFT_EN_SHIFT                       0  /* DAC0_LEFT_EN */
-#define ES_DAC0_LEFT_EN_WIDTH                       1  /* DAC0_LEFT_EN */
-#define ES_DAC0_RIGHT_EN                       0x02  /* DAC0_RIGHT_EN */
-#define ES_DAC0_RIGHT_EN_MASK                  0x02  /* DAC0_RIGHT_EN */
-#define ES_DAC0_RIGHT_EN_SHIFT                      1  /* DAC0_RIGHT_EN */
-#define ES_DAC0_RIGHT_EN_WIDTH                      1  /* DAC0_RIGHT_EN */
-#define ES_DAC1_LEFT_EN                                0x04  /* DAC1_LEFT_EN */
-#define ES_DAC1_LEFT_EN_MASK                   0x04  /* DAC1_LEFT_EN */
-#define ES_DAC1_LEFT_EN_SHIFT                       2  /* DAC1_LEFT_EN */
-#define ES_DAC1_LEFT_EN_WIDTH                       1  /* DAC1_LEFT_EN */
-#define ES_DAC1_RIGHT_EN                       0x08  /* DAC1_RIGHT_EN */
-#define ES_DAC1_RIGHT_EN_MASK                  0x08  /* DAC1_RIGHT_EN */
-#define ES_DAC1_RIGHT_EN_SHIFT                      3  /* DAC1_RIGHT_EN */
-#define ES_DAC1_RIGHT_EN_WIDTH                      1  /* DAC1_RIGHT_EN */
-#define ES_DAC_CLK_EN                          0x10  /* DAC_CLK_EN */
-#define ES_DAC_CLK_EN_MASK                     0x10  /* DAC_CLK_EN */
-#define ES_DAC_CLK_EN_SHIFT                         4  /* DAC_CLK_EN */
-#define ES_DAC_CLK_EN_WIDTH                         1  /* DAC_CLK_EN */
-#define ES_DIG_CLK_EN                          0x20  /* DIG_CLK_EN */
-#define ES_DIG_CLK_EN_MASK                     0x20  /* DIG_CLK_EN */
-#define ES_DIG_CLK_EN_SHIFT                         5  /* DIG_CLK_EN */
-#define ES_DIG_CLK_EN_WIDTH                         1  /* DIG_CLK_EN */
-#define ES_I2S_MODE                            0x40  /* 1=master 0=slave */
-#define ES_I2S_MODE_MASK                       0x40  /* I2S_MODE */
-#define ES_I2S_MODE_SHIFT                           6  /* I2S_MODE */
-#define ES_I2S_MODE_WIDTH                           1  /* I2S_MODE */
-#define ES_I2S_LEFT_JUSTIFIED                  0x80  /* 1=Left justified */
-#define ES_I2S_LEFT_JUSTIFIED_MASK             0x80  /* I2S_LEFT_JUSTIFIED */
-#define ES_I2S_LEFT_JUSTIFIED_SHIFT                 7  /* I2S_LEFT_JUSTIFIED */
-#define ES_I2S_LEFT_JUSTIFIED_WIDTH                 1  /* I2S_LEFT_JUSTIFIED */
-
-
-/*
- * R61 (0x41) - DAC Digital Channel Register
- */
-
-#define ES_I2S_CH                              0x01  /* 1=4 chn 0=2 chn */
-#define ES_I2S_CH_MASK                         0x01  /* I2S_CH */
-#define ES_I2S_CH_SHIFT                                     0  /* I2S_CH */
-#define ES_I2S_CH_WIDTH                                     1  /* I2S_CH */
-#define ES_I2S_PIN_EN                          0x02  /* 1=I2s clock 0=mclk */
-#define ES_I2S_PIN_EN_MASK                     0x02  /* I2S_PIN_EN */
-#define ES_I2S_PIN_EN_SHIFT                         1  /* I2S_PIN_EN */
-#define ES_I2S_PIN_EN_WIDTH                         1  /* I2S_PIN_EN */
-#define ES_I2S_CLK_SEL                         0x04  /* 1=mclk/2 0=mclk */
-#define ES_I2S_CLK_SEL_MASK                    0x04  /* I2S_CLK_SEL */
-#define ES_I2S_CLK_SEL_SHIFT                        2  /* I2S_CLK_SEL */
-#define ES_I2S_CLK_SEL_WIDTH                        1  /* I2S_CLK_SEL */
-#define ES_I2S_CLK_SEL_CLKDIV2                 0x08  /* 1=clk/2 0=clk */
-#define ES_I2S_CLK_SEL_CLKDIV2_MASK            0x08  /* I2S_CLK_SEL_CLKDIV2*/
-#define ES_I2S_CLK_SEL_CLKDIV2_SHIFT                3  /* I2S_CLK_SEL_CLKDIV2*/
-#define ES_I2S_CLK_SEL_CLKDIV2_WIDTH                1  /* I2S_CLK_SEL_CLKDIV2*/
-#define ES_CLK_SOURCE                          0x10  /* 1=mclk 0=i2s_clk_in*/
-#define ES_CLK_SOURCE_MASK                     0x10  /* CLK_SOURCE */
-#define ES_CLK_SOURCE_SHIFT                         4  /* CLK_SOURCE */
-#define ES_CLK_SOURCE_WIDTH                         1  /* CLK_SOURCE */
-
-
-/*
- * R63 (0x43) - DAC Digital I2S1 Register
- */
-
-#define ES_BITS_PER_SAMPLE_MASK                        0x1F  /* BITS_PER_SAMPLE */
-#define ES_BITS_PER_SAMPLE_SHIFT                  0  /* BITS_PER_SAMPLE */
-#define ES_BITS_PER_SAMPLE_WIDTH                  5  /* BITS_PER_SAMPLE */
-#define ES_FS_POL_MASK                         0x60  /* FS_POL */
-#define ES_FS_POL_SHIFT                             5  /* FS_POL */
-#define ES_FS_POL_WIDTH                             2  /* FS_POL */
-#define ES_CLK_POL_MASK                                0x80  /* CLK_POL */
-#define ES_CLK_POL_SHIFT                            7  /* CLK_POL */
-#define ES_CLK_POL_WIDTH                            1  /* CLK_POL */
-
-
-/*
- * R65 (0x45) - Frame Sync Selection Register
- */
-
-#define ES_FS_SEL_MASK                 0x03  /* FS_SEL */
-#define ES_FS_SEL_SHIFT                   0  /* FS_SEL */
-#define ES_FS_SEL_WIDTH                   2  /* FS_SEL */
-#define ES_FS_OVERRIDE_MASK            0x04  /* FS_OVERRIDE */
-#define ES_FS_OVERRIDE_SHIFT              2  /* FS_OVERRIDE */
-#define ES_FS_OVERRIDE_WIDTH              1  /* FS_OVERRIDE */
+#define ES_MIC0_GAIN_MAX                     0x14
+#define ES_MIC1_GAIN_MAX                     0x14
+#define ES_MIC2_GAIN_MAX                     0x14
+#define ES_MICHS_GAIN_MAX                    0x14
+#define ES_AUXL_GAIN_MAX                     0x14
+#define ES_AUXR_GAIN_MAX                     0x14
+#define ES_EP_GAIN_MAX                       0x0F
+#define ES_HPL_GAIN_MAX                      0x0F
+#define ES_HPR_GAIN_MAX                      0x0F
+#define ES_SPKR_L_GAIN_MAX                   0x1F
+#define ES_SPKR_R_GAIN_MAX                   0x1F
+#define ES_LO_L_GAIN_MAX                     0x0F
+#define ES_LO_R_GAIN_MAX                     0x0F
+
+#define ES_CHIP_EN                           0x0000
+#define ES_CHIP_EN_MASK                      0x01
+#define ES_CHIP_EN_SHIFT                     0
+#define ES_CHIP_EN_WIDTH                     1
+
+#define ES_STANDBY                           0x0001
+#define ES_STANDBY_MASK                      0x01
+#define ES_STANDBY_SHIFT                     0
+#define ES_STANDBY_WIDTH                     1
+
+#define ES_MBIAS0_MODE                       0x0010
+#define ES_MBIAS0_MODE_MASK                  0x03
+#define ES_MBIAS0_MODE_SHIFT                 0
+#define ES_MBIAS0_MODE_WIDTH                 2
+
+#define ES_MBIAS1_MODE                       0x0011
+#define ES_MBIAS1_MODE_MASK                  0x03
+#define ES_MBIAS1_MODE_SHIFT                 0
+#define ES_MBIAS1_MODE_WIDTH                 2
+
+#define ES_MBIAS2_MODE                       0x0012
+#define ES_MBIAS2_MODE_MASK                  0x03
+#define ES_MBIAS2_MODE_SHIFT                 0
+#define ES_MBIAS2_MODE_WIDTH                 2
+
+#define ES_MIC0_ON                           0x0014
+#define ES_MIC0_ON_MASK                      0x01
+#define ES_MIC0_ON_SHIFT                     0
+#define ES_MIC0_ON_WIDTH                     1
+
+#define ES_MIC0_GAIN                         0x0015
+#define ES_MIC0_GAIN_MASK                    0x1F
+#define ES_MIC0_GAIN_SHIFT                   0
+#define ES_MIC0_GAIN_WIDTH                   5
+
+#define ES_MIC0_ZIN_MODE                     0x0017
+#define ES_MIC0_ZIN_MODE_MASK                0x03
+#define ES_MIC0_ZIN_MODE_SHIFT               0
+#define ES_MIC0_ZIN_MODE_WIDTH               2
+
+#define ES_MIC1_ZIN_MODE                     0x0018
+#define ES_MIC1_ZIN_MODE_MASK                0x03
+#define ES_MIC1_ZIN_MODE_SHIFT               0
+#define ES_MIC1_ZIN_MODE_WIDTH               2
+
+#define ES_MIC2_ZIN_MODE                     0x0019
+#define ES_MIC2_ZIN_MODE_MASK                0x03
+#define ES_MIC2_ZIN_MODE_SHIFT               0
+#define ES_MIC2_ZIN_MODE_WIDTH               2
+
+#define ES_MICHS_ZIN_MODE                    0x001A
+#define ES_MICHS_ZIN_MODE_MASK               0x03
+#define ES_MICHS_ZIN_MODE_SHIFT              0
+#define ES_MICHS_ZIN_MODE_WIDTH              2
+
+#define ES_MIC1_ON                           0x001B
+#define ES_MIC1_ON_MASK                      0x01
+#define ES_MIC1_ON_SHIFT                     0
+#define ES_MIC1_ON_WIDTH                     1
+
+#define ES_MIC1_GAIN                         0x001C
+#define ES_MIC1_GAIN_MASK                    0x1F
+#define ES_MIC1_GAIN_SHIFT                   0
+#define ES_MIC1_GAIN_WIDTH                   5
+
+#define ES_AUX_ZIN_MODE                      0x001E
+#define ES_AUX_ZIN_MODE_MASK                 0x03
+#define ES_AUX_ZIN_MODE_SHIFT                0
+#define ES_AUX_ZIN_MODE_WIDTH                2
+
+#define ES_REC_MUTE                          0x001F
+#define ES_REC_MUTE_MASK                     0x01
+#define ES_REC_MUTE_SHIFT                    0
+#define ES_REC_MUTE_WIDTH                    1
+
+#define ES_AUXL_ON                           0x0024
+#define ES_AUXL_ON_MASK                      0x01
+#define ES_AUXL_ON_SHIFT                     0
+#define ES_AUXL_ON_WIDTH                     1
+
+#define ES_AUXL_GAIN                         0x0025
+#define ES_AUXL_GAIN_MASK                    0x1F
+#define ES_AUXL_GAIN_SHIFT                   0
+#define ES_AUXL_GAIN_WIDTH                   5
+
+#define ES_MIC2_ON                           0x0028
+#define ES_MIC2_ON_MASK                      0x01
+#define ES_MIC2_ON_SHIFT                     0
+#define ES_MIC2_ON_WIDTH                     1
+
+#define ES_MIC2_GAIN                         0x0029
+#define ES_MIC2_GAIN_MASK                    0x1F
+#define ES_MIC2_GAIN_SHIFT                   0
+#define ES_MIC2_GAIN_WIDTH                   5
+
+#define ES_AUXR_ON                           0x002C
+#define ES_AUXR_ON_MASK                      0x01
+#define ES_AUXR_ON_SHIFT                     0
+#define ES_AUXR_ON_WIDTH                     1
+
+#define ES_AUXR_GAIN                         0x002D
+#define ES_AUXR_GAIN_MASK                    0x1F
+#define ES_AUXR_GAIN_SHIFT                   0
+#define ES_AUXR_GAIN_WIDTH                   5
+
+#define ES_ADC0_ON                           0x0030
+#define ES_ADC0_ON_MASK                      0x01
+#define ES_ADC0_ON_SHIFT                     0
+#define ES_ADC0_ON_WIDTH                     1
+
+#define ES_ADC1_ON                           0x0031
+#define ES_ADC1_ON_MASK                      0x01
+#define ES_ADC1_ON_SHIFT                     0
+#define ES_ADC1_ON_WIDTH                     1
+
+#define ES_ADC2_ON                           0x0032
+#define ES_ADC2_ON_MASK                      0x01
+#define ES_ADC2_ON_SHIFT                     0
+#define ES_ADC2_ON_WIDTH                     1
+
+#define ES_ADC3_ON                           0x0033
+#define ES_ADC3_ON_MASK                      0x01
+#define ES_ADC3_ON_SHIFT                     0
+#define ES_ADC3_ON_WIDTH                     1
+
+#define ES_ADC1_IN_SEL                       0x0034
+#define ES_ADC1_IN_SEL_MASK                  0x01
+#define ES_ADC1_IN_SEL_SHIFT                 0
+#define ES_ADC1_IN_SEL_WIDTH                 1
+
+#define ES_ADC2_IN_SEL                       0x0035
+#define ES_ADC2_IN_SEL_MASK                  0x01
+#define ES_ADC2_IN_SEL_SHIFT                 0
+#define ES_ADC2_IN_SEL_WIDTH                 1
+
+#define ES_ADC_MUTE                          0x0036
+#define ES_ADC_MUTE_MASK                     0x01
+#define ES_ADC_MUTE_SHIFT                    0
+#define ES_ADC_MUTE_WIDTH                    1
+
+#define ES_MICHS_ON                          0x0042
+#define ES_MICHS_ON_MASK                     0x01
+#define ES_MICHS_ON_SHIFT                    0
+#define ES_MICHS_ON_WIDTH                    1
+
+#define ES_MICHS_GAIN                        0x0043
+#define ES_MICHS_GAIN_MASK                   0x1F
+#define ES_MICHS_GAIN_SHIFT                  0
+#define ES_MICHS_GAIN_WIDTH                  5
+
+#define ES_MICHS_IN_SEL                      0x0045
+#define ES_MICHS_IN_SEL_MASK                 0x01
+#define ES_MICHS_IN_SEL_SHIFT                0
+#define ES_MICHS_IN_SEL_WIDTH                1
+
+#define ES_EP_GAIN                           0x004B
+#define ES_EP_GAIN_MASK                      0x0F
+#define ES_EP_GAIN_SHIFT                     0
+#define ES_EP_GAIN_WIDTH                     4
+
+#define ES_EP_MUTE                           0x004E
+#define ES_EP_MUTE_MASK                      0x01
+#define ES_EP_MUTE_SHIFT                     0
+#define ES_EP_MUTE_WIDTH                     1
+
+#define ES_EP_ON                             0x004F
+#define ES_EP_ON_MASK                        0x01
+#define ES_EP_ON_SHIFT                       0
+#define ES_EP_ON_WIDTH                       1
+
+#define ES_DAC0L_TO_EP                       0x0050
+#define ES_DAC0L_TO_EP_MASK                  0x01
+#define ES_DAC0L_TO_EP_SHIFT                 0
+#define ES_DAC0L_TO_EP_WIDTH                 1
+
+#define ES_HPL_GAIN                          0x0055
+#define ES_HPL_GAIN_MASK                     0x0F
+#define ES_HPL_GAIN_SHIFT                    0
+#define ES_HPL_GAIN_WIDTH                    4
+
+#define ES_HPL_MUTE                          0x0058
+#define ES_HPL_MUTE_MASK                     0x01
+#define ES_HPL_MUTE_SHIFT                    0
+#define ES_HPL_MUTE_WIDTH                    1
+
+#define ES_HPL_ON                            0x0059
+#define ES_HPL_ON_MASK                       0x01
+#define ES_HPL_ON_SHIFT                      0
+#define ES_HPL_ON_WIDTH                      1
+
+#define ES_DAC0L_TO_HPL                      0x005A
+#define ES_DAC0L_TO_HPL_MASK                 0x01
+#define ES_DAC0L_TO_HPL_SHIFT                0
+#define ES_DAC0L_TO_HPL_WIDTH                1
+
+#define ES_HPR_GAIN                          0x0060
+#define ES_HPR_GAIN_MASK                     0x0F
+#define ES_HPR_GAIN_SHIFT                    0
+#define ES_HPR_GAIN_WIDTH                    4
+
+#define ES_HPR_MUTE                          0x0063
+#define ES_HPR_MUTE_MASK                     0x01
+#define ES_HPR_MUTE_SHIFT                    0
+#define ES_HPR_MUTE_WIDTH                    1
+
+#define ES_HPR_ON                            0x0064
+#define ES_HPR_ON_MASK                       0x01
+#define ES_HPR_ON_SHIFT                      0
+#define ES_HPR_ON_WIDTH                      1
+
+#define ES_DAC0R_TO_HPR                      0x0065
+#define ES_DAC0R_TO_HPR_MASK                 0x01
+#define ES_DAC0R_TO_HPR_SHIFT                0
+#define ES_DAC0R_TO_HPR_WIDTH                1
+
+#define ES_SPKRL_GAIN                        0x006B
+#define ES_SPKRL_GAIN_MASK                   0x1F
+#define ES_SPKRL_GAIN_SHIFT                  0
+#define ES_SPKRL_GAIN_WIDTH                  5
+
+#define ES_SPKRL_MUTE                        0x006E
+#define ES_SPKRL_MUTE_MASK                   0x01
+#define ES_SPKRL_MUTE_SHIFT                  0
+#define ES_SPKRL_MUTE_WIDTH                  1
+
+#define ES_SPKRL_ON                          0x006F
+#define ES_SPKRL_ON_MASK                     0x01
+#define ES_SPKRL_ON_SHIFT                    0
+#define ES_SPKRL_ON_WIDTH                    1
+
+#define ES_DAC0L_TO_SPKRL                    0x0070
+#define ES_DAC0L_TO_SPKRL_MASK               0x01
+#define ES_DAC0L_TO_SPKRL_SHIFT              0
+#define ES_DAC0L_TO_SPKRL_WIDTH              1
+
+#define ES_DAC1L_TO_SPKRL                    0x0071
+#define ES_DAC1L_TO_SPKRL_MASK               0x01
+#define ES_DAC1L_TO_SPKRL_SHIFT              0
+#define ES_DAC1L_TO_SPKRL_WIDTH              1
+
+#define ES_SPKRR_GAIN                        0x0075
+#define ES_SPKRR_GAIN_MASK                   0x1F
+#define ES_SPKRR_GAIN_SHIFT                  0
+#define ES_SPKRR_GAIN_WIDTH                  5
+
+#define ES_SPKRR_MUTE                        0x0077
+#define ES_SPKRR_MUTE_MASK                   0x01
+#define ES_SPKRR_MUTE_SHIFT                  0
+#define ES_SPKRR_MUTE_WIDTH                  1
+
+#define ES_SPKRR_ON                          0x0078
+#define ES_SPKRR_ON_MASK                     0x01
+#define ES_SPKRR_ON_SHIFT                    0
+#define ES_SPKRR_ON_WIDTH                    1
+
+#define ES_DAC0R_TO_SPKRR                    0x0079
+#define ES_DAC0R_TO_SPKRR_MASK               0x01
+#define ES_DAC0R_TO_SPKRR_SHIFT              0
+#define ES_DAC0R_TO_SPKRR_WIDTH              1
+
+#define ES_DAC1R_TO_SPKRR                    0x007A
+#define ES_DAC1R_TO_SPKRR_MASK               0x01
+#define ES_DAC1R_TO_SPKRR_SHIFT              0
+#define ES_DAC1R_TO_SPKRR_WIDTH              1
+
+#define ES_LO_L_GAIN                         0x007E
+#define ES_LO_L_GAIN_MASK                    0x0F
+#define ES_LO_L_GAIN_SHIFT                   0
+#define ES_LO_L_GAIN_WIDTH                   4
+
+#define ES_LO_L_MUTE                         0x0081
+#define ES_LO_L_MUTE_MASK                    0x01
+#define ES_LO_L_MUTE_SHIFT                   0
+#define ES_LO_L_MUTE_WIDTH                   1
+
+#define ES_LO_L_ON                           0x0082
+#define ES_LO_L_ON_MASK                      0x01
+#define ES_LO_L_ON_SHIFT                     0
+#define ES_LO_L_ON_WIDTH                     1
+
+#define ES_DAC1L_TO_LO_L                     0x0083
+#define ES_DAC1L_TO_LO_L_MASK                0x01
+#define ES_DAC1L_TO_LO_L_SHIFT               0
+#define ES_DAC1L_TO_LO_L_WIDTH               1
+
+#define ES_LO_R_GAIN                         0x008A
+#define ES_LO_R_GAIN_MASK                    0x0F
+#define ES_LO_R_GAIN_SHIFT                   0
+#define ES_LO_R_GAIN_WIDTH                   4
+
+#define ES_LO_R_MUTE                         0x008D
+#define ES_LO_R_MUTE_MASK                    0x01
+#define ES_LO_R_MUTE_SHIFT                   0
+#define ES_LO_R_MUTE_WIDTH                   1
+
+#define ES_LO_R_ON                           0x008E
+#define ES_LO_R_ON_MASK                      0x01
+#define ES_LO_R_ON_SHIFT                     0
+#define ES_LO_R_ON_WIDTH                     1
+
+#define ES_DAC1R_TO_LO_R                     0x008F
+#define ES_DAC1R_TO_LO_R_MASK                0x01
+#define ES_DAC1R_TO_LO_R_SHIFT               0
+#define ES_DAC1R_TO_LO_R_WIDTH               1
+
+#define ES_VC_ADC_ON                         0x00ED
+#define ES_VC_ADC_ON_MASK                    0x01
+#define ES_VC_ADC_ON_SHIFT                   0
+#define ES_VC_ADC_ON_WIDTH                   1
+
+#define ES_MB2_TRIM                          0x0100
+#define ES_MB2_TRIM_MASK                     0x07
+#define ES_MB2_TRIM_SHIFT                    0
+#define ES_MB2_TRIM_WIDTH                    3
+
+#define ES_MBHS_TRIM                         0x0101
+#define ES_MBHS_TRIM_MASK                    0x07
+#define ES_MBHS_TRIM_SHIFT                   0
+#define ES_MBHS_TRIM_WIDTH                   3
+
+#define ES_LD02_TRIM                         0x0102
+#define ES_LD02_TRIM_MASK                    0x03
+#define ES_LD02_TRIM_SHIFT                   0
+#define ES_LD02_TRIM_WIDTH                   2
+
+#define ES_MB0_TRIM                          0x0103
+#define ES_MB0_TRIM_MASK                     0x07
+#define ES_MB0_TRIM_SHIFT                    0
+#define ES_MB0_TRIM_WIDTH                    3
+
+#define ES_MB1_TRIM                          0x0104
+#define ES_MB1_TRIM_MASK                     0x07
+#define ES_MB1_TRIM_SHIFT                    0
+#define ES_MB1_TRIM_WIDTH                    3
+
+#define ES_SQUELCH_THRESHOLD                 0x014C
+#define ES_SQUELCH_THRESHOLD_MASK            0x07
+#define ES_SQUELCH_THRESHOLD_SHIFT           0
+#define ES_SQUELCH_THRESHOLD_WIDTH           3
+
+#define ES_SQUELCH_TERM_CNT                  0x014D
+#define ES_SQUELCH_TERM_CNT_MASK             0x0F
+#define ES_SQUELCH_TERM_CNT_SHIFT            0
+#define ES_SQUELCH_TERM_CNT_WIDTH            4
+
+
+
+#define ES_MAX_REGISTER             0x014F
+
 
 int es_analog_add_snd_soc_controls(struct snd_soc_codec *codec);
 int es_analog_add_snd_soc_dapm_controls(struct snd_soc_codec *codec);
 int es_analog_add_snd_soc_route_map(struct snd_soc_codec *codec);
 
-
 #endif
index 9a76912..eb81534 100644 (file)
@@ -18,7 +18,6 @@
 #include "es-a300-reg.h"
 
 static DECLARE_TLV_DB_SCALE(spkr_tlv, -3600, 200, 1);
-static DECLARE_TLV_DB_SCALE(lo_tlv, -2200, 200, 1);
 static DECLARE_TLV_DB_SCALE(ep_tlv, -2200, 200, 1);
 static DECLARE_TLV_DB_SCALE(aux_tlv, 0, 150, 0);
 static DECLARE_TLV_DB_SCALE(mic_tlv, 0, 150, 0);
@@ -33,66 +32,14 @@ static const unsigned int hp_tlv[] = {
        12, 15, TLV_DB_SCALE_ITEM(-600, 200, 0),
 };
 
-static const char * const aux_mono_text[] = {
-       "Mono", "Stereo"
-};
-
-static const struct soc_enum auxl_mono_enum =
-       SOC_ENUM_SINGLE(ES_AUX_L_CTRL, ES_AUX_STEREO_SHIFT,
-               ARRAY_SIZE(aux_mono_text), aux_mono_text);
-
-static const struct soc_enum auxr_mono_enum =
-       SOC_ENUM_SINGLE(ES_AUX_R_CTRL, ES_AUX_STEREO_SHIFT,
-               ARRAY_SIZE(aux_mono_text), aux_mono_text);
-
-static const char * const i2s_ch_text[] = {
-       "2", "4",
-};
-
-static const struct soc_enum i2s_ch_enum =
-       SOC_ENUM_SINGLE(ES_DAC_DIG_CH, ES_I2S_CH_SHIFT,
-               ARRAY_SIZE(i2s_ch_text), i2s_ch_text);
-
-static const char * const fs_sel_text[] = {
-       "48", "96", "192",
-};
-
-static const struct soc_enum fs_sel_enum =
-       SOC_ENUM_SINGLE(ES_DAC_DIG_FS_SEL, ES_FS_SEL_SHIFT,
-               ARRAY_SIZE(fs_sel_text), fs_sel_text);
-
 static const char * const michs_sel_mux_text[] = {
        "MIC0_PGA", "MIC1_PGA",
 };
 
 static const struct soc_enum michs_sel_mux_enum =
-       SOC_ENUM_SINGLE(ES_MICHS_CTRL, ES_MICHS_IN_SEL_SHIFT,
+       SOC_ENUM_SINGLE(ES_MICHS_IN_SEL, ES_MICHS_IN_SEL_SHIFT,
                ARRAY_SIZE(michs_sel_mux_text), michs_sel_mux_text);
 
-static const char * const micx_input_type_text[] = {
-       "Differential", "Single Ended",
-};
-
-static const struct soc_enum mic0_input_type_enum =
-       SOC_ENUM_SINGLE(ES_MIC0_CTRL, ES_MIC0_SE_SHIFT,
-               ARRAY_SIZE(micx_input_type_text), micx_input_type_text);
-
-static const struct soc_enum mic1_input_type_enum =
-       SOC_ENUM_SINGLE(ES_MIC1_CTRL, ES_MIC1_SE_SHIFT,
-               ARRAY_SIZE(micx_input_type_text), micx_input_type_text);
-
-static const struct soc_enum mic2_input_type_enum =
-       SOC_ENUM_SINGLE(ES_MIC2_CTRL, ES_MIC2_SE_SHIFT,
-               ARRAY_SIZE(micx_input_type_text), micx_input_type_text);
-
-static const struct soc_enum michs_input_type_enum =
-       SOC_ENUM_SINGLE(ES_MICHS_CTRL, ES_MICHS_SE_SHIFT,
-               ARRAY_SIZE(micx_input_type_text), micx_input_type_text);
-
-static const struct soc_enum auxin_input_type_enum =
-       SOC_ENUM_SINGLE(ES_AUX_R_CTRL, ES_AUXR_SE_SHIFT,
-               ARRAY_SIZE(micx_input_type_text), micx_input_type_text);
-
 static const char * const micx_bias_output_voltage_text[] = {
        "1.6V", "1.8V", "2.0V", "2.2V", "2.4V", "2.6V", "2.8V", "3.0V",
 };
@@ -101,26 +48,47 @@ static const unsigned int micx_bias_output_voltage_value[] = {
        0, 1, 2, 3, 4, 5, 6, 7,
 };
 
+static const char * const lo_gain_text[] = {
+       "mute", "-6db", "-4db", "-2db", "0db", "2db",
+};
+
+static const unsigned int lo_gain_value[] = {
+       0, 9, 10, 11, 12, 13,
+};
+
+static const struct soc_enum lol_gain_enum =
+       SOC_VALUE_ENUM_SINGLE(ES_LO_L_GAIN, ES_LO_L_GAIN_SHIFT,
+               ES_LO_L_GAIN_MASK, ARRAY_SIZE(lo_gain_text),
+                       lo_gain_text,
+                       lo_gain_value);
+
+static const struct soc_enum lor_gain_enum =
+       SOC_VALUE_ENUM_SINGLE(ES_LO_R_GAIN, ES_LO_R_GAIN_SHIFT,
+               ES_LO_R_GAIN_MASK, ARRAY_SIZE(lo_gain_text),
+                       lo_gain_text,
+                       lo_gain_value);
+
 static const struct soc_enum mic0_bias_output_voltage_enum =
-       SOC_VALUE_ENUM_SINGLE(ES_MB_TRIM2, ES_MB0_TRIM_SHIFT,
+       SOC_VALUE_ENUM_SINGLE(ES_MB0_TRIM, ES_MB0_TRIM_SHIFT,
                ES_MB0_TRIM_MASK, ARRAY_SIZE(micx_bias_output_voltage_text),
                        micx_bias_output_voltage_text,
                        micx_bias_output_voltage_value);
 
+
 static const struct soc_enum mic1_bias_output_voltage_enum =
-       SOC_VALUE_ENUM_SINGLE(ES_MB_TRIM2, ES_MB1_TRIM_SHIFT,
+       SOC_VALUE_ENUM_SINGLE(ES_MB1_TRIM, ES_MB1_TRIM_SHIFT,
                ES_MB1_TRIM_MASK, ARRAY_SIZE(micx_bias_output_voltage_text),
                        micx_bias_output_voltage_text,
                        micx_bias_output_voltage_value);
 
 static const struct soc_enum mic2_bias_output_voltage_enum =
-       SOC_VALUE_ENUM_SINGLE(ES_MB_TRIM1, ES_MB2_TRIM_SHIFT,
+       SOC_VALUE_ENUM_SINGLE(ES_MB2_TRIM, ES_MB2_TRIM_SHIFT,
                ES_MB2_TRIM_MASK, ARRAY_SIZE(micx_bias_output_voltage_text),
                        micx_bias_output_voltage_text,
                        micx_bias_output_voltage_value);
 
 static const struct soc_enum michs_bias_output_voltage_enum =
-       SOC_VALUE_ENUM_SINGLE(ES_MB_TRIM1, ES_MBHS_TRIM_SHIFT,
+       SOC_VALUE_ENUM_SINGLE(ES_MBHS_TRIM, ES_MBHS_TRIM_SHIFT,
                ES_MBHS_TRIM_MASK, ARRAY_SIZE(micx_bias_output_voltage_text),
                        micx_bias_output_voltage_text,
                        micx_bias_output_voltage_value);
@@ -129,22 +97,34 @@ static const char * const micx_zin_mode_text[] = {
        "100kohm", "50kohm", "25kohm", "Attenuate by 3dB",
 };
 
+static const char * const squelch_mode_texts[] = {
+       "Off", "On"
+};
+static const unsigned int squelch_mode_value[] = {
+       0, 3,
+};
+
 static const struct soc_enum mic0_zin_mode_enum =
-       SOC_ENUM_SINGLE(ES_MIC_TUNE, ES_MIC0_ZIN_MODE_SHIFT,
+       SOC_ENUM_SINGLE(ES_MIC0_ZIN_MODE, ES_MIC0_ZIN_MODE_SHIFT,
                ARRAY_SIZE(micx_zin_mode_text), micx_zin_mode_text);
 
 static const struct soc_enum mic1_zin_mode_enum =
-       SOC_ENUM_SINGLE(ES_MIC_TUNE, ES_MIC1_ZIN_MODE_SHIFT,
+       SOC_ENUM_SINGLE(ES_MIC1_ZIN_MODE, ES_MIC1_ZIN_MODE_SHIFT,
                ARRAY_SIZE(micx_zin_mode_text), micx_zin_mode_text);
 
 static const struct soc_enum mic2_zin_mode_enum =
-       SOC_ENUM_SINGLE(ES_MIC_TUNE, ES_MIC2_ZIN_MODE_SHIFT,
+       SOC_ENUM_SINGLE(ES_MIC2_ZIN_MODE, ES_MIC2_ZIN_MODE_SHIFT,
                ARRAY_SIZE(micx_zin_mode_text), micx_zin_mode_text);
 
 static const struct soc_enum michs_zin_mode_enum =
-       SOC_ENUM_SINGLE(ES_MIC_TUNE, ES_MICHS_ZIN_MODE_SHIFT,
+       SOC_ENUM_SINGLE(ES_MICHS_ZIN_MODE, ES_MICHS_ZIN_MODE_SHIFT,
                ARRAY_SIZE(micx_zin_mode_text), micx_zin_mode_text);
 
+static const struct soc_enum squelch_mode_enum =
+       SOC_VALUE_ENUM_SINGLE(ES_SQUELCH_THRESHOLD, ES_SQUELCH_THRESHOLD_SHIFT,
+               ES_SQUELCH_THRESHOLD_MASK, ARRAY_SIZE(squelch_mode_texts),
+               squelch_mode_texts, squelch_mode_value);
+
 static const char * const bps_text[] = {
        "0", "16", "20", "24", "32",
 };
@@ -153,77 +133,55 @@ static const unsigned int bps_value_text[] = {
        0, 15, 19, 23, 31,
 };
 
-static const struct soc_enum bps_enum =
-       SOC_VALUE_ENUM_SINGLE(ES_DAC_DIG_I2S1, ES_BITS_PER_SAMPLE_SHIFT,
-               ES_BITS_PER_SAMPLE_MASK, ARRAY_SIZE(bps_text),
-                       bps_text, bps_value_text);
-
 const struct snd_kcontrol_new es_codec_snd_controls[] = {
 
-       SOC_SINGLE("Bypass Alc", ES_SPKR_ALC1, BYPASS_ALC_SHIFT, 0x01, 0),
-       SOC_DOUBLE_R_TLV("SPKR Gain", ES_SPKR_L_GAIN, ES_SPKR_R_GAIN,
+       SOC_DOUBLE_R_TLV("SPKR Gain", ES_SPKRL_GAIN, ES_SPKRR_GAIN,
                        0, 0x1F, 0, spkr_tlv),
-       SOC_DOUBLE_R_TLV("LO Gain", ES_LO_L_GAIN, ES_LO_R_GAIN,
-                       0, 0x0F, 0, lo_tlv),
-       SOC_DOUBLE_R_TLV("HP Gain", ES_HP_L_GAIN, ES_HP_R_GAIN,
+       SOC_DOUBLE_R_TLV("HP Gain", ES_HPL_GAIN, ES_HPR_GAIN,
                        0, 0x0F, 0, hp_tlv),
-       SOC_DOUBLE_R_TLV("AUXIN Gain", ES_AUX_L_CTRL, ES_AUX_R_CTRL,
+       SOC_DOUBLE_R_TLV("AUXIN Gain", ES_AUXL_ON, ES_AUXR_ON,
                        1, 0x14, 0, aux_tlv),
 
 
-       SOC_SINGLE_TLV("SPKRL Gain", ES_SPKR_L_GAIN, ES_SPKRL_GAIN_SHIFT,
-                       ES_SPKRL_GAIN_MAX, 0, spkr_tlv),
-       SOC_SINGLE_TLV("SPKRR Gain", ES_SPKR_R_GAIN, ES_SPKRR_GAIN_SHIFT,
-                       ES_SPKRR_GAIN_MAX, 0, spkr_tlv),
-       SOC_SINGLE_TLV("LOL Gain", ES_LO_L_GAIN, ES_LO_L_GAIN_SHIFT,
-                       ES_LO_L_GAIN_MAX, 0, lo_tlv),
-       SOC_SINGLE_TLV("LOR Gain", ES_LO_R_GAIN, ES_LO_R_GAIN_SHIFT,
-                       ES_LO_R_GAIN_MAX, 0, lo_tlv),
-       SOC_SINGLE_TLV("HPL Gain", ES_HP_L_GAIN, ES_HPL_GAIN_SHIFT,
+       SOC_SINGLE_TLV("SPKRL Gain", ES_SPKRL_GAIN, ES_SPKRL_GAIN_SHIFT,
+                       ES_SPKR_L_GAIN_MAX, 0, spkr_tlv),
+       SOC_SINGLE_TLV("SPKRR Gain", ES_SPKRR_GAIN, ES_SPKRR_GAIN_SHIFT,
+                       ES_SPKR_R_GAIN_MAX, 0, spkr_tlv),
+       SOC_VALUE_ENUM("LOL Gain", lol_gain_enum),
+       SOC_VALUE_ENUM("LOR Gain", lor_gain_enum),
+       SOC_SINGLE_TLV("HPL Gain", ES_HPL_GAIN, ES_HPL_GAIN_SHIFT,
                        ES_HPL_GAIN_MAX, 0, hp_tlv),
-       SOC_SINGLE_TLV("HPR Gain", ES_HP_R_GAIN, ES_HPR_GAIN_SHIFT,
+       SOC_SINGLE_TLV("HPR Gain", ES_HPR_GAIN, ES_HPR_GAIN_SHIFT,
                        ES_HPR_GAIN_MAX, 0, hp_tlv),
        SOC_SINGLE_TLV("EP Gain", ES_EP_GAIN, ES_EP_GAIN_SHIFT,
                        ES_EP_GAIN_MAX, 0, ep_tlv),
-       SOC_SINGLE_TLV("AUXINL Gain", ES_AUX_L_CTRL, ES_AUXL_GAIN_SHIFT,
+       SOC_SINGLE_TLV("AUXINL Gain", ES_AUXL_GAIN, ES_AUXL_GAIN_SHIFT,
                        ES_AUXL_GAIN_MAX, 0, aux_tlv),
-       SOC_SINGLE_TLV("AUXINR Gain", ES_AUX_R_CTRL, ES_AUXR_GAIN_SHIFT,
+       SOC_SINGLE_TLV("AUXINR Gain", ES_AUXR_GAIN, ES_AUXR_GAIN_SHIFT,
                        ES_AUXR_GAIN_MAX, 0, aux_tlv),
 
 
-       SOC_SINGLE_TLV("MIC0 Gain", ES_MIC0_CTRL, ES_MIC0_GAIN_SHIFT,
+       SOC_SINGLE_TLV("MIC0 Gain", ES_MIC0_GAIN, ES_MIC0_GAIN_SHIFT,
                        ES_MIC0_GAIN_MAX, 0, mic_tlv),
-       SOC_SINGLE_TLV("MIC1 Gain", ES_MIC1_CTRL, ES_MIC1_GAIN_SHIFT,
+       SOC_SINGLE_TLV("MIC1 Gain", ES_MIC1_GAIN, ES_MIC1_GAIN_SHIFT,
                        ES_MIC1_GAIN_MAX, 0, mic_tlv),
-       SOC_SINGLE_TLV("MIC2 Gain", ES_MIC2_CTRL, ES_MIC2_GAIN_SHIFT,
+       SOC_SINGLE_TLV("MIC2 Gain", ES_MIC2_GAIN, ES_MIC2_GAIN_SHIFT,
                        ES_MIC2_GAIN_MAX, 0, mic_tlv),
-       SOC_SINGLE_TLV("MICHS Gain", ES_MICHS_CTRL, ES_MICHS_GAIN_SHIFT,
+       SOC_SINGLE_TLV("MICHS Gain", ES_MICHS_GAIN, ES_MICHS_GAIN_SHIFT,
                        ES_MICHS_GAIN_MAX, 0, mic_tlv),
 
 
-       SOC_ENUM("AUXL Mono", auxl_mono_enum),
-       SOC_ENUM("AUXR Mono", auxr_mono_enum),
-       SOC_SINGLE("ADC Mute", ES_ADC_CTRL, ES_ADC_MUTE_SHIFT, 1, 0),
-       SOC_SINGLE("EP Mute", ES_EP_GAIN, ES_EP_MUTE_SHIFT, 1, 0),
-       SOC_SINGLE("HPL Mute", ES_HP_L_GAIN, ES_HPL_MUTE_SHIFT, 1, 0),
-       SOC_SINGLE("HPR Mute", ES_HP_R_GAIN, ES_HPR_MUTE_SHIFT, 1, 0),
-       SOC_SINGLE("SPKRL Mute", ES_SPKR_L_GAIN, ES_SPKRL_MUTE_SHIFT, 1, 0),
-       SOC_SINGLE("SPKRR Mute", ES_SPKR_R_GAIN, ES_SPKRR_MUTE_SHIFT, 1, 0),
-       SOC_SINGLE("LOL Mute", ES_LO_L_GAIN, ES_LO_L_MUTE_SHIFT, 1, 0),
-       SOC_SINGLE("LOR Mute", ES_LO_R_GAIN, ES_LO_R_MUTE_SHIFT, 1, 0),
-
-       SOC_ENUM("I2S Channels", i2s_ch_enum),
-       SOC_ENUM("FrameSync SEL", fs_sel_enum),
-       SOC_VALUE_ENUM("Bits per Sample", bps_enum),
+       SOC_SINGLE("ADC Mute", ES_ADC_MUTE, ES_ADC_MUTE_SHIFT, 1, 0),
+       SOC_SINGLE("EP Mute", ES_EP_MUTE, ES_EP_MUTE_SHIFT, 1, 0),
+       SOC_SINGLE("HPL Mute", ES_HPL_MUTE, ES_HPL_MUTE_SHIFT, 1, 0),
+       SOC_SINGLE("HPR Mute", ES_HPR_MUTE, ES_HPR_MUTE_SHIFT, 1, 0),
+       SOC_SINGLE("SPKRL Mute", ES_SPKRL_MUTE, ES_SPKRL_MUTE_SHIFT, 1, 0),
+       SOC_SINGLE("SPKRR Mute", ES_SPKRR_MUTE, ES_SPKRR_MUTE_SHIFT, 1, 0),
+       SOC_SINGLE("LOL Mute", ES_LO_L_MUTE, ES_LO_L_MUTE_SHIFT, 1, 0),
+       SOC_SINGLE("LOR Mute", ES_LO_R_MUTE, ES_LO_R_MUTE_SHIFT, 1, 0),
 
        SOC_ENUM("MICHS SEL MUX", michs_sel_mux_enum),
 
-       SOC_ENUM("MIC0 Input Type", mic0_input_type_enum),
-       SOC_ENUM("MIC1 Input Type", mic1_input_type_enum),
-       SOC_ENUM("MIC2 Input Type", mic2_input_type_enum),
-       SOC_ENUM("MICHS Input Type", michs_input_type_enum),
-       SOC_ENUM("AUXIN Input Type", auxin_input_type_enum),
-
        SOC_VALUE_ENUM("MIC0 Bias Output Voltage",
                        mic0_bias_output_voltage_enum),
        SOC_VALUE_ENUM("MIC1 Bias Output Voltage",
@@ -237,6 +195,10 @@ const struct snd_kcontrol_new es_codec_snd_controls[] = {
        SOC_ENUM("MIC1 Input Impedance Mode", mic1_zin_mode_enum),
        SOC_ENUM("MIC2 Input Impedance Mode", mic2_zin_mode_enum),
        SOC_ENUM("MICHS Input Impedance Mode", michs_zin_mode_enum),
+
+       SOC_VALUE_ENUM("Squelch", squelch_mode_enum),
+       SOC_SINGLE("Squelch Count Threshold", ES_SQUELCH_TERM_CNT,
+                       ES_SQUELCH_TERM_CNT_SHIFT, 15, 0),
 };
 
 static const char * const adc1_mux_text[] = {
@@ -244,7 +206,7 @@ static const char * const adc1_mux_text[] = {
 };
 
 static const struct soc_enum adc1_mux_enum =
-       SOC_ENUM_SINGLE(ES_ADC_CTRL, ES_ADC1_IN_SEL_SHIFT,
+       SOC_ENUM_SINGLE(ES_ADC1_IN_SEL, ES_ADC1_IN_SEL_SHIFT,
                ARRAY_SIZE(adc1_mux_text), adc1_mux_text);
 
 static const struct snd_kcontrol_new adc1_mux =
@@ -255,7 +217,7 @@ static const char * const adc2_mux_text[] = {
 };
 
 static const struct soc_enum adc2_mux_enum =
-       SOC_ENUM_SINGLE(ES_ADC_CTRL, ES_ADC2_IN_SEL_SHIFT,
+       SOC_ENUM_SINGLE(ES_ADC2_IN_SEL, ES_ADC2_IN_SEL_SHIFT,
                ARRAY_SIZE(adc2_mux_text), adc2_mux_text);
 
 static const struct snd_kcontrol_new adc2_mux =
@@ -263,61 +225,62 @@ static const struct snd_kcontrol_new adc2_mux =
 
 
 static const struct snd_kcontrol_new ep_mix[] = {
-       SOC_DAPM_SINGLE("DAC0L", ES_EP_CTRL, ES_DAC0L_TO_EP_SHIFT, 1, 0),
-       SOC_DAPM_SINGLE("AUXL", ES_EP_CTRL, ES_AUXL_TO_EP_SHIFT, 1, 0),
+       SOC_DAPM_SINGLE("DAC0L", ES_DAC0L_TO_EP, ES_DAC0L_TO_EP_SHIFT, 1, 0),
 };
 
 static const struct snd_kcontrol_new hpl_mix[] = {
-       SOC_DAPM_SINGLE("DAC0L", ES_HP_L_CTRL, ES_DAC0L_TO_HPL_SHIFT, 1, 0),
-       SOC_DAPM_SINGLE("AUXL", ES_HP_L_CTRL, ES_AUXL_TO_HPL_SHIFT, 1, 0),
+       SOC_DAPM_SINGLE("DAC0L", ES_DAC0L_TO_HPL, ES_DAC0L_TO_HPL_SHIFT, 1, 0),
 };
 
 static const struct snd_kcontrol_new hpr_mix[] = {
-       SOC_DAPM_SINGLE("DAC0R", ES_HP_R_CTRL, ES_DAC0R_TO_HPR_SHIFT, 1, 0),
-       SOC_DAPM_SINGLE("AUXR", ES_HP_R_CTRL, ES_AUXR_TO_HPR_SHIFT, 1, 0),
+       SOC_DAPM_SINGLE("DAC0R", ES_DAC0R_TO_HPR, ES_DAC0R_TO_HPR_SHIFT, 1, 0),
 };
 
 static const struct snd_kcontrol_new spkrl_mix[] = {
-       SOC_DAPM_SINGLE("DAC0L", ES_SPKR_L_CTRL, ES_DAC0L_TO_SPKRL_SHIFT, 1, 0),
-       SOC_DAPM_SINGLE("DAC1L", ES_SPKR_L_CTRL, ES_DAC1L_TO_SPKRL_SHIFT, 1, 0),
-       SOC_DAPM_SINGLE("AUXL", ES_SPKR_L_CTRL, ES_AUXL_TO_SPKRL_SHIFT, 1, 0),
+       SOC_DAPM_SINGLE("DAC0L", ES_DAC0L_TO_SPKRL, ES_DAC0L_TO_SPKRL_SHIFT,
+                                                               1, 0),
+       SOC_DAPM_SINGLE("DAC1L", ES_DAC1L_TO_SPKRL, ES_DAC1L_TO_SPKRL_SHIFT,
+                                                                1, 0),
 };
 
 static const struct snd_kcontrol_new spkrr_mix[] = {
-       SOC_DAPM_SINGLE("DAC0R", ES_SPKR_R_CTRL, ES_DAC0R_TO_SPKRR_SHIFT, 1, 0),
-       SOC_DAPM_SINGLE("DAC1R", ES_SPKR_R_CTRL, ES_DAC1R_TO_SPKRR_SHIFT, 1, 0),
-       SOC_DAPM_SINGLE("AUXR", ES_SPKR_R_CTRL, ES_AUXR_TO_SPKRR_SHIFT, 1, 0),
+       SOC_DAPM_SINGLE("DAC0R", ES_DAC0R_TO_SPKRR, ES_DAC0R_TO_SPKRR_SHIFT,
+                                                                1, 0),
+       SOC_DAPM_SINGLE("DAC1R", ES_DAC1R_TO_SPKRR, ES_DAC1R_TO_SPKRR_SHIFT,
+                                                                1, 0),
 };
 
 static const struct snd_kcontrol_new lo_l_mix[] = {
-       SOC_DAPM_SINGLE("DAC1L", ES_LO_L_CTRL, ES_DAC1L_TO_LO_L_SHIFT, 1, 0),
+       SOC_DAPM_SINGLE("DAC1L", ES_DAC1L_TO_LO_L, ES_DAC1L_TO_LO_L_SHIFT,
+                                                               1, 0),
 };
 
 static const struct snd_kcontrol_new lo_r_mix[] = {
-       SOC_DAPM_SINGLE("DAC1R", ES_LO_R_CTRL, ES_DAC1R_TO_LO_R_SHIFT, 1, 0),
+       SOC_DAPM_SINGLE("DAC1R", ES_DAC1R_TO_LO_R, ES_DAC1R_TO_LO_R_SHIFT,
+                                                               1, 0),
 };
 
-static const struct snd_kcontrol_new michs_control =
-       SOC_DAPM_SINGLE("Switch", ES_MICHS_CTRL, ES_MICHS_ON_SHIFT, 1, 0);
+static const char *const mic0_pga_mux_names[] = {
+       "NONE", "MIC-0", "MIC-HS"
+};
 
-static int es_lo_enable(struct snd_soc_dapm_widget *w,
-       struct snd_kcontrol *kcontrol, int event)
-{
-       struct snd_soc_codec *codec = w->codec;
-       pr_debug("%s LO event %d\n", __func__, event);
-
-       switch (event) {
-       case SND_SOC_DAPM_PRE_PMU:
-               snd_soc_update_bits(codec, ES_LO_L_CTRL, ES_LO_TRIM_DIS_MASK,
-                       ES_LO_TRIM_DIS);
-               break;
-       case SND_SOC_DAPM_POST_PMD:
-               snd_soc_update_bits(codec, ES_LO_L_CTRL, ES_LO_TRIM_DIS_MASK,
-                       0);
-               break;
-       }
-       return 0;
-}
+static const struct soc_enum mic0_pga_mux_enum =
+       SOC_ENUM_SINGLE_EXT(ARRAY_SIZE(mic0_pga_mux_names),
+                       mic0_pga_mux_names);
+
+static const struct snd_kcontrol_new mic0_pga_mux_controls =
+       SOC_DAPM_ENUM_VIRT("Switch", mic0_pga_mux_enum);
+
+static const char *const mic1_pga_mux_names[] = {
+       "NONE", "MIC-1", "MIC-HS"
+};
+
+static const struct soc_enum mic1_pga_mux_enum =
+       SOC_ENUM_SINGLE_EXT(ARRAY_SIZE(mic1_pga_mux_names),
+                       mic1_pga_mux_names);
+
+static const struct snd_kcontrol_new mic1_pga_mux_controls =
+       SOC_DAPM_ENUM_VIRT("Switch", mic1_pga_mux_enum);
 
 static int mic_event(struct snd_soc_dapm_widget *w,
                struct snd_kcontrol *k, int event)
@@ -327,33 +290,31 @@ static int mic_event(struct snd_soc_dapm_widget *w,
 
        if (SND_SOC_DAPM_EVENT_ON(event)) {
                if (!strncmp(w->name, "MIC0", 4))
-                       snd_soc_update_bits(codec, ES_MIC0_CTRL,
-                                       ES_MIC0_ON_MASK, 1);
+                       snd_soc_write(codec, ES_MIC0_ON, 1);
                else if (!strncmp(w->name, "MIC1", 4))
-                       snd_soc_update_bits(codec, ES_MIC1_CTRL,
-                                       ES_MIC1_ON_MASK, 1);
+                       snd_soc_write(codec, ES_MIC1_ON, 1);
                else if (!strncmp(w->name, "MIC2", 4))
-                       snd_soc_update_bits(codec, ES_MIC2_CTRL,
-                                       ES_MIC2_ON_MASK, 1);
+                       snd_soc_write(codec, ES_MIC2_ON, 1);
+               else if (!strncmp(w->name, "MICHS", 5))
+                       snd_soc_write(codec, ES_MICHS_ON, 1);
                else {
-                       pr_err("%s() Invalid Mic Widget ON = %s\n",
-                                       __func__, w->name);
+                       pr_err("%s: Invalid Mic Widget ON = %s\n",
+                              __func__, w->name);
                        return -EINVAL;
                }
 
        } else {
                if (!strncmp(w->name, "MIC0", 4))
-                       snd_soc_update_bits(codec, ES_MIC0_CTRL,
-                               ES_MIC0_ON_MASK, 0);
+                       snd_soc_write(codec, ES_MIC0_ON, 0);
                else if (!strncmp(w->name, "MIC1", 4))
-                       snd_soc_update_bits(codec, ES_MIC1_CTRL,
-                               ES_MIC1_ON_MASK, 0);
+                       snd_soc_write(codec, ES_MIC1_ON, 0);
                else if (!strncmp(w->name, "MIC2", 4))
-                       snd_soc_update_bits(codec, ES_MIC2_CTRL,
-                               ES_MIC2_ON_MASK, 0);
+                       snd_soc_write(codec, ES_MIC2_ON, 0);
+               else if (!strncmp(w->name, "MICHS", 5))
+                       snd_soc_write(codec, ES_MICHS_ON, 0);
                else {
-                       pr_err("%s() Invalid Mic Widget OFF = %s\n",
-                                       __func__, w->name);
+                       pr_err("%s: Invalid Mic Widget OFF = %s\n",
+                              __func__, w->name);
                        return -EINVAL;
                }
        }
@@ -366,7 +327,7 @@ const struct snd_soc_dapm_widget es_codec_dapm_widgets[] = {
        SND_SOC_DAPM_MIC("MIC0", mic_event),
        SND_SOC_DAPM_MIC("MIC1", mic_event),
        SND_SOC_DAPM_MIC("MIC2", mic_event),
-       SND_SOC_DAPM_MIC("MICHS", NULL),
+       SND_SOC_DAPM_MIC("MICHS", mic_event),
        SND_SOC_DAPM_MIC("AUXINM", NULL),
        SND_SOC_DAPM_MIC("AUXINP", NULL),
 
@@ -376,31 +337,29 @@ const struct snd_soc_dapm_widget es_codec_dapm_widgets[] = {
        SND_SOC_DAPM_SPK("SPKRL", NULL),
        SND_SOC_DAPM_SPK("SPKRR", NULL),
        SND_SOC_DAPM_OUTPUT("EP"),
-       /* Dummy EP Right output */
-       SND_SOC_DAPM_OUTPUT("EPR"),
        SND_SOC_DAPM_LINE("AUXOUTL", NULL),
        SND_SOC_DAPM_LINE("AUXOUTR", NULL),
 
        /* Microphone bias */
-       /*SND_SOC_DAPM_SUPPLY("MICHS Bias", ES_MICBIAS_CTRL,
-               ES_MBIASHS_MODE_SHIFT, 0, NULL, 0),
-       SND_SOC_DAPM_SUPPLY("MIC0 Bias", ES_MICBIAS_CTRL,
-               ES_MBIAS0_MODE_SHIFT, 0, NULL, 0),*/
-       SND_SOC_DAPM_SUPPLY("MIC1 Bias", ES_MICBIAS_CTRL,
+       SND_SOC_DAPM_SUPPLY("MIC0 Bias", ES_MBIAS0_MODE,
+               ES_MBIAS0_MODE_SHIFT, 0, NULL, 0),
+       SND_SOC_DAPM_SUPPLY("MIC1 Bias", ES_MBIAS1_MODE,
                ES_MBIAS1_MODE_SHIFT, 0, NULL, 0),
-       SND_SOC_DAPM_SUPPLY("MIC2 Bias", ES_MICBIAS_CTRL,
+       SND_SOC_DAPM_SUPPLY("MIC2 Bias", ES_MBIAS2_MODE,
                ES_MBIAS2_MODE_SHIFT, 0, NULL, 0),
 
-       /* Mic headset Switch ON/OFF */
-       SND_SOC_DAPM_SWITCH("MICHS ON", SND_SOC_NOPM, 0, 0, &michs_control),
+       SND_SOC_DAPM_VIRT_MUX("MIC0 PGA Mux", SND_SOC_NOPM, 0, 0,
+               &mic0_pga_mux_controls),
 
+       SND_SOC_DAPM_VIRT_MUX("MIC1 PGA Mux", SND_SOC_NOPM, 0, 0,
+               &mic1_pga_mux_controls),
        /* ADC */
-       SND_SOC_DAPM_ADC("ADC0", NULL, ES_ADC_CTRL, ES_ADC0_ON_SHIFT, 0),
+       SND_SOC_DAPM_ADC("ADC0", NULL, ES_ADC0_ON, ES_ADC0_ON_SHIFT, 0),
        SND_SOC_DAPM_MUX("ADC1 MUX", SND_SOC_NOPM, 0, 0, &adc1_mux),
-       SND_SOC_DAPM_ADC("ADC1", NULL, ES_ADC_CTRL, ES_ADC1_ON_SHIFT, 0),
+       SND_SOC_DAPM_ADC("ADC1", NULL, ES_ADC1_ON, ES_ADC1_ON_SHIFT, 0),
        SND_SOC_DAPM_MUX("ADC2 MUX", SND_SOC_NOPM, 0, 0, &adc2_mux),
-       SND_SOC_DAPM_ADC("ADC2", NULL, ES_ADC_CTRL, ES_ADC2_ON_SHIFT, 0),
-       SND_SOC_DAPM_ADC("ADC3", NULL, ES_ADC_CTRL, ES_ADC3_ON_SHIFT, 0),
+       SND_SOC_DAPM_ADC("ADC2", NULL, ES_ADC2_ON, ES_ADC2_ON_SHIFT, 0),
+       SND_SOC_DAPM_ADC("ADC3", NULL, ES_ADC3_ON, ES_ADC3_ON_SHIFT, 0),
 
        /* DAC */
        SND_SOC_DAPM_DAC("DAC0L", NULL, SND_SOC_NOPM, 0, 0),
@@ -411,7 +370,6 @@ const struct snd_soc_dapm_widget es_codec_dapm_widgets[] = {
        /* Earphone Mixer */
        SND_SOC_DAPM_MIXER("EP MIXER", SND_SOC_NOPM, 0, 0,
                ep_mix, ARRAY_SIZE(ep_mix)),
-
        /* Headphone Mixer */
        SND_SOC_DAPM_MIXER("HPL MIXER", SND_SOC_NOPM, 0, 0,
                hpl_mix, ARRAY_SIZE(hpl_mix)),
@@ -431,25 +389,23 @@ const struct snd_soc_dapm_widget es_codec_dapm_widgets[] = {
                lo_r_mix, ARRAY_SIZE(lo_r_mix)),
 
        /* Output PGAs */
-       SND_SOC_DAPM_PGA("SPKRL PGA", ES_SPKR_L_CTRL, ES_SPKRL_ON_SHIFT,
+       SND_SOC_DAPM_PGA("SPKRL PGA", ES_SPKRL_ON, ES_SPKRL_ON_SHIFT,
                0, NULL, 0),
-       SND_SOC_DAPM_PGA("SPKRR PGA", ES_SPKR_R_CTRL, ES_SPKRR_ON_SHIFT,
+       SND_SOC_DAPM_PGA("SPKRR PGA", ES_SPKRR_ON, ES_SPKRR_ON_SHIFT,
                0, NULL, 0),
-       SND_SOC_DAPM_PGA("HPL PGA", ES_HP_L_CTRL, ES_HPL_ON_SHIFT, 0, NULL, 0),
-       SND_SOC_DAPM_PGA("HPR PGA", ES_HP_R_CTRL, ES_HPR_ON_SHIFT, 0, NULL, 0),
-       SND_SOC_DAPM_PGA_E("LOL PGA", ES_LO_L_CTRL, ES_LO_L_ON_SHIFT, 0, NULL,
-               0, es_lo_enable, SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
-       SND_SOC_DAPM_PGA_E("LOR PGA", ES_LO_R_CTRL, ES_LO_R_ON_SHIFT, 0, NULL,
-               0, es_lo_enable, SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
-       SND_SOC_DAPM_PGA("EP PGA", ES_EP_CTRL, ES_EP_ON_SHIFT, 0, NULL, 0),
+       SND_SOC_DAPM_PGA("HPL PGA", ES_HPL_ON, ES_HPL_ON_SHIFT, 0, NULL, 0),
+       SND_SOC_DAPM_PGA("HPR PGA", ES_HPR_ON, ES_HPR_ON_SHIFT, 0, NULL, 0),
+       SND_SOC_DAPM_PGA("LOL PGA", ES_LO_L_ON, ES_LO_L_ON_SHIFT, 0, NULL, 0),
+       SND_SOC_DAPM_PGA("LOR PGA", ES_LO_R_ON, ES_LO_R_ON_SHIFT, 0, NULL, 0),
+       SND_SOC_DAPM_PGA("EP PGA", ES_EP_ON, ES_EP_ON_SHIFT, 0, NULL, 0),
 
        /* Input PGAs */
        SND_SOC_DAPM_PGA("MIC0 PGA", SND_SOC_NOPM, 0, 0, NULL, 0),
        SND_SOC_DAPM_PGA("MIC1 PGA", SND_SOC_NOPM, 0, 0, NULL, 0),
        SND_SOC_DAPM_PGA("MIC2 PGA", SND_SOC_NOPM, 0, 0, NULL, 0),
-       SND_SOC_DAPM_PGA("AUXINL PGA", ES_AUX_L_CTRL, ES_AUXL_ON_SHIFT, 0,
+       SND_SOC_DAPM_PGA("AUXINL PGA", ES_AUXL_ON, ES_AUXL_ON_SHIFT, 0,
                NULL, 0),
-       SND_SOC_DAPM_PGA("AUXINR PGA", ES_AUX_R_CTRL, ES_AUXR_ON_SHIFT, 0,
+       SND_SOC_DAPM_PGA("AUXINR PGA", ES_AUXR_ON, ES_AUXR_ON_SHIFT,    0,
                NULL, 0),
 
 };
@@ -459,19 +415,19 @@ static const struct snd_soc_dapm_route intercon[] = {
 
        /* Capture path */
 
-       /*{"MICHS", NULL, "MICHS Bias"},
-       {"MIC0", NULL, "MIC0 Bias"},*/
+       {"MIC0", NULL, "MIC0 Bias"},
        {"MIC1", NULL, "MIC1 Bias"},
        {"MIC2", NULL, "MIC2 Bias"},
 
-       {"MICHS ON", "Switch", "MICHS"},
+       {"MIC0 PGA Mux", "MIC-0", "MIC0"},
+       {"MIC0 PGA Mux", "MIC-HS", "MICHS"},
+       {"MIC0 PGA", NULL, "MIC0 PGA Mux"},
+
+       {"MIC1 PGA Mux", "MIC-1", "MIC1"},
+       {"MIC1 PGA Mux", "MIC-HS", "MICHS"},
+       {"MIC1 PGA", NULL, "MIC1 PGA Mux"},
 
-       /*{"MIC0 PGA", NULL, "MIC0"},*/
-       {"MIC0 PGA", NULL, "MICHS ON"},
-       {"MIC1 PGA", NULL, "MIC1"},
-       {"MIC1 PGA", NULL, "MICHS ON"},
        {"MIC2 PGA", NULL, "MIC2"},
-       {"MIC2 PGA", NULL, "MICHS ON"},
 
        {"AUXINL PGA", NULL, "AUXINP"},
        {"AUXINR PGA", NULL, "AUXINM"},
@@ -490,20 +446,15 @@ static const struct snd_soc_dapm_route intercon[] = {
 
        {"SPKRL MIXER", "DAC0L", "DAC0L"},
        {"SPKRL MIXER", "DAC1L", "DAC1L"},
-       {"SPKRL MIXER", "AUXL", "AUXINL PGA"},
 
        {"SPKRR MIXER", "DAC0R", "DAC0R"},
        {"SPKRR MIXER", "DAC1R", "DAC1R"},
-       {"SPKRR MIXER", "AUXR", "AUXINR PGA"},
 
        {"HPL MIXER", "DAC0L", "DAC0L"},
-       {"HPL MIXER", "AUXL", "AUXINL PGA"},
 
        {"HPR MIXER", "DAC0R", "DAC0R"},
-       {"HPR MIXER", "AUXR", "AUXINR PGA"},
 
        {"EP MIXER", "DAC0L", "DAC0L"},
-       {"EP MIXER", "AUXL", "AUXINL PGA"},
 
        {"LOL MIXER", "DAC1L", "DAC1L"},
 
@@ -524,8 +475,6 @@ static const struct snd_soc_dapm_route intercon[] = {
        {"SPKRL", NULL, "SPKRL PGA"},
        {"SPKRR", NULL, "SPKRR PGA"},
        {"EP", NULL, "EP PGA"},
-       /* Dummy entry */
-       {"EPR", NULL, "DAC0R"},
 
 };
 
@@ -533,8 +482,13 @@ int es_analog_add_snd_soc_controls(struct snd_soc_codec *codec)
 {
        int rc;
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0)
        rc = snd_soc_add_codec_controls(codec, es_codec_snd_controls,
                        ARRAY_SIZE(es_codec_snd_controls));
+#else
+       rc = snd_soc_add_controls(codec, es_codec_snd_controls,
+                       ARRAY_SIZE(es_codec_snd_controls));
+#endif
 
        return rc;
 }
index 2cb7f96..8e9b5c1 100644 (file)
@@ -160,7 +160,7 @@ enum {
        PT_VP_CSOUT1_MUX,
        PT_VP_FEOUT1_MUX,
        PT_VP_AO1_MUX,
-       PT_VP_MO2_MUX,
+       PT_VP_AO2_MUX,
        PT_VP_OUT_MUX_LEN,
 };
 
@@ -248,10 +248,10 @@ static struct route_tbl es_pt_vp_out_route_tbl[PT_VP_OUT_MUX_LEN] = {
                .cmd_len = 1,
                .chn_mgr_mask = BIT(TXCHMGR4),
        },
-       [PT_VP_MO2_MUX] = {
+       [PT_VP_AO2_MUX] = {
                .cmd[0] = ES_API_WORD(ES_SET_MUX_CMD,
                                ES300_DATA_PATH(0, 0, TXCHMGR5)),
-               .mux_type = PASS_MO2,
+               .mux_type = PASS_AO2,
                .cmd_len = 1,
                .chn_mgr_mask = BIT(TXCHMGR5),
        },
@@ -266,46 +266,170 @@ struct es_mux_info es_pt_vp_mux_info = {
        .out_tbl = &es_pt_vp_out_route_tbl,
 };
 
-/* DHWPT Mux ENUM */
+/* AudioFocus Mux ENUM */
 enum {
-       DHWPT_PASSIN1_MUX,
-       DHWPT_PASSIN2_MUX,
-       DHWPT_PRIMARY_MUX,
-       DHWPT_SECONDARY_MUX,
-       DHWPT_FEIN_MUX,
-       DHWPT_IN_MUX_LEN,
+       AF_PASSIN1_MUX,
+       AF_PASSIN2_MUX,
+       AF_PRIMARY_MUX,
+       AF_SECONDARY_MUX,
+       AF_TERTIARY_MUX,
+
+       AF_IN_MUX_LEN,
 };
+
 enum {
-       DHWPT_PASSOUT1_MUX,
-       DHWPT_PASSOUT2_MUX,
-       DHWPT_CSOUT1_MUX,
-       DHWPT_FEOUT1_MUX,
-       DHWPT_AO1_MUX,
-       DHWPT_MO2_MUX,
-       DHWPT_OUT_MUX_LEN,
+       AF_PASSOUT1_MUX,
+       AF_PASSOUT2_MUX,
+       AF_CSOUT1_MUX,
+       AF_CSOUT2_MUX,
+       AF_AO1_MUX,
+       AF_AO2_MUX,
+
+       AF_OUT_MUX_LEN,
 };
 
-static struct route_tbl es_dhwpt_in_route_tbl[DHWPT_IN_MUX_LEN] = {
-       [DHWPT_PASSIN1_MUX] = {
-               .cmd[0] = ES_API_WORD(0xB05A, 0x3FF3),
+static struct route_tbl es_audiofocus_in_route_tbl[AF_IN_MUX_LEN] = {
+       [AF_PASSIN1_MUX] = {
+               .cmd[0] = ES_API_WORD(ES_SET_PATH_CMD,
+                               (ES300_DATA_PATH(0, 0, RXCHMGR3))),
                .mux_type = ES_PASSIN1_MUX,
                .cmd_len = 1,
                .chn_mgr_mask = BIT(RXCHMGR3),
        },
-       [DHWPT_PASSIN2_MUX] = {
-               .cmd[0] = ES_API_WORD(0xB05A, 0x3FF4),
+       [AF_PASSIN2_MUX] = {
+               .cmd[0] = ES_API_WORD(ES_SET_MUX_CMD,
+                               ES300_DATA_PATH(0, 0, RXCHMGR4)),
                .mux_type = ES_PASSIN2_MUX,
                .cmd_len = 1,
                .chn_mgr_mask = BIT(RXCHMGR4),
        },
-       [DHWPT_PRIMARY_MUX] = {
+       [AF_PRIMARY_MUX] = {
+               .cmd[0] = ES_API_WORD(ES_SET_MUX_CMD,
+                               ES300_DATA_PATH(0, 0, RXCHMGR0)),
+               .mux_type = ES_AF_PRI_MUX,
+               .cmd_len = 1,
+               .chn_mgr_mask = BIT(RXCHMGR0),
+       },
+       [AF_SECONDARY_MUX] = {
+               .cmd[0] = ES_API_WORD(ES_SET_MUX_CMD,
+                               ES300_DATA_PATH(0, 0, RXCHMGR1)),
+               .mux_type = ES_AF_SEC_MUX,
+               .cmd_len = 1,
+               .chn_mgr_mask = BIT(RXCHMGR1),
+       },
+       [AF_TERTIARY_MUX] = {
+               .cmd[0] = ES_API_WORD(ES_SET_MUX_CMD,
+                               ES300_DATA_PATH(0, 0, RXCHMGR2)),
+               .cmd[1] = ES_API_WORD(0xB05B, 0x0202),
+               .cmd[2] = ES_API_WORD(0xB064, 0x0058),
+               .cmd[3] = ES_API_WORD(0xB064, 0x0142),
+               .cmd[4] = ES_API_WORD(0xB063, 0x0205),
+               .cmd[5] = ES_API_WORD(0xB068, 0x0500),
+               .mux_type = ES_AF_TER_MUX,
+               .cmd_len = 6,
+               .chn_mgr_mask = BIT(RXCHMGR2),
+       },
+};
+
+static struct route_tbl es_audiofocus_out_route_tbl[AF_OUT_MUX_LEN] = {
+       [AF_PASSOUT1_MUX] = {
+               .cmd[0] = ES_API_WORD(ES_SET_MUX_CMD,
+                               ES300_DATA_PATH(0, 0, TXCHMGR0)),
+               .mux_type = PASS_AUDOUT1,
+               .cmd_len = 1,
+               .chn_mgr_mask = BIT(TXCHMGR0),
+       },
+       [AF_PASSOUT2_MUX] = {
+               .cmd[0] = ES_API_WORD(ES_SET_MUX_CMD,
+                               ES300_DATA_PATH(0, 0, TXCHMGR5)),
+               .mux_type = PASS_AUDOUT2,
+               .cmd_len = 1,
+               .chn_mgr_mask = BIT(TXCHMGR5),
+       },
+       [AF_CSOUT1_MUX] = {
+               .cmd[0] = ES_API_WORD(ES_SET_MUX_CMD,
+                               ES300_DATA_PATH(0, 0, TXCHMGR1)),
+               .mux_type = AUDIOFOCUS_CSOUT1,
+               .cmd_len = 1,
+               .chn_mgr_mask = BIT(TXCHMGR1),
+       },
+       [AF_CSOUT2_MUX] = {
+               .cmd[0] = ES_API_WORD(ES_SET_MUX_CMD,
+                               ES300_DATA_PATH(0, 0, TXCHMGR2)),
+               .mux_type = AUDIOFOCUS_CSOUT2,
+               .cmd_len = 1,
+               .chn_mgr_mask = BIT(TXCHMGR2),
+       },
+       [AF_AO1_MUX] = {
+               .cmd[0] = ES_API_WORD(ES_SET_MUX_CMD,
+                               ES300_DATA_PATH(0, 0, TXCHMGR3)),
+               .mux_type = PASS_AO1,
+               .cmd_len = 1,
+               .chn_mgr_mask = BIT(TXCHMGR3),
+       },
+       [AF_AO2_MUX] = {
+               .cmd[0] = ES_API_WORD(ES_SET_MUX_CMD,
+                               ES300_DATA_PATH(0, 0, TXCHMGR4)),
+               .mux_type = PASS_AO2,
+               .cmd_len = 1,
+               .chn_mgr_mask = BIT(TXCHMGR4),
+       },
+};
+
+struct es_mux_info es_audiofocus_mux_info = {
+       .in_mux_start = AF_PASSIN1_MUX,
+       .in_mux_len = AF_IN_MUX_LEN,
+       .out_mux_start = AF_PASSOUT1_MUX,
+       .out_mux_len = AF_OUT_MUX_LEN,
+       .in_tbl = &es_audiofocus_in_route_tbl,
+       .out_tbl = &es_audiofocus_out_route_tbl,
+};
+
+/* Barge-In Mux ENUM */
+enum {
+       BRG_PASSIN1_MUX,
+       BRG_PASSIN2_MUX,
+       BRG_PRIMARY_MUX,
+       BRG_SECONDARY_MUX,
+       BRG_FEIN_MUX,
+
+       BRG_IN_MUX_LEN,
+};
+
+enum {
+       BRG_PASSOUT1_MUX,
+       BRG_PASSOUT2_MUX,
+       BRG_CSOUT1_MUX,
+       BRG_CSOUT2_MUX,
+       BRG_AO1_MUX,
+       BRG_AO2_MUX,
+
+       BRG_OUT_MUX_LEN,
+};
+
+static struct route_tbl es_bargein_in_route_tbl[BRG_IN_MUX_LEN] = {
+       [BRG_PASSIN1_MUX] = {
+               .cmd[0] = ES_API_WORD(ES_SET_PATH_CMD,
+                               (ES300_DATA_PATH(0, 0, RXCHMGR3))),
+               .mux_type = ES_PASSIN1_MUX,
+               .cmd_len = 1,
+               .chn_mgr_mask = BIT(RXCHMGR3),
+       },
+       [BRG_PASSIN2_MUX] = {
+               .cmd[0] = ES_API_WORD(ES_SET_MUX_CMD,
+                               ES300_DATA_PATH(0, 0, RXCHMGR4)),
+               .mux_type = ES_PASSIN2_MUX,
+               .cmd_len = 1,
+               .chn_mgr_mask = BIT(RXCHMGR4),
+       },
+       [BRG_PRIMARY_MUX] = {
                .cmd[0] = ES_API_WORD(ES_SET_MUX_CMD,
                                ES300_DATA_PATH(0, 0, RXCHMGR0)),
                .mux_type = ES_PRIMARY_MUX,
                .cmd_len = 1,
                .chn_mgr_mask = BIT(RXCHMGR0),
        },
-       [DHWPT_SECONDARY_MUX] = {
+       [BRG_SECONDARY_MUX] = {
                .cmd[0] = ES_API_WORD(ES_SET_MUX_CMD,
                                ES300_DATA_PATH(0, 0, RXCHMGR1)),
                .cmd[1] = ES_API_WORD(0xB05B, 0x0101),
@@ -317,7 +441,7 @@ static struct route_tbl es_dhwpt_in_route_tbl[DHWPT_IN_MUX_LEN] = {
                .cmd_len = 6,
                .chn_mgr_mask = BIT(RXCHMGR1),
        },
-       [DHWPT_FEIN_MUX] = {
+       [BRG_FEIN_MUX] = {
                .cmd[0] = ES_API_WORD(ES_SET_MUX_CMD,
                                ES300_DATA_PATH(0, 0, RXCHMGR2)),
                .cmd[1] = ES_API_WORD(0xB05B, 0x0203),
@@ -331,56 +455,148 @@ static struct route_tbl es_dhwpt_in_route_tbl[DHWPT_IN_MUX_LEN] = {
        },
 };
 
-static struct route_tbl es_dhwpt_out_route_tbl[DHWPT_OUT_MUX_LEN] = {
-       [DHWPT_PASSOUT1_MUX] = {
-               .cmd[0] = ES_API_WORD(0xB05A, 0x3FFA),
+static struct route_tbl es_bargein_out_route_tbl[BRG_OUT_MUX_LEN] = {
+       [BRG_PASSOUT1_MUX] = {
+               .cmd[0] = ES_API_WORD(ES_SET_MUX_CMD,
+                               ES300_DATA_PATH(0, 0, TXCHMGR0)),
                .mux_type = PASS_AUDOUT1,
                .cmd_len = 1,
                .chn_mgr_mask = BIT(TXCHMGR0),
        },
-       [DHWPT_PASSOUT2_MUX] = {
-               .cmd[0] = ES_API_WORD(0xB05A, 0x3FFB),
+       [BRG_PASSOUT2_MUX] = {
+               .cmd[0] = ES_API_WORD(ES_SET_MUX_CMD,
+                               ES300_DATA_PATH(0, 0, TXCHMGR5)),
                .mux_type = PASS_AUDOUT2,
                .cmd_len = 1,
+               .chn_mgr_mask = BIT(TXCHMGR5),
+       },
+       [BRG_CSOUT1_MUX] = {
+               .cmd[0] = ES_API_WORD(ES_SET_MUX_CMD,
+                               ES300_DATA_PATH(0, 0, TXCHMGR1)),
+               .mux_type = VP_CSOUT1,
+               .cmd_len = 1,
                .chn_mgr_mask = BIT(TXCHMGR1),
        },
-       [DHWPT_CSOUT1_MUX] = {
+       [BRG_CSOUT2_MUX] = {
                .cmd[0] = ES_API_WORD(ES_SET_MUX_CMD,
                                ES300_DATA_PATH(0, 0, TXCHMGR2)),
-               .mux_type = VP_CSOUT1,
+               .mux_type = VP_CSOUT2,
                .cmd_len = 1,
                .chn_mgr_mask = BIT(TXCHMGR2),
        },
-       [DHWPT_FEOUT1_MUX] = {
+       [BRG_AO1_MUX] = {
                .cmd[0] = ES_API_WORD(ES_SET_MUX_CMD,
                                ES300_DATA_PATH(0, 0, TXCHMGR3)),
-               .mux_type = VP_FEOUT1,
+               .mux_type = PASS_AO1,
                .cmd_len = 1,
                .chn_mgr_mask = BIT(TXCHMGR3),
        },
-       [DHWPT_AO1_MUX] = {
+       [BRG_AO2_MUX] = {
                .cmd[0] = ES_API_WORD(ES_SET_MUX_CMD,
                                ES300_DATA_PATH(0, 0, TXCHMGR4)),
-               .mux_type = PASS_AO1,
+               .mux_type = PASS_AO2,
                .cmd_len = 1,
                .chn_mgr_mask = BIT(TXCHMGR4),
        },
-       [DHWPT_MO2_MUX] = {
+};
+
+struct es_mux_info es_bargein_mux_info = {
+       .in_mux_start = BRG_PASSIN1_MUX,
+       .in_mux_len = BRG_IN_MUX_LEN,
+       .out_mux_start = BRG_PASSOUT1_MUX,
+       .out_mux_len = BRG_OUT_MUX_LEN,
+       .in_tbl = &es_bargein_in_route_tbl,
+       .out_tbl = &es_bargein_out_route_tbl,
+};
+
+/* KalaOK Mux ENUM */
+enum {
+       KALAOK_PASSIN1_MUX,
+       KALAOK_PASSIN2_MUX,
+       KALAOK_PASSIN3_MUX,
+
+       KALAOK_IN_MUX_LEN,
+};
+
+enum {
+       KALAOK_PASSOUT1_MUX,
+       KALAOK_PASSOUT2_MUX,
+       KALAOK_PASSOUT3_MUX,
+       KALAOK_AO1_MUX,
+       KALAOK_AO2_MUX,
+
+       KALAOK_OUT_MUX_LEN,
+};
+
+static struct route_tbl es_kalaok_in_route_tbl[KALAOK_IN_MUX_LEN] = {
+       [KALAOK_PASSIN1_MUX] = {
+               .cmd[0] = ES_API_WORD(ES_SET_PATH_CMD,
+                               (ES300_DATA_PATH(0, 0, RXCHMGR0))),
+               .mux_type = ES_PASSIN1_MUX,
+               .cmd_len = 1,
+               .chn_mgr_mask = BIT(RXCHMGR0),
+       },
+       [KALAOK_PASSIN2_MUX] = {
                .cmd[0] = ES_API_WORD(ES_SET_MUX_CMD,
-                               ES300_DATA_PATH(0, 0, TXCHMGR5)),
-               .mux_type = PASS_MO2,
+                               ES300_DATA_PATH(0, 0, RXCHMGR1)),
+               .mux_type = ES_PASSIN2_MUX,
                .cmd_len = 1,
-               .chn_mgr_mask = BIT(TXCHMGR5),
+               .chn_mgr_mask = BIT(RXCHMGR1),
+       },
+       [KALAOK_PASSIN3_MUX] = {
+               .cmd[0] = ES_API_WORD(ES_SET_MUX_CMD,
+                               ES300_DATA_PATH(0, 0, RXCHMGR2)),
+               .mux_type = ES_PASSIN3_MUX,
+               .cmd_len = 1,
+               .chn_mgr_mask = BIT(RXCHMGR2),
+       },
+};
+
+static struct route_tbl es_kalaok_out_route_tbl[KALAOK_OUT_MUX_LEN] = {
+       [KALAOK_PASSOUT1_MUX] = {
+               .cmd[0] = ES_API_WORD(ES_SET_MUX_CMD,
+                               ES300_DATA_PATH(0, 0, TXCHMGR0)),
+               .mux_type = PASS_AUDOUT1,
+               .cmd_len = 1,
+               .chn_mgr_mask = BIT(TXCHMGR0),
+       },
+       [KALAOK_PASSOUT2_MUX] = {
+               .cmd[0] = ES_API_WORD(ES_SET_MUX_CMD,
+                               ES300_DATA_PATH(0, 0, TXCHMGR1)),
+               .mux_type = PASS_AUDOUT2,
+               .cmd_len = 1,
+               .chn_mgr_mask = BIT(TXCHMGR1),
+       },
+       [KALAOK_PASSOUT3_MUX] = {
+               .cmd[0] = ES_API_WORD(ES_SET_MUX_CMD,
+                               ES300_DATA_PATH(0, 0, TXCHMGR2)),
+               .mux_type = PASS_AUDOUT3,
+               .cmd_len = 1,
+               .chn_mgr_mask = BIT(TXCHMGR2),
+       },
+       [KALAOK_AO1_MUX] = {
+               .cmd[0] = ES_API_WORD(ES_SET_MUX_CMD,
+                               ES300_DATA_PATH(0, 0, TXCHMGR3)),
+               .mux_type = PASS_AO1,
+               .cmd_len = 1,
+               .chn_mgr_mask = BIT(TXCHMGR3),
+       },
+       [KALAOK_AO2_MUX] = {
+               .cmd[0] = ES_API_WORD(ES_SET_MUX_CMD,
+                               ES300_DATA_PATH(0, 0, TXCHMGR4)),
+               .mux_type = PASS_AO2,
+               .cmd_len = 1,
+               .chn_mgr_mask = BIT(TXCHMGR4),
        },
 };
 
-struct es_mux_info es_dhwpt_mux_info = {
-       .in_mux_start = DHWPT_PASSIN1_MUX,
-       .in_mux_len = DHWPT_IN_MUX_LEN,
-       .out_mux_start = DHWPT_PASSOUT1_MUX,
-       .out_mux_len = DHWPT_OUT_MUX_LEN,
-       .in_tbl = &es_dhwpt_in_route_tbl,
-       .out_tbl = &es_dhwpt_out_route_tbl,
+struct es_mux_info es_kalaok_mux_info = {
+       .in_mux_start = KALAOK_PASSIN1_MUX,
+       .in_mux_len = KALAOK_IN_MUX_LEN,
+       .out_mux_start = KALAOK_PASSOUT1_MUX,
+       .out_mux_len = KALAOK_OUT_MUX_LEN,
+       .in_tbl = &es_kalaok_in_route_tbl,
+       .out_tbl = &es_kalaok_out_route_tbl,
 };
 
 void prepare_mux_cmd(int mux, u32 *msg, u32 *msg_len,
index e298260..1943aef 100644 (file)
@@ -28,8 +28,8 @@ enum {
        VP_CSOUT2,
        VP_FEOUT1,
        VP_FEOUT2,
-       AUDIOZOOM_CSOUT,
-       AUDIOZOOM_AOUT1,
+       AUDIOFOCUS_CSOUT1,
+       AUDIOFOCUS_CSOUT2,
        MM_AUDOUT1,
        MM_AUDOUT2,
        MM_PASSOUT1,
@@ -41,7 +41,7 @@ enum {
        PASS_AUDOUT3,
        PASS_AUDOUT4,
        PASS_AO1,
-       PASS_MO2,
+       PASS_AO2,
        MONOUT1,
        MONOUT2,
        MONOUT3,
@@ -60,12 +60,12 @@ enum {
        VP,
        PT,
        MM,
-       AUDIOZOOM,
+       AUDIOFOCUS,
        VP_MM,
        PT_VP,
        PT_VP_DSM,
        VP_DSM,
-       AZ_DSM,
+       AF_DSM,
        PT_COPY,
        PT_4CH,
        VP_2CSOUT,
@@ -73,9 +73,11 @@ enum {
 };
 #endif
 /* MUX info structure for each base route */
-extern struct es_mux_info es_dhwpt_mux_info;
+extern struct es_mux_info es_kalaok_mux_info;
+extern struct es_mux_info es_bargein_mux_info;
 extern struct es_mux_info es_pt_vp_mux_info;
 extern struct es_mux_info es_vp_mux_info;
+extern struct es_mux_info es_audiofocus_mux_info;
 
 /* Helper routines to build commands for any base route */
 void prepare_mux_cmd(int mux, u32 *msg, u32 *msg_len,
index ae239eb..0ee2524 100644 (file)
 #include "es-d300.h"
 #include "es-d300-route.h"
 
+
+/* Switch initialization */
+static struct switch_setting es_d300_switch[SW_MAX] = {
+       [SWIN1] = {
+               .value_cmd[0] = 0x90660009, /* Input 0 */
+               .value_cmd[1] = 0x90660109, /* Input 1 */
+               .value = 0, /* Default Value */
+       },
+       [SWIN2] = {
+               .value_cmd[0] = 0x9066000A, /* Input 0 */
+               .value_cmd[1] = 0x9066010A, /* Input 1 */
+               .value = 0, /* Default Value */
+       },
+       [SWOUT0] = {
+               .value_cmd[0] = 0x90660000, /* Output 0 */
+               .value_cmd[1] = 0x90660100, /* Output 1 */
+               .value = 0, /* Default Value */
+       },
+       [SWOUT1] = {
+               .value_cmd[0] = 0x90660001, /* Output 0 */
+               .value_cmd[1] = 0x90660101, /* Output 1 */
+               .value = 0, /* Default Value */
+       },
+       [SWOUT2] = {
+               .value_cmd[0] = 0x90660002, /* Output 0 */
+               .value_cmd[1] = 0x90660102, /* Output 1 */
+               .value = 0, /* Default Value */
+       },
+       [SWOUT3] = {
+               .value_cmd[0] = 0x90660003, /* Output 0 */
+               .value_cmd[1] = 0x90660103, /* Output 1 */
+               .value = 0, /* Default Value */
+       },
+};
+
 struct cachedcmd_t {
        u8 reg;
-       u8 refcnt;
 };
 
 struct cachedcmd_t prev_cmdlist[ES_API_ADDR_MAX];
@@ -57,27 +91,15 @@ struct channel_id {
 static struct cachedcmd_t **cachedcmd_list;
 static int es_vp_tx;
 static int es_vp_rx;
-static int es_az_tx;
-static int es_az_rx;
+static int es_af_tx;
+static int es_af_rx;
 
 #define LEFT_CAPTURE           0x1
 #define RIGHT_CAPTURE          0x2
 #define MONO_CAPTURE           (LEFT_CAPTURE)
 #define STEREO_CAPTURE         (LEFT_CAPTURE | RIGHT_CAPTURE)
 
-#define OUTPUT_NONE    0x0
-#define OUTPUT_AO1     0x1
-#define OUTPUT_MO2     0x2
-#define OUTPUT_PO1     0x4
-#define OUTPUT_PO2     0x8
-
-/* Used to provide mixed output on a single channel output */
-#define OUTPUT_MIXED_MONO      (OUTPUT_AO1)
-
-/* Used to copy the stereo output to extra two channels output */
-#define OUTPUT_PT_COPY         (OUTPUT_AO1 | OUTPUT_MO2)
-
-/* Mask to keep track of chmgrs set by UCM */
+/* Mask to keep track of chmgrs set by UCM per algorithm type*/
 static u16 chn_mgr_mask[ALGO_MAX];
 
 static const u8 pcm_port[] = { 0x0, 0xA, 0xB, 0xC };
@@ -126,53 +148,25 @@ static const u16 es300_input_mux_text_to_api[] = {
 static const char * const proc_block_output_texts[] = {
        "None",
        "VP CSOUT1", "VP CSOUT2", "VP FEOUT1", "VP FEOUT2",
-       "AudioZoom CSOUT",
-       "AudioZoom AOUT1",
+       "AudioFocus CSOUT1",
+       "AudioFocus CSOUT2",
        "MM AUDOUT1", "MM AUDOUT2", "MM PASSOUT1", "MM PASSOUT2",
        "MM MONOUT1", "MM MONOUT2",
        "Pass AUDOUT1", "Pass AUDOUT2", "Pass AUDOUT3", "Pass AUDOUT4",
-       "Pass AO1", "Pass MO2",
+       "Pass AO1", "Pass AO2",
        "MONOUT1", "MONOUT2", "MONOUT3", "MONOUT4",
+       "PCM0.0", "PCM0.1", "PCM0.2", "PCM0.3",
+       "PCM1.0", "PCM1.1", "PCM1.2", "PCM1.3",
+       "PCM2.0", "PCM2.1", "PCM2.2", "PCM2.3",
+};
+
+
+static const char * const pri_pb_mode_texts[] = {
+       "Off", "Stereo"
 };
 
-static const u16 es300_output_mux_text_to_api[] = {
-       0xffff, /* Default value for all output MUXes */
-
-       /* VP outputs */
-       ES300_PATH_ID(TXCHMGR0, ES300_CSOUT1),
-       ES300_PATH_ID(TXCHMGR1, ES300_CSOUT2),
-       ES300_PATH_ID(TXCHMGR2, ES300_FEOUT1),
-       ES300_PATH_ID(TXCHMGR3, ES300_FEOUT2),
-
-       /* AudioZoom */
-       ES300_PATH_ID(TXCHMGR0, ES300_CSOUT1),
-       ES300_PATH_ID(TXCHMGR1, ES300_AUDOUT1),
-
-       /* MM AUDOUT */
-       ES300_PATH_ID(TXCHMGR0, ES300_AUDOUT1),
-       ES300_PATH_ID(TXCHMGR1, ES300_AUDOUT2),
-
-       /* MM PASSOUT */
-       ES300_PATH_ID(TXCHMGR4, ES300_PASSOUT1),
-       ES300_PATH_ID(TXCHMGR5, ES300_PASSOUT2),
-
-       /* MM MONOUT */
-       ES300_PATH_ID(TXCHMGR2, ES300_MM_MONOUT1),
-       ES300_PATH_ID(TXCHMGR3, ES300_MM_MONOUT2),
-
-       /* Passthru AUDOUT */
-       ES300_PATH_ID(TXCHMGR0, ES300_PASSOUT1),
-       ES300_PATH_ID(TXCHMGR1, ES300_PASSOUT2),
-       ES300_PATH_ID(TXCHMGR2, ES300_PASSOUT3),
-       ES300_PATH_ID(TXCHMGR3, ES300_PASSOUT4),
-       ES300_PATH_ID(TXCHMGR4, ES300_AUDOUT1),
-       ES300_PATH_ID(TXCHMGR5, ES300_MONOUT2),
-
-       /* UI Tone MONOUT */
-       ES300_PATH_ID(TXCHMGR1, ES300_MONOUT1),
-       ES300_PATH_ID(TXCHMGR2, ES300_MONOUT2),
-       ES300_PATH_ID(0, ES300_MONOUT3),
-       ES300_PATH_ID(0, ES300_MONOUT4),
+static const char * const sec_pb_mode_texts[] = {
+       "Off", "Mixed Mono", "Stereo"
 };
 
 struct out_mux_map es_out_mux_map[] = {
@@ -201,18 +195,11 @@ struct out_mux_map es_out_mux_map[] = {
 };
 
 static const u32 es_base_route_preset[ALGO_MAX] = {
-       [VP] = 0x90311771,
-       [VP_MM] = 0x90311777,
-       [PASSTHRU_VP] = 0x90311785,
-       [AUDIOZOOM] = 0x90311774,
-#if defined(CONFIG_SND_SOC_ES_SLIM)
-       [MM] = 0x90311773,
-       [PASSTHRU] = 0x90311776,
-#else
-       [MM] = 0x90311772,
-       [PASSTHRU] = 0x9031177D,
-#endif
-       [DHWPT] = 0x9031178F,
+       [VP] = 0xB0311771,
+       [AUDIOFOCUS] = 0xB031179B,
+       [PASSTHRU_VP] = 0xB0311785,
+       [BARGE_IN] = 0xB0311799,
+       [KALA_OK] = 0xB031179A,
 };
 
 static const struct es_ch_mgr_max es_chn_mgr_max[ALGO_MAX] = {
@@ -220,50 +207,41 @@ static const struct es_ch_mgr_max es_chn_mgr_max[ALGO_MAX] = {
                .rx = VP_RXCHMGR_MAX,
                .tx = VP_TXCHMGR_MAX,
        },
-       [MM] = {
-               .rx = MM_RXCHMGR_MAX,
-               .tx = MM_TXCHMGR_MAX,
-       },
-       [VP_MM] = {
-               .rx = VP_MM_RXCHMGR_MAX,
-               .tx = VP_MM_TXCHMGR_MAX,
+       [AUDIOFOCUS] = {
+               .tx = AUDIOFOCUS_TXCHMGR_MAX,
        },
        [PASSTHRU_VP] = {
                .tx = PT_VP_TXCHMGR_MAX,
        },
-       [DHWPT] = {
-               .rx = DHWPT_RXCHMGR_MAX,
-               .tx = DHWPT_TXCHMGR_MAX,
+       [BARGE_IN] = {
+               .tx = BARGE_IN_TXCHMGR_MAX,
+       },
+       [KALA_OK] = {
+               .rx = KALA_OK_RXCHMGR_MAX,
+               .tx = KALA_OK_TXCHMGR_MAX,
        },
 };
 
-static u32 switch_arr[] = {
-       [SWIN1_I0] = 0x90660009,
-       [SWIN1_I1] = 0x90660109,
-       [SWIN2_I0] = 0x9066000A,
-       [SWIN2_I1] = 0x9066010A,
-       [SWOUT0_O1] = 0x90660100,
-       [SWOUT1_O1] = 0x90660101,
-       [SWOUT2_O1] = 0x90660102,
-       [SWOUT3_O1] = 0x90660103,
-};
-
-static int escore_set_switch(int id)
+/* This function must be called with access_lock acquired */
+static int _es_set_switch(int id)
 {
        struct escore_priv *escore = &escore_priv;
        u32 cmd, resp;
        int rc = 0;
+       int switch_value = 0;
+
+       switch_value = es_d300_switch[id].value;
+       cmd = es_d300_switch[id].value_cmd[switch_value];
+       cmd = cmd | (1 << ES_SC_BIT);
 
        /*
         * The delay is required to make sure the route is active.
         * Without delay, the switch settings are not coming into
         * effect.
         */
-       usleep_range(1000, 1005);
-       cmd = switch_arr[id];
+       usleep_range(5000, 5005);
 
-       mutex_lock(&escore->api_mutex);
-       rc = escore->bus.ops.cmd(escore, cmd, &resp);
+       rc = escore_cmd(escore, cmd, &resp);
        if (rc) {
                pr_err("%s(): Error %d setting switch preset %x\n",
                                __func__, rc, cmd);
@@ -271,44 +249,133 @@ static int escore_set_switch(int id)
        }
 
        /*
-       cmd = ES_SYNC_CMD << 16;
-       rc = escore->bus.ops.cmd(escore, cmd, &resp);
-       if (rc) {
-               pr_err("%s(): Error %d in sending sync cmd\n",
-                               __func__, rc);
-               goto err;
-       }
-       */
+        * For ES_POWER_LEVEL_x power saving mode other than ES_POWER_LEVEL_6,
+        * need delay after switch cmd based on ES_POWER_LEVEL_x.
+        */
+       if (escore->power_saving_mode != ES_POWER_LEVEL_DISABLE &&
+           escore->algo_type == PASSTHRU_VP &&
+           escore->power_saving_mode < ES_POWER_LEVEL_6)
+               msleep(5 * (ES_POWER_LEVEL_6 - escore->power_saving_mode));
+
 err:
-       mutex_unlock(&escore->api_mutex);
        return rc;
 }
 
-static int es300_codec_stop_algo(struct escore_priv *escore)
+/* This function must be called with access_lock acquired */
+int _es_stop_route(struct escore_priv *escore, u8 stream_type)
 {
        u32 stop_route_cmd = ES_STOP_ROUTE<<16;
        u32 resp;
        int ret = 0;
 
-       /* Disable DHWPT if enabled */
-       if (escore->algo_type == DHWPT) {
-               u32 cmd = escore->dhwpt_cmd & 0xFFFF0000;
-               ret = escore_cmd(escore, cmd, &resp);
-               if (ret) {
-                       pr_err("%s: Disabling DHWPT failed = %d\n",
-                                       __func__, ret);
-                       return ret;
-               }
+
+       /* If XML disable sequence is not started before stop route,
+        * set algo_type_off to algo_type */
+       if (escore->algo_type_off == ALGO_NONE)
+               escore->algo_type_off = escore->algo_type;
+
+       /* Check which algo is turned off with below check */
+       if (escore->algo_type == DHWPT || escore->algo_type == PASSTHRU_VP) {
+
+               if (stream_type == ES_TYPE_PB && escore->dhwpt_mode)
+                       escore->algo_type_off = DHWPT;
+               else
+                       escore->algo_type_off = PASSTHRU_VP;
        }
 
-       /* Stop the route */
-       ret = escore_cmd(escore, stop_route_cmd, &resp);
-       if (ret) {
-               pr_err("%s: Route stop failed\n", __func__);
-               return ret;
+
+       pr_debug("%s **** Stop route Algo type %d for stream type %d ******* \n", __func__,escore->algo_type_off, stream_type);
+
+
+       /* Stop the route first, except when stopping DHWPT use cases */
+       if (escore->algo_type_off != DHWPT) {
+               if (escore->algo_type_off == PASSTHRU_VP &&
+                                       escore->dhwpt_enabled &&
+                                       !escore->dhwpt_mode &&
+                                       escore->dhwpt_cmd) {
+
+                       u32 cmd = escore->dhwpt_cmd & 0xFFFF0000;
+                       ret = escore_cmd(escore, cmd, &resp);
+                       if (ret) {
+                               pr_err("%s: Disabling DHWPT failed = %d\n",
+                                               __func__, ret);
+                               return ret;
+                       }
+
+                       /* Require 1ms delay between stop route and DHWPT to avoid noise */
+                       usleep_range(5000, 5005);
+               }
+
+
+               if (escore->base_route_setup) {
+                       ret = escore_cmd(escore, stop_route_cmd, &resp);
+                       if (ret) {
+                               pr_err("%s: Route stop failed, ret = %d\n", __func__,
+                                               ret);
+                               return ret;
+                       }
+
+                       escore->base_route_setup = 0;
+               }
+
+               /* When stopping capture route and DHWPT playback is running,
+                * restore chip to MP_Sleep mode */
+               if (escore->algo_type_off == PASSTHRU_VP && escore->dhwpt_capture_on)
+                       escore->dhwpt_capture_on = 0;
+
+               if (escore->mp_sleep_requested && escore->dhwpt_mode && !escore->dhwpt_capture_on) {
+                       pr_debug("%s(): Put chip back into mp_sleep\n", __func__);
+                       ret = es755_enter_mp_sleep();
+                       if (ret) {
+                               pr_err("%s: es755_enter_mp_sleep failed = %d\n",
+                                               __func__, ret);
+                               return ret;
+                       }
+               }
+
+       } else {
+
+               if (escore->dhwpt_mode) {
+
+                       if (!escore->dhwpt_capture_on) {
+
+                               /* Disable DHWPT if enabled, or when stopping DHWPT use cases */
+                               u32 cmd = escore->dhwpt_cmd & 0xFFFF0000;
+
+                               /* Bring the chip from MP Sleep mode to Normal mode before
+                                * sending any commands */
+                               ret = es755_exit_mp_sleep();
+                               if (ret) {
+                                       pr_err("%s(): es755_exit_mp_sleep() fail %d\n",
+                                                       __func__, ret);
+                                       return ret;
+                               }
+
+                               ret = escore_cmd(escore, cmd, &resp);
+                               if (ret) {
+                                       pr_err("%s: Disabling DHWPT failed = %d\n",
+                                                       __func__, ret);
+                                       return ret;
+                               }
+                       } else {
+
+                               pr_debug("%s(): Seems DHWPT capture is on. Skip disabling DHWPT\n", __func__);
+                       }
+
+                       escore->dhwpt_mode = 0;
+               }
        }
 
+
        escore->current_preset = 0;
+       /* Reset algo_preset so that it is not accidently set for a
+       * diffeent route, UCM is responsible to set this algo preset
+       * for every use case
+       */
+       escore->algo_preset_one = 0;
+       escore->algo_preset_two = 0;
+       //escore->algo_type_off = ALGO_NONE;
+
        return ret;
 }
 
@@ -319,260 +386,150 @@ static void update_chan_id(u32 *msg, int chan_id)
        *msg |= ES_API_WORD(ES_SET_PATH_CMD,
                        ES300_DATA_PATH(0x0, chan_id, 0x0));
 }
+
+static int setup_dhwpt_msg(u32 *msg, int mux)
+{
+       pr_debug("****** %s() *********:\n", __func__);
+       switch (mux) {
+       case ES_PASSIN1_MUX:
+               msg[0] = 0xB05A3FF3;
+               break;
+       case ES_PASSIN2_MUX:
+               msg[0] = 0xB05A3FF4;
+               break;
+       case PASS_AUDOUT1:
+               msg[0] = 0xB05A3FFA;
+               chn_mgr_mask[PASSTHRU_VP] |= BIT(TXCHMGR0);
+               break;
+       case PASS_AUDOUT2:
+               msg[0] = 0xB05A3FFB;
+               chn_mgr_mask[PASSTHRU_VP] |= BIT(TXCHMGR1);
+               break;
+       default:
+               return 0;
+       }
+       return sizeof(msg[0]);
+}
+
 static int convert_input_mux_to_cmd(struct escore_priv *escore, int reg)
 {
        unsigned int value;
-       int msg_len = escore->api_access[reg].write_msg_len;
+       int msg_len;
        u32 msg[ES_CMD_ACCESS_WR_MAX] = {0};
-       u16 port, chnum;
-       u16 ch_mgr;
-       u8 path_id = 0;
-       u8 update_cmds = 0;
-       u8 update_chmgr_mask = 1;
+       u16 port;
        int mux = cachedcmd_list[escore->algo_type][reg].reg;
+       struct es_mux_info *in_mux_info = NULL;
+       u8 algo_type = escore->algo_type;
 
-       memcpy((char *)msg, (char *)escore->api_access[reg].write_msg,
-                       msg_len);
        value = es300_input_mux_text_to_api[mux];
 
        pr_debug("%s(): reg = %d mux = %d\n", __func__, reg, mux);
-       msg[0] |= value;
-       path_id = msg[1] & 0xFF;
-       ch_mgr = ES_CHMGR_DATAPATH(msg[0]);
-
-       switch (escore->algo_type) {
-       case AUDIOZOOM:
-               if (reg == ES_TERTIARY_MUX) {
-                       /* Connect RxChMgr2.o0 */
-                       msg[2] = ES_API_WORD(ES_CONNECT_CMD,
-                                       ES300_ENDPOINT(FILTER_RXCHANMGR2, OUT,
-                                               RxChMgr_o0));
-                       msg_len += sizeof(*msg);
-
-                       /* Connect AZ.i2 */
-                       msg[3] = ES_API_WORD(ES_CONNECT_CMD,
-                                       ES300_ENDPOINT(FILTER_AZ, IN, az_i2));
-                       msg_len += sizeof(*msg);
-
-                       /* Set Rate 48k */
-                       msg[4] = ES_API_WORD(ES_SET_RATE_CMD,
-                                       ES300_RATE(FILTER_RXCHANMGR2, 3));
-                       msg_len += sizeof(*msg);
-
-                       /* Set Rate 48k */
-                       msg[5] = ES_API_WORD(ES_SET_GROUP_CMD,
-                                       ES300_GROUP(FILTER_RXCHANMGR2, 0));
-                       msg_len += sizeof(*msg);
-
-               } else if (reg == ES_AZ_AI1_MUX) {
-                       port = (value >> 9) & 0x1f;
-                       chnum = (value >> 4) & 0x1f;
-
-                       /* Update the data path */
-                       msg[0] = ES_API_WORD(ES_SET_MUX_CMD,
-                                       ES300_DATA_PATH(port, chnum, RXCHMGR3));
-
-                       /* Set corresponding path id */
-                       msg[1] = ES_API_WORD(ES_SET_PATH_ID_CMD,
-                               ES300_PATH_ID(RXCHMGR3, path_id));
-
-                       msg_len = 8;
-                       chn_mgr_mask[escore->algo_type] |= 1 << RXCHMGR3;
-                       update_chmgr_mask = 0;
 
+       switch (algo_type) {
+       case VP:
+               in_mux_info = &es_vp_mux_info;
+               break;
+       case PASSTHRU_VP:
+               in_mux_info = &es_pt_vp_mux_info;
+               if (escore->dhwpt_enabled) {
+                       msg_len = setup_dhwpt_msg(msg, reg);
+                       if (msg_len)
+                               goto queue_msg;
                }
                break;
-
-       case PASSTHRU:
+       case BARGE_IN:
+               in_mux_info = &es_bargein_mux_info;
                break;
-
-       case MM:
-               update_cmds = 1;
-               port = (value >> 9) & 0x1f;
-               chnum = (value >> 4) & 0x1f;
-
-               switch (reg) {
-               case ES_MM_PASSIN1_MUX:
-                       ch_mgr = RXCHMGR4;
-                       break;
-               case ES_MM_PASSIN2_MUX:
-                       ch_mgr = RXCHMGR5;
-                       break;
-               default:
-                       update_cmds = 0;
-                       break;
-               }
-
-               if (update_cmds) {
-                       /* Update the data path */
-                       msg[0] = ES_API_WORD(ES_SET_MUX_CMD,
-                                       ES300_DATA_PATH(port, chnum, ch_mgr));
-
-                       /* Set corresponding path id */
-                       msg[1] = ES_API_WORD(ES_SET_PATH_ID_CMD,
-                                       ES300_PATH_ID(ch_mgr, path_id));
-
-                       msg_len = 8;
-                       chn_mgr_mask[escore->algo_type] |= 1 << ch_mgr;
-                       update_chmgr_mask = 0;
-               }
+       case KALA_OK:
+               in_mux_info = &es_kalaok_mux_info;
                break;
+       case AUDIOFOCUS:
+               in_mux_info = &es_audiofocus_mux_info;
+               break;
+       default:
+               pr_err("%s(): Invalid algo type:%d\n", __func__, algo_type);
+               return -EINVAL;
+       }
 
-       case VP_MM:
-               update_cmds = 1;
-               port = (value >> 9) & 0x1f;
-               chnum = (value >> 4) & 0x1f;
-
-               switch (reg) {
-               case ES_AUDIN1_MUX:
-                       ch_mgr = RXCHMGR8;
-                       break;
-               case ES_AUDIN2_MUX:
-                       ch_mgr = RXCHMGR9;
-                       break;
-               default:
-                       update_cmds = 0;
-                       break;
-               }
+       prepare_mux_cmd(reg, msg, &msg_len, &chn_mgr_mask[algo_type],
+                       in_mux_info, CMD_INPUT);
 
-               if (update_cmds) {
-                       /* Update the data path */
-                       msg[0] = ES_API_WORD(ES_SET_MUX_CMD,
-                                       ES300_DATA_PATH(port, chnum, ch_mgr));
+       msg[0] |= value;
 
-                       /* Set corresponding path id */
-                       msg[1] = ES_API_WORD(ES_SET_PATH_ID_CMD,
-                                       ES300_PATH_ID(ch_mgr, path_id));
+       port = (msg[0] >> 9) & 0x1f;
 
-                       msg_len = 8;
-                       chn_mgr_mask[escore->algo_type] |= 1 << ch_mgr;
-                       update_chmgr_mask = 0;
-               }
-               break;
-       case VP:
-               prepare_mux_cmd(reg, msg, &msg_len,
-                               &chn_mgr_mask[escore->algo_type],
-                               &es_vp_mux_info, CMD_INPUT);
-               msg[0] |= value;
-               update_chmgr_mask = 0;
-               break;
+       /* For BAS-3205, in case of PT_VP route and PCM0 port and 16bits,
+        * set channel number to 0 for PassIN1 and 2 for PassIN2 */
+       if (PCM0 == port && PASSTHRU_VP == algo_type &&
+           (SNDRV_PCM_FORMAT_S32_LE == escore->pcm_format ||
+            SNDRV_PCM_FORMAT_S32_BE == escore->pcm_format)) {
 
-       case DHWPT:
-               /* Unused channel managers in base route 6031 */
-               chn_mgr_mask[escore->algo_type] |= BIT(RXCHMGR5);
-               prepare_mux_cmd(reg, msg, &msg_len,
-                               &chn_mgr_mask[escore->algo_type],
-                               &es_dhwpt_mux_info, CMD_INPUT);
-               if (reg != ES_PASSIN1_MUX && reg != ES_PASSIN2_MUX) {
-                       msg[0] |= value;
-                       update_chmgr_mask = 0;
-               } else {
-                       goto done;
-               }
-               break;
-       case PASSTHRU_VP:
-               prepare_mux_cmd(reg, msg, &msg_len,
-                               &chn_mgr_mask[escore->algo_type],
-                               &es_pt_vp_mux_info, CMD_INPUT);
-               msg[0] |= value;
-               update_chmgr_mask = 0;
-               break;
+               if (ES_PASSIN1_MUX == reg)
+                       channel_ids[algo_type][port].rx_chan_id = 0;
+               else if (ES_PASSIN2_MUX == reg)
+                       channel_ids[algo_type][port].rx_chan_id = 2;
        }
 
-       port = (msg[0] >> 9) & 0x1f;
-       update_chan_id(&msg[0],
-                       channel_ids[escore->algo_type][port].rx_chan_id);
-       channel_ids[escore->algo_type][port].rx_chan_id++;
+       update_chan_id(&msg[0], channel_ids[algo_type][port].rx_chan_id);
+       channel_ids[algo_type][port].rx_chan_id++;
 
-       if (update_chmgr_mask)
-               chn_mgr_mask[escore->algo_type] |= 1 << ch_mgr;
-done:
+queue_msg:
        return escore_queue_msg_to_list(escore, (char *)msg, msg_len);
 }
 
 static int convert_output_mux_to_cmd(struct escore_priv *escore, int reg)
 {
-       unsigned int value;
-       int msg_len = escore->api_access[reg].write_msg_len;
+       int msg_len;
        u32 msg[ES_CMD_ACCESS_WR_MAX] = {0};
-       u16 port, ch_mgr;
-       u8 path_id = 0;
-       u8 update_chmgr_mask = 1, update_msgs = 1;
+       u16 port;
        u32 i;
        int mux = cachedcmd_list[escore->algo_type][reg].reg;
-
-       memcpy((char *)msg, (char *)escore->api_access[reg].write_msg,
-                               msg_len);
-       value = es300_output_mux_text_to_api[mux];
+       struct es_mux_info *out_mux_info = NULL;
+       u8 algo_type = escore->algo_type;
 
        pr_debug("%s(): reg = %d mux = %d\n", __func__, reg, mux);
 
-       path_id = value & 0x3f;
-       ch_mgr = (value >> 8) & 0xf;
-
-       switch (escore->algo_type) {
+       switch (algo_type) {
        case VP:
-               prepare_mux_cmd(mux, msg, &msg_len,
-                               &chn_mgr_mask[escore->algo_type],
-                               &es_vp_mux_info, CMD_OUTPUT);
-               for (i = 0; i < ARRAY_SIZE(es_out_mux_map); i++) {
-                       if (es_out_mux_map[i].mux_id == reg) {
-                               msg[0] |= es_out_mux_map[i].port_desc;
-                               break;
-                       }
-               }
-               update_chmgr_mask = 0;
-               update_msgs = 0;
-               break;
-       case AUDIOZOOM:
-               break;
-       case MM:
-               break;
-       case PASSTHRU:
+               out_mux_info = &es_vp_mux_info;
                break;
        case PASSTHRU_VP:
-               prepare_mux_cmd(mux, msg, &msg_len,
-                               &chn_mgr_mask[escore->algo_type],
-                               &es_pt_vp_mux_info, CMD_OUTPUT);
-               for (i = 0; i < ARRAY_SIZE(es_out_mux_map); i++) {
-                       if (es_out_mux_map[i].mux_id == reg) {
-                               msg[0] |= es_out_mux_map[i].port_desc;
-                               break;
-                       }
+               out_mux_info = &es_pt_vp_mux_info;
+               if (escore->dhwpt_enabled) {
+                       msg_len = setup_dhwpt_msg(msg, mux);
+                       if (msg_len)
+                               goto queue_msg;
                }
-               update_chmgr_mask = 0;
-               update_msgs = 0;
                break;
-       case DHWPT:
-               prepare_mux_cmd(mux, msg, &msg_len,
-                               &chn_mgr_mask[escore->algo_type],
-                               &es_dhwpt_mux_info, CMD_OUTPUT);
-               for (i = 0; i < ARRAY_SIZE(es_out_mux_map); i++) {
-                       if (es_out_mux_map[i].mux_id == reg) {
-                               if (mux != PASS_AUDOUT1 && mux != PASS_AUDOUT2)
-                                       msg[0] |= es_out_mux_map[i].port_desc;
-                               else
-                                       goto done;
-                       }
-               }
-               update_chmgr_mask = 0;
-               update_msgs = 0;
+       case BARGE_IN:
+               out_mux_info = &es_bargein_mux_info;
+               break;
+       case KALA_OK:
+               out_mux_info = &es_kalaok_mux_info;
                break;
+       case AUDIOFOCUS:
+               out_mux_info = &es_audiofocus_mux_info;
+               break;
+       default:
+               pr_err("%s(): Invalid algo type:%d\n", __func__, algo_type);
+               return -EINVAL;
        }
 
-       port = (msg[0] >> 9) & 0x1f;
-       update_chan_id(&msg[0],
-                       channel_ids[escore->algo_type][port].tx_chan_id);
-       channel_ids[escore->algo_type][port].tx_chan_id++;
+       prepare_mux_cmd(mux, msg, &msg_len, &chn_mgr_mask[algo_type],
+                       out_mux_info, CMD_OUTPUT);
 
-       if (update_msgs) {
-               msg[0] |= ES300_DATA_PATH(0, 0, ch_mgr);
-               msg[1] |= ES300_PATH_ID(ch_mgr, path_id);
+       for (i = 0; i < ARRAY_SIZE(es_out_mux_map); i++) {
+               if (es_out_mux_map[i].mux_id == reg) {
+                       msg[0] |= es_out_mux_map[i].port_desc;
+                       break;
+               }
        }
 
-       if (update_chmgr_mask)
-               chn_mgr_mask[escore->algo_type] |= 1 << ch_mgr;
-done:
+       port = (msg[0] >> 9) & 0x1f;
+       update_chan_id(&msg[0], channel_ids[algo_type][port].tx_chan_id);
+       channel_ids[algo_type][port].tx_chan_id++;
+
+queue_msg:
        return escore_queue_msg_to_list(escore, (char *)msg, msg_len);
 }
 
@@ -581,6 +538,7 @@ static void set_chmgr_null(struct escore_priv *escore)
        u32 msg = ES_SET_MUX_NULL;
        int i;
        u16 mask = chn_mgr_mask[escore->algo_type];
+
        pr_debug("%s: mask %04x\n", __func__, mask);
 
        /* Set RXCHMGR NULL */
@@ -617,6 +575,14 @@ static int add_algo_base_route(struct escore_priv *escore)
        escore->current_preset =  msg & 0xFFFF;
        rc = escore_queue_msg_to_list(escore, (char *)&msg, sizeof(msg));
 
+/*
+       if (!rc && escore->dhwpt_enabled) {
+               msg = escore->dhwpt_cmd;
+               rc = escore_queue_msg_to_list(escore,
+                               (char *)&msg, sizeof(msg));
+       }
+*/
+
        /* Configure command completion mode */
        if (escore->cmd_compl_mode == ES_CMD_COMP_INTR) {
                cmd |= escore->pdata->gpio_a_irq_type;
@@ -627,21 +593,11 @@ static int add_algo_base_route(struct escore_priv *escore)
        return rc;
 }
 
-static void es_clear_route(struct escore_priv *escore)
-{
-
-       pr_debug("%s\n", __func__);
-
-       if (escore->algo_type == AUDIOZOOM) {
-               es_az_tx = ES_AZ_NONE;
-               es_az_rx = ES_AZ_NONE;
-       }
-}
-
-static int es_set_algo_rate(struct escore_priv *escore, int algo)
+/* This function must be called with access_lock acquired */
+static int _es_set_algo_rate(struct escore_priv *escore, int algo)
 {
        int rc = 0;
-       u32 filter;
+       u32 filter = FILTER_RESERVED;
        u32 rate_msg, resp;
 
        switch (algo) {
@@ -655,8 +611,8 @@ static int es_set_algo_rate(struct escore_priv *escore, int algo)
        case PASSTHRU:
                filter = FILTER_PASSTHRU;
                break;
-       case AUDIOZOOM:
-               filter = FILTER_AZ;
+       case AUDIOFOCUS:
+               filter = FILTER_AF;
                break;
        default:
                pr_err("%s(): Algorithm rate not supported for algo type:%d\n",
@@ -678,27 +634,227 @@ static int es_set_algo_rate(struct escore_priv *escore, int algo)
                 * By clearing BIT 29 will clear the STAGE bit in a command
                 * and make it a COMMIT command.
                 */
-               /* clear_bit(ES_SC_BIT, (unsigned long *) &rate_msg); */
-
-               /* On Loki, crash is observed with clear_bit API.
-               Replaced clear_bit API with bit wise operation */
                rate_msg &= ~(1 << ES_SC_BIT);
-
                rc = escore_cmd(escore, rate_msg, &resp);
                if (rc)
                        pr_err("%s(): Fail to set algorithm rate :%d\n",
                                        __func__, rc);
+
+       }
+       return rc;
+}
+
+/* This function must be called with access_lock acquired */
+static int _es_set_digital_gain(struct escore_priv *escore)
+{
+       int rc   = 0, i;
+       u32 cmd  = 0;
+       u32 resp = 0;
+
+       if (NULL == escore) {
+               pr_err("%s(): Null pointer.\n", __func__);
+               return -EINVAL;
+       }
+
+       for (i = 0; i < ES_DIGITAL_GAIN_MAX_NUM; i++) {
+               if (0 != escore->digital_gain[i]) {
+                       pr_debug("%s: Set digital gain 0x%x on path ID %d.\n",
+                                __func__,
+                                escore->digital_gain[i],
+                                i);
+
+                       /* Select path ID */
+                       cmd = (ES_SELECT_ENDPOINT<<16) | i;
+                       rc = escore_cmd(escore, cmd, &resp);
+                       if (rc) {
+                               dev_err(escore_priv.dev,
+                                       "%s(): Select Endpoint failed: %d\n",
+                                       __func__, rc);
+                               escore->digital_gain[i] = 0;
+                               return rc;
+                       }
+
+                       /* Set digital output gain */
+                       cmd = (ES_SET_DIGITAL_GAIN<<16) | escore->digital_gain[i];
+                       rc = escore_cmd(escore, cmd, &resp);
+                       if (rc) {
+                               dev_err(escore_priv.dev,
+                                       "%s(): Set Digital Gain failed: %d\n",
+                                       __func__, rc);
+                               escore->digital_gain[i] = 0;
+                               return rc;
+                       }
+               }
+       }
+
+       return rc;
+}
+
+/* This function must be called with access_lock acquired */
+int es_change_power_state_normal(struct escore_priv *escore)
+{
+       int rc = 0;
+       u32 cmd, resp;
+
+       pr_debug("%s\n", __func__);
+
+       /* If codec event is detected in CVQ mode, firmware remains in CVQ mode.
+        * At this point CVQ resume triggered by escore_pm_get_sync() (called
+        * from ISR) doesn't do resume and return 0. Hence firmware remains in
+        * CVQ mode. Because of RPM get sync call, RPM status is RPM_ACTIVE.
+        * Now before suspend is executed if any audio usecase is run, because
+        * of RPM_ACTIVE status, runtime resume will not be called and all
+        * audio related commands will be sent in CVQ mode.
+        * These commands should be sent in NORMAL mode only.
+        * This check brings chip into BOSKO mode (Normal Power State) before
+        * sending any audio related commands.
+        */
+       if (escore->escore_power_state == ES_SET_POWER_STATE_VS_OVERLAY) {
+
+               /* Set flag to Wait for API Interrupt */
+               escore_set_api_intr_wait(escore);
+
+               /* change power state to Normal*/
+               cmd = (ES_SET_POWER_STATE << 16) | ES_SET_POWER_STATE_NORMAL;
+               rc = escore_cmd_nopm(escore, cmd, &resp);
+               if (rc < 0) {
+                       dev_err(escore->dev, "%s() power state cmd failed %d\n",
+                                               __func__, rc);
+                       return rc;
+               }
+
+               if (escore->pdata->gpioa_gpio != -1) {
+                       /* Wait for API Interrupt to confirm
+                        * that device is ready to accept commands */
+                       rc = escore_api_intr_wait_completion(escore);
+                       if (rc)
+                               return rc;
+               } else
+                       msleep(escore->delay.vs_to_normal);
+
+               escore->mode = STANDARD;
+               escore->escore_power_state = ES_SET_POWER_STATE_NORMAL;
+       }
+
+       if (escore->dhwpt_mode) {
+               /* Exit MP Sleep mode */
+               rc = es755_exit_mp_sleep();
+               if (rc) {
+                       dev_err(escore->dev,
+                               "%s(): es755_exit_mp_sleep() fail %d\n",
+                               __func__, rc);
+               }
        }
+
        return rc;
+
 }
 
-static int es_set_final_route(struct escore_priv *escore)
+static int _es_set_algo_switch(struct escore_priv *escore)
+{
+       int algo_type = escore->algo_type;
+       int pri, fein;
+       int rc = 0;
+       int i;
+
+       switch (algo_type) {
+       case PASSTHRU_VP:
+       case BARGE_IN:
+               pri = cachedcmd_list[algo_type][ES_PRIMARY_MUX].reg;
+               fein = cachedcmd_list[algo_type][ES_FEIN_MUX].reg;
+
+               /* Decide the capture use-case out of three:
+                * 1. mono capture
+                * 2. stereo capture
+                * 3. mono to stereo capture
+                */
+               switch (escore->capture_mode) {
+               /* Only possible case at the moment */
+               case STEREO_CAPTURE:
+                       if (pri && fein) {
+                               /* Stereo capture */
+                               es_d300_switch[SWIN1].value = 0;
+                       } else if (pri) {
+                               /* mono to stereo capture */
+                               es_d300_switch[SWIN1].value = 1;
+                       }
+                       break;
+               default:
+                       pr_err("%s(): Invalid capture mode:%d\n", __func__,
+                                       escore->capture_mode);
+               }
+               break;
+       case AUDIOFOCUS:
+               switch (escore->capture_mode) {
+               case STEREO_CAPTURE:
+                       /* Stereo capture */
+                       es_d300_switch[SWOUT3].value = 1;
+                       break;
+               default:
+                       /* mono to capture */
+                       es_d300_switch[SWOUT3].value = 0;
+               }
+               break;
+       default:
+               pr_debug("%s(): Switch settings not supported for algo :%d\n",
+                               __func__, algo_type);
+       }
+
+       for (i = 0; i < SW_MAX; i++) {
+               if (!es_d300_switch[i].value)
+                       continue;
+
+               rc = _es_set_switch(i);
+               if (rc) {
+                       pr_err("%s(): Failure in switch settings\n", __func__);
+                       rc = -EIO;
+                       break;
+               }
+       }
+
+       return rc;
+}
+/* This function must be called with access_lock acquired */
+static int _es_set_final_route(struct escore_priv *escore)
 {
        int rc = 0, i;
        u16 preset;
+       u32 resp = 0;
+       u32 msg;
 
        pr_debug("%s\n", __func__);
 
+       /* DHWPT playback case */
+       if (escore->algo_type == DHWPT) {
+               if (escore->dhwpt_capture_on)
+                       pr_debug("%s(): ****** Seem capture is present. DHWPT is already sent **********\n",__func__);
+               else {
+                       /* Before setting DHWPT configurations, ensure that normal route setup is inactive. */
+                       if (atomic_read(&escore->active_streams)) {
+                               pr_debug("%s(): ** Stop route before sending DHWPT ****\n",__func__);
+                               _es_stop_route(escore, ES_TYPE_NONE);
+                               /* Require 1ms delay between stop route and DHWPT to avoid noise */
+                               usleep_range(5000, 5005);
+                       }
+
+                       rc = escore_cmd(escore, escore->dhwpt_cmd, &resp);
+                       if (rc < 0) {
+                               pr_err("%s(): Error %d in sending DHWPT command\n",__func__, rc);
+                               return rc;
+                       }
+               }
+
+               escore->dhwpt_mode = 1;
+               return rc;
+       }
+
+       rc =  es_change_power_state_normal(escore);
+       if (rc) {
+               pr_err("%s(): Power state transition failed %d\n",
+                       __func__, rc);
+               return rc;
+       }
+
        if ((escore->algo_type == VP) && !escore->vp_asr) {
                if (es_vp_tx != ES_VP_TX_INIT ||
                                es_vp_rx != ES_VP_RX_INIT) {
@@ -706,13 +862,6 @@ static int es_set_final_route(struct escore_priv *escore)
                                es_vp_rx, es_vp_tx);
                        return 0;
                }
-       } else if (escore->algo_type == AUDIOZOOM) {
-               if (es_az_tx != ES_AZ_TX_INIT ||
-                               es_az_rx != ES_AZ_RX_INIT) {
-                       pr_debug("%s AZ not ready rx=%d tx=%d\n", __func__,
-                               es_az_rx, es_az_tx);
-                       return 0;
-               }
        }
 
        preset = es_base_route_preset[escore->algo_type] & 0xFFFF;
@@ -729,17 +878,30 @@ static int es_set_final_route(struct escore_priv *escore)
                        pr_debug("%s(): Skip same preset %x\n", __func__, preset);
                        return 0;
                }
-               es300_codec_stop_algo(escore);
+               _es_stop_route(escore, ES_TYPE_NONE);
        }
 
        /* If the new use-case is started and still there are pending streams
         * from previous use-case, just go ahead and write the new route to
         * firmware after stopping the current route. The stream count will
-        * anyway will be decremented when the HAL layer stops the PCM stream
+        * anyway be decremented when the HAL layer stops the PCM stream
         * of previous use-case. */
-       else if (unlikely(atomic_read(&escore->active_streams)))
-               es300_codec_stop_algo(escore);
-
+       else if (unlikely(atomic_read(&escore->active_streams)) && !escore->dhwpt_mode)
+               _es_stop_route(escore, ES_TYPE_NONE);
+
+       if (escore->algo_type == PASSTHRU_VP && !escore->dhwpt_enabled && escore->dhwpt_mode) {
+               dev_err(escore_priv.dev, "%s(): **** WARNING: PT_VP route called even DHWPT playback is ON ****\n",__func__);
+               dev_err(escore_priv.dev, "%s(): **** Forcibly stopping DHWPT playback ****\n",__func__);
+               /* Disable DHWPT if enabled, or when stopping DHWPT use cases */
+               msg = escore->dhwpt_cmd & 0xFFFF0000;
+               rc = escore_cmd(escore, msg, &resp);
+               if (rc) {
+                       pr_err("%s: Disabling DHWPT failed = %d\n",
+                                       __func__, rc);
+                       return rc;
+               }
+               escore->dhwpt_mode = 0;
+       }
        escore_flush_msg_list(escore);
 
        /* Reset the channel manager mask */
@@ -748,7 +910,13 @@ static int es_set_final_route(struct escore_priv *escore)
        /* Reset channel ids */
        memset(&channel_ids[escore->algo_type], 0x0,
                        sizeof(channel_ids[escore->algo_type]));
-       escore_flush_msg_list(escore);
+
+       if (escore->dhwpt_enabled && !escore->dhwpt_mode) {
+               msg = escore->dhwpt_cmd;
+               rc = escore_queue_msg_to_list(escore,
+                               (char *)&msg, sizeof(msg));
+       }
+
 
        for (i = ES_PRIMARY_MUX; i <= ES_PASSIN4_MUX; i++) {
                if (cachedcmd_list[escore->algo_type][i].reg != 0) {
@@ -759,28 +927,26 @@ static int es_set_final_route(struct escore_priv *escore)
        }
 
        escore->capture_mode = 0;
-       escore->output_mode = 0;
        for (i = ES_DAC0_0_MUX; i <= ES_SBUSTX5_MUX; i++) {
-               if (escore->algo_type == PASSTHRU_VP
-                               || escore->algo_type == DHWPT) {
+               if (escore->algo_type == PASSTHRU_VP ||
+                               escore->algo_type == BARGE_IN) {
                        int mux = cachedcmd_list[escore->algo_type][i].reg;
                        switch (mux) {
-                       case PASS_AO1:
-                               escore->output_mode |= OUTPUT_AO1;
-                               break;
-                       case PASS_MO2:
-                               escore->output_mode |= OUTPUT_MO2;
-                               break;
-                       case PASS_AUDOUT1:
-                               escore->output_mode |= OUTPUT_PO1;
-                               break;
-                       case PASS_AUDOUT2:
-                               escore->output_mode |= OUTPUT_PO2;
-                               break;
                        case VP_CSOUT1:
                                escore->capture_mode |= LEFT_CAPTURE;
                                break;
                        case VP_FEOUT1:
+                       case VP_CSOUT2:
+                               escore->capture_mode |= RIGHT_CAPTURE;
+                               break;
+                       }
+               } else if (escore->algo_type == AUDIOFOCUS) {
+                       int mux = cachedcmd_list[escore->algo_type][i].reg;
+                       switch (mux) {
+                       case AUDIOFOCUS_CSOUT1:
+                               escore->capture_mode |= LEFT_CAPTURE;
+                               break;
+                       case AUDIOFOCUS_CSOUT2:
                                escore->capture_mode |= RIGHT_CAPTURE;
                                break;
                        }
@@ -793,71 +959,58 @@ static int es_set_final_route(struct escore_priv *escore)
        }
 
        /* Setup AEC if enabled */
-       if (escore->vp_aec) {
+       if (escore->algo_type == PASSTHRU_VP && escore->vp_aec && !escore->dhwpt_enabled) {
                escore_queue_msg_to_list(escore, (char *)pt_vp_aec_msgblk,
                                sizeof(pt_vp_aec_msgblk));
        }
+
+       /* Set power level if enabled */
+       if (escore->power_saving_mode != ES_POWER_LEVEL_DISABLE &&
+               escore->algo_type == PASSTHRU_VP) {
+               rc = escore_cmd(escore,
+                       (ES_SET_POWER_LEVEL << 16)|escore->power_saving_mode,
+                        &resp);
+
+               if (rc)
+                       pr_warn("%s(): Error %d setting Power Saving Level" \
+                               " resp = 0x%x\n", __func__, rc, resp);
+       }
+
        /* add umbrella base route */
        rc = add_algo_base_route(escore);
        if (!rc)
                escore_write_msg_list(escore);
 
+       escore->base_route_setup = 1;
+
+       if (escore->algo_type == PASSTHRU_VP && escore->dhwpt_enabled)
+               escore->dhwpt_capture_on = 1;
+
        memcpy(prev_cmdlist, cachedcmd_list[escore->algo_type],
                        sizeof(prev_cmdlist));
 
        /* Do necessary switch settings */
-       if (escore->algo_type == PASSTHRU_VP || escore->algo_type == DHWPT) {
-               int pri, fein;
-
-               pri = cachedcmd_list[escore->algo_type][ES_PRIMARY_MUX].reg;
-               fein = cachedcmd_list[escore->algo_type][ES_FEIN_MUX].reg;
-
-               if (escore->output_mode & OUTPUT_PO1)
-                       escore_set_switch(SWOUT0_O1);
-               if (escore->output_mode & OUTPUT_PO2)
-                       escore_set_switch(SWOUT1_O1);
-
-               if ((escore->output_mode & OUTPUT_PT_COPY) == OUTPUT_PT_COPY) {
-                       /* PT Copy use case which uses both A01 and MO2 */
-                       escore_set_switch(SWIN2_I1);
-                       escore_set_switch(SWOUT3_O1);
-                       escore_set_switch(SWOUT2_O1);
-               } else if ((escore->output_mode & OUTPUT_MIXED_MONO) ==
-                               OUTPUT_MIXED_MONO) {
-                       /* Mixed mono use case - which uses only AO1 */
-                       escore_set_switch(SWIN2_I0);
-                       escore_set_switch(SWOUT3_O1);
-               }
-
-               /* Decide the capture use-case out of three:
-                * 1. mono capture
-                * 2. stereo capture
-                * 3. mono to stereo capture
-                */
-               switch (escore->capture_mode) {
-               case MONO_CAPTURE:
-                       /* No switch settings required  - dead code */
-                       break;
-               case STEREO_CAPTURE:
-                       if (pri && fein) {
-                               /* Stereo capture */
-                               escore_set_switch(SWIN1_I0);
-                       } else if (pri) {
-                               /* mono to stereo capture */
-                               escore_set_switch(SWIN1_I1);
-                       }
-                       break;
-               }
+       rc = _es_set_algo_switch(escore);
+       if (rc) {
+               pr_err("%s(): Switch settings failed :%d\n", __func__, rc);
+               goto exit;
        }
 
        if (escore->algo_preset_one != 0) {
                usleep_range(5000, 5005);
                pr_debug("%s:add algo preset one: %d", __func__,
                                escore->algo_preset_one);
-               rc = escore_write(NULL, ES_PRESET, escore->algo_preset_one);
+               rc = escore_cmd(escore, ((ES_SET_PRESET << 16) |
+                                       (1 << ES_SC_BIT) |
+                                       escore->algo_preset_one),
+                                       &resp);
                if (rc)
                        dev_err(escore_priv.dev, "%s(): Set Algo Preset one failed:%d\n",
                                __func__, rc);
+               /* Reset algo_preset so that it is not accidently set for a
+               * diffeent route, UCM is responsible to set this algo preset
+               * for every use case
+               */
                escore->algo_preset_one = 0;
        }
 
@@ -865,16 +1018,49 @@ static int es_set_final_route(struct escore_priv *escore)
                usleep_range(5000, 5005);
                pr_debug("%s:add algo preset two: %d", __func__,
                                escore->algo_preset_two);
-               rc = escore_write(NULL, ES_PRESET, escore->algo_preset_two);
+               rc = escore_cmd(escore, ((ES_SET_PRESET << 16) |
+                                       (1 << ES_SC_BIT) |
+                                       escore->algo_preset_two),
+                                       &resp);
                if (rc)
                        dev_err(escore_priv.dev, "%s(): Set Algo Preset two failed:%d\n",
                                __func__, rc);
+               /* Reset algo_preset so that it is not accidently set for a
+               * diffeent route, UCM is responsible to set this algo preset
+               * for every use case
+               */
                escore->algo_preset_two = 0;
        }
 
+       /* Send sync command */
+       rc = escore_cmd(escore, (ES_SYNC_CMD << 16), &resp);
+       if (rc < 0)
+               pr_warn("%s(): Error %d sending sync command",
+                       __func__, rc);
+
+       if (escore->hpf_mode != 0) {
+               rc = escore_cmd(escore,
+                               (ES_SELECT_HPF_MODE << 16)|escore->hpf_mode,
+                               &resp);
+
+               if (rc) {
+                       pr_warn("%s(): Error %d selecting HPF mode" \
+                                       " resp = 0x%x\n", __func__, rc, resp);
+                       goto exit;
+               }
+       }
+
+       rc = _es_set_digital_gain(escore);
+       if (rc) {
+               pr_err("%s(): Failed to set digital gain:%d\n",
+                       __func__, rc);
+               return rc;
+       }
+
        if (cachedcmd_list[escore->algo_type][ES_ALGO_SAMPLE_RATE].reg)
-               rc = es_set_algo_rate(escore, escore->algo_type);
+               rc = _es_set_algo_rate(escore, escore->algo_type);
 
+exit:
        return rc;
 }
 
@@ -910,7 +1096,9 @@ static int es300_codec_enable_slimtx(struct snd_soc_dapm_widget *w,
                if (escore->slim_dai_data[dai_id].ch_act ==
                                escore->slim_dai_data[dai_id].ch_tot) {
 
-                       ret = es_set_final_route(escore);
+                       mutex_lock(&escore->access_lock);
+                       ret = _es_set_final_route(escore);
+                       mutex_unlock(&escore->access_lock);
                        if (!ret) {
                                ret = escore_cfg_slim_tx(escore->gen0_client,
                                        escore->slim_dai_data[dai_id].ch_num,
@@ -918,7 +1106,6 @@ static int es300_codec_enable_slimtx(struct snd_soc_dapm_widget *w,
                                        escore->slim_dai_data[dai_id].rate);
                                atomic_inc(&escore->active_streams);
                        }
-
                }
                break;
        case SND_SOC_DAPM_POST_PMD:
@@ -952,12 +1139,13 @@ static int es300_codec_enable_slimtx(struct snd_soc_dapm_widget *w,
                                pm_runtime_mark_last_busy(codec->dev->parent);
                                pm_runtime_put(codec->dev->parent);
                        }
-                       if (!ret)
-                               es_clear_route(escore);
 
                }
-               if (atomic_read(&escore->active_streams) == 0)
-                       ret = es300_codec_stop_algo(escore);
+               if (atomic_read(&escore->active_streams) == 0) {
+                       mutex_lock(&escore->access_lock);
+                       ret = _es_stop_route(escore, ES_TYPE_CAP);
+                       mutex_unlock(&escore->access_lock);
+               }
        }
        return ret;
 }
@@ -992,7 +1180,9 @@ static int es300_codec_enable_slimrx(struct snd_soc_dapm_widget *w,
                if (escore->slim_dai_data[dai_id].ch_act ==
                                escore->slim_dai_data[dai_id].ch_tot) {
 
-                       ret = es_set_final_route(escore);
+                       mutex_lock(&escore->access_lock);
+                       ret = _es_set_final_route(escore);
+                       mutex_unlock(&escore->access_lock);
                        if (!ret) {
                                ret = escore_cfg_slim_rx(escore->gen0_client,
                                        escore->slim_dai_data[dai_id].ch_num,
@@ -1000,6 +1190,7 @@ static int es300_codec_enable_slimrx(struct snd_soc_dapm_widget *w,
                                        escore->slim_dai_data[dai_id].rate);
                                atomic_inc(&escore->active_streams);
                        }
+
                }
                break;
        case SND_SOC_DAPM_POST_PMD:
@@ -1032,11 +1223,12 @@ static int es300_codec_enable_slimrx(struct snd_soc_dapm_widget *w,
                                pm_runtime_mark_last_busy(codec->dev->parent);
                                pm_runtime_put(codec->dev->parent);
                        }
-                       if (!ret)
-                               es_clear_route(escore);
                }
-               if (atomic_read(&escore->active_streams) == 0)
-                       ret = es300_codec_stop_algo(escore);
+               if (atomic_read(&escore->active_streams) == 0) {
+                       mutex_lock(&escore->access_lock);
+                       ret = _es_stop_route(escore, ES_TYPE_PB);
+                       mutex_unlock(&escore->access_lock);
+               }
        }
        return ret;
 }
@@ -1072,6 +1264,7 @@ static int es300_codec_enable_i2srx(struct snd_soc_dapm_widget *w,
 
        pr_debug("%s(): event:%d\n", __func__, event);
 
+       mutex_lock(&codec->mutex);
        switch (event) {
        case SND_SOC_DAPM_POST_PMU:
                for (j = 0; j < escore->dai_nr; j++) {
@@ -1083,13 +1276,18 @@ static int es300_codec_enable_i2srx(struct snd_soc_dapm_widget *w,
                        }
                }
 
+               pr_debug("%s: START RX PMU Active channels Act %d Total %d\n", __func__,
+                               escore->i2s_dai_data[dai_id].rx_ch_act, escore->i2s_dai_data[dai_id].rx_ch_tot);
                if (escore->i2s_dai_data[dai_id].rx_ch_act ==
                                escore->i2s_dai_data[dai_id].rx_ch_tot) {
-                       ret = es_set_final_route(escore);
-                       msleep(20);
+
+                       mutex_lock(&escore->access_lock);
+                       ret = _es_set_final_route(escore);
+                       mutex_unlock(&escore->access_lock);
+
                        atomic_inc(&escore->active_streams);
                }
-               pr_debug("%s: RX PMU Active channels %d Active streams %d\n", __func__,
+               pr_debug("%s: END RX PMU Active channels %d Active streams %d\n", __func__,
                        escore->i2s_dai_data[dai_id].rx_ch_act, escore->active_streams);
                break;
        case SND_SOC_DAPM_POST_PMD:
@@ -1102,17 +1300,39 @@ static int es300_codec_enable_i2srx(struct snd_soc_dapm_widget *w,
                        }
                }
 
+               pr_debug("%s: BEGIN RX PMD Active channels %d Active streams %d\n", __func__,
+                       escore->i2s_dai_data[dai_id].rx_ch_act, escore->active_streams);
                if (!escore->i2s_dai_data[dai_id].rx_ch_act) {
-                       es_clear_route(escore);
 
+/*
                        if (atomic_read(&escore->active_streams) &&
-                               atomic_dec_and_test(&escore->active_streams))
-                               ret = es300_codec_stop_algo(escore);
+                               atomic_dec_and_test(&escore->active_streams)) {
+                               mutex_lock(&escore->access_lock);
+                               ret = _es_stop_route(escore,ES_TYPE_PB);
+                               mutex_unlock(&escore->access_lock);
+                       }
+*/
+                       /* Decrease active streams count if non-zero */
+                       if (atomic_read(&escore->active_streams)) {
+                               atomic_dec(&escore->active_streams);
+
+                               /* If no active stream exist, or only DHWPT
+                                * stream active, call _es_stop_route() */
+                               if (!atomic_read(&escore->active_streams) ||
+                                   (atomic_read(&escore->active_streams) == 1
+                                    && escore->dhwpt_mode)) {
+                                       mutex_lock(&escore->access_lock);
+                                       ret = _es_stop_route(escore,ES_TYPE_PB);
+                                       mutex_unlock(&escore->access_lock);
+                               }
+                       }
+
                }
-               pr_debug("%s: RX PMD Active channels %d Active streams %d\n", __func__,
+               pr_debug("%s: END RX PMD Active channels %d Active streams %d\n", __func__,
                        escore->i2s_dai_data[dai_id].rx_ch_act, escore->active_streams);
                break;
        }
+       mutex_unlock(&codec->mutex);
        return ret;
 }
 static int es300_codec_enable_i2stx(struct snd_soc_dapm_widget *w,
@@ -1126,6 +1346,7 @@ static int es300_codec_enable_i2stx(struct snd_soc_dapm_widget *w,
 
        pr_debug("%s(): event:%d\n", __func__, event);
 
+       mutex_lock(&codec->mutex);
        switch (event) {
        case SND_SOC_DAPM_POST_PMU:
                for (j = 0; j < escore->dai_nr; j++) {
@@ -1137,13 +1358,18 @@ static int es300_codec_enable_i2stx(struct snd_soc_dapm_widget *w,
                        }
                }
 
+               pr_debug("%s: BEGIN TX PMU Active channels %d Active streams %d\n", __func__,
+                       escore->i2s_dai_data[dai_id].tx_ch_act, escore->active_streams);
                if (escore->i2s_dai_data[dai_id].tx_ch_act ==
                                escore->i2s_dai_data[dai_id].tx_ch_tot) {
 
-                       ret = es_set_final_route(escore);
+                       mutex_lock(&escore->access_lock);
+                       ret = _es_set_final_route(escore);
+                       mutex_unlock(&escore->access_lock);
+
                        atomic_inc(&escore->active_streams);
                }
-               pr_debug("%s: TX PMU Active channels %d Active streams %d\n", __func__,
+               pr_debug("%s: END TX PMU Active channels %d Active streams %d\n", __func__,
                        escore->i2s_dai_data[dai_id].tx_ch_act, escore->active_streams);
                break;
        case SND_SOC_DAPM_POST_PMD:
@@ -1156,17 +1382,30 @@ static int es300_codec_enable_i2stx(struct snd_soc_dapm_widget *w,
                        }
                }
 
+               pr_debug("%s: BEGIN TX PMD Active channels %d Active streams %d DHWPT mode %d\n", __func__,
+                       escore->i2s_dai_data[dai_id].tx_ch_act, escore->active_streams,escore->dhwpt_mode);
+
                if (!escore->i2s_dai_data[dai_id].tx_ch_act) {
-                       es_clear_route(escore);
+                       /* Decrease active streams count if non-zero */
+                       if (atomic_read(&escore->active_streams)) {
+                               atomic_dec(&escore->active_streams);
 
-                       if (atomic_read(&escore->active_streams) &&
-                               atomic_dec_and_test(&escore->active_streams))
-                               ret = es300_codec_stop_algo(escore);
+                               /* If no active stream exist, or only DHWPT
+                                * stream active, call _es_stop_route() */
+                               if (!atomic_read(&escore->active_streams) ||
+                                   (atomic_read(&escore->active_streams) == 1
+                                    && escore->dhwpt_mode)) {
+                                       mutex_lock(&escore->access_lock);
+                                       ret = _es_stop_route(escore,ES_TYPE_CAP);
+                                       mutex_unlock(&escore->access_lock);
+                               }
+                       }
                }
-               pr_debug("%s: TX PMD Active channels %d Active streams %d\n", __func__,
+               pr_debug("%s: END TX PMD Active channels %d Active streams %d\n", __func__,
                        escore->i2s_dai_data[dai_id].tx_ch_act, escore->active_streams);
                break;
        }
+       mutex_unlock(&codec->mutex);
        return ret;
 }
 #endif
@@ -1180,7 +1419,7 @@ static int get_noise_suppression(struct snd_kcontrol *kcontrol,
        unsigned int reg = e->reg;
        u16 value;
 
-       value = escore_read(codec, reg);
+       value = escore_read_locked(codec, reg);
 
        ucontrol->value.enumerated.item[0] = value;
 
@@ -1206,7 +1445,7 @@ static int put_noise_suppression(struct snd_kcontrol *kcontrol,
        pr_debug("%s: Noise Suppression value %u\n", __func__, value);
        value = value << 8;
 
-       return escore_write(codec, reg, value);
+       return escore_write_locked(codec, reg, value);
 }
 
 static int put_aec_mode(struct snd_kcontrol *kcontrol,
@@ -1225,7 +1464,7 @@ static int put_aec_mode(struct snd_kcontrol *kcontrol,
        }
        pr_debug("%s: AEC mode value %u\n", __func__, value);
 
-       return escore_write(codec, reg, value);
+       return escore_write_locked(codec, reg, value);
 }
 
 static int get_aec_mode(struct snd_kcontrol *kcontrol,
@@ -1237,7 +1476,7 @@ static int get_aec_mode(struct snd_kcontrol *kcontrol,
        unsigned int reg = e->reg;
        u16 value;
 
-       value = escore_read(codec, reg);
+       value = escore_read_locked(codec, reg);
 
        if (value > ES_MAX_AEC_MODE)
                pr_err("%s(): Invalid value %d\n", __func__, value);
@@ -1249,7 +1488,7 @@ static int get_aec_mode(struct snd_kcontrol *kcontrol,
        return 0;
 }
 
-static int put_az_mode(struct snd_kcontrol *kcontrol,
+static int put_af_mode(struct snd_kcontrol *kcontrol,
                struct snd_ctl_elem_value *ucontrol)
 {
        struct snd_soc_codec *codec = escore_priv.codec;
@@ -1257,19 +1496,25 @@ static int put_az_mode(struct snd_kcontrol *kcontrol,
                (struct soc_enum *)kcontrol->private_value;
        unsigned int reg = e->reg;
        unsigned int value = ucontrol->value.enumerated.item[0];
+       struct escore_priv *escore = snd_soc_codec_get_drvdata(codec);
 
-       if (value > ES_MAX_AZ_MODE) {
+       if (escore->mode != AF) {
+               pr_err("%s(): Chip not in AF state\n", __func__);
+               return -EAGAIN;
+       }
+
+       if (value > ES_MAX_AF_MODE) {
                pr_err("%s(): Invalid value %d for the control\n", __func__,
                                value);
                return -EINVAL;
        }
 
-       pr_debug("%s: Audio Zoom mode value %u\n", __func__, value);
+       pr_debug("%s: Audio Focus mode value %u\n", __func__, value);
 
-       return escore_write(codec, reg, value);
+       return escore_write_locked(codec, reg, value);
 }
 
-static int get_az_mode(struct snd_kcontrol *kcontrol,
+static int get_af_mode(struct snd_kcontrol *kcontrol,
                struct snd_ctl_elem_value *ucontrol)
 {
        struct snd_soc_codec *codec = escore_priv.codec;
@@ -1277,15 +1522,22 @@ static int get_az_mode(struct snd_kcontrol *kcontrol,
                (struct soc_enum *)kcontrol->private_value;
        unsigned int reg = e->reg;
        u16 value;
+       struct escore_priv *escore = snd_soc_codec_get_drvdata(codec);
 
-       value = escore_read(codec, reg);
+       if (escore->mode != AF) {
+               pr_err("%s(): Chip not in AF state\n", __func__);
+               return -EAGAIN;
+       }
 
-       if (value > ES_MAX_AZ_MODE)
-               pr_err("%s(): Invalid value %d\n", __func__, value);
+       value = escore_read_locked(codec, reg);
+
+       if (value > ES_MAX_AF_MODE)
+               pr_err("%s(): Invalid value %d (%d)\n",
+                      __func__, value, (signed short)(value));
 
        ucontrol->value.enumerated.item[0] = value;
 
-       pr_debug("%s: Audio Zoom mode value %u\n", __func__, value);
+       pr_debug("%s: Audio Focus mode value %u\n", __func__, value);
 
        return 0;
 }
@@ -1347,7 +1599,7 @@ static int put_cmd_compl_mode_sel(struct snd_kcontrol *kcontrol,
 
        /* Set the suppress response bit */
        cmd |= BIT(ES_SR_BIT);
-       rc = escore_cmd(escore, cmd, &resp);
+       rc = escore_cmd_locked(escore, cmd, &resp);
        if (rc < 0) {
                pr_err("%s(): Error %d to set command mode", __func__, rc);
                return rc;
@@ -1374,7 +1626,7 @@ static int es300_get_algo_state(struct snd_kcontrol *kcontrol,
 static int es300_put_algo_state(struct snd_kcontrol *kcontrol,
                struct snd_ctl_elem_value *ucontrol)
 {
-       int ret = 0, algo_type = NONE;
+       int ret = 0, algo_type = ALGO_NONE;
        struct snd_soc_codec *codec = escore_priv.codec;
        struct escore_priv *escore = snd_soc_codec_get_drvdata(codec);
        struct soc_enum *e =
@@ -1382,9 +1634,9 @@ static int es300_put_algo_state(struct snd_kcontrol *kcontrol,
        unsigned int reg = e->reg;
        unsigned int value = ucontrol->value.enumerated.item[0];
 
+       mutex_lock(&codec->mutex);
        pr_debug("%s(): %s algo :%s\n", __func__, (value) ? "Enabling" :
                        "Disabling", kcontrol->id.name);
-
        /* Use 0th array to store the algo status */
        cachedcmd_list[0][reg].reg = value;
        switch (reg) {
@@ -1400,8 +1652,14 @@ static int es300_put_algo_state(struct snd_kcontrol *kcontrol,
        case ES_ALGORITHM_PT_VP:
                algo_type = PASSTHRU_VP;
                break;
-       case ES_ALGORITHM_AZ:
-               algo_type = AUDIOZOOM;
+       case ES_ALGORITHM_AF:
+               algo_type = AUDIOFOCUS;
+               break;
+       case ES_ALGORITHM_BRG:
+               algo_type = BARGE_IN;
+               break;
+       case ES_ALGORITHM_KALAOK:
+               algo_type = KALA_OK;
                break;
        case ES_ALGORITHM_DHWPT:
                algo_type = DHWPT;
@@ -1415,8 +1673,12 @@ static int es300_put_algo_state(struct snd_kcontrol *kcontrol,
        if (ret < 0)
                goto out;
 
-       if (value)
+       if (value) {
                escore->algo_type = algo_type;
+
+               if (!atomic_read(&escore->active_streams))
+                       escore->algo_type_off = ALGO_NONE;
+       }
        else {
                /* During the disable sequence the algo_type will not be
                 * updated. Use the algo_type_off as the array index to reset
@@ -1439,6 +1701,7 @@ static int es300_put_algo_state(struct snd_kcontrol *kcontrol,
                escore->algo_type_off = algo_type;
        }
 out:
+       mutex_unlock(&codec->mutex);
        return ret;
 }
 static int es300_put_algo_rate(struct snd_kcontrol *kcontrol,
@@ -1451,7 +1714,11 @@ static int es300_put_algo_rate(struct snd_kcontrol *kcontrol,
        unsigned int reg = e->reg;
        int ret = 0;
        unsigned int value = ucontrol->value.enumerated.item[0];
+
+       mutex_lock(&codec->mutex);
        cachedcmd_list[escore->algo_type][reg].reg = value;
+       mutex_unlock(&codec->mutex);
+
        return ret;
 }
 static int get_control_enum(struct snd_kcontrol *kcontrol,
@@ -1484,9 +1751,11 @@ static int put_input_route_value(struct snd_kcontrol *kcontrol,
        int rc = 0;
        u8 algo_type;
 
+       mutex_lock(&codec->mutex);
        if (mux >= ARRAY_SIZE(proc_block_input_texts) || mux < 0) {
-               pr_err("%s(): Invalid input mux:%d Max valid value:%lu\n",
+               pr_err("%s(): Invalid input mux:%d Max valid value:%d\n",
                        __func__, mux, ARRAY_SIZE(proc_block_input_texts));
+               mutex_unlock(&codec->mutex);
                return -EINVAL;
        }
 
@@ -1497,15 +1766,20 @@ static int put_input_route_value(struct snd_kcontrol *kcontrol,
        if (!mux && atomic_read(&escore->active_streams))
                goto exit;
 
-#if (defined(CONFIG_ARCH_OMAP) || defined(CONFIG_ARCH_EXYNOS) || \
-       defined(CONFIG_X86_32) || defined(CONFIG_ARCH_TEGRA))
+#if (defined(KERNEL_VERSION_3_2_0) && defined(CONFIG_ARCH_OMAP))
+       rc = snd_soc_dapm_mux_update_power(widget, kcontrol, 1, mux, e);
+#elif (defined(CONFIG_ARCH_OMAP) || defined(CONFIG_ARCH_EXYNOS) || \
+               defined(CONFIG_X86_32) || defined(CONFIG_ARCH_TEGRA) || \
+               defined(CONFIG_ARCH_MSM8994))
        rc = snd_soc_dapm_mux_update_power(widget, kcontrol, mux, e);
 #else
        rc = snd_soc_dapm_mux_update_power(widget, kcontrol, 1, mux, e);
 #endif
 
 exit:
-       pr_debug("put input control %s (%d) val %s (%d)\n", kcontrol->id.name, reg, proc_block_input_texts[mux], mux);
+       pr_debug("put input control %s (%d) val %s\n", kcontrol->id.name,reg,
+                               proc_block_input_texts[mux]);
+       mutex_unlock(&codec->mutex);
 
        return rc;
 }
@@ -1525,7 +1799,8 @@ static int get_input_route_value(struct snd_kcontrol *kcontrol,
        /* TBD: translation */
        /* value = escore_read(NULL, reg); */
        ucontrol->value.enumerated.item[0] = value;
-       pr_debug("get input control %s (%d) val %s (%d)\n", kcontrol->id.name, reg, proc_block_input_texts[value], value);
+       pr_debug("get input control %s (%d)  val %s\n", kcontrol->id.name,reg,
+                               proc_block_input_texts[value]);
 
        return 0;
 }
@@ -1545,26 +1820,19 @@ static int put_output_route_value(struct snd_kcontrol *kcontrol,
        int prev_mux;
        u8 algo_type;
 
+       mutex_lock(&codec->mutex);
        if (mux >= ARRAY_SIZE(proc_block_output_texts) || mux < 0) {
-               pr_err("%s(): Invalid output mux:%d Max valid value:%lu\n",
+               pr_err("%s(): Invalid output mux:%d Max valid value:%d\n",
                        __func__, mux, ARRAY_SIZE(proc_block_output_texts));
+               mutex_unlock(&codec->mutex);
                return -EINVAL;
        }
        /* VP CSOUT signals Tx init and VP FEOUT signals Rx init */
-       if (escore->algo_type == VP &&
-               strncmp(proc_block_output_texts[mux], "VP CSOUT", 8) == 0) {
-               es_vp_tx = ES_VP_TX_INIT;
-       } else if (escore->algo_type == VP &&
-               strncmp(proc_block_output_texts[mux], "VP FEOUT1", 9) == 0) {
-               es_vp_rx = ES_VP_RX_INIT;
-       } else if (escore->algo_type == AUDIOZOOM &&
-                       strncmp(proc_block_output_texts[mux],
-                               "AudioZoom CSOUT", 15) == 0) {
-               es_az_tx = ES_AZ_TX_INIT;
-       } else if (escore->algo_type == AUDIOZOOM &&
-                       strncmp(proc_block_output_texts[mux],
-                               "AudioZoom AOUT1", 15) == 0) {
-               es_az_rx = ES_AZ_RX_INIT;
+       if (escore->algo_type == VP) {
+               if (mux == VP_CSOUT1)
+                       es_vp_tx = ES_VP_TX_INIT;
+               else if (mux == VP_FEOUT1)
+                       es_vp_rx = ES_VP_RX_INIT;
        }
 
        algo_type = (mux) ? escore->algo_type : escore->algo_type_off;
@@ -1574,26 +1842,29 @@ static int put_output_route_value(struct snd_kcontrol *kcontrol,
 
        /* Request of clearing the VP output */
        if (!mux && prev_mux && algo_type == VP) {
-               if (!strncmp(proc_block_output_texts[prev_mux],
-                                       "VP CSOUT", sizeof("VP CSOUT") - 1))
+               if (prev_mux == VP_CSOUT1)
                        es_vp_tx = ES_VP_NONE;
-               else if (!strncmp(proc_block_output_texts[prev_mux],
-                                       "VP FEOUT1", sizeof("VP FEOUT1") - 1))
+               else if (prev_mux == VP_FEOUT1)
                        es_vp_rx = ES_VP_NONE;
        }
 
        if (!mux && atomic_read(&escore->active_streams))
                goto exit;
 
-#if (defined(CONFIG_ARCH_OMAP) || defined(CONFIG_ARCH_EXYNOS) || \
-       defined(CONFIG_X86_32) || defined(CONFIG_ARCH_TEGRA))
+#if (defined(KERNEL_VERSION_3_2_0) && defined(CONFIG_ARCH_OMAP))
+       rc = snd_soc_dapm_mux_update_power(widget, kcontrol, 1, mux, e);
+#elif (defined(CONFIG_ARCH_OMAP) || defined(CONFIG_ARCH_EXYNOS) || \
+               defined(CONFIG_X86_32) || defined(CONFIG_ARCH_TEGRA) || \
+               defined(CONFIG_ARCH_MSM8994))
        rc = snd_soc_dapm_mux_update_power(widget, kcontrol, mux, e);
 #else
        rc = snd_soc_dapm_mux_update_power(widget, kcontrol, 1, mux, e);
 #endif
 
 exit:
-       pr_debug("put output control %s (%d) val %s (%d)\n", kcontrol->id.name, reg, proc_block_output_texts[mux], mux);
+       pr_debug("put output control %s (%d) val %s\n", kcontrol->id.name,reg,
+                               proc_block_output_texts[mux]);
+       mutex_unlock(&codec->mutex);
        return rc;
 }
 
@@ -1612,7 +1883,8 @@ static int get_output_route_value(struct snd_kcontrol *kcontrol,
        /* TBD: translation */
        /* value = escore_read(NULL, reg); */
        ucontrol->value.enumerated.item[0] = value;
-       pr_debug("get output control %s (%d)  val %s (%d)\n", kcontrol->id.name, reg, proc_block_output_texts[value], value);
+       pr_debug("get output control %s (%d) val %s\n", kcontrol->id.name,reg,
+                               proc_block_output_texts[value]);
 
        return 0;
 }
@@ -1632,17 +1904,74 @@ static int put_write_route_cmds(struct snd_kcontrol *kcontrol,
        return 0;
 }
 
+static int put_dhwpt_sel(struct snd_kcontrol *kcontrol,
+                           struct snd_ctl_elem_value *ucontrol)
+{
+       struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
+       struct escore_priv *escore = snd_soc_codec_get_drvdata(codec);
+
+       mutex_lock(&codec->mutex);
+       escore->dhwpt_enabled = ucontrol->value.enumerated.item[0];
+       pr_debug("put DHWPT enable control val %d\n", escore->dhwpt_enabled);
+
+       if (escore->dhwpt_enabled && !escore->dhwpt_mode) {
+               mutex_lock(&escore->access_lock);
+               _es_stop_route(escore, ES_TYPE_CAP);
+               mutex_unlock(&escore->access_lock);
+       }
+       mutex_unlock(&codec->mutex);
+       return 0;
+}
+
+static int get_dhwpt_sel(struct snd_kcontrol *kcontrol,
+               struct snd_ctl_elem_value *ucontrol)
+{
+       struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
+       struct escore_priv *escore = snd_soc_codec_get_drvdata(codec);
+
+       pr_debug("get DHWPT enable control val %d\n", escore->dhwpt_enabled);
+       ucontrol->value.enumerated.item[0] = escore->dhwpt_enabled;
+       return 0;
+}
+
 static int put_asr_sel(struct snd_kcontrol *kcontrol,
                            struct snd_ctl_elem_value *ucontrol)
 {
        struct snd_soc_codec *codec = escore_priv.codec;
        struct escore_priv *escore = snd_soc_codec_get_drvdata(codec);
 
+       mutex_lock(&codec->mutex);
        escore->vp_asr = ucontrol->value.enumerated.item[0];
+       mutex_unlock(&codec->mutex);
 
        return 0;
 }
 
+static int get_ambient_noise(struct snd_kcontrol *kcontrol,
+               struct snd_ctl_elem_value *ucontrol)
+{
+       struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
+       struct escore_priv *escore = snd_soc_codec_get_drvdata(codec);
+       int rc = 0;
+       u32 resp;
+
+       rc = escore_cmd_locked(escore, ES_QUERY_AMBIENT_NOISE, &resp);
+       if (rc < 0) {
+               pr_err("%s(): Error %d while reading ambient noise\n",
+                               __func__, rc);
+               return rc;
+       }
+
+       /* Ambient Noise query returns 16 bit value which is
+        * in form of 2's compliment. All the values except "max" value
+        * (i.e. 0 dB) will be negative. We need the typecasting to
+        * s16 of the value being reported to upper layers for the
+        * correctness.
+        */
+       ucontrol->value.enumerated.item[0] = (s16) (resp & 0xFFFF);
+       return rc;
+}
+
 static int get_asr_sel(struct snd_kcontrol *kcontrol,
                struct snd_ctl_elem_value *ucontrol)
 {
@@ -1659,7 +1988,10 @@ static int put_vp_aec(struct snd_kcontrol *kcontrol,
        struct snd_soc_codec *codec = escore_priv.codec;
        struct escore_priv *escore = snd_soc_codec_get_drvdata(codec);
 
+       mutex_lock(&codec->mutex);
        escore->vp_aec = ucontrol->value.enumerated.item[0];
+       mutex_unlock(&codec->mutex);
+
        return 0;
 }
 
@@ -1688,8 +2020,8 @@ static int put_reset(struct snd_kcontrol *kcontrol,
        es_d300_reset_cmdcache();
        es_vp_tx = ES_VP_NONE;
        es_vp_rx = ES_VP_NONE;
-       es_az_tx = ES_AZ_NONE;
-       es_az_rx = ES_AZ_NONE;
+       es_af_tx = ES_AF_NONE;
+       es_af_rx = ES_AF_NONE;
        return 0;
 }
 
@@ -1744,15 +2076,15 @@ static int get_pcm_port_param(struct snd_kcontrol *kcontrol,
        rc = escore_prepare_msg(escore, reg, value, (char *)msg, &msg_len,
                        ES_MSG_READ);
        if (rc) {
-               pr_err("%s(): Preparing write message failed\n", __func__);
+               pr_err("%s(): Prepare write message fail %d\n", __func__, rc);
                return rc;
        }
        /* Clear the Port info in read command */
        api_access->read_msg[0] &= ES_API_WORD(ES_GET_DEV_PARAM, 0x00ff);
 
-       rc = escore_cmd(escore, msg[0], &resp);
+       rc = escore_cmd_locked(escore, msg[0], &resp);
        if (rc < 0) {
-               pr_err("%s(): escore_cmd()", __func__);
+               pr_err("%s(): escore_cmd failed, rc = %d", __func__, rc);
                return rc;
        }
        msg[0] = escore->bus.last_response;
@@ -1795,9 +2127,9 @@ static int put_pcm_port_param(struct snd_kcontrol *kcontrol,
                        (pcm_port_id << 8));
 
        value = ucontrol->value.enumerated.item[0];
-       rc = escore_write(codec, reg, value);
+       rc = escore_write_locked(codec, reg, value);
        if (rc) {
-               pr_err("%s(): Preparing write message failed\n", __func__);
+               pr_err("%s(): Prepare write message fail %d\n", __func__, rc);
                return rc;
        }
 
@@ -1816,7 +2148,7 @@ static int get_mic_config(struct snd_kcontrol *kcontrol,
        unsigned int reg = e->reg;
        u16 value;
 
-       value = escore_read(codec, reg);
+       value = escore_read_locked(codec, reg);
 
        ucontrol->value.enumerated.item[0] = value;
 
@@ -1837,9 +2169,188 @@ static int put_mic_config(struct snd_kcontrol *kcontrol,
        pr_debug("%s: mic configuration value %u\n", __func__,
                value);
 
-       return escore_write(codec, reg, value);
+       return escore_write_locked(codec, reg, value);
+}
+
+static int get_pri_pb_mode(struct snd_kcontrol *kcontrol,
+               struct snd_ctl_elem_value *ucontrol)
+{
+       ucontrol->value.enumerated.item[0] = escore_priv.pri_pb_mode;
+       return 0;
+}
+
+static int _es_update_pt_vp_pri_switches(struct escore_priv *escore)
+{
+       int rc = 0;
+
+       switch (escore->pri_pb_mode) {
+       case PRI_PB_OFF:
+               es_d300_switch[SWOUT0].value = 0;
+               es_d300_switch[SWOUT1].value = 0;
+               break;
+       case PRI_PB_STEREO:
+               es_d300_switch[SWOUT0].value = 1;
+               es_d300_switch[SWOUT1].value = 1;
+               break;
+       }
+       /* Set the switches for if route is already active */
+       if (atomic_read(&escore->active_streams)) {
+               rc = _es_set_switch(SWOUT0);
+               if (!rc)
+                       rc = _es_set_switch(SWOUT1);
+       }
+
+       return rc;
+}
+
+static int _es_update_pt_vp_sec_switches(struct escore_priv *escore)
+{
+       int rc = 0;
+
+       switch (escore->sec_pb_mode) {
+       case SEC_PB_OFF:
+               es_d300_switch[SWIN2].value = 0;
+               es_d300_switch[SWOUT2].value = 0;
+               es_d300_switch[SWOUT3].value = 0;
+               break;
+       case SEC_PB_MIXED_MONO:
+               es_d300_switch[SWIN2].value = 0;
+               es_d300_switch[SWOUT2].value = 0;
+               es_d300_switch[SWOUT3].value = 1;
+               break;
+       case SEC_PB_STEREO:
+               es_d300_switch[SWIN2].value = 1;
+               es_d300_switch[SWOUT2].value = 1;
+               es_d300_switch[SWOUT3].value = 1;
+               break;
+       }
+       /* Set the switches for if route is already active */
+       if (atomic_read(&escore->active_streams)) {
+               rc = _es_set_switch(SWIN2);
+               if (!rc)
+                       rc = _es_set_switch(SWOUT2);
+               if (!rc)
+                       rc = _es_set_switch(SWOUT3);
+       }
+
+       return rc;
+}
+
+static int _es_update_bargein_pri_switches(struct escore_priv *escore)
+{
+       int rc = 0;
+
+       switch (escore->pri_pb_mode) {
+       case PRI_PB_OFF:
+               es_d300_switch[SWOUT0].value = 0;
+               es_d300_switch[SWOUT1].value = 0;
+               break;
+       case PRI_PB_STEREO:
+               es_d300_switch[SWOUT0].value = 1;
+               es_d300_switch[SWOUT1].value = 1;
+               break;
+       }
+       /* Set the switches for if route is already active */
+       if (atomic_read(&escore->active_streams)) {
+               rc = _es_set_switch(SWOUT0);
+               if (!rc)
+                       rc = _es_set_switch(SWOUT1);
+       }
+
+       return rc;
+}
+
+static int _es_update_bargein_sec_switches(struct escore_priv *escore)
+{
+       int rc = 0;
+
+       switch (escore->sec_pb_mode) {
+       case SEC_PB_OFF:
+               es_d300_switch[SWOUT2].value = 0;
+               break;
+       case SEC_PB_MIXED_MONO:
+               es_d300_switch[SWOUT2].value = 1;
+               break;
+       case SEC_PB_STEREO:
+               pr_warn("%s(): Secondary stereo output not supported\n",
+                               __func__);
+               break;
+       }
+       /* Set the switches for if route is already active */
+       if (atomic_read(&escore->active_streams))
+               rc = _es_set_switch(SWOUT2);
+
+       return rc;
+}
+
+static int put_pri_pb_mode(struct snd_kcontrol *kcontrol,
+               struct snd_ctl_elem_value *ucontrol)
+{
+       struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
+       struct escore_priv *escore = snd_soc_codec_get_drvdata(codec);
+       int rc = 0;
+       int algo_type = escore->algo_type;
+
+       escore->pri_pb_mode = ucontrol->value.enumerated.item[0];
+
+       mutex_lock(&codec->mutex);
+       mutex_lock(&escore->access_lock);
+       switch (algo_type) {
+       case PASSTHRU_VP:
+               rc = _es_update_pt_vp_pri_switches(escore);
+               break;
+       case BARGE_IN:
+       case AUDIOFOCUS:
+               rc = _es_update_bargein_pri_switches(escore);
+               break;
+       default:
+               pr_err("%s(): Invalid algo type :%d\n", __func__, algo_type);
+               break;
+       }
+       mutex_unlock(&escore->access_lock);
+       mutex_unlock(&codec->mutex);
+
+       return rc;
+}
+
+static int get_sec_pb_mode(struct snd_kcontrol *kcontrol,
+               struct snd_ctl_elem_value *ucontrol)
+{
+       ucontrol->value.enumerated.item[0] = escore_priv.sec_pb_mode;
+       return 0;
+}
+
+static int put_sec_pb_mode(struct snd_kcontrol *kcontrol,
+               struct snd_ctl_elem_value *ucontrol)
+{
+       struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
+       struct escore_priv *escore = snd_soc_codec_get_drvdata(codec);
+       int rc = 0;
+       int algo_type = escore->algo_type;
+
+       escore->sec_pb_mode = ucontrol->value.enumerated.item[0];
+
+       mutex_lock(&codec->mutex);
+       mutex_lock(&escore->access_lock);
+       switch (algo_type) {
+       case PASSTHRU_VP:
+               rc = _es_update_pt_vp_sec_switches(escore);
+               break;
+       case BARGE_IN:
+       case AUDIOFOCUS:
+               rc = _es_update_bargein_sec_switches(escore);
+               break;
+       default:
+               pr_err("%s(): Invalid algo type :%d\n", __func__, algo_type);
+               break;
+       }
+       mutex_unlock(&escore->access_lock);
+       mutex_unlock(&codec->mutex);
+
+       return rc;
 }
 
+
 static int get_lp_mode(struct snd_kcontrol *kcontrol,
                struct snd_ctl_elem_value *ucontrol)
 {
@@ -1873,13 +2384,15 @@ static int put_lp_route(struct snd_kcontrol *kcontrol,
                pr_debug("%s(): loopback mode is not enabled\n", __func__);
                return 0;
        }
+       mutex_lock(&escore->access_lock);
        if (!value) {
                pr_debug("%s(): discard cached list\n", __func__);
-               ret = es300_codec_stop_algo(escore);
+               ret = _es_stop_route(escore, ES_TYPE_NONE);
        } else {
                pr_debug("%s(): commit cached list\n", __func__);
-               ret = es_set_final_route(escore);
+               ret = _es_set_final_route(escore);
        }
+       mutex_unlock(&escore->access_lock);
        return ret;
 }
 
@@ -1893,28 +2406,31 @@ static int put_preset_value_one(struct snd_kcontrol *kcontrol,
 
        value = ucontrol->value.integer.value[0];
 
-       escore->algo_preset_one = value;
+       mutex_lock(&codec->mutex);
+       escore->algo_preset_one = (u16) value;
 
-       /* Ignore Preset ID 0 and don't send command to device,5
+       /* Ignore Preset ID 0 and don't send command to device,
         * but reset algo_preset value so that next preset value
         * can be set properly. */
-       if (!escore->algo_preset_one) {
+       if(!escore->algo_preset_one) {
                dev_dbg(escore_priv.dev,
-                       "%s(): Algo Preset %d is not supported, Skipped\n",
+                       "%s(): Preset ID %d is not supported\n",
                        __func__, value);
+               mutex_unlock(&codec->mutex);
                return rc;
        }
 
-       if (atomic_read(&escore->active_streams)) {
+       if (atomic_read(&escore->active_streams) && !escore->dhwpt_mode) {
                /* Set the preset immediately */
                usleep_range(5000, 5005);
                pr_debug("%s:add algo preset one: %d", __func__,
                                escore->algo_preset_one);
-               rc = escore_write(NULL, ES_PRESET, escore->algo_preset_one);
+               rc = escore_write_locked(NULL, ES_PRESET, escore->algo_preset_one);
                if (rc)
-                       pr_err("%s(): Set Algo Preset one failed:%d\n",
+                       dev_err(escore_priv.dev, "%s(): Set Preset one failed:%d\n",
                                __func__, rc);
        }
+       mutex_unlock(&codec->mutex);
 
        return rc;
 }
@@ -1939,29 +2455,31 @@ static int put_preset_value_two(struct snd_kcontrol *kcontrol,
 
        value = ucontrol->value.integer.value[0];
 
-       escore->algo_preset_two = value;
+       mutex_lock(&codec->mutex);
+       escore->algo_preset_two = (u16) value;
 
-       /* Ignore Preset ID 0 and don't send command to device,5
+       /* Ignore Preset ID 0 and don't send command to device,
         * but reset algo_preset value so that next preset value
         * can be set properly. */
-       if (!escore->algo_preset_two) {
+       if(!escore->algo_preset_two) {
                dev_dbg(escore_priv.dev,
-                       "%s(): Algo Preset %d is not supported, Skipped\n",
+                       "%s(): Preset ID %d is not supported\n",
                        __func__, value);
+               mutex_unlock(&codec->mutex);
                return rc;
        }
 
-       if (atomic_read(&escore->active_streams)) {
+       if (atomic_read(&escore->active_streams) && !escore->dhwpt_mode) {
                /* Set the preset immediately */
                usleep_range(5000, 5005);
                pr_debug("%s:add algo preset two: %d", __func__,
                                escore->algo_preset_two);
-               rc = escore_write(NULL, ES_PRESET, escore->algo_preset_two);
+               rc = escore_write_locked(NULL, ES_PRESET, escore->algo_preset_two);
                if (rc)
-                       pr_err("%s(): Set Algo Preset two failed:%d\n",
+                       dev_err(escore_priv.dev, "%s(): Set Preset two failed:%d\n",
                                __func__, rc);
        }
-
+       mutex_unlock(&codec->mutex);
        return rc;
 }
 
@@ -1975,7 +2493,75 @@ static int get_preset_value_two(struct snd_kcontrol *kcontrol,
        return 0;
 }
 
-static const char * const algorithm_texts[] = {
+
+static int get_vp_meters(struct snd_kcontrol *kcontrol,
+               struct snd_ctl_elem_value *ucontrol)
+{
+       struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
+       struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
+       unsigned int reg = e->reg;
+       int rc;
+
+       rc = escore_read_locked(codec, reg);
+       if (rc < 0) {
+               pr_err("%s(): Failed to read VP Meters value :%d\n",
+                               __func__, rc);
+               return rc;
+       }
+
+       ucontrol->value.enumerated.item[0] = (unsigned int) rc;
+
+       return 0;
+}
+
+static int put_vp_meters(struct snd_kcontrol *kcontrol,
+               struct snd_ctl_elem_value *ucontrol)
+{
+       struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
+       struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
+       unsigned int reg = e->reg, value;
+       int rc;
+
+       value = ucontrol->value.enumerated.item[0];
+
+       pr_debug("%s: %s VP Meters\n", __func__,
+                       (value) ? "Enable" : "Disable");
+
+       rc = escore_write_locked(codec, reg, value);
+
+       return rc;
+}
+
+static int get_hpf_mode(struct snd_kcontrol *kcontrol,
+                struct snd_ctl_elem_value *ucontrol)
+{
+       struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
+       struct escore_priv *escore = snd_soc_codec_get_drvdata(codec);
+
+       ucontrol->value.enumerated.item[0] = escore->hpf_mode;
+
+       pr_debug("%s(): HPF mode Get:%d\n", __func__, escore->hpf_mode);
+       return 0;
+}
+
+static int put_hpf_mode(struct snd_kcontrol *kcontrol,
+                struct snd_ctl_elem_value *ucontrol)
+{
+       struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
+       struct escore_priv *escore = snd_soc_codec_get_drvdata(codec);
+       int ret = 0;
+       int value = ucontrol->value.enumerated.item[0];
+
+       pr_debug("%s(): HPF mode Put:%d\n", __func__, value);
+
+       mutex_lock(&codec->mutex);
+       escore->hpf_mode = value;
+       mutex_unlock(&codec->mutex);
+
+       return ret;
+}
+
+static const char * const off_on_texts[] = {
        "Off", "On"
 };
 
@@ -1999,28 +2585,37 @@ static const struct soc_enum pcm_port_sel_enum =
 
 static const struct soc_enum vp_algorithm_enum =
        SOC_ENUM_SINGLE(ES_ALGORITHM_VP, 0,
-                       ARRAY_SIZE(algorithm_texts),
-                       algorithm_texts);
+                       ARRAY_SIZE(off_on_texts),
+                       off_on_texts);
 static const struct soc_enum mm_algorithm_enum =
        SOC_ENUM_SINGLE(ES_ALGORITHM_MM, 0,
-                       ARRAY_SIZE(algorithm_texts),
-                       algorithm_texts);
+                       ARRAY_SIZE(off_on_texts),
+                       off_on_texts);
 static const struct soc_enum pt_vp_algorithm_enum =
        SOC_ENUM_SINGLE(ES_ALGORITHM_PT_VP, 0,
-                       ARRAY_SIZE(algorithm_texts),
-                       algorithm_texts);
+                       ARRAY_SIZE(off_on_texts),
+                       off_on_texts);
 static const struct soc_enum pass_algorithm_enum =
        SOC_ENUM_SINGLE(ES_ALGORITHM_PT, 0,
-                       ARRAY_SIZE(algorithm_texts),
-                       algorithm_texts);
-static const struct soc_enum az_algorithm_enum =
-       SOC_ENUM_SINGLE(ES_ALGORITHM_AZ, 0,
-                       ARRAY_SIZE(algorithm_texts),
-                       algorithm_texts);
+                       ARRAY_SIZE(off_on_texts),
+                       off_on_texts);
+static const struct soc_enum af_algorithm_enum =
+       SOC_ENUM_SINGLE(ES_ALGORITHM_AF, 0,
+                       ARRAY_SIZE(off_on_texts),
+                       off_on_texts);
+static const struct soc_enum brg_algorithm_enum =
+       SOC_ENUM_SINGLE(ES_ALGORITHM_BRG, 0,
+                       ARRAY_SIZE(off_on_texts),
+                       off_on_texts);
+static const struct soc_enum kalaok_algorithm_enum =
+       SOC_ENUM_SINGLE(ES_ALGORITHM_KALAOK, 0,
+                       ARRAY_SIZE(off_on_texts),
+                       off_on_texts);
 static const struct soc_enum dhwpt_algorithm_enum =
        SOC_ENUM_SINGLE(ES_ALGORITHM_DHWPT, 0,
-                       ARRAY_SIZE(algorithm_texts),
-                       algorithm_texts);
+                       ARRAY_SIZE(off_on_texts),
+                       off_on_texts);
+
 
 static const char * const es755_algo_rates_text[] = {
        "None", "SR_8k", "SR_16k", "SR_24k", "SR_48k", "SR_96k", "SR_192k",
@@ -2031,14 +2626,10 @@ static const struct soc_enum algorithm_rate_enum =
                        ARRAY_SIZE(es755_algo_rates_text),
                        es755_algo_rates_text);
 
-static const char * const noise_suppression_texts[] = {
-       "Off", "On"
-};
-
 static const struct soc_enum noise_suppression_enum =
        SOC_ENUM_SINGLE(ES_SET_NS, 0,
-                       ARRAY_SIZE(noise_suppression_texts),
-                       noise_suppression_texts);
+                       ARRAY_SIZE(off_on_texts),
+                       off_on_texts);
 
 static const char * const mic_config_texts[] = {
        "CT Multi-mic", "FT Multi-mic", "DV 1-mic", "EXT 1-mic", "BT 1-mic",
@@ -2061,36 +2652,52 @@ static const struct soc_enum aec_mode_enum =
                ARRAY_SIZE(aec_mode_texts),
                aec_mode_texts);
 
+static const struct soc_enum vp_aec_enum =
+       SOC_ENUM_SINGLE(SND_SOC_NOPM, 0, ARRAY_SIZE(off_on_texts),
+                       off_on_texts);
 
-static const char * const es755_audio_zoom_texts[] = {
+
+static const char * const es755_audio_focus_texts[] = {
        "Narrator", "Scene", "Narration"
 };
 
-static const struct soc_enum es755_az_mode_enum =
-       SOC_ENUM_SINGLE(ES_AZ_MODE, 0, ARRAY_SIZE(es755_audio_zoom_texts),
-                       es755_audio_zoom_texts);
+static const struct soc_enum es755_af_mode_enum =
+       SOC_ENUM_SINGLE(ES_AF_MODE, 0, ARRAY_SIZE(es755_audio_focus_texts),
+                       es755_audio_focus_texts);
 
-static const char * const lp_mode_texts[] = {
-       "Off", "On"
-};
 static const struct soc_enum lp_mode_enum =
-       SOC_ENUM_SINGLE(SND_SOC_NOPM, 0, ARRAY_SIZE(lp_mode_texts),
-                       lp_mode_texts);
+       SOC_ENUM_SINGLE(SND_SOC_NOPM, 0, ARRAY_SIZE(off_on_texts),
+                       off_on_texts);
 
 static const char * const lp_commit_texts[] = {
        "Discard", "Commit"
 };
+
+static const char * const hpf_modes[] = {
+       "NONE", "FEOUT1", "FEOUT2", "FEOUT12", "AUDOUT1",
+       "AUDOUT2", "AUDOUT12", "PASSOUT1", "PASSOUT2",
+       "PASSOUT12", "PASSOUT3", "PASSOUT4", "PASSOUT34"
+};
+
 static const struct soc_enum lp_commit_enum =
        SOC_ENUM_SINGLE(SND_SOC_NOPM, 0, ARRAY_SIZE(lp_commit_texts),
                        lp_commit_texts);
 
-static const char * const vp_aec_texts[] = {
-       "Off", "On"
-};
-static const struct soc_enum vp_aec_enum =
-       SOC_ENUM_SINGLE(SND_SOC_NOPM, 0, ARRAY_SIZE(vp_aec_texts),
-                       vp_aec_texts);
+static const struct soc_enum pri_pb_mode_enum =
+       SOC_ENUM_SINGLE(SND_SOC_NOPM, 0, ARRAY_SIZE(pri_pb_mode_texts),
+                       pri_pb_mode_texts);
+
+static const struct soc_enum sec_pb_mode_enum =
+       SOC_ENUM_SINGLE(SND_SOC_NOPM, 0, ARRAY_SIZE(sec_pb_mode_texts),
+                       sec_pb_mode_texts);
+
+static const struct soc_enum vp_meters_enum =
+       SOC_ENUM_SINGLE(ES_VP_METERS, 0, ARRAY_SIZE(off_on_texts),
+                       off_on_texts);
 
+static const struct soc_enum hpf_modes_enum =
+       SOC_ENUM_SINGLE(SND_SOC_NOPM, 0, ARRAY_SIZE(hpf_modes),
+                       hpf_modes);
 
 static const struct snd_kcontrol_new es_d300_snd_controls[] = {
        SOC_ENUM_EXT("VP Algorithm", vp_algorithm_enum,
@@ -2101,13 +2708,19 @@ static const struct snd_kcontrol_new es_d300_snd_controls[] = {
                         es300_get_algo_state, es300_put_algo_state),
        SOC_ENUM_EXT("PT Algorithm", pass_algorithm_enum,
                         es300_get_algo_state, es300_put_algo_state),
-       SOC_ENUM_EXT("AZ Algorithm", az_algorithm_enum,
+       SOC_ENUM_EXT("AF Algorithm", af_algorithm_enum,
+                        es300_get_algo_state, es300_put_algo_state),
+       SOC_ENUM_EXT("BRG Algorithm", brg_algorithm_enum,
+                        es300_get_algo_state, es300_put_algo_state),
+       SOC_ENUM_EXT("KALAOK Algorithm", kalaok_algorithm_enum,
                         es300_get_algo_state, es300_put_algo_state),
        SOC_ENUM_EXT("DHWPT Algorithm", dhwpt_algorithm_enum,
                         es300_get_algo_state, es300_put_algo_state),
 
        SOC_ENUM_EXT("Algorithm Rate", algorithm_rate_enum,
                         get_control_enum, es300_put_algo_rate),
+       SOC_SINGLE_EXT("DHWPT Enable", SND_SOC_NOPM, 0, 1, 0,
+                       get_dhwpt_sel, put_dhwpt_sel),
        SOC_SINGLE_EXT("ASR", SND_SOC_NOPM, 0, 1, 0,
                         get_asr_sel, put_asr_sel),
        SOC_SINGLE_EXT("Write Route Cmds", SND_SOC_NOPM, 0, 1, 0,
@@ -2118,8 +2731,8 @@ static const struct snd_kcontrol_new es_d300_snd_controls[] = {
                        get_noise_suppression, put_noise_suppression),
        SOC_ENUM_EXT("Mic Config", mic_config_enum,
                        get_mic_config, put_mic_config),
-       SOC_ENUM_EXT("Audio Zoom", es755_az_mode_enum,
-                       get_az_mode, put_az_mode),
+       SOC_ENUM_EXT("Audio Focus Mode", es755_af_mode_enum,
+                       get_af_mode, put_af_mode),
        SOC_ENUM_EXT("PCM Port Selection", pcm_port_sel_enum,
                        get_control_enum, put_pcm_port_sel),
        SOC_ENUM_EXT("Command Mode Selection", cmd_compl_mode_sel_enum,
@@ -2167,8 +2780,26 @@ static const struct snd_kcontrol_new es_d300_snd_controls[] = {
        SOC_SINGLE_EXT("Algo Preset 2",
                        SND_SOC_NOPM, 0, 65535, 0, get_preset_value_two,
                        put_preset_value_two),
+       SOC_ENUM_EXT("PRI Playback Mode", pri_pb_mode_enum,
+                        get_pri_pb_mode, put_pri_pb_mode),
+       SOC_ENUM_EXT("SEC Playback Mode", sec_pb_mode_enum,
+                        get_sec_pb_mode, put_sec_pb_mode),
        SOC_ENUM_EXT("VP AEC", vp_aec_enum,
                         get_vp_aec, put_vp_aec),
+
+       /* The range of Ambient Noise starts from 0dB (Max) down to
+        * -96dB (Min). However, the kcontrol framework range start from
+        *  0 (Min) to XX (positive Max). We made this adjustment to use minimum
+        *  value of "Ambient Noise" value as the "max" field in kcontrol
+        *  declaration so that we get range of 0 to -96 (in dB).
+        */
+       SOC_SINGLE_EXT("Ambient Noise", SND_SOC_NOPM, 0, ES_MIN_NOISE_DB, 0,
+                        get_ambient_noise, NULL),
+       SOC_ENUM_EXT("VP Meters", vp_meters_enum,
+                        get_vp_meters, put_vp_meters),
+       SOC_ENUM_EXT("HPF Endpoint", hpf_modes_enum,
+                       get_hpf_mode, put_hpf_mode),
+
 };
 
 static const struct soc_enum vp_pri_enum =
@@ -2330,36 +2961,28 @@ static const struct soc_enum pass_audin4_enum =
 static const struct snd_kcontrol_new dapm_pass_audin4_control =
        SOC_DAPM_ENUM_EXT("Pass AUDIN4 MUX Mux", pass_audin4_enum,
                          get_input_route_value, put_input_route_value);
-static const struct soc_enum az_pri_enum =
-       SOC_ENUM_SINGLE(ES_AZ_PRI_MUX, 0,
+static const struct soc_enum af_pri_enum =
+       SOC_ENUM_SINGLE(ES_AF_PRI_MUX, 0,
                     ARRAY_SIZE(proc_block_input_texts),
                     proc_block_input_texts);
-static const struct snd_kcontrol_new dapm_az_pri_control =
-       SOC_DAPM_ENUM_EXT("AudioZoom Primary MUX Mux", az_pri_enum,
+static const struct snd_kcontrol_new dapm_af_pri_control =
+       SOC_DAPM_ENUM_EXT("AudioFocus Primary MUX Mux", af_pri_enum,
                          get_input_route_value, put_input_route_value);
 
-static const struct soc_enum az_sec_enum =
-       SOC_ENUM_SINGLE(ES_AZ_SEC_MUX, 0,
+static const struct soc_enum af_sec_enum =
+       SOC_ENUM_SINGLE(ES_AF_SEC_MUX, 0,
                     ARRAY_SIZE(proc_block_input_texts),
                     proc_block_input_texts);
-static const struct snd_kcontrol_new dapm_az_sec_control =
-       SOC_DAPM_ENUM_EXT("AudioZoom Secondary MUX Mux", az_sec_enum,
+static const struct snd_kcontrol_new dapm_af_sec_control =
+       SOC_DAPM_ENUM_EXT("AudioFocus Secondary MUX Mux", af_sec_enum,
                          get_input_route_value, put_input_route_value);
 
-static const struct soc_enum az_ter_enum =
-       SOC_ENUM_SINGLE(ES_AZ_TER_MUX, 0,
+static const struct soc_enum af_ter_enum =
+       SOC_ENUM_SINGLE(ES_AF_TER_MUX, 0,
                     ARRAY_SIZE(proc_block_input_texts),
                     proc_block_input_texts);
-static const struct snd_kcontrol_new dapm_az_ter_control =
-       SOC_DAPM_ENUM_EXT("AudioZoom Tertiary MUX Mux", az_ter_enum,
-                         get_input_route_value, put_input_route_value);
-
-static const struct soc_enum az_ai1_enum =
-       SOC_ENUM_SINGLE(ES_AZ_AI1_MUX, 0,
-                    ARRAY_SIZE(proc_block_input_texts),
-                    proc_block_input_texts);
-static const struct snd_kcontrol_new dapm_az_ai1_control =
-       SOC_DAPM_ENUM_EXT("AudioZoom AI1 MUX Mux", az_ai1_enum,
+static const struct snd_kcontrol_new dapm_af_ter_control =
+       SOC_DAPM_ENUM_EXT("AudioFocus Tertiary MUX Mux", af_ter_enum,
                          get_input_route_value, put_input_route_value);
 
 static const struct soc_enum pcm0_0_enum =
@@ -2710,15 +3333,13 @@ static const struct snd_soc_dapm_widget es_d300_dapm_widgets[] = {
                        &dapm_mm_passin2_control),
 
 
-       /* AudioZoom */
-       SND_SOC_DAPM_MUX("AudioZoom Primary MUX", SND_SOC_NOPM, 0, 0,
-                       &dapm_az_pri_control),
-       SND_SOC_DAPM_MUX("AudioZoom Secondary MUX", SND_SOC_NOPM, 0, 0,
-                       &dapm_az_sec_control),
-       SND_SOC_DAPM_MUX("AudioZoom Teritary MUX", SND_SOC_NOPM, 0, 0,
-                       &dapm_az_ter_control),
-       SND_SOC_DAPM_MUX("AudioZoom AI1 MUX", SND_SOC_NOPM, 0, 0,
-                       &dapm_az_ai1_control),
+       /* AudioFocus */
+       SND_SOC_DAPM_MUX("AudioFocus Primary MUX", SND_SOC_NOPM, 0, 0,
+                       &dapm_af_pri_control),
+       SND_SOC_DAPM_MUX("AudioFocus Secondary MUX", SND_SOC_NOPM, 0, 0,
+                       &dapm_af_sec_control),
+       SND_SOC_DAPM_MUX("AudioFocus Teritary MUX", SND_SOC_NOPM, 0, 0,
+                       &dapm_af_ter_control),
 
        SND_SOC_DAPM_MUX("PCM0.0 MUX", SND_SOC_NOPM, 0, 0,
                         &dapm_pcm0_0_control),
@@ -2785,10 +3406,10 @@ static const struct snd_soc_dapm_widget es_d300_dapm_widgets[] = {
        SND_SOC_DAPM_MIXER("Pass AUDOUT3 Mixer", SND_SOC_NOPM, 0, 0, NULL, 0),
        SND_SOC_DAPM_MIXER("Pass AUDOUT4 Mixer", SND_SOC_NOPM, 0, 0, NULL, 0),
        SND_SOC_DAPM_MIXER("Pass AO1 Mixer", SND_SOC_NOPM, 0, 0, NULL, 0),
-       SND_SOC_DAPM_MIXER("Pass MO2 Mixer", SND_SOC_NOPM, 0, 0, NULL, 0),
-       SND_SOC_DAPM_MIXER("AudioZoom CSOUT Mixer", SND_SOC_NOPM,
+       SND_SOC_DAPM_MIXER("Pass AO2 Mixer", SND_SOC_NOPM, 0, 0, NULL, 0),
+       SND_SOC_DAPM_MIXER("AudioFocus CSOUT1 Mixer", SND_SOC_NOPM,
                        0, 0, NULL, 0),
-       SND_SOC_DAPM_MIXER("AudioZoom AOUT1 Mixer", SND_SOC_NOPM,
+       SND_SOC_DAPM_MIXER("AudioFocus CSOUT2 Mixer", SND_SOC_NOPM,
                        0, 0, NULL, 0),
        SND_SOC_DAPM_OUTPUT("PCM PORT A.0"),
        SND_SOC_DAPM_OUTPUT("PCM PORT A.1"),
@@ -3062,6 +3683,7 @@ static const struct snd_soc_dapm_route intercon[] = {
        {"VP CSOUT2 Mixer", NULL, "VP Secondary MUX"},
        {"VP CSOUT2 Mixer", NULL, "VP Teritary MUX"},
        {"VP CSOUT2 Mixer", NULL, "VP AECREF MUX"},
+       {"VP CSOUT2 Mixer", NULL, "VP FEIN MUX"},
        {"VP FEOUT1 Mixer", NULL, "VP FEIN MUX"},
        {"VP FEOUT2 Mixer", NULL, "VP FEIN2 MUX"},
        {"VP FEOUT1 Mixer", NULL, "VP UITONE1 MUX"},
@@ -3375,144 +3997,116 @@ static const struct snd_soc_dapm_route intercon[] = {
        {"Pass AUDOUT4 Mixer", NULL, "Pass AUDIN4 MUX"},
        {"Pass AO1 Mixer", NULL, "Pass AUDIN1 MUX"},
        {"Pass AO1 Mixer", NULL, "Pass AUDIN2 MUX"},
-       {"Pass MO2 Mixer", NULL, "Pass AUDIN2 MUX"},
-
-       {"AudioZoom Primary MUX", "PCM0.0", "PCM0.0 RX"},
-       {"AudioZoom Primary MUX", "PCM0.1", "PCM0.1 RX"},
-       {"AudioZoom Primary MUX", "PCM0.2", "PCM0.2 RX"},
-       {"AudioZoom Primary MUX", "PCM0.3", "PCM0.3 RX"},
-       {"AudioZoom Primary MUX", "PCM1.0", "PCM1.0 RX"},
-       {"AudioZoom Primary MUX", "PCM1.1", "PCM1.1 RX"},
-       {"AudioZoom Primary MUX", "PCM1.2", "PCM1.2 RX"},
-       {"AudioZoom Primary MUX", "PCM1.3", "PCM1.3 RX"},
-       {"AudioZoom Primary MUX", "PCM2.0", "PCM2.0 RX"},
-       {"AudioZoom Primary MUX", "PCM2.1", "PCM2.1 RX"},
-       {"AudioZoom Primary MUX", "PCM2.2", "PCM2.2 RX"},
-       {"AudioZoom Primary MUX", "PCM2.3", "PCM2.3 RX"},
-       {"AudioZoom Primary MUX", "PDMI0", "PDMI0"},
-       {"AudioZoom Primary MUX", "PDMI1", "PDMI1"},
-       {"AudioZoom Primary MUX", "PDMI2", "PDMI2"},
-       {"AudioZoom Primary MUX", "PDMI3", "PDMI3"},
-       {"AudioZoom Primary MUX", "SBUS.RX0", "SBUS.RX0"},
-       {"AudioZoom Primary MUX", "SBUS.RX1", "SBUS.RX1"},
-       {"AudioZoom Primary MUX", "SBUS.RX2", "SBUS.RX2"},
-       {"AudioZoom Primary MUX", "SBUS.RX3", "SBUS.RX3"},
-       {"AudioZoom Primary MUX", "SBUS.RX4", "SBUS.RX4"},
-       {"AudioZoom Primary MUX", "SBUS.RX5", "SBUS.RX5"},
-       {"AudioZoom Primary MUX", "SBUS.RX6", "SBUS.RX6"},
-       {"AudioZoom Primary MUX", "SBUS.RX7", "SBUS.RX7"},
-       {"AudioZoom Primary MUX", "SBUS.RX8", "SBUS.RX8"},
-       {"AudioZoom Primary MUX", "SBUS.RX9", "SBUS.RX9"},
-       {"AudioZoom Primary MUX", "ADC0", "ADC0"},
-       {"AudioZoom Primary MUX", "ADC1", "ADC1"},
-       {"AudioZoom Primary MUX", "ADC2", "ADC2"},
-       {"AudioZoom Primary MUX", "ADC3", "ADC3"},
-
-       {"AudioZoom Secondary MUX", "PCM0.0", "PCM0.0 RX"},
-       {"AudioZoom Secondary MUX", "PCM0.1", "PCM0.1 RX"},
-       {"AudioZoom Secondary MUX", "PCM0.2", "PCM0.2 RX"},
-       {"AudioZoom Secondary MUX", "PCM0.3", "PCM0.3 RX"},
-       {"AudioZoom Secondary MUX", "PCM1.0", "PCM1.0 RX"},
-       {"AudioZoom Secondary MUX", "PCM1.1", "PCM1.1 RX"},
-       {"AudioZoom Secondary MUX", "PCM1.2", "PCM1.2 RX"},
-       {"AudioZoom Secondary MUX", "PCM1.3", "PCM1.3 RX"},
-       {"AudioZoom Secondary MUX", "PCM2.0", "PCM2.0 RX"},
-       {"AudioZoom Secondary MUX", "PCM2.1", "PCM2.1 RX"},
-       {"AudioZoom Secondary MUX", "PCM2.2", "PCM2.2 RX"},
-       {"AudioZoom Secondary MUX", "PCM2.3", "PCM2.3 RX"},
-       {"AudioZoom Secondary MUX", "PDMI0", "PDMI0"},
-       {"AudioZoom Secondary MUX", "PDMI1", "PDMI1"},
-       {"AudioZoom Secondary MUX", "PDMI2", "PDMI2"},
-       {"AudioZoom Secondary MUX", "PDMI3", "PDMI3"},
-       {"AudioZoom Secondary MUX", "SBUS.RX0", "SBUS.RX0"},
-       {"AudioZoom Secondary MUX", "SBUS.RX1", "SBUS.RX1"},
-       {"AudioZoom Secondary MUX", "SBUS.RX2", "SBUS.RX2"},
-       {"AudioZoom Secondary MUX", "SBUS.RX3", "SBUS.RX3"},
-       {"AudioZoom Secondary MUX", "SBUS.RX4", "SBUS.RX4"},
-       {"AudioZoom Secondary MUX", "SBUS.RX5", "SBUS.RX5"},
-       {"AudioZoom Secondary MUX", "SBUS.RX6", "SBUS.RX6"},
-       {"AudioZoom Secondary MUX", "SBUS.RX7", "SBUS.RX7"},
-       {"AudioZoom Secondary MUX", "SBUS.RX8", "SBUS.RX8"},
-       {"AudioZoom Secondary MUX", "SBUS.RX9", "SBUS.RX9"},
-       {"AudioZoom Secondary MUX", "ADC0", "ADC0"},
-       {"AudioZoom Secondary MUX", "ADC1", "ADC1"},
-       {"AudioZoom Secondary MUX", "ADC2", "ADC2"},
-       {"AudioZoom Secondary MUX", "ADC3", "ADC3"},
-
-       {"AudioZoom Teritary MUX", "PCM0.0", "PCM0.0 RX"},
-       {"AudioZoom Teritary MUX", "PCM0.1", "PCM0.1 RX"},
-       {"AudioZoom Teritary MUX", "PCM0.2", "PCM0.2 RX"},
-       {"AudioZoom Teritary MUX", "PCM0.3", "PCM0.3 RX"},
-       {"AudioZoom Teritary MUX", "PCM1.0", "PCM1.0 RX"},
-       {"AudioZoom Teritary MUX", "PCM1.1", "PCM1.1 RX"},
-       {"AudioZoom Teritary MUX", "PCM1.2", "PCM1.2 RX"},
-       {"AudioZoom Teritary MUX", "PCM1.3", "PCM1.3 RX"},
-       {"AudioZoom Teritary MUX", "PCM2.0", "PCM2.0 RX"},
-       {"AudioZoom Teritary MUX", "PCM2.1", "PCM2.1 RX"},
-       {"AudioZoom Teritary MUX", "PCM2.2", "PCM2.2 RX"},
-       {"AudioZoom Teritary MUX", "PCM2.3", "PCM2.3 RX"},
-       {"AudioZoom Teritary MUX", "PDMI0", "PDMI0"},
-       {"AudioZoom Teritary MUX", "PDMI1", "PDMI1"},
-       {"AudioZoom Teritary MUX", "PDMI2", "PDMI2"},
-       {"AudioZoom Teritary MUX", "PDMI3", "PDMI3"},
-       {"AudioZoom Teritary MUX", "SBUS.RX0", "SBUS.RX0"},
-       {"AudioZoom Teritary MUX", "SBUS.RX1", "SBUS.RX1"},
-       {"AudioZoom Teritary MUX", "SBUS.RX2", "SBUS.RX2"},
-       {"AudioZoom Teritary MUX", "SBUS.RX3", "SBUS.RX3"},
-       {"AudioZoom Teritary MUX", "SBUS.RX4", "SBUS.RX4"},
-       {"AudioZoom Teritary MUX", "SBUS.RX5", "SBUS.RX5"},
-       {"AudioZoom Teritary MUX", "SBUS.RX6", "SBUS.RX6"},
-       {"AudioZoom Teritary MUX", "SBUS.RX7", "SBUS.RX7"},
-       {"AudioZoom Teritary MUX", "SBUS.RX8", "SBUS.RX8"},
-       {"AudioZoom Teritary MUX", "SBUS.RX9", "SBUS.RX9"},
-       {"AudioZoom Teritary MUX", "ADC0", "ADC0"},
-       {"AudioZoom Teritary MUX", "ADC1", "ADC1"},
-       {"AudioZoom Teritary MUX", "ADC2", "ADC2"},
-       {"AudioZoom Teritary MUX", "ADC3", "ADC3"},
-
-       {"AudioZoom AI1 MUX", "PCM0.0", "PCM0.0 RX"},
-       {"AudioZoom AI1 MUX", "PCM0.1", "PCM0.1 RX"},
-       {"AudioZoom AI1 MUX", "PCM0.2", "PCM0.2 RX"},
-       {"AudioZoom AI1 MUX", "PCM0.3", "PCM0.3 RX"},
-       {"AudioZoom AI1 MUX", "PCM1.0", "PCM1.0 RX"},
-       {"AudioZoom AI1 MUX", "PCM1.1", "PCM1.1 RX"},
-       {"AudioZoom AI1 MUX", "PCM1.2", "PCM1.2 RX"},
-       {"AudioZoom AI1 MUX", "PCM1.3", "PCM1.3 RX"},
-       {"AudioZoom AI1 MUX", "PCM2.0", "PCM2.0 RX"},
-       {"AudioZoom AI1 MUX", "PCM2.1", "PCM2.1 RX"},
-       {"AudioZoom AI1 MUX", "PCM2.2", "PCM2.2 RX"},
-       {"AudioZoom AI1 MUX", "PCM2.3", "PCM2.3 RX"},
-       {"AudioZoom AI1 MUX", "PDMI0", "PDMI0"},
-       {"AudioZoom AI1 MUX", "PDMI1", "PDMI1"},
-       {"AudioZoom AI1 MUX", "PDMI2", "PDMI2"},
-       {"AudioZoom AI1 MUX", "PDMI3", "PDMI3"},
-       {"AudioZoom AI1 MUX", "SBUS.RX0", "SBUS.RX0"},
-       {"AudioZoom AI1 MUX", "SBUS.RX1", "SBUS.RX1"},
-       {"AudioZoom AI1 MUX", "SBUS.RX2", "SBUS.RX2"},
-       {"AudioZoom AI1 MUX", "SBUS.RX3", "SBUS.RX3"},
-       {"AudioZoom AI1 MUX", "SBUS.RX4", "SBUS.RX4"},
-       {"AudioZoom AI1 MUX", "SBUS.RX5", "SBUS.RX5"},
-       {"AudioZoom AI1 MUX", "SBUS.RX6", "SBUS.RX6"},
-       {"AudioZoom AI1 MUX", "SBUS.RX7", "SBUS.RX7"},
-       {"AudioZoom AI1 MUX", "SBUS.RX8", "SBUS.RX8"},
-       {"AudioZoom AI1 MUX", "SBUS.RX9", "SBUS.RX9"},
-       {"AudioZoom AI1 MUX", "ADC0", "ADC0"},
-       {"AudioZoom AI1 MUX", "ADC1", "ADC1"},
-       {"AudioZoom AI1 MUX", "ADC2", "ADC2"},
-       {"AudioZoom AI1 MUX", "ADC3", "ADC3"},
-
-       {"AudioZoom CSOUT Mixer", NULL, "AudioZoom Primary MUX"},
-       {"AudioZoom CSOUT Mixer", NULL, "AudioZoom Secondary MUX"},
-       {"AudioZoom CSOUT Mixer", NULL, "AudioZoom Teritary MUX"},
-       {"AudioZoom AOUT1 Mixer", NULL, "AudioZoom AI1 MUX"},
+       {"Pass AO2 Mixer", NULL, "Pass AUDIN1 MUX"},
+       {"Pass AO2 Mixer", NULL, "Pass AUDIN2 MUX"},
+
+       {"AudioFocus Primary MUX", "PCM0.0", "PCM0.0 RX"},
+       {"AudioFocus Primary MUX", "PCM0.1", "PCM0.1 RX"},
+       {"AudioFocus Primary MUX", "PCM0.2", "PCM0.2 RX"},
+       {"AudioFocus Primary MUX", "PCM0.3", "PCM0.3 RX"},
+       {"AudioFocus Primary MUX", "PCM1.0", "PCM1.0 RX"},
+       {"AudioFocus Primary MUX", "PCM1.1", "PCM1.1 RX"},
+       {"AudioFocus Primary MUX", "PCM1.2", "PCM1.2 RX"},
+       {"AudioFocus Primary MUX", "PCM1.3", "PCM1.3 RX"},
+       {"AudioFocus Primary MUX", "PCM2.0", "PCM2.0 RX"},
+       {"AudioFocus Primary MUX", "PCM2.1", "PCM2.1 RX"},
+       {"AudioFocus Primary MUX", "PCM2.2", "PCM2.2 RX"},
+       {"AudioFocus Primary MUX", "PCM2.3", "PCM2.3 RX"},
+       {"AudioFocus Primary MUX", "PDMI0", "PDMI0"},
+       {"AudioFocus Primary MUX", "PDMI1", "PDMI1"},
+       {"AudioFocus Primary MUX", "PDMI2", "PDMI2"},
+       {"AudioFocus Primary MUX", "PDMI3", "PDMI3"},
+       {"AudioFocus Primary MUX", "SBUS.RX0", "SBUS.RX0"},
+       {"AudioFocus Primary MUX", "SBUS.RX1", "SBUS.RX1"},
+       {"AudioFocus Primary MUX", "SBUS.RX2", "SBUS.RX2"},
+       {"AudioFocus Primary MUX", "SBUS.RX3", "SBUS.RX3"},
+       {"AudioFocus Primary MUX", "SBUS.RX4", "SBUS.RX4"},
+       {"AudioFocus Primary MUX", "SBUS.RX5", "SBUS.RX5"},
+       {"AudioFocus Primary MUX", "SBUS.RX6", "SBUS.RX6"},
+       {"AudioFocus Primary MUX", "SBUS.RX7", "SBUS.RX7"},
+       {"AudioFocus Primary MUX", "SBUS.RX8", "SBUS.RX8"},
+       {"AudioFocus Primary MUX", "SBUS.RX9", "SBUS.RX9"},
+       {"AudioFocus Primary MUX", "ADC0", "ADC0"},
+       {"AudioFocus Primary MUX", "ADC1", "ADC1"},
+       {"AudioFocus Primary MUX", "ADC2", "ADC2"},
+       {"AudioFocus Primary MUX", "ADC3", "ADC3"},
+
+       {"AudioFocus Secondary MUX", "PCM0.0", "PCM0.0 RX"},
+       {"AudioFocus Secondary MUX", "PCM0.1", "PCM0.1 RX"},
+       {"AudioFocus Secondary MUX", "PCM0.2", "PCM0.2 RX"},
+       {"AudioFocus Secondary MUX", "PCM0.3", "PCM0.3 RX"},
+       {"AudioFocus Secondary MUX", "PCM1.0", "PCM1.0 RX"},
+       {"AudioFocus Secondary MUX", "PCM1.1", "PCM1.1 RX"},
+       {"AudioFocus Secondary MUX", "PCM1.2", "PCM1.2 RX"},
+       {"AudioFocus Secondary MUX", "PCM1.3", "PCM1.3 RX"},
+       {"AudioFocus Secondary MUX", "PCM2.0", "PCM2.0 RX"},
+       {"AudioFocus Secondary MUX", "PCM2.1", "PCM2.1 RX"},
+       {"AudioFocus Secondary MUX", "PCM2.2", "PCM2.2 RX"},
+       {"AudioFocus Secondary MUX", "PCM2.3", "PCM2.3 RX"},
+       {"AudioFocus Secondary MUX", "PDMI0", "PDMI0"},
+       {"AudioFocus Secondary MUX", "PDMI1", "PDMI1"},
+       {"AudioFocus Secondary MUX", "PDMI2", "PDMI2"},
+       {"AudioFocus Secondary MUX", "PDMI3", "PDMI3"},
+       {"AudioFocus Secondary MUX", "SBUS.RX0", "SBUS.RX0"},
+       {"AudioFocus Secondary MUX", "SBUS.RX1", "SBUS.RX1"},
+       {"AudioFocus Secondary MUX", "SBUS.RX2", "SBUS.RX2"},
+       {"AudioFocus Secondary MUX", "SBUS.RX3", "SBUS.RX3"},
+       {"AudioFocus Secondary MUX", "SBUS.RX4", "SBUS.RX4"},
+       {"AudioFocus Secondary MUX", "SBUS.RX5", "SBUS.RX5"},
+       {"AudioFocus Secondary MUX", "SBUS.RX6", "SBUS.RX6"},
+       {"AudioFocus Secondary MUX", "SBUS.RX7", "SBUS.RX7"},
+       {"AudioFocus Secondary MUX", "SBUS.RX8", "SBUS.RX8"},
+       {"AudioFocus Secondary MUX", "SBUS.RX9", "SBUS.RX9"},
+       {"AudioFocus Secondary MUX", "ADC0", "ADC0"},
+       {"AudioFocus Secondary MUX", "ADC1", "ADC1"},
+       {"AudioFocus Secondary MUX", "ADC2", "ADC2"},
+       {"AudioFocus Secondary MUX", "ADC3", "ADC3"},
+
+       {"AudioFocus Teritary MUX", "PCM0.0", "PCM0.0 RX"},
+       {"AudioFocus Teritary MUX", "PCM0.1", "PCM0.1 RX"},
+       {"AudioFocus Teritary MUX", "PCM0.2", "PCM0.2 RX"},
+       {"AudioFocus Teritary MUX", "PCM0.3", "PCM0.3 RX"},
+       {"AudioFocus Teritary MUX", "PCM1.0", "PCM1.0 RX"},
+       {"AudioFocus Teritary MUX", "PCM1.1", "PCM1.1 RX"},
+       {"AudioFocus Teritary MUX", "PCM1.2", "PCM1.2 RX"},
+       {"AudioFocus Teritary MUX", "PCM1.3", "PCM1.3 RX"},
+       {"AudioFocus Teritary MUX", "PCM2.0", "PCM2.0 RX"},
+       {"AudioFocus Teritary MUX", "PCM2.1", "PCM2.1 RX"},
+       {"AudioFocus Teritary MUX", "PCM2.2", "PCM2.2 RX"},
+       {"AudioFocus Teritary MUX", "PCM2.3", "PCM2.3 RX"},
+       {"AudioFocus Teritary MUX", "PDMI0", "PDMI0"},
+       {"AudioFocus Teritary MUX", "PDMI1", "PDMI1"},
+       {"AudioFocus Teritary MUX", "PDMI2", "PDMI2"},
+       {"AudioFocus Teritary MUX", "PDMI3", "PDMI3"},
+       {"AudioFocus Teritary MUX", "SBUS.RX0", "SBUS.RX0"},
+       {"AudioFocus Teritary MUX", "SBUS.RX1", "SBUS.RX1"},
+       {"AudioFocus Teritary MUX", "SBUS.RX2", "SBUS.RX2"},
+       {"AudioFocus Teritary MUX", "SBUS.RX3", "SBUS.RX3"},
+       {"AudioFocus Teritary MUX", "SBUS.RX4", "SBUS.RX4"},
+       {"AudioFocus Teritary MUX", "SBUS.RX5", "SBUS.RX5"},
+       {"AudioFocus Teritary MUX", "SBUS.RX6", "SBUS.RX6"},
+       {"AudioFocus Teritary MUX", "SBUS.RX7", "SBUS.RX7"},
+       {"AudioFocus Teritary MUX", "SBUS.RX8", "SBUS.RX8"},
+       {"AudioFocus Teritary MUX", "SBUS.RX9", "SBUS.RX9"},
+       {"AudioFocus Teritary MUX", "ADC0", "ADC0"},
+       {"AudioFocus Teritary MUX", "ADC1", "ADC1"},
+       {"AudioFocus Teritary MUX", "ADC2", "ADC2"},
+       {"AudioFocus Teritary MUX", "ADC3", "ADC3"},
+
+       {"AudioFocus CSOUT1 Mixer", NULL, "AudioFocus Primary MUX"},
+       {"AudioFocus CSOUT1 Mixer", NULL, "AudioFocus Secondary MUX"},
+       {"AudioFocus CSOUT1 Mixer", NULL, "AudioFocus Teritary MUX"},
+       {"AudioFocus CSOUT2 Mixer", NULL, "AudioFocus Primary MUX"},
+       {"AudioFocus CSOUT2 Mixer", NULL, "AudioFocus Secondary MUX"},
+       {"AudioFocus CSOUT2 Mixer", NULL, "AudioFocus Teritary MUX"},
 
        {"PCM0.0 MUX", "VP CSOUT1", "VP CSOUT1 Mixer"},
        {"PCM0.0 MUX", "VP CSOUT2", "VP CSOUT2 Mixer"},
        {"PCM0.0 MUX", "VP FEOUT1", "VP FEOUT1 Mixer"},
        {"PCM0.0 MUX", "VP FEOUT1", "VP FEOUT_CSOUT Mixer"},
        {"PCM0.0 MUX", "VP FEOUT2", "VP FEOUT2 Mixer"},
-       {"PCM0.0 MUX", "AudioZoom CSOUT", "AudioZoom CSOUT Mixer"},
-       {"PCM0.0 MUX", "AudioZoom AOUT1", "AudioZoom AOUT1 Mixer"},
+       {"PCM0.0 MUX", "AudioFocus CSOUT1", "AudioFocus CSOUT1 Mixer"},
+       {"PCM0.0 MUX", "AudioFocus CSOUT2", "AudioFocus CSOUT2 Mixer"},
        {"PCM0.0 MUX", "MM PASSOUT1", "MM PASSOUT1 Mixer"},
        {"PCM0.0 MUX", "MM PASSOUT2", "MM PASSOUT2 Mixer"},
        {"PCM0.0 MUX", "MM AUDOUT1", "MM AUDOUT1 Mixer"},
@@ -3524,14 +4118,14 @@ static const struct snd_soc_dapm_route intercon[] = {
        {"PCM0.0 MUX", "Pass AUDOUT3", "Pass AUDOUT3 Mixer"},
        {"PCM0.0 MUX", "Pass AUDOUT4", "Pass AUDOUT4 Mixer"},
        {"PCM0.0 MUX", "Pass AO1", "Pass AO1 Mixer"},
-       {"PCM0.0 MUX", "Pass MO2", "Pass MO2 Mixer"},
+       {"PCM0.0 MUX", "Pass AO2", "Pass AO2 Mixer"},
        {"PCM0.1 MUX", "VP CSOUT1", "VP CSOUT1 Mixer"},
        {"PCM0.1 MUX", "VP CSOUT2", "VP CSOUT2 Mixer"},
        {"PCM0.1 MUX", "VP FEOUT1", "VP FEOUT1 Mixer"},
        {"PCM0.1 MUX", "VP FEOUT1", "VP FEOUT_CSOUT Mixer"},
        {"PCM0.1 MUX", "VP FEOUT2", "VP FEOUT2 Mixer"},
-       {"PCM0.1 MUX", "AudioZoom CSOUT", "AudioZoom CSOUT Mixer"},
-       {"PCM0.1 MUX", "AudioZoom AOUT1", "AudioZoom AOUT1 Mixer"},
+       {"PCM0.1 MUX", "AudioFocus CSOUT1", "AudioFocus CSOUT1 Mixer"},
+       {"PCM0.1 MUX", "AudioFocus CSOUT2", "AudioFocus CSOUT2 Mixer"},
        {"PCM0.1 MUX", "MM PASSOUT1", "MM PASSOUT1 Mixer"},
        {"PCM0.1 MUX", "MM PASSOUT2", "MM PASSOUT2 Mixer"},
        {"PCM0.1 MUX", "MM AUDOUT1", "MM AUDOUT1 Mixer"},
@@ -3543,14 +4137,14 @@ static const struct snd_soc_dapm_route intercon[] = {
        {"PCM0.1 MUX", "Pass AUDOUT3", "Pass AUDOUT3 Mixer"},
        {"PCM0.1 MUX", "Pass AUDOUT4", "Pass AUDOUT4 Mixer"},
        {"PCM0.1 MUX", "Pass AO1", "Pass AO1 Mixer"},
-       {"PCM0.1 MUX", "Pass MO2", "Pass MO2 Mixer"},
+       {"PCM0.1 MUX", "Pass AO2", "Pass AO2 Mixer"},
        {"PCM0.2 MUX", "VP CSOUT1", "VP CSOUT1 Mixer"},
        {"PCM0.2 MUX", "VP CSOUT2", "VP CSOUT2 Mixer"},
        {"PCM0.2 MUX", "VP FEOUT1", "VP FEOUT1 Mixer"},
        {"PCM0.2 MUX", "VP FEOUT1", "VP FEOUT_CSOUT Mixer"},
        {"PCM0.2 MUX", "VP FEOUT2", "VP FEOUT2 Mixer"},
-       {"PCM0.2 MUX", "AudioZoom CSOUT", "AudioZoom CSOUT Mixer"},
-       {"PCM0.2 MUX", "AudioZoom AOUT1", "AudioZoom AOUT1 Mixer"},
+       {"PCM0.2 MUX", "AudioFocus CSOUT1", "AudioFocus CSOUT1 Mixer"},
+       {"PCM0.2 MUX", "AudioFocus CSOUT2", "AudioFocus CSOUT2 Mixer"},
        {"PCM0.2 MUX", "MM PASSOUT1", "MM PASSOUT1 Mixer"},
        {"PCM0.2 MUX", "MM PASSOUT2", "MM PASSOUT2 Mixer"},
        {"PCM0.2 MUX", "MM AUDOUT1", "MM AUDOUT1 Mixer"},
@@ -3562,14 +4156,14 @@ static const struct snd_soc_dapm_route intercon[] = {
        {"PCM0.2 MUX", "Pass AUDOUT3", "Pass AUDOUT3 Mixer"},
        {"PCM0.2 MUX", "Pass AUDOUT4", "Pass AUDOUT4 Mixer"},
        {"PCM0.2 MUX", "Pass AO1", "Pass AO1 Mixer"},
-       {"PCM0.2 MUX", "Pass MO2", "Pass MO2 Mixer"},
+       {"PCM0.2 MUX", "Pass AO2", "Pass AO2 Mixer"},
        {"PCM0.3 MUX", "VP CSOUT1", "VP CSOUT1 Mixer"},
        {"PCM0.3 MUX", "VP CSOUT2", "VP CSOUT2 Mixer"},
        {"PCM0.3 MUX", "VP FEOUT1", "VP FEOUT1 Mixer"},
        {"PCM0.3 MUX", "VP FEOUT1", "VP FEOUT_CSOUT Mixer"},
        {"PCM0.3 MUX", "VP FEOUT2", "VP FEOUT2 Mixer"},
-       {"PCM0.3 MUX", "AudioZoom CSOUT", "AudioZoom CSOUT Mixer"},
-       {"PCM0.3 MUX", "AudioZoom AOUT1", "AudioZoom AOUT1 Mixer"},
+       {"PCM0.3 MUX", "AudioFocus CSOUT1", "AudioFocus CSOUT1 Mixer"},
+       {"PCM0.3 MUX", "AudioFocus CSOUT2", "AudioFocus CSOUT2 Mixer"},
        {"PCM0.3 MUX", "MM PASSOUT1", "MM PASSOUT1 Mixer"},
        {"PCM0.3 MUX", "MM PASSOUT2", "MM PASSOUT2 Mixer"},
        {"PCM0.3 MUX", "MM AUDOUT1", "MM AUDOUT1 Mixer"},
@@ -3581,15 +4175,15 @@ static const struct snd_soc_dapm_route intercon[] = {
        {"PCM0.3 MUX", "Pass AUDOUT3", "Pass AUDOUT3 Mixer"},
        {"PCM0.3 MUX", "Pass AUDOUT4", "Pass AUDOUT4 Mixer"},
        {"PCM0.3 MUX", "Pass AO1", "Pass AO1 Mixer"},
-       {"PCM0.3 MUX", "Pass MO2", "Pass MO2 Mixer"},
+       {"PCM0.3 MUX", "Pass AO2", "Pass AO2 Mixer"},
 
        {"PCM1.0 MUX", "VP CSOUT1", "VP CSOUT1 Mixer"},
        {"PCM1.0 MUX", "VP CSOUT2", "VP CSOUT2 Mixer"},
        {"PCM1.0 MUX", "VP FEOUT1", "VP FEOUT1 Mixer"},
        {"PCM1.0 MUX", "VP FEOUT1", "VP FEOUT_CSOUT Mixer"},
        {"PCM1.0 MUX", "VP FEOUT2", "VP FEOUT2 Mixer"},
-       {"PCM1.0 MUX", "AudioZoom CSOUT", "AudioZoom CSOUT Mixer"},
-       {"PCM1.0 MUX", "AudioZoom AOUT1", "AudioZoom AOUT1 Mixer"},
+       {"PCM1.0 MUX", "AudioFocus CSOUT1", "AudioFocus CSOUT1 Mixer"},
+       {"PCM1.0 MUX", "AudioFocus CSOUT2", "AudioFocus CSOUT2 Mixer"},
        {"PCM1.0 MUX", "MM PASSOUT1", "MM PASSOUT1 Mixer"},
        {"PCM1.0 MUX", "MM PASSOUT2", "MM PASSOUT2 Mixer"},
        {"PCM1.0 MUX", "MM AUDOUT1", "MM AUDOUT1 Mixer"},
@@ -3601,14 +4195,14 @@ static const struct snd_soc_dapm_route intercon[] = {
        {"PCM1.0 MUX", "Pass AUDOUT3", "Pass AUDOUT3 Mixer"},
        {"PCM1.0 MUX", "Pass AUDOUT4", "Pass AUDOUT4 Mixer"},
        {"PCM1.0 MUX", "Pass AO1", "Pass AO1 Mixer"},
-       {"PCM1.0 MUX", "Pass MO2", "Pass MO2 Mixer"},
+       {"PCM1.0 MUX", "Pass AO2", "Pass AO2 Mixer"},
        {"PCM1.1 MUX", "VP CSOUT1", "VP CSOUT1 Mixer"},
        {"PCM1.1 MUX", "VP CSOUT2", "VP CSOUT2 Mixer"},
        {"PCM1.1 MUX", "VP FEOUT1", "VP FEOUT1 Mixer"},
        {"PCM1.1 MUX", "VP FEOUT1", "VP FEOUT_CSOUT Mixer"},
        {"PCM1.1 MUX", "VP FEOUT2", "VP FEOUT2 Mixer"},
-       {"PCM1.1 MUX", "AudioZoom CSOUT", "AudioZoom CSOUT Mixer"},
-       {"PCM1.1 MUX", "AudioZoom AOUT1", "AudioZoom AOUT1 Mixer"},
+       {"PCM1.1 MUX", "AudioFocus CSOUT1", "AudioFocus CSOUT1 Mixer"},
+       {"PCM1.1 MUX", "AudioFocus CSOUT2", "AudioFocus CSOUT2 Mixer"},
        {"PCM1.1 MUX", "MM PASSOUT1", "MM PASSOUT1 Mixer"},
        {"PCM1.1 MUX", "MM PASSOUT2", "MM PASSOUT2 Mixer"},
        {"PCM1.1 MUX", "MM AUDOUT1", "MM AUDOUT1 Mixer"},
@@ -3620,14 +4214,14 @@ static const struct snd_soc_dapm_route intercon[] = {
        {"PCM1.1 MUX", "Pass AUDOUT3", "Pass AUDOUT3 Mixer"},
        {"PCM1.1 MUX", "Pass AUDOUT4", "Pass AUDOUT4 Mixer"},
        {"PCM1.1 MUX", "Pass AO1", "Pass AO1 Mixer"},
-       {"PCM1.1 MUX", "Pass MO2", "Pass MO2 Mixer"},
+       {"PCM1.1 MUX", "Pass AO2", "Pass AO2 Mixer"},
        {"PCM1.2 MUX", "VP CSOUT1", "VP CSOUT1 Mixer"},
        {"PCM1.2 MUX", "VP CSOUT2", "VP CSOUT2 Mixer"},
        {"PCM1.2 MUX", "VP FEOUT1", "VP FEOUT1 Mixer"},
        {"PCM1.2 MUX", "VP FEOUT1", "VP FEOUT_CSOUT Mixer"},
        {"PCM1.2 MUX", "VP FEOUT2", "VP FEOUT2 Mixer"},
-       {"PCM1.2 MUX", "AudioZoom CSOUT", "AudioZoom CSOUT Mixer"},
-       {"PCM1.2 MUX", "AudioZoom AOUT1", "AudioZoom AOUT1 Mixer"},
+       {"PCM1.2 MUX", "AudioFocus CSOUT1", "AudioFocus CSOUT1 Mixer"},
+       {"PCM1.2 MUX", "AudioFocus CSOUT2", "AudioFocus CSOUT2 Mixer"},
        {"PCM1.2 MUX", "MM PASSOUT1", "MM PASSOUT1 Mixer"},
        {"PCM1.2 MUX", "MM PASSOUT2", "MM PASSOUT2 Mixer"},
        {"PCM1.2 MUX", "MM AUDOUT1", "MM AUDOUT1 Mixer"},
@@ -3639,14 +4233,14 @@ static const struct snd_soc_dapm_route intercon[] = {
        {"PCM1.2 MUX", "Pass AUDOUT3", "Pass AUDOUT3 Mixer"},
        {"PCM1.2 MUX", "Pass AUDOUT4", "Pass AUDOUT4 Mixer"},
        {"PCM1.2 MUX", "Pass AO1", "Pass AO1 Mixer"},
-       {"PCM1.2 MUX", "Pass MO2", "Pass MO2 Mixer"},
+       {"PCM1.2 MUX", "Pass AO2", "Pass AO2 Mixer"},
        {"PCM1.3 MUX", "VP CSOUT1", "VP CSOUT1 Mixer"},
        {"PCM1.3 MUX", "VP CSOUT2", "VP CSOUT2 Mixer"},
        {"PCM1.3 MUX", "VP FEOUT1", "VP FEOUT1 Mixer"},
        {"PCM1.3 MUX", "VP FEOUT1", "VP FEOUT_CSOUT Mixer"},
        {"PCM1.3 MUX", "VP FEOUT2", "VP FEOUT2 Mixer"},
-       {"PCM1.3 MUX", "AudioZoom CSOUT", "AudioZoom CSOUT Mixer"},
-       {"PCM1.3 MUX", "AudioZoom AOUT1", "AudioZoom AOUT1 Mixer"},
+       {"PCM1.3 MUX", "AudioFocus CSOUT1", "AudioFocus CSOUT1 Mixer"},
+       {"PCM1.3 MUX", "AudioFocus CSOUT2", "AudioFocus CSOUT2 Mixer"},
        {"PCM1.3 MUX", "MM PASSOUT1", "MM PASSOUT1 Mixer"},
        {"PCM1.3 MUX", "MM PASSOUT2", "MM PASSOUT2 Mixer"},
        {"PCM1.3 MUX", "MM AUDOUT1", "MM AUDOUT1 Mixer"},
@@ -3658,15 +4252,15 @@ static const struct snd_soc_dapm_route intercon[] = {
        {"PCM1.3 MUX", "Pass AUDOUT3", "Pass AUDOUT3 Mixer"},
        {"PCM1.3 MUX", "Pass AUDOUT4", "Pass AUDOUT4 Mixer"},
        {"PCM1.3 MUX", "Pass AO1", "Pass AO1 Mixer"},
-       {"PCM1.3 MUX", "Pass MO2", "Pass MO2 Mixer"},
+       {"PCM1.3 MUX", "Pass AO2", "Pass AO2 Mixer"},
 
        {"PCM2.0 MUX", "VP CSOUT1", "VP CSOUT1 Mixer"},
        {"PCM2.0 MUX", "VP CSOUT2", "VP CSOUT2 Mixer"},
        {"PCM2.0 MUX", "VP FEOUT1", "VP FEOUT1 Mixer"},
        {"PCM2.0 MUX", "VP FEOUT1", "VP FEOUT_CSOUT Mixer"},
        {"PCM2.0 MUX", "VP FEOUT2", "VP FEOUT2 Mixer"},
-       {"PCM2.0 MUX", "AudioZoom CSOUT", "AudioZoom CSOUT Mixer"},
-       {"PCM2.0 MUX", "AudioZoom AOUT1", "AudioZoom AOUT1 Mixer"},
+       {"PCM2.0 MUX", "AudioFocus CSOUT1", "AudioFocus CSOUT1 Mixer"},
+       {"PCM2.0 MUX", "AudioFocus CSOUT2", "AudioFocus CSOUT2 Mixer"},
        {"PCM2.0 MUX", "MM PASSOUT1", "MM PASSOUT1 Mixer"},
        {"PCM2.0 MUX", "MM PASSOUT2", "MM PASSOUT2 Mixer"},
        {"PCM2.0 MUX", "MM AUDOUT1", "MM AUDOUT1 Mixer"},
@@ -3678,14 +4272,14 @@ static const struct snd_soc_dapm_route intercon[] = {
        {"PCM2.0 MUX", "Pass AUDOUT3", "Pass AUDOUT3 Mixer"},
        {"PCM2.0 MUX", "Pass AUDOUT4", "Pass AUDOUT4 Mixer"},
        {"PCM2.0 MUX", "Pass AO1", "Pass AO1 Mixer"},
-       {"PCM2.0 MUX", "Pass MO2", "Pass MO2 Mixer"},
+       {"PCM2.0 MUX", "Pass AO2", "Pass AO2 Mixer"},
        {"PCM2.1 MUX", "VP CSOUT1", "VP CSOUT1 Mixer"},
        {"PCM2.1 MUX", "VP CSOUT2", "VP CSOUT2 Mixer"},
        {"PCM2.1 MUX", "VP FEOUT1", "VP FEOUT1 Mixer"},
        {"PCM2.1 MUX", "VP FEOUT1", "VP FEOUT_CSOUT Mixer"},
        {"PCM2.1 MUX", "VP FEOUT2", "VP FEOUT2 Mixer"},
-       {"PCM2.1 MUX", "AudioZoom CSOUT", "AudioZoom CSOUT Mixer"},
-       {"PCM2.1 MUX", "AudioZoom AOUT1", "AudioZoom AOUT1 Mixer"},
+       {"PCM2.1 MUX", "AudioFocus CSOUT1", "AudioFocus CSOUT1 Mixer"},
+       {"PCM2.1 MUX", "AudioFocus CSOUT2", "AudioFocus CSOUT2 Mixer"},
        {"PCM2.1 MUX", "MM PASSOUT1", "MM PASSOUT1 Mixer"},
        {"PCM2.1 MUX", "MM PASSOUT2", "MM PASSOUT2 Mixer"},
        {"PCM2.1 MUX", "MM AUDOUT1", "MM AUDOUT1 Mixer"},
@@ -3697,14 +4291,14 @@ static const struct snd_soc_dapm_route intercon[] = {
        {"PCM2.1 MUX", "Pass AUDOUT3", "Pass AUDOUT3 Mixer"},
        {"PCM2.1 MUX", "Pass AUDOUT4", "Pass AUDOUT4 Mixer"},
        {"PCM2.1 MUX", "Pass AO1", "Pass AO1 Mixer"},
-       {"PCM2.1 MUX", "Pass MO2", "Pass MO2 Mixer"},
+       {"PCM2.1 MUX", "Pass AO2", "Pass AO2 Mixer"},
        {"PCM2.2 MUX", "VP CSOUT1", "VP CSOUT1 Mixer"},
        {"PCM2.2 MUX", "VP CSOUT2", "VP CSOUT2 Mixer"},
        {"PCM2.2 MUX", "VP FEOUT1", "VP FEOUT1 Mixer"},
        {"PCM2.2 MUX", "VP FEOUT1", "VP FEOUT_CSOUT Mixer"},
        {"PCM2.2 MUX", "VP FEOUT2", "VP FEOUT2 Mixer"},
-       {"PCM2.2 MUX", "AudioZoom CSOUT", "AudioZoom CSOUT Mixer"},
-       {"PCM2.2 MUX", "AudioZoom AOUT1", "AudioZoom AOUT1 Mixer"},
+       {"PCM2.2 MUX", "AudioFocus CSOUT1", "AudioFocus CSOUT1 Mixer"},
+       {"PCM2.2 MUX", "AudioFocus CSOUT2", "AudioFocus CSOUT2 Mixer"},
        {"PCM2.2 MUX", "MM PASSOUT1", "MM PASSOUT1 Mixer"},
        {"PCM2.2 MUX", "MM PASSOUT2", "MM PASSOUT2 Mixer"},
        {"PCM2.2 MUX", "MM AUDOUT1", "MM AUDOUT1 Mixer"},
@@ -3716,14 +4310,14 @@ static const struct snd_soc_dapm_route intercon[] = {
        {"PCM2.2 MUX", "Pass AUDOUT3", "Pass AUDOUT3 Mixer"},
        {"PCM2.2 MUX", "Pass AUDOUT4", "Pass AUDOUT4 Mixer"},
        {"PCM2.2 MUX", "Pass AO1", "Pass AO1 Mixer"},
-       {"PCM2.2 MUX", "Pass MO2", "Pass MO2 Mixer"},
+       {"PCM2.2 MUX", "Pass AO2", "Pass AO2 Mixer"},
        {"PCM2.3 MUX", "VP CSOUT1", "VP CSOUT1 Mixer"},
        {"PCM2.3 MUX", "VP CSOUT2", "VP CSOUT2 Mixer"},
        {"PCM2.3 MUX", "VP FEOUT1", "VP FEOUT1 Mixer"},
        {"PCM2.3 MUX", "VP FEOUT1", "VP FEOUT_CSOUT Mixer"},
        {"PCM2.3 MUX", "VP FEOUT2", "VP FEOUT2 Mixer"},
-       {"PCM2.3 MUX", "AudioZoom CSOUT", "AudioZoom CSOUT Mixer"},
-       {"PCM2.3 MUX", "AudioZoom AOUT1", "AudioZoom AOUT1 Mixer"},
+       {"PCM2.3 MUX", "AudioFocus CSOUT1", "AudioFocus CSOUT1 Mixer"},
+       {"PCM2.3 MUX", "AudioFocus CSOUT2", "AudioFocus CSOUT2 Mixer"},
        {"PCM2.3 MUX", "MM PASSOUT1", "MM PASSOUT1 Mixer"},
        {"PCM2.3 MUX", "MM PASSOUT2", "MM PASSOUT2 Mixer"},
        {"PCM2.3 MUX", "MM AUDOUT1", "MM AUDOUT1 Mixer"},
@@ -3735,7 +4329,7 @@ static const struct snd_soc_dapm_route intercon[] = {
        {"PCM2.3 MUX", "Pass AUDOUT3", "Pass AUDOUT3 Mixer"},
        {"PCM2.3 MUX", "Pass AUDOUT4", "Pass AUDOUT4 Mixer"},
        {"PCM2.3 MUX", "Pass AO1", "Pass AO1 Mixer"},
-       {"PCM2.3 MUX", "Pass MO2", "Pass MO2 Mixer"},
+       {"PCM2.3 MUX", "Pass AO2", "Pass AO2 Mixer"},
 
 
        {"SBUS.TX0 MUX", "VP CSOUT1", "VP CSOUT1 Mixer"},
@@ -3743,8 +4337,8 @@ static const struct snd_soc_dapm_route intercon[] = {
        {"SBUS.TX0 MUX", "VP FEOUT1", "VP FEOUT1 Mixer"},
        {"SBUS.TX0 MUX", "VP FEOUT1", "VP FEOUT_CSOUT Mixer"},
        {"SBUS.TX0 MUX", "VP FEOUT2", "VP FEOUT2 Mixer"},
-       {"SBUS.TX0 MUX", "AudioZoom CSOUT", "AudioZoom CSOUT Mixer"},
-       {"SBUS.TX0 MUX", "AudioZoom AOUT1", "AudioZoom AOUT1 Mixer"},
+       {"SBUS.TX0 MUX", "AudioFocus CSOUT1", "AudioFocus CSOUT1 Mixer"},
+       {"SBUS.TX0 MUX", "AudioFocus CSOUT2", "AudioFocus CSOUT2 Mixer"},
        {"SBUS.TX0 MUX", "MM PASSOUT1", "MM PASSOUT1 Mixer"},
        {"SBUS.TX0 MUX", "MM PASSOUT2", "MM PASSOUT2 Mixer"},
        {"SBUS.TX0 MUX", "MM AUDOUT1", "MM AUDOUT1 Mixer"},
@@ -3756,15 +4350,15 @@ static const struct snd_soc_dapm_route intercon[] = {
        {"SBUS.TX0 MUX", "Pass AUDOUT3", "Pass AUDOUT3 Mixer"},
        {"SBUS.TX0 MUX", "Pass AUDOUT4", "Pass AUDOUT4 Mixer"},
        {"SBUS.TX0 MUX", "Pass AO1", "Pass AO1 Mixer"},
-       {"SBUS.TX0 MUX", "Pass MO2", "Pass MO2 Mixer"},
+       {"SBUS.TX0 MUX", "Pass AO2", "Pass AO2 Mixer"},
 
        {"SBUS.TX1 MUX", "VP CSOUT1", "VP CSOUT1 Mixer"},
        {"SBUS.TX1 MUX", "VP CSOUT2", "VP CSOUT2 Mixer"},
        {"SBUS.TX1 MUX", "VP FEOUT1", "VP FEOUT1 Mixer"},
        {"SBUS.TX1 MUX", "VP FEOUT1", "VP FEOUT_CSOUT Mixer"},
        {"SBUS.TX1 MUX", "VP FEOUT2", "VP FEOUT2 Mixer"},
-       {"SBUS.TX1 MUX", "AudioZoom CSOUT", "AudioZoom CSOUT Mixer"},
-       {"SBUS.TX1 MUX", "AudioZoom AOUT1", "AudioZoom AOUT1 Mixer"},
+       {"SBUS.TX1 MUX", "AudioFocus CSOUT1", "AudioFocus CSOUT1 Mixer"},
+       {"SBUS.TX1 MUX", "AudioFocus CSOUT2", "AudioFocus CSOUT2 Mixer"},
        {"SBUS.TX1 MUX", "MM PASSOUT1", "MM PASSOUT1 Mixer"},
        {"SBUS.TX1 MUX", "MM PASSOUT2", "MM PASSOUT2 Mixer"},
        {"SBUS.TX1 MUX", "MM AUDOUT1", "MM AUDOUT1 Mixer"},
@@ -3776,15 +4370,15 @@ static const struct snd_soc_dapm_route intercon[] = {
        {"SBUS.TX1 MUX", "Pass AUDOUT3", "Pass AUDOUT3 Mixer"},
        {"SBUS.TX1 MUX", "Pass AUDOUT4", "Pass AUDOUT4 Mixer"},
        {"SBUS.TX1 MUX", "Pass AO1", "Pass AO1 Mixer"},
-       {"SBUS.TX1 MUX", "Pass MO2", "Pass MO2 Mixer"},
+       {"SBUS.TX1 MUX", "Pass AO2", "Pass AO2 Mixer"},
 
        {"SBUS.TX2 MUX", "VP CSOUT1", "VP CSOUT1 Mixer"},
        {"SBUS.TX2 MUX", "VP CSOUT2", "VP CSOUT2 Mixer"},
        {"SBUS.TX2 MUX", "VP FEOUT1", "VP FEOUT1 Mixer"},
        {"SBUS.TX2 MUX", "VP FEOUT1", "VP FEOUT_CSOUT Mixer"},
        {"SBUS.TX2 MUX", "VP FEOUT2", "VP FEOUT2 Mixer"},
-       {"SBUS.TX2 MUX", "AudioZoom CSOUT", "AudioZoom CSOUT Mixer"},
-       {"SBUS.TX2 MUX", "AudioZoom AOUT1", "AudioZoom AOUT1 Mixer"},
+       {"SBUS.TX2 MUX", "AudioFocus CSOUT1", "AudioFocus CSOUT1 Mixer"},
+       {"SBUS.TX2 MUX", "AudioFocus CSOUT2", "AudioFocus CSOUT2 Mixer"},
        {"SBUS.TX2 MUX", "MM PASSOUT1", "MM PASSOUT1 Mixer"},
        {"SBUS.TX2 MUX", "MM PASSOUT2", "MM PASSOUT2 Mixer"},
        {"SBUS.TX2 MUX", "MM AUDOUT1", "MM AUDOUT1 Mixer"},
@@ -3796,15 +4390,15 @@ static const struct snd_soc_dapm_route intercon[] = {
        {"SBUS.TX2 MUX", "Pass AUDOUT3", "Pass AUDOUT3 Mixer"},
        {"SBUS.TX2 MUX", "Pass AUDOUT4", "Pass AUDOUT4 Mixer"},
        {"SBUS.TX2 MUX", "Pass AO1", "Pass AO1 Mixer"},
-       {"SBUS.TX2 MUX", "Pass MO2", "Pass MO2 Mixer"},
+       {"SBUS.TX2 MUX", "Pass AO2", "Pass AO2 Mixer"},
 
        {"SBUS.TX3 MUX", "VP CSOUT1", "VP CSOUT1 Mixer"},
        {"SBUS.TX3 MUX", "VP CSOUT2", "VP CSOUT2 Mixer"},
        {"SBUS.TX3 MUX", "VP FEOUT1", "VP FEOUT1 Mixer"},
        {"SBUS.TX3 MUX", "VP FEOUT1", "VP FEOUT_CSOUT Mixer"},
        {"SBUS.TX3 MUX", "VP FEOUT2", "VP FEOUT2 Mixer"},
-       {"SBUS.TX3 MUX", "AudioZoom CSOUT", "AudioZoom CSOUT Mixer"},
-       {"SBUS.TX3 MUX", "AudioZoom AOUT1", "AudioZoom AOUT1 Mixer"},
+       {"SBUS.TX3 MUX", "AudioFocus CSOUT1", "AudioFocus CSOUT1 Mixer"},
+       {"SBUS.TX3 MUX", "AudioFocus CSOUT2", "AudioFocus CSOUT2 Mixer"},
        {"SBUS.TX3 MUX", "MM PASSOUT1", "MM PASSOUT1 Mixer"},
        {"SBUS.TX3 MUX", "MM PASSOUT2", "MM PASSOUT2 Mixer"},
        {"SBUS.TX3 MUX", "MM AUDOUT1", "MM AUDOUT1 Mixer"},
@@ -3816,15 +4410,15 @@ static const struct snd_soc_dapm_route intercon[] = {
        {"SBUS.TX3 MUX", "Pass AUDOUT3", "Pass AUDOUT3 Mixer"},
        {"SBUS.TX3 MUX", "Pass AUDOUT4", "Pass AUDOUT4 Mixer"},
        {"SBUS.TX3 MUX", "Pass AO1", "Pass AO1 Mixer"},
-       {"SBUS.TX3 MUX", "Pass MO2", "Pass MO2 Mixer"},
+       {"SBUS.TX3 MUX", "Pass AO2", "Pass AO2 Mixer"},
 
        {"SBUS.TX4 MUX", "VP CSOUT1", "VP CSOUT1 Mixer"},
        {"SBUS.TX4 MUX", "VP CSOUT2", "VP CSOUT2 Mixer"},
        {"SBUS.TX4 MUX", "VP FEOUT1", "VP FEOUT1 Mixer"},
        {"SBUS.TX4 MUX", "VP FEOUT1", "VP FEOUT_CSOUT Mixer"},
        {"SBUS.TX4 MUX", "VP FEOUT2", "VP FEOUT2 Mixer"},
-       {"SBUS.TX4 MUX", "AudioZoom CSOUT", "AudioZoom CSOUT Mixer"},
-       {"SBUS.TX4 MUX", "AudioZoom AOUT1", "AudioZoom AOUT1 Mixer"},
+       {"SBUS.TX4 MUX", "AudioFocus CSOUT1", "AudioFocus CSOUT1 Mixer"},
+       {"SBUS.TX4 MUX", "AudioFocus CSOUT2", "AudioFocus CSOUT2 Mixer"},
        {"SBUS.TX4 MUX", "MM PASSOUT1", "MM PASSOUT1 Mixer"},
        {"SBUS.TX4 MUX", "MM PASSOUT2", "MM PASSOUT2 Mixer"},
        {"SBUS.TX4 MUX", "MM AUDOUT1", "MM AUDOUT1 Mixer"},
@@ -3836,15 +4430,15 @@ static const struct snd_soc_dapm_route intercon[] = {
        {"SBUS.TX4 MUX", "Pass AUDOUT3", "Pass AUDOUT3 Mixer"},
        {"SBUS.TX4 MUX", "Pass AUDOUT4", "Pass AUDOUT4 Mixer"},
        {"SBUS.TX4 MUX", "Pass AO1", "Pass AO1 Mixer"},
-       {"SBUS.TX4 MUX", "Pass MO2", "Pass MO2 Mixer"},
+       {"SBUS.TX4 MUX", "Pass AO2", "Pass AO2 Mixer"},
 
        {"SBUS.TX5 MUX", "VP CSOUT1", "VP CSOUT1 Mixer"},
        {"SBUS.TX5 MUX", "VP CSOUT2", "VP CSOUT2 Mixer"},
        {"SBUS.TX5 MUX", "VP FEOUT1", "VP FEOUT1 Mixer"},
        {"SBUS.TX5 MUX", "VP FEOUT1", "VP FEOUT_CSOUT Mixer"},
        {"SBUS.TX5 MUX", "VP FEOUT2", "VP FEOUT2 Mixer"},
-       {"SBUS.TX5 MUX", "AudioZoom CSOUT", "AudioZoom CSOUT Mixer"},
-       {"SBUS.TX5 MUX", "AudioZoom AOUT1", "AudioZoom AOUT1 Mixer"},
+       {"SBUS.TX5 MUX", "AudioFocus CSOUT1", "AudioFocus CSOUT1 Mixer"},
+       {"SBUS.TX5 MUX", "AudioFocus CSOUT2", "AudioFocus CSOUT2 Mixer"},
        {"SBUS.TX5 MUX", "MM PASSOUT1", "MM PASSOUT1 Mixer"},
        {"SBUS.TX5 MUX", "MM PASSOUT2", "MM PASSOUT2 Mixer"},
        {"SBUS.TX5 MUX", "MM AUDOUT1", "MM AUDOUT1 Mixer"},
@@ -3856,15 +4450,15 @@ static const struct snd_soc_dapm_route intercon[] = {
        {"SBUS.TX5 MUX", "Pass AUDOUT3", "Pass AUDOUT3 Mixer"},
        {"SBUS.TX5 MUX", "Pass AUDOUT4", "Pass AUDOUT4 Mixer"},
        {"SBUS.TX5 MUX", "Pass AO1", "Pass AO1 Mixer"},
-       {"SBUS.TX5 MUX", "Pass MO2", "Pass MO2 Mixer"},
+       {"SBUS.TX5 MUX", "Pass AO2", "Pass AO2 Mixer"},
 
        {"DAC0.0 MUX", "VP CSOUT1", "VP CSOUT1 Mixer"},
        {"DAC0.0 MUX", "VP CSOUT2", "VP CSOUT2 Mixer"},
        {"DAC0.0 MUX", "VP FEOUT1", "VP FEOUT1 Mixer"},
        {"DAC0.0 MUX", "VP FEOUT1", "VP FEOUT_CSOUT Mixer"},
        {"DAC0.0 MUX", "VP FEOUT2", "VP FEOUT2 Mixer"},
-       {"DAC0.0 MUX", "AudioZoom CSOUT", "AudioZoom CSOUT Mixer"},
-       {"DAC0.0 MUX", "AudioZoom AOUT1", "AudioZoom AOUT1 Mixer"},
+       {"DAC0.0 MUX", "AudioFocus CSOUT1", "AudioFocus CSOUT1 Mixer"},
+       {"DAC0.0 MUX", "AudioFocus CSOUT2", "AudioFocus CSOUT2 Mixer"},
        {"DAC0.0 MUX", "MM PASSOUT1", "MM PASSOUT1 Mixer"},
        {"DAC0.0 MUX", "MM PASSOUT2", "MM PASSOUT2 Mixer"},
        {"DAC0.0 MUX", "MM AUDOUT1", "MM AUDOUT1 Mixer"},
@@ -3876,14 +4470,27 @@ static const struct snd_soc_dapm_route intercon[] = {
        {"DAC0.0 MUX", "Pass AUDOUT3", "Pass AUDOUT3 Mixer"},
        {"DAC0.0 MUX", "Pass AUDOUT4", "Pass AUDOUT4 Mixer"},
        {"DAC0.0 MUX", "Pass AO1", "Pass AO1 Mixer"},
-       {"DAC0.0 MUX", "Pass MO2", "Pass MO2 Mixer"},
+       {"DAC0.0 MUX", "Pass AO2", "Pass AO2 Mixer"},
+       {"DAC0.0 MUX", "PCM0.0", "PCM0.0 RX"},
+       {"DAC0.0 MUX", "PCM0.1", "PCM0.1 RX"},
+       {"DAC0.0 MUX", "PCM0.2", "PCM0.2 RX"},
+       {"DAC0.0 MUX", "PCM0.3", "PCM0.3 RX"},
+       {"DAC0.0 MUX", "PCM1.0", "PCM1.0 RX"},
+       {"DAC0.0 MUX", "PCM1.1", "PCM1.1 RX"},
+       {"DAC0.0 MUX", "PCM1.2", "PCM1.2 RX"},
+       {"DAC0.0 MUX", "PCM1.3", "PCM1.3 RX"},
+       {"DAC0.0 MUX", "PCM2.0", "PCM2.0 RX"},
+       {"DAC0.0 MUX", "PCM2.1", "PCM2.1 RX"},
+       {"DAC0.0 MUX", "PCM2.2", "PCM2.2 RX"},
+       {"DAC0.0 MUX", "PCM2.3", "PCM2.3 RX"},
+
        {"DAC0.1 MUX", "VP CSOUT1", "VP CSOUT1 Mixer"},
        {"DAC0.1 MUX", "VP CSOUT2", "VP CSOUT2 Mixer"},
        {"DAC0.1 MUX", "VP FEOUT1", "VP FEOUT1 Mixer"},
        {"DAC0.1 MUX", "VP FEOUT1", "VP FEOUT_CSOUT Mixer"},
        {"DAC0.1 MUX", "VP FEOUT2", "VP FEOUT2 Mixer"},
-       {"DAC0.1 MUX", "AudioZoom CSOUT", "AudioZoom CSOUT Mixer"},
-       {"DAC0.1 MUX", "AudioZoom AOUT1", "AudioZoom AOUT1 Mixer"},
+       {"DAC0.1 MUX", "AudioFocus CSOUT1", "AudioFocus CSOUT1 Mixer"},
+       {"DAC0.1 MUX", "AudioFocus CSOUT2", "AudioFocus CSOUT2 Mixer"},
        {"DAC0.1 MUX", "MM PASSOUT1", "MM PASSOUT1 Mixer"},
        {"DAC0.1 MUX", "MM PASSOUT2", "MM PASSOUT2 Mixer"},
        {"DAC0.1 MUX", "MM AUDOUT1", "MM AUDOUT1 Mixer"},
@@ -3895,15 +4502,27 @@ static const struct snd_soc_dapm_route intercon[] = {
        {"DAC0.1 MUX", "Pass AUDOUT3", "Pass AUDOUT3 Mixer"},
        {"DAC0.1 MUX", "Pass AUDOUT4", "Pass AUDOUT4 Mixer"},
        {"DAC0.1 MUX", "Pass AO1", "Pass AO1 Mixer"},
-       {"DAC0.1 MUX", "Pass MO2", "Pass MO2 Mixer"},
+       {"DAC0.1 MUX", "Pass AO2", "Pass AO2 Mixer"},
+       {"DAC0.1 MUX", "PCM0.0", "PCM0.0 RX"},
+       {"DAC0.1 MUX", "PCM0.1", "PCM0.1 RX"},
+       {"DAC0.1 MUX", "PCM0.2", "PCM0.2 RX"},
+       {"DAC0.1 MUX", "PCM0.3", "PCM0.3 RX"},
+       {"DAC0.1 MUX", "PCM1.0", "PCM1.0 RX"},
+       {"DAC0.1 MUX", "PCM1.1", "PCM1.1 RX"},
+       {"DAC0.1 MUX", "PCM1.2", "PCM1.2 RX"},
+       {"DAC0.1 MUX", "PCM1.3", "PCM1.3 RX"},
+       {"DAC0.1 MUX", "PCM2.0", "PCM2.0 RX"},
+       {"DAC0.1 MUX", "PCM2.1", "PCM2.1 RX"},
+       {"DAC0.1 MUX", "PCM2.2", "PCM2.2 RX"},
+       {"DAC0.1 MUX", "PCM2.3", "PCM2.3 RX"},
 
        {"DAC1.0 MUX", "VP CSOUT1", "VP CSOUT1 Mixer"},
        {"DAC1.0 MUX", "VP CSOUT2", "VP CSOUT2 Mixer"},
        {"DAC1.0 MUX", "VP FEOUT1", "VP FEOUT1 Mixer"},
        {"DAC1.0 MUX", "VP FEOUT1", "VP FEOUT_CSOUT Mixer"},
        {"DAC1.0 MUX", "VP FEOUT2", "VP FEOUT2 Mixer"},
-       {"DAC1.0 MUX", "AudioZoom CSOUT", "AudioZoom CSOUT Mixer"},
-       {"DAC1.0 MUX", "AudioZoom AOUT1", "AudioZoom AOUT1 Mixer"},
+       {"DAC1.0 MUX", "AudioFocus CSOUT1", "AudioFocus CSOUT1 Mixer"},
+       {"DAC1.0 MUX", "AudioFocus CSOUT2", "AudioFocus CSOUT2 Mixer"},
        {"DAC1.0 MUX", "MM PASSOUT1", "MM PASSOUT1 Mixer"},
        {"DAC1.0 MUX", "MM PASSOUT2", "MM PASSOUT2 Mixer"},
        {"DAC1.0 MUX", "MM AUDOUT1", "MM AUDOUT1 Mixer"},
@@ -3915,14 +4534,27 @@ static const struct snd_soc_dapm_route intercon[] = {
        {"DAC1.0 MUX", "Pass AUDOUT3", "Pass AUDOUT3 Mixer"},
        {"DAC1.0 MUX", "Pass AUDOUT4", "Pass AUDOUT4 Mixer"},
        {"DAC1.0 MUX", "Pass AO1", "Pass AO1 Mixer"},
-       {"DAC1.0 MUX", "Pass MO2", "Pass MO2 Mixer"},
+       {"DAC1.0 MUX", "Pass AO2", "Pass AO2 Mixer"},
+       {"DAC1.0 MUX", "PCM0.0", "PCM0.0 RX"},
+       {"DAC1.0 MUX", "PCM0.1", "PCM0.1 RX"},
+       {"DAC1.0 MUX", "PCM0.2", "PCM0.2 RX"},
+       {"DAC1.0 MUX", "PCM0.3", "PCM0.3 RX"},
+       {"DAC1.0 MUX", "PCM1.0", "PCM1.0 RX"},
+       {"DAC1.0 MUX", "PCM1.1", "PCM1.1 RX"},
+       {"DAC1.0 MUX", "PCM1.2", "PCM1.2 RX"},
+       {"DAC1.0 MUX", "PCM1.3", "PCM1.3 RX"},
+       {"DAC1.0 MUX", "PCM2.0", "PCM2.0 RX"},
+       {"DAC1.0 MUX", "PCM2.1", "PCM2.1 RX"},
+       {"DAC1.0 MUX", "PCM2.2", "PCM2.2 RX"},
+       {"DAC1.0 MUX", "PCM2.3", "PCM2.3 RX"},
+
        {"DAC1.1 MUX", "VP CSOUT1", "VP CSOUT1 Mixer"},
        {"DAC1.1 MUX", "VP CSOUT2", "VP CSOUT2 Mixer"},
        {"DAC1.1 MUX", "VP FEOUT1", "VP FEOUT1 Mixer"},
        {"DAC1.1 MUX", "VP FEOUT1", "VP FEOUT_CSOUT Mixer"},
        {"DAC1.1 MUX", "VP FEOUT2", "VP FEOUT2 Mixer"},
-       {"DAC1.1 MUX", "AudioZoom CSOUT", "AudioZoom CSOUT Mixer"},
-       {"DAC1.1 MUX", "AudioZoom AOUT1", "AudioZoom AOUT1 Mixer"},
+       {"DAC1.1 MUX", "AudioFocus CSOUT1", "AudioFocus CSOUT1 Mixer"},
+       {"DAC1.1 MUX", "AudioFocus CSOUT2", "AudioFocus CSOUT2 Mixer"},
        {"DAC1.1 MUX", "MM PASSOUT1", "MM PASSOUT1 Mixer"},
        {"DAC1.1 MUX", "MM PASSOUT2", "MM PASSOUT2 Mixer"},
        {"DAC1.1 MUX", "MM AUDOUT1", "MM AUDOUT1 Mixer"},
@@ -3934,7 +4566,19 @@ static const struct snd_soc_dapm_route intercon[] = {
        {"DAC1.1 MUX", "Pass AUDOUT3", "Pass AUDOUT3 Mixer"},
        {"DAC1.1 MUX", "Pass AUDOUT4", "Pass AUDOUT4 Mixer"},
        {"DAC1.1 MUX", "Pass AO1", "Pass AO1 Mixer"},
-       {"DAC1.1 MUX", "Pass MO2", "Pass MO2 Mixer"},
+       {"DAC1.1 MUX", "Pass AO2", "Pass AO2 Mixer"},
+       {"DAC1.1 MUX", "PCM0.0", "PCM0.0 RX"},
+       {"DAC1.1 MUX", "PCM0.1", "PCM0.1 RX"},
+       {"DAC1.1 MUX", "PCM0.2", "PCM0.2 RX"},
+       {"DAC1.1 MUX", "PCM0.3", "PCM0.3 RX"},
+       {"DAC1.1 MUX", "PCM1.0", "PCM1.0 RX"},
+       {"DAC1.1 MUX", "PCM1.1", "PCM1.1 RX"},
+       {"DAC1.1 MUX", "PCM1.2", "PCM1.2 RX"},
+       {"DAC1.1 MUX", "PCM1.3", "PCM1.3 RX"},
+       {"DAC1.1 MUX", "PCM2.0", "PCM2.0 RX"},
+       {"DAC1.1 MUX", "PCM2.1", "PCM2.1 RX"},
+       {"DAC1.1 MUX", "PCM2.2", "PCM2.2 RX"},
+       {"DAC1.1 MUX", "PCM2.3", "PCM2.3 RX"},
 
        /* AIF TX <--> PCM PORTA  */
 
@@ -4011,7 +4655,7 @@ int es_d300_fill_cmdcache(struct snd_soc_codec *codec)
        const char *algo_text[ALGO_MAX] = {
                [VP] = "VP",
                [MM] = "MM",
-               [AUDIOZOOM] = "AudioZoom",
+               [AUDIOFOCUS] = "AudioFocus",
                [PASSTHRU] = "Passthru",
        };
 
@@ -4041,8 +4685,13 @@ int es_d300_add_snd_soc_controls(struct snd_soc_codec *codec)
 {
        int rc;
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0)
        rc = snd_soc_add_codec_controls(codec, es_d300_snd_controls,
                        ARRAY_SIZE(es_d300_snd_controls));
+#else
+       rc = snd_soc_add_controls(codec, es_d300_snd_controls,
+                       ARRAY_SIZE(es_d300_snd_controls));
+#endif
 
        return rc;
 }
index cfe4474..520c791 100644 (file)
@@ -60,37 +60,49 @@ enum {
 
 #define VP_RXCHMGR_MAX 9
 #define VP_TXCHMGR_MAX 6
+#define AUDIOFOCUS_TXCHMGR_MAX 6
 #define MM_RXCHMGR_MAX 6
 #define MM_TXCHMGR_MAX 6
 #define VP_MM_RXCHMGR_MAX 10
 #define VP_MM_TXCHMGR_MAX 5
 #define PT_VP_RXCHMGR_MAX 6
 #define PT_VP_TXCHMGR_MAX 6
-#define DHWPT_RXCHMGR_MAX 6
-#define DHWPT_TXCHMGR_MAX 6
+#define BARGE_IN_TXCHMGR_MAX 6
+#define KALA_OK_RXCHMGR_MAX 3
+#define KALA_OK_TXCHMGR_MAX 5
+
 enum {
        ES_VP_NONE,
        ES_VP_RX_INIT, /* VP RX Initialized */
        ES_VP_TX_INIT, /* VP TX Initialized */
-       ES_AZ_NONE,
-       ES_AZ_RX_INIT, /* AZ RX Initialized */
-       ES_AZ_TX_INIT, /* AZ TX Initialized */
+       ES_AF_NONE,
+       ES_AF_RX_INIT, /* AF RX Initialized */
+       ES_AF_TX_INIT, /* AF TX Initialized */
 };
 
+enum {
+       ES_TYPE_NONE,
+       ES_TYPE_PB,
+       ES_TYPE_CAP,
+};
+
+
 /* Algorithm */
 enum {
        VP,
        MM,
-       AUDIOZOOM,
+       AUDIOFOCUS,
        PASSTHRU,
        VP_MM,
        PASSTHRU_VP,
        PASSTHRU_MM,
        PASSTHRU_VP_MM,
-       PASSTHRU_AZ,
+       PASSTHRU_AF,
        VOICEQ,
+       BARGE_IN,
+       KALA_OK,
        DHWPT,
-       NONE,
+       ALGO_NONE,
        ALGO_MAX,
 };
 
@@ -117,7 +129,7 @@ enum {
        FILTER_TXCHANMGR5,
 
        FILTER_VP = 0x13,
-       FILTER_AZ,
+       FILTER_AF,
        FILTER_MM,
        FILTER_PASSTHRU,
        FILTER_BEEP,
@@ -210,10 +222,10 @@ enum {
        mm_o0 = 0x0,
        mm_o1,
 
-       az_i0 = 0x0,
-       az_i1,
-       az_i2,
-       az_o0 = 0x0,
+       af_i0 = 0x0,
+       af_i1,
+       af_i2,
+       af_o0 = 0x0,
 
        pass_i0 = 0x0,
        pass_i1,
@@ -260,16 +272,42 @@ struct es_ch_mgr_max {
 };
 
 /* Switch Settings used in PT+VP Algorithm */
-#define SWIN0_I0       0
-#define SWIN0_I1       1
-#define SWIN1_I0       2
-#define SWIN1_I1       3
-#define SWIN2_I0       4
-#define SWIN2_I1       5
-#define SWOUT0_O1      6
-#define SWOUT1_O1      7
-#define SWOUT2_O1      8
-#define SWOUT3_O1      9
+#define SW_VALUE_MAX 2
+struct switch_setting {
+       u32 value_cmd[SW_VALUE_MAX];
+       bool value;
+};
+
+enum {
+       SWIN1 = 0,
+       SWIN2,
+       SWOUT0,
+       SWOUT1,
+       SWOUT2,
+       SWOUT3,
+       SW_MAX,
+};
+
+/* Active IP */
+enum {
+       ACTIVE_IP_OFF = 0,
+       ACTIVE_IP_PRI,
+       ACTIVE_IP_WPIN,
+};
+
+/* Primary PB */
+enum {
+       PRI_PB_OFF = 0,
+       PRI_PB_STEREO,
+};
+
+/* Secondary PB */
+enum {
+       SEC_PB_OFF = 0,
+       SEC_PB_MIXED_MONO,
+       SEC_PB_STEREO,
+};
+
 
 /* TODO: Create a 2D array to map endpoint values
  * with path IDs. */
@@ -297,7 +335,9 @@ struct es_ch_mgr_max {
 extern int es_d300_add_snd_soc_dapm_controls(struct snd_soc_codec *codec);
 extern int es_d300_add_snd_soc_controls(struct snd_soc_codec *codec);
 extern int es_d300_add_snd_soc_route_map(struct snd_soc_codec *codec);
+extern int es_change_power_state_normal(struct escore_priv *escore);
 int es_d300_fill_cmdcache(struct snd_soc_codec *codec);
 void es_d300_reset_cmdcache(void);
+int _es_stop_route(struct escore_priv *escore, u8 stream_type);
 
 #endif /* _ES_D300_H */
index 344b6fc..0b208c1 100644 (file)
 
 
 #include "es-d300.h"
+#if defined(CONFIG_SND_SOC_ES854)
+#include "es-a350-reg.h"
+#elif defined(CONFIG_SND_SOC_ES857)
+#include "es-a375-reg.h"
+#else
 #include "es-a300-reg.h"
+#endif
 #include "es755.h"
 
 static struct escore_api_access es755_api_access[ES_API_ADDR_MAX] = {
@@ -51,7 +57,7 @@ static struct escore_api_access es755_api_access[ES_API_ADDR_MAX] = {
                .write_msg = { ES_API_WORD(0x9056, 0x0000) },
                .write_msg_len = 4,
                .val_shift = 0,
-               .val_max = 0xFF,
+               .val_max = 0x1FF,
        },
        [ES_GET_ACCDET_STATUS] = {
                .read_msg = { ES_API_WORD(0x8054, 0x0000) },
@@ -131,493 +137,16 @@ static struct escore_api_access es755_api_access[ES_API_ADDR_MAX] = {
                .val_shift = 0,
                .val_max = 65535,
        },
-       [ES_BUTTON_CTRL2] = {
-               .read_msg = { ES_API_WORD(ES_GET_DEV_PARAM, 0x1632) },
-               .read_msg_len = 4,
-               .write_msg = { ES_API_WORD(ES_SET_DEV_PARAM_ID, 0x1632),
-                              ES_API_WORD(ES_SET_DEV_PARAM, 0x0000) },
-               .write_msg_len = 8,
-               .val_shift = 0,
-               .val_max = 65535,
-       },
-       [ES_BUTTON_CTRL3] = {
-               .read_msg = { ES_API_WORD(ES_GET_DEV_PARAM, 0x1633) },
-               .read_msg_len = 4,
-               .write_msg = { ES_API_WORD(ES_SET_DEV_PARAM_ID, 0x1633),
-                              ES_API_WORD(ES_SET_DEV_PARAM, 0x0000) },
-               .write_msg_len = 8,
-               .val_shift = 0,
-               .val_max = 65535,
-       },
-       [ES_BUTTON_CTRL4] = {
-               .read_msg = { ES_API_WORD(ES_GET_DEV_PARAM, 0x1634) },
+       [ES_CODEC_VALUE] = {
+               .read_msg = { ES_API_WORD(0x8009, 0x0000) },
                .read_msg_len = 4,
-               .write_msg = { ES_API_WORD(ES_SET_DEV_PARAM_ID, 0x1634),
-                              ES_API_WORD(ES_SET_DEV_PARAM, 0x0000) },
-               .write_msg_len = 8,
+               .write_msg = { ES_API_WORD(0x900A, 0x0000) },
+               .write_msg_len = 4,
                .val_shift = 0,
                .val_max = 65535,
        },
-       [ES_PRIMARY_MUX] = {
-               .write_msg = {
-                       ES_API_WORD(ES_SET_MUX_CMD,
-                                       ES300_DATA_PATH(0, 0, RXCHMGR0)),
-                       ES_API_WORD(ES_SET_PATH_ID_CMD,
-                                       ES300_PATH_ID(RXCHMGR0, ES300_PRI)),
-               },
-               .write_msg_len = 8,
-               .val_shift = 0,
-               .val_max = MAX_INPUT_PORT,
-       },
-       [ES_SECONDARY_MUX] = {
-               .write_msg = {
-                       ES_API_WORD(ES_SET_MUX_CMD,
-                                       ES300_DATA_PATH(0, 0, RXCHMGR1)),
-                       ES_API_WORD(ES_SET_PATH_ID_CMD,
-                                       ES300_PATH_ID(RXCHMGR1, ES300_SEC)),
-                       ES_API_WORD(ES_CONNECT_CMD,
-                                       ES300_ENDPOINT(FILTER_RXCHANMGR1,
-                                               OUT, RxChMgr_o0)),
-                       ES_API_WORD(ES_CONNECT_CMD,
-                                       ES300_ENDPOINT(FILTER_VP, IN, vp_i2)),
-                       ES_API_WORD(ES_SET_RATE_CMD,
-                                       ES300_RATE(FILTER_RXCHANMGR1, 1)),
-                       ES_API_WORD(ES_SET_GROUP_CMD,
-                                       ES300_GROUP(FILTER_RXCHANMGR1, 0)),
-               },
-               .write_msg_len = 24,
-               .val_shift = 0,
-               .val_max = MAX_INPUT_PORT,
-
-       },
-       [ES_TERTIARY_MUX] = {
-               .write_msg = {
-                       ES_API_WORD(ES_SET_MUX_CMD,
-                                       ES300_DATA_PATH(0, 0, RXCHMGR2)),
-                       ES_API_WORD(ES_SET_PATH_ID_CMD,
-                                       ES300_PATH_ID(RXCHMGR2, ES300_TER)),
-                       ES_API_WORD(ES_CONNECT_CMD,
-                                       ES300_ENDPOINT(FILTER_RXCHANMGR2,
-                                               OUT, RxChMgr_o0)),
-                       ES_API_WORD(ES_CONNECT_CMD,
-                                       ES300_ENDPOINT(FILTER_VP, IN, vp_i3)),
-                       ES_API_WORD(ES_SET_RATE_CMD,
-                                       ES300_RATE(FILTER_RXCHANMGR2, 2)),
-                       ES_API_WORD(ES_SET_GROUP_CMD,
-                                       ES300_GROUP(FILTER_RXCHANMGR2, 0)),
-               },
-               .write_msg_len = 24,
-               .val_shift = 0,
-               .val_max = MAX_INPUT_PORT,
-       },
-       [ES_AECREF1_MUX] = {
-               .write_msg = {
-                       ES_API_WORD(ES_SET_MUX_CMD,
-                                       ES300_DATA_PATH(0, 0, RXCHMGR4)),
-                       ES_API_WORD(ES_SET_PATH_ID_CMD,
-                                       ES300_PATH_ID(RXCHMGR4, ES300_AECREF)),
-                       ES_API_WORD(ES_CONNECT_CMD,
-                                       ES300_ENDPOINT(FILTER_RXCHANMGR4,
-                                               OUT, RxChMgr_o0)),
-                       ES_API_WORD(ES_CONNECT_CMD,
-                                       ES300_ENDPOINT(FILTER_VP, IN, vp_i4)),
-                       ES_API_WORD(ES_SET_RATE_CMD,
-                                       ES300_RATE(FILTER_RXCHANMGR4, 2)),
-                       ES_API_WORD(ES_SET_GROUP_CMD,
-                                       ES300_GROUP(FILTER_RXCHANMGR4, 0)),
-               },
-               .write_msg_len = 24,
-               .val_shift = 0,
-               .val_max = MAX_INPUT_PORT,
-       },
-       [ES_FEIN_MUX] = {
-               .write_msg = {
-                       ES_API_WORD(ES_SET_MUX_CMD,
-                                       ES300_DATA_PATH(0, 0, RXCHMGR3)),
-                       ES_API_WORD(ES_SET_PATH_ID_CMD,
-                                       ES300_PATH_ID(RXCHMGR3, ES300_FEIN)),
-               },
-               .write_msg_len = 8,
-               .val_shift = 0,
-               .val_max = MAX_INPUT_PORT,
-       },
-
-       [ES_UITONE1_MUX] = {
-               .write_msg = {
-                       ES_API_WORD(ES_SET_MUX_CMD,
-                                       ES300_DATA_PATH(0, 0, RXCHMGR5)),
-                       ES_API_WORD(ES_SET_PATH_ID_CMD,
-                               ES300_PATH_ID(RXCHMGR5, ES300_UITONE1)),
-               },
-               .write_msg_len = 8,
-               .val_shift = 0,
-               .val_max = MAX_PATH_TYPE,
-       },
-
-       [ES_UITONE2_MUX] = {
-               .write_msg = {
-                       ES_API_WORD(ES_SET_MUX_CMD,
-                                       ES300_DATA_PATH(0, 0, RXCHMGR6)),
-                       ES_API_WORD(ES_SET_PATH_ID_CMD,
-                               ES300_PATH_ID(RXCHMGR6, ES300_UITONE1)),
-               },
-               .write_msg_len = 8,
-               .val_shift = 0,
-               .val_max = MAX_PATH_TYPE,
-       },
-
-       [ES_UITONE3_MUX] = {
-               .write_msg = {
-                       ES_API_WORD(ES_SET_MUX_CMD,
-                                       ES300_DATA_PATH(0, 0, RXCHMGR5)),
-                       ES_API_WORD(ES_SET_PATH_ID_CMD,
-                               ES300_PATH_ID(RXCHMGR5, ES300_UITONE3)),
-               },
-               .write_msg_len = 8,
-               .val_shift = 0,
-               .val_max = MAX_PATH_TYPE,
-       },
-
-       [ES_UITONE4_MUX] = {
-               .write_msg = {
-                       ES_API_WORD(ES_SET_MUX_CMD,
-                                       ES300_DATA_PATH(0, 0, RXCHMGR6)),
-                       ES_API_WORD(ES_SET_PATH_ID_CMD,
-                               ES300_PATH_ID(RXCHMGR6, ES300_UITONE4)),
-               },
-               .write_msg_len = 8,
-               .val_shift = 0,
-               .val_max = MAX_PATH_TYPE,
-       },
-
-       [ES_MMUITONE1_MUX] = {
-               .write_msg = {
-                       ES_API_WORD(ES_SET_MUX_CMD,
-                                       ES300_DATA_PATH(0, 0, RXCHMGR2)),
-                       ES_API_WORD(ES_SET_PATH_ID_CMD,
-                                       ES300_PATH_ID(RXCHMGR2, ES300_UITONE1)),
-               },
-               .write_msg_len = 8,
-               .val_shift = 0,
-               .val_max = MAX_PATH_TYPE,
-       },
-       [ES_MMUITONE2_MUX] = {
-               .write_msg = {
-                       ES_API_WORD(ES_SET_MUX_CMD,
-                                       ES300_DATA_PATH(0, 0, RXCHMGR3)),
-                       ES_API_WORD(ES_SET_PATH_ID_CMD,
-                                       ES300_PATH_ID(RXCHMGR3, ES300_UITONE2)),
-               },
-               .write_msg_len = 8,
-               .val_shift = 0,
-               .val_max = MAX_PATH_TYPE,
-       },
-       [ES_AUDIN1_MUX] = {
-               .write_msg = {
-                       ES_API_WORD(ES_SET_MUX_CMD,
-                                       ES300_DATA_PATH(0, 0, RXCHMGR0)),
-                       ES_API_WORD(ES_SET_PATH_ID_CMD,
-                                       ES300_PATH_ID(RXCHMGR0, ES300_AUDIN1)),
-               },
-               .write_msg_len = 8,
-               .val_shift = 0,
-               .val_max = MAX_PATH_TYPE,
-       },
-       [ES_AUDIN2_MUX] = {
-               .write_msg = {
-                       ES_API_WORD(ES_SET_MUX_CMD,
-                                       ES300_DATA_PATH(0, 0, RXCHMGR1)),
-                       ES_API_WORD(ES_SET_PATH_ID_CMD,
-                                       ES300_PATH_ID(RXCHMGR1, ES300_AUDIN2)),
-               },
-               .write_msg_len = 8,
-               .val_shift = 0,
-               .val_max = MAX_PATH_TYPE,
-       },
-       [ES_MM_PASSIN1_MUX] = {
-               .write_msg = {
-                       ES_API_WORD(ES_SET_MUX_CMD,
-                                       ES300_DATA_PATH(0, 0, RXCHMGR0)),
-                       ES_API_WORD(ES_SET_PATH_ID_CMD,
-                                       ES300_PATH_ID(RXCHMGR0, ES300_PASSIN1)),
-               },
-               .write_msg_len = 8,
-               .val_shift = 0,
-               .val_max = MAX_PATH_TYPE,
-       },
-       [ES_MM_PASSIN2_MUX] = {
-               .write_msg = {
-                       ES_API_WORD(ES_SET_MUX_CMD,
-                                       ES300_DATA_PATH(0, 0, RXCHMGR1)),
-                       ES_API_WORD(ES_SET_PATH_ID_CMD,
-                               ES300_PATH_ID(RXCHMGR1, ES300_PASSIN2)),
-                       ES_API_WORD(ES_CONNECT_CMD,
-                                       ES300_ENDPOINT(FILTER_RXCHANMGR1,
-                                               OUT, RxChMgr_o0)),
-                       ES_API_WORD(ES_CONNECT_CMD,
-                               ES300_ENDPOINT(FILTER_PASSTHRU, IN, pass_i1)),
-                       ES_API_WORD(ES_SET_RATE_CMD,
-                                       ES300_RATE(FILTER_RXCHANMGR1, 3)),
-                       ES_API_WORD(ES_SET_GROUP_CMD,
-                                       ES300_GROUP(FILTER_RXCHANMGR1, 0)),
-               },
-               .write_msg_len = 24,
-               .val_shift = 0,
-               .val_max = MAX_PATH_TYPE,
-       },
-
-       [ES_PASSIN1_MUX] = {
-               .write_msg = {
-                       ES_API_WORD(ES_SET_MUX_CMD,
-                                       ES300_DATA_PATH(0, 0, RXCHMGR0)),
-                       ES_API_WORD(ES_SET_PATH_ID_CMD,
-                                       ES300_PATH_ID(RXCHMGR0, ES300_PASSIN1)),
-               },
-               .write_msg_len = 8,
-               .val_shift = 0,
-               .val_max = MAX_PATH_TYPE,
-       },
-       [ES_PASSIN2_MUX] = {
-               .write_msg = {
-                       ES_API_WORD(ES_SET_MUX_CMD,
-                                       ES300_DATA_PATH(0, 0, RXCHMGR1)),
-                       ES_API_WORD(ES_SET_PATH_ID_CMD,
-                               ES300_PATH_ID(RXCHMGR1, ES300_PASSIN2)),
-                       ES_API_WORD(ES_CONNECT_CMD,
-                                       ES300_ENDPOINT(FILTER_RXCHANMGR1,
-                                               OUT, RxChMgr_o0)),
-                       ES_API_WORD(ES_CONNECT_CMD,
-                               ES300_ENDPOINT(FILTER_PASSTHRU, IN, pass_i1)),
-                       ES_API_WORD(ES_SET_RATE_CMD,
-                                       ES300_RATE(FILTER_RXCHANMGR1, 3)),
-                       ES_API_WORD(ES_SET_GROUP_CMD,
-                                       ES300_GROUP(FILTER_RXCHANMGR1, 0)),
-               },
-               .write_msg_len = 24,
-               .val_shift = 0,
-               .val_max = MAX_PATH_TYPE,
-       },
-       [ES_PASSIN3_MUX] = {
-               .write_msg = {
-                       ES_API_WORD(ES_SET_MUX_CMD,
-                                       ES300_DATA_PATH(0, 0, RXCHMGR2)),
-                       ES_API_WORD(ES_SET_PATH_ID_CMD,
-                               ES300_PATH_ID(RXCHMGR2, ES300_PASSIN3)),
-                       ES_API_WORD(ES_CONNECT_CMD,
-                                       ES300_ENDPOINT(FILTER_RXCHANMGR2,
-                                               OUT, RxChMgr_o0)),
-                       ES_API_WORD(ES_CONNECT_CMD,
-                               ES300_ENDPOINT(FILTER_PASSTHRU, IN, pass_i2)),
-                       ES_API_WORD(ES_SET_RATE_CMD,
-                                       ES300_RATE(FILTER_RXCHANMGR2, 4)),
-                       ES_API_WORD(ES_SET_GROUP_CMD,
-                                       ES300_GROUP(FILTER_RXCHANMGR2, 0)),
-               },
-               .write_msg_len = 24,
-               .val_shift = 0,
-               .val_max = MAX_PATH_TYPE,
-       },
-       [ES_PASSIN4_MUX] = {
-               .write_msg = {
-                       ES_API_WORD(ES_SET_MUX_CMD,
-                                       ES300_DATA_PATH(0, 0, RXCHMGR3)),
-                       ES_API_WORD(ES_SET_PATH_ID_CMD,
-                               ES300_PATH_ID(RXCHMGR3, ES300_PASSIN4)),
-                       ES_API_WORD(ES_CONNECT_CMD,
-                                       ES300_ENDPOINT(FILTER_RXCHANMGR3,
-                                               OUT, RxChMgr_o0)),
-                       ES_API_WORD(ES_CONNECT_CMD,
-                               ES300_ENDPOINT(FILTER_PASSTHRU, IN, pass_i3)),
-                       ES_API_WORD(ES_SET_RATE_CMD,
-                                       ES300_RATE(FILTER_RXCHANMGR3, 4)),
-                       ES_API_WORD(ES_SET_GROUP_CMD,
-                                       ES300_GROUP(FILTER_RXCHANMGR3, 0)),
-               },
-               .write_msg_len = 24,
-               .val_shift = 0,
-               .val_max = MAX_PATH_TYPE,
-       },
-       [ES_DAC0_0_MUX] = {
-               .write_msg = {
-                       ES_API_WORD(ES_SET_MUX_CMD,
-                                       ES300_DATA_PATH(DAC0, 0, 0)),
-                       ES_API_WORD(ES_SET_PATH_ID_CMD,
-                                       ES300_PATH_ID(0, 0)),
-               },
-               .write_msg_len = 8,
-               .val_shift = 0,
-               .val_max = MAX_PATH_TYPE,
-       },
-       [ES_DAC0_1_MUX] = {
-               .write_msg = {
-                       ES_API_WORD(ES_SET_MUX_CMD,
-                                       ES300_DATA_PATH(DAC0, 1, 0)),
-                       ES_API_WORD(ES_SET_PATH_ID_CMD,
-                                       ES300_PATH_ID(0, 0)),
-               },
-               .write_msg_len = 8,
-               .val_shift = 0,
-               .val_max = MAX_PATH_TYPE,
-       },
-       [ES_DAC1_0_MUX] = {
-               .write_msg = {
-                       ES_API_WORD(ES_SET_MUX_CMD,
-                                       ES300_DATA_PATH(DAC1, 0, 0)),
-                       ES_API_WORD(ES_SET_PATH_ID_CMD,
-                                       ES300_PATH_ID(0, 0)),
-               },
-               .write_msg_len = 8,
-               .val_shift = 0,
-               .val_max = MAX_PATH_TYPE,
-       },
-       [ES_DAC1_1_MUX] = {
-               .write_msg = {
-                       ES_API_WORD(ES_SET_MUX_CMD,
-                                       ES300_DATA_PATH(DAC1, 1, 0)),
-                       ES_API_WORD(ES_SET_PATH_ID_CMD,
-                                       ES300_PATH_ID(0, 0)),
-               },
-               .write_msg_len = 8,
-               .val_shift = 0,
-               .val_max = MAX_PATH_TYPE,
-       },
-
-       [ES_PCM0_0_MUX] = {
-               .write_msg = {
-                       ES_API_WORD(ES_SET_MUX_CMD,
-                                       ES300_DATA_PATH(PCM0, 0, 0)),
-                       ES_API_WORD(ES_SET_PATH_ID_CMD,
-                                       ES300_PATH_ID(0, 0)),
-               },
-               .write_msg_len = 8,
-               .val_shift = 0,
-               .val_max = MAX_PATH_TYPE,
-       },
-       [ES_PCM0_1_MUX] = {
-               .write_msg = {
-                       ES_API_WORD(ES_SET_MUX_CMD,
-                                       ES300_DATA_PATH(PCM0, 1, 0)),
-                       ES_API_WORD(ES_SET_PATH_ID_CMD,
-                                       ES300_PATH_ID(0, 0)),
-               },
-               .write_msg_len = 8,
-               .val_shift = 0,
-               .val_max = MAX_PATH_TYPE,
-       },
-       [ES_PCM0_2_MUX] = {
-               .write_msg = {
-                       ES_API_WORD(ES_SET_MUX_CMD,
-                                       ES300_DATA_PATH(PCM0, 2, 0)),
-                       ES_API_WORD(ES_SET_PATH_ID_CMD,
-                                       ES300_PATH_ID(0, 0)),
-               },
-               .write_msg_len = 8,
-               .val_shift = 0,
-               .val_max = MAX_PATH_TYPE,
-       },
-       [ES_PCM0_3_MUX] = {
-               .write_msg = {
-                       ES_API_WORD(ES_SET_MUX_CMD,
-                                       ES300_DATA_PATH(PCM0, 3, 0)),
-                       ES_API_WORD(ES_SET_PATH_ID_CMD,
-                                       ES300_PATH_ID(0, 0)),
-               },
-               .write_msg_len = 8,
-               .val_shift = 0,
-               .val_max = MAX_PATH_TYPE,
-       },
-       [ES_PCM1_0_MUX] = {
-               .write_msg = {
-                       ES_API_WORD(ES_SET_MUX_CMD,
-                                       ES300_DATA_PATH(PCM1, 0, 0)),
-                       ES_API_WORD(ES_SET_PATH_ID_CMD,
-                                       ES300_PATH_ID(0, 0)),
-               },
-               .write_msg_len = 8,
-               .val_shift = 0,
-               .val_max = MAX_PATH_TYPE,
-       },
-       [ES_PCM1_1_MUX] = {
-               .write_msg = {
-                       ES_API_WORD(ES_SET_MUX_CMD,
-                                       ES300_DATA_PATH(PCM1, 1, 0)),
-                       ES_API_WORD(ES_SET_PATH_ID_CMD,
-                                       ES300_PATH_ID(0, 0)),
-               },
-               .write_msg_len = 8,
-               .val_shift = 0,
-               .val_max = MAX_PATH_TYPE,
-       },
-       [ES_PCM1_2_MUX] = {
-               .write_msg = {
-                       ES_API_WORD(ES_SET_MUX_CMD,
-                                       ES300_DATA_PATH(PCM1, 2, 0)),
-                       ES_API_WORD(ES_SET_PATH_ID_CMD,
-                                       ES300_PATH_ID(0, 0)),
-               },
-               .write_msg_len = 8,
-               .val_shift = 0,
-               .val_max = MAX_PATH_TYPE,
-       },
-       [ES_PCM1_3_MUX] = {
-               .write_msg = {
-                       ES_API_WORD(ES_SET_MUX_CMD,
-                                       ES300_DATA_PATH(PCM1, 3, 0)),
-                       ES_API_WORD(ES_SET_PATH_ID_CMD,
-                                       ES300_PATH_ID(0, 0)),
-               },
-               .write_msg_len = 8,
-               .val_shift = 0,
-               .val_max = MAX_PATH_TYPE,
-       },
-       [ES_PCM2_0_MUX] = {
-               .write_msg = {