asoc: es755: fix pop sound in passthru playback
Srinivas Anne [Thu, 12 Nov 2015 04:07:23 +0000 (20:07 -0800)]
Hawkeye FW version:
M90.5.2.12_B61366_NVidia_Hawkeye_MCFFillIn_STREAM.bin

Loki FW version:
M90.5.2.12_B61668_NVidia_Loki_MCFFillIn_STREAM.bin

Change Summary:
fixed POP sound in DHWPT playback when capture starts.
Fixed audio mute issue during device switch
fixed Commit warnings.

Bug 200118587

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

12 files changed:
firmware/audience/es755/audience-es755-fw.bin
firmware/audience/es755/audience-es755-fw_loki.bin
sound/soc/codecs/audience/Kconfig
sound/soc/codecs/audience/es-a300-reg.h
sound/soc/codecs/audience/es-a300.c
sound/soc/codecs/audience/es-d300.c
sound/soc/codecs/audience/es755.c
sound/soc/codecs/audience/escore-pm.c
sound/soc/codecs/audience/escore-spi.c
sound/soc/codecs/audience/escore-vs.c
sound/soc/codecs/audience/escore.c
sound/soc/codecs/audience/escore.h

index 2457c3c..b43da15 100644 (file)
Binary files a/firmware/audience/es755/audience-es755-fw.bin and b/firmware/audience/es755/audience-es755-fw.bin differ
index d2af79f..2d82ac7 100644 (file)
Binary files a/firmware/audience/es755/audience-es755-fw_loki.bin and b/firmware/audience/es755/audience-es755-fw_loki.bin differ
index b347d61..3bdda1d 100644 (file)
@@ -179,8 +179,8 @@ config SND_SOC_ES705_UART_WAKEUP
 config SND_SOC_ES705_EXTCLK_OVER_GPIO
        bool "Enable External Clock Control Over GPIO"
        ---help---
-         This will enable external clock ON/OFF over 
-         GPIO
+         This will enable support of external clock ON/OFF
+         over GPIO
 
 # Options for escore infrastructure
 
index d533a1d..d1852f9 100644 (file)
@@ -1,14 +1,13 @@
-//***********************************************************************************
-// 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
-//
-//***********************************************************************************
+/*
+ * 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__
index eb81534..936437a 100644 (file)
@@ -276,8 +276,8 @@ static const char *const mic1_pga_mux_names[] = {
 };
 
 static const struct soc_enum mic1_pga_mux_enum =
-       SOC_ENUM_SINGLE_EXT(ARRAY_SIZE(mic1_pga_mux_names),
-                       mic1_pga_mux_names);
+       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);
@@ -351,8 +351,8 @@ const struct snd_soc_dapm_widget es_codec_dapm_widgets[] = {
        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),
+       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_ADC0_ON, ES_ADC0_ON_SHIFT, 0),
        SND_SOC_DAPM_MUX("ADC1 MUX", SND_SOC_NOPM, 0, 0, &adc1_mux),
@@ -423,9 +423,9 @@ static const struct snd_soc_dapm_route intercon[] = {
        {"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"},
+       {"MIC1 PGA Mux", "MIC-1", "MIC1"},
+       {"MIC1 PGA Mux", "MIC-HS", "MICHS"},
+       {"MIC1 PGA", NULL, "MIC1 PGA Mux"},
 
        {"MIC2 PGA", NULL, "MIC2"},
 
index 0ee2524..3d9d8d9 100644 (file)
@@ -232,7 +232,6 @@ static int _es_set_switch(int id)
 
        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.
@@ -283,10 +282,6 @@ int _es_stop_route(struct escore_priv *escore, u8 stream_type)
                        escore->algo_type_off = PASSTHRU_VP;
        }
 
-
-       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 &&
@@ -302,7 +297,8 @@ int _es_stop_route(struct escore_priv *escore, u8 stream_type)
                                return ret;
                        }
 
-                       /* Require 1ms delay between stop route and DHWPT to avoid noise */
+                       /* Require 1ms delay between stop route
+                          and DHWPT to avoid noise */
                        usleep_range(5000, 5005);
                }
 
@@ -310,8 +306,8 @@ int _es_stop_route(struct escore_priv *escore, u8 stream_type)
                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);
+                               pr_err("%s: Route stop failed, ret = %d\n",
+                                       __func__, ret);
                                return ret;
                        }
 
@@ -320,11 +316,14 @@ int _es_stop_route(struct escore_priv *escore, u8 stream_type)
 
                /* 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)
+               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__);
+               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",
@@ -339,11 +338,14 @@ int _es_stop_route(struct escore_priv *escore, u8 stream_type)
 
                        if (!escore->dhwpt_capture_on) {
 
-                               /* Disable DHWPT if enabled, or when stopping DHWPT use cases */
+                               /* 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 */
+                               /* 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",
@@ -358,23 +360,15 @@ int _es_stop_route(struct escore_priv *escore, u8 stream_type)
                                        return ret;
                                }
                        } else {
-
-                               pr_debug("%s(): Seems DHWPT capture is on. Skip disabling DHWPT\n", __func__);
+                               pr_debug("%s(): %s\n",
+                                       "DHWPT capture is on.Skip disabling DHWPT",
+                                       __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;
 }
@@ -389,7 +383,6 @@ static void update_chan_id(u32 *msg, int chan_id)
 
 static int setup_dhwpt_msg(u32 *msg, int mux)
 {
-       pr_debug("****** %s() *********:\n", __func__);
        switch (mux) {
        case ES_PASSIN1_MUX:
                msg[0] = 0xB05A3FF3;
@@ -575,14 +568,6 @@ 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;
@@ -675,7 +660,8 @@ static int _es_set_digital_gain(struct escore_priv *escore)
                        }
 
                        /* Set digital output gain */
-                       cmd = (ES_SET_DIGITAL_GAIN<<16) | escore->digital_gain[i];
+                       cmd = (ES_SET_DIGITAL_GAIN<<16) |
+                               escore->digital_gain[i];
                        rc = escore_cmd(escore, cmd, &resp);
                        if (rc) {
                                dev_err(escore_priv.dev,
@@ -827,19 +813,27 @@ static int _es_set_final_route(struct escore_priv *escore)
        /* 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__);
+                       pr_debug("%s():Capture is present. DHWPT is already sent.\n",
+                                                       __func__);
                else {
-                       /* Before setting DHWPT configurations, ensure that normal route setup is inactive. */
+                       /* 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__);
+                               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 */
+
+                               /* 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);
+                               pr_err("%s(): Error %d in sending DHWPT command\n",
+                                                       __func__, rc);
                                return rc;
                        }
                }
@@ -851,7 +845,7 @@ static int _es_set_final_route(struct escore_priv *escore)
        rc =  es_change_power_state_normal(escore);
        if (rc) {
                pr_err("%s(): Power state transition failed %d\n",
-                       __func__, rc);
+                               __func__, rc);
                return rc;
        }
 
@@ -886,12 +880,16 @@ static int _es_set_final_route(struct escore_priv *escore)
         * firmware after stopping the current route. The stream count will
         * anyway be decremented when the HAL layer stops the PCM stream
         * of previous use-case. */
-       else if (unlikely(atomic_read(&escore->active_streams)) && !escore->dhwpt_mode)
+       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__);
+       if (escore->algo_type == PASSTHRU_VP && !escore->dhwpt_enabled &&
+                                               escore->dhwpt_mode) {
+               dev_err(escore_priv.dev, "%s(): %s\n", __func__,
+                       "WARNING: PT_VP route called even DHWPT playback is ON");
+               dev_err(escore_priv.dev, "%s(): %s\n", __func__,
+                       "Forcibly stopping DHWPT playback");
                /* Disable DHWPT if enabled, or when stopping DHWPT use cases */
                msg = escore->dhwpt_cmd & 0xFFFF0000;
                rc = escore_cmd(escore, msg, &resp);
@@ -959,7 +957,8 @@ static int _es_set_final_route(struct escore_priv *escore)
        }
 
        /* Setup AEC if enabled */
-       if (escore->algo_type == PASSTHRU_VP && escore->vp_aec && !escore->dhwpt_enabled) {
+       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));
        }
@@ -972,8 +971,8 @@ static int _es_set_final_route(struct escore_priv *escore)
                         &resp);
 
                if (rc)
-                       pr_warn("%s(): Error %d setting Power Saving Level" \
-                               " resp = 0x%x\n", __func__, rc, resp);
+                       pr_warn("%s(): Error %d %s resp = 0x%x\n",
+                       __func__, rc, "setting Power Saving Level", resp);
        }
 
        /* add umbrella base route */
@@ -1044,8 +1043,8 @@ static int _es_set_final_route(struct escore_priv *escore)
                                &resp);
 
                if (rc) {
-                       pr_warn("%s(): Error %d selecting HPF mode" \
-                                       " resp = 0x%x\n", __func__, rc, resp);
+                       pr_warn("%s(): Error %d %s resp = 0x%x\n", __func__,
+                               rc, "selecting HPF mode", resp);
                        goto exit;
                }
        }
@@ -1276,8 +1275,10 @@ 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);
+               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) {
 
@@ -1287,8 +1288,10 @@ static int es300_codec_enable_i2srx(struct snd_soc_dapm_widget *w,
 
                        atomic_inc(&escore->active_streams);
                }
-               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);
+               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:
                for (j = 0; j < escore->dai_nr; j++) {
@@ -1300,18 +1303,12 @@ 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);
+               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) {
 
-/*
-                       if (atomic_read(&escore->active_streams) &&
-                               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);
@@ -1322,14 +1319,16 @@ static int es300_codec_enable_i2srx(struct snd_soc_dapm_widget *w,
                                    (atomic_read(&escore->active_streams) == 1
                                     && escore->dhwpt_mode)) {
                                        mutex_lock(&escore->access_lock);
-                                       ret = _es_stop_route(escore,ES_TYPE_PB);
+                                       ret = _es_stop_route(escore,
+                                                               ES_TYPE_PB);
                                        mutex_unlock(&escore->access_lock);
                                }
                        }
 
                }
-               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);
+               pr_debug("%s: END RX PMD Active channels %d Streams %d\n",
+                       __func__, escore->i2s_dai_data[dai_id].rx_ch_act,
+                       escore->active_streams);
                break;
        }
        mutex_unlock(&codec->mutex);
@@ -1358,8 +1357,9 @@ 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);
+               pr_debug("%s: BEGIN TX PMU Active channels %d 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) {
 
@@ -1369,8 +1369,9 @@ static int es300_codec_enable_i2stx(struct snd_soc_dapm_widget *w,
 
                        atomic_inc(&escore->active_streams);
                }
-               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);
+               pr_debug("%s: END TX PMU Active channels %d Streams %d\n",
+                       __func__, escore->i2s_dai_data[dai_id].tx_ch_act,
+                       escore->active_streams);
                break;
        case SND_SOC_DAPM_POST_PMD:
                for (j = 0; j < escore->dai_nr; j++) {
@@ -1382,8 +1383,9 @@ 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);
+               pr_debug("%s: BEGIN TX PMD Active channels %d Streams %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) {
                        /* Decrease active streams count if non-zero */
@@ -1396,13 +1398,15 @@ static int es300_codec_enable_i2stx(struct snd_soc_dapm_widget *w,
                                    (atomic_read(&escore->active_streams) == 1
                                     && escore->dhwpt_mode)) {
                                        mutex_lock(&escore->access_lock);
-                                       ret = _es_stop_route(escore,ES_TYPE_CAP);
+                                       ret = _es_stop_route(escore,
+                                                               ES_TYPE_CAP);
                                        mutex_unlock(&escore->access_lock);
                                }
                        }
                }
-               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);
+               pr_debug("%s: END TX PMD Active channels %d Streams %d\n",
+                       __func__, escore->i2s_dai_data[dai_id].tx_ch_act,
+                       escore->active_streams);
                break;
        }
        mutex_unlock(&codec->mutex);
@@ -1665,7 +1669,8 @@ static int es300_put_algo_state(struct snd_kcontrol *kcontrol,
                algo_type = DHWPT;
                break;
        default:
-               pr_err("%s(): Algo type not implemented: %s\n", __func__, kcontrol->id.name);
+               pr_err("%s(): Algo type not implemented: %s\n", __func__,
+                                               kcontrol->id.name);
                ret = -EINVAL;
                break;
        }
@@ -1777,7 +1782,7 @@ static int put_input_route_value(struct snd_kcontrol *kcontrol,
 #endif
 
 exit:
-       pr_debug("put input control %s (%d) val %s\n", kcontrol->id.name,reg,
+       pr_debug("put input control %s (%d) val %s\n", kcontrol->id.name, reg,
                                proc_block_input_texts[mux]);
        mutex_unlock(&codec->mutex);
 
@@ -1799,7 +1804,7 @@ 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\n", kcontrol->id.name,reg,
+       pr_debug("get input control %s (%d)  val %s\n", kcontrol->id.name, reg,
                                proc_block_input_texts[value]);
 
        return 0;
@@ -1862,7 +1867,7 @@ static int put_output_route_value(struct snd_kcontrol *kcontrol,
 #endif
 
 exit:
-       pr_debug("put output control %s (%d) val %s\n", kcontrol->id.name,reg,
+       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;
@@ -1883,7 +1888,7 @@ 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\n", kcontrol->id.name,reg,
+       pr_debug("get output control %s (%d) val %s\n", kcontrol->id.name, reg,
                                proc_block_output_texts[value]);
 
        return 0;
@@ -2412,7 +2417,7 @@ static int put_preset_value_one(struct snd_kcontrol *kcontrol,
        /* 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(): Preset ID %d is not supported\n",
                        __func__, value);
@@ -2420,12 +2425,13 @@ static int put_preset_value_one(struct snd_kcontrol *kcontrol,
                return rc;
        }
 
-       if (atomic_read(&escore->active_streams) && !escore->dhwpt_mode) {
+       if (escore->base_route_setup) {
                /* Set the preset immediately */
                usleep_range(5000, 5005);
                pr_debug("%s:add algo preset one: %d", __func__,
                                escore->algo_preset_one);
-               rc = escore_write_locked(NULL, ES_PRESET, escore->algo_preset_one);
+               rc = escore_write_locked(NULL, ES_PRESET,
+                               escore->algo_preset_one);
                if (rc)
                        dev_err(escore_priv.dev, "%s(): Set Preset one failed:%d\n",
                                __func__, rc);
@@ -2461,7 +2467,7 @@ static int put_preset_value_two(struct snd_kcontrol *kcontrol,
        /* 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(): Preset ID %d is not supported\n",
                        __func__, value);
@@ -2469,12 +2475,13 @@ static int put_preset_value_two(struct snd_kcontrol *kcontrol,
                return rc;
        }
 
-       if (atomic_read(&escore->active_streams) && !escore->dhwpt_mode) {
+       if (escore->base_route_setup) {
                /* Set the preset immediately */
                usleep_range(5000, 5005);
                pr_debug("%s:add algo preset two: %d", __func__,
                                escore->algo_preset_two);
-               rc = escore_write_locked(NULL, ES_PRESET, escore->algo_preset_two);
+               rc = escore_write_locked(NULL, ES_PRESET,
+                               escore->algo_preset_two);
                if (rc)
                        dev_err(escore_priv.dev, "%s(): Set Preset two failed:%d\n",
                                __func__, rc);
@@ -2533,7 +2540,7 @@ static int put_vp_meters(struct snd_kcontrol *kcontrol,
 }
 
 static int get_hpf_mode(struct snd_kcontrol *kcontrol,
-                struct snd_ctl_elem_value *ucontrol)
+               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);
@@ -2545,7 +2552,7 @@ static int get_hpf_mode(struct snd_kcontrol *kcontrol,
 }
 
 static int put_hpf_mode(struct snd_kcontrol *kcontrol,
-                struct snd_ctl_elem_value *ucontrol)
+               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);
index 8364fc8..28d2741 100644 (file)
@@ -145,7 +145,7 @@ static int es755_clk_ctl(int enable)
        int ret = 0;
        bool clk_en;
 
-       clk_en = enable? true: false;
+       clk_en = enable ? true : false;
 
        if (clk_en == escore_priv.codec_clk_en)
                return 0;
@@ -163,8 +163,7 @@ static int es755_clk_ctl(int enable)
                clk_disable(codec_clk);
 #endif
 
-       if ( -EINVAL != ret)
-       {
+       if (-EINVAL != ret) {
                escore_priv.codec_clk_en = clk_en;
                ret = 0;
        }
@@ -997,7 +996,8 @@ static int es755_hw_params(struct snd_pcm_substream *substream,
                        return -EINVAL;
                }
        }
-       rc = escore_write_locked(codec, ES_CODEC_OUTPUT_RATE, codec_output_rate);
+       rc = escore_write_locked(codec, ES_CODEC_OUTPUT_RATE,
+                                               codec_output_rate);
        if (rc) {
                pr_err("%s(): Preparing write message failed %d\n",
                                __func__, rc);
@@ -1011,7 +1011,7 @@ static int es755_hw_params(struct snd_pcm_substream *substream,
         */
        escore->can_mpsleep = (rate >= 48) && (bps >= 0x1F) && (channels >= 2);
 
-       dev_dbg(codec->dev, "%s(): ############# Rate %d BPS %d channels %d #############n", __func__,
+       dev_dbg(codec->dev, "%s(): # Rate %d BPS %d channels %d #\n", __func__,
                rate, bps, channels);
 
        switch (dai->id) {
@@ -1029,16 +1029,15 @@ static int es755_hw_params(struct snd_pcm_substream *substream,
        if (escore->algo_type == DHWPT || escore->dhwpt_enabled)
                escore->dhwpt_cmd = (ES_DHWPT_CMD << 16) | port_map;
 
-
        /* BAS-3205, if frame size is 64 bits and word length is 16 bits, set
         * TDM Timeslots Per Frame of PortA to 3  */
-
-
        if (escore->algo_type != DHWPT && !escore->dhwpt_enabled) {
                if (64 == (bps + 1)*channels && 0x1F == bps) {
-                       api_access = &escore->api_access[ES_PORT_TDM_SLOTS_PER_FRAME];
-                       api_access->write_msg[0] |=  ES_API_WORD(ES_SET_DEV_PARAM_ID,
-                                       (ES755_PCM_PORT_A << 8));
+                       api_access =
+                            &escore->api_access[ES_PORT_TDM_SLOTS_PER_FRAME];
+                       api_access->write_msg[0] |=
+                               ES_API_WORD(ES_SET_DEV_PARAM_ID,
+                               (ES755_PCM_PORT_A << 8));
 
                        rc = escore_write_locked(escore,
                                        ES_PORT_TDM_SLOTS_PER_FRAME,
@@ -1049,8 +1048,8 @@ static int es755_hw_params(struct snd_pcm_substream *substream,
                                return rc;
                        }
 
-                       api_access->write_msg[0] &= ES_API_WORD(ES_SET_DEV_PARAM_ID,
-                                       0x00ff);
+                       api_access->write_msg[0] &=
+                               ES_API_WORD(ES_SET_DEV_PARAM_ID, 0x00ff);
                }
        }
 
@@ -1258,18 +1257,18 @@ static int es755_get_null_control_enum(struct snd_kcontrol *kcontrol,
 }
 
 static int es755_get_power_saving_mode(struct snd_kcontrol *kcontrol,
-                            struct snd_ctl_elem_value *ucontrol)
+               struct snd_ctl_elem_value *ucontrol)
 {
-        struct snd_soc_codec *codec = escore_priv.codec;
-        struct escore_priv *escore = snd_soc_codec_get_drvdata(codec);
+       struct snd_soc_codec *codec = escore_priv.codec;
+       struct escore_priv *escore = snd_soc_codec_get_drvdata(codec);
 
-        ucontrol->value.enumerated.item[0] = escore->power_saving_mode;
+       ucontrol->value.enumerated.item[0] = escore->power_saving_mode;
 
        return 0;
 }
 
 static int es755_set_power_saving_mode(struct snd_kcontrol *kcontrol,
-                            struct snd_ctl_elem_value *ucontrol)
+               struct snd_ctl_elem_value *ucontrol)
 {
        struct snd_soc_codec *codec = escore_priv.codec;
        struct escore_priv *escore = snd_soc_codec_get_drvdata(codec);
@@ -1433,10 +1432,8 @@ int es755_power_transition(int next_power_state,
                                unsigned int set_power_state_cmd)
 {
        int rc = 0;
-       dev_dbg(escore_priv.dev,
-                       "%s(): **** Current state = %d, Next state = %d\n",
-                       __func__, escore_priv.escore_power_state,
-                       next_power_state);
+
+       dev_info(escore_priv.dev, "%s()\n", __func__);
 
        /* Power state transition */
        while (next_power_state != escore_priv.escore_power_state) {
@@ -1598,15 +1595,14 @@ int es755_power_transition(int next_power_state,
                        rc = -EINVAL;
                        goto es755_power_transition_exit;
                }
-/*
                dev_dbg(escore_priv.dev,
                        "%s(): Current state = %d, val=%d\n",
                        __func__, escore_priv.escore_power_state,
                        next_power_state);
-*/
        }
 
-       dev_dbg(escore_priv.dev, "%s(): Power state changed to %d\n", __func__,escore_priv.escore_power_state);
+       dev_dbg(escore_priv.dev, "%s(): Power state change successful\n",
+               __func__);
 es755_power_transition_exit:
        return rc;
 }
@@ -1629,7 +1625,6 @@ static int es755_put_power_control_enum(struct snd_kcontrol *kcontrol,
        struct escore_priv *escore = &escore_priv;
 
        value = ucontrol->value.enumerated.item[0];
-       dev_dbg(escore_priv.dev, "%s(): ***** Put Power state call %d *** \n", __func__,value);
 
        /* Not supported */
        if (!value) {
@@ -1652,17 +1647,18 @@ static int es755_put_power_control_enum(struct snd_kcontrol *kcontrol,
 
                escore->mp_sleep_requested = 1;
 
-               dev_dbg(escore_priv.dev, "%s(): ***** Can_mpsleep %d MP_sleep requested %d DHWPT mode %d dhwpt_capture_on %d *****\n",
-                                               __func__,escore->can_mpsleep,escore->mp_sleep_requested,escore->dhwpt_mode,escore->dhwpt_capture_on);
-               if (escore->mp_sleep_requested && escore->dhwpt_mode && !escore->dhwpt_capture_on) {
+               if (escore->mp_sleep_requested && escore->dhwpt_mode &&
+                                       !escore->dhwpt_capture_on) {
                        rc = es755_enter_mp_sleep();
                        if (rc) {
                                dev_dbg(escore_priv.dev,
-                                               "%s() es755_enter_mp_sleep fail :%d\n",
-                                               __func__, rc);
+                                       "%s() es755_enter_mp_sleep fail :%d\n",
+                                       __func__, rc);
                        }
                } else {
-                       dev_dbg(escore_priv.dev, "%s(): ***** Seem capture is present or no playback started yet, Skip putting in MP_sleep *****\n", __func__);
+                       dev_dbg(escore_priv.dev, "%s(): %s, %s\n", __func__,
+                               "Seem capture is present or no playback started yet",
+                               "Skip putting in MP_sleep");
                }
        } else {
 
@@ -1802,7 +1798,7 @@ static int es755_put_digital_gain(struct snd_kcontrol *kcontrol,
 
        pr_debug("%s: Set digital gain 0x%x.\n", __func__, val);
 
-       if ( ucontrol->value.enumerated.item[0] > (e->max - 1) ) {
+       if (ucontrol->value.enumerated.item[0] > (e->max - 1)) {
                dev_err(escore_priv.dev, "%s(): Enum exceed the maximum!\n",
                        __func__);
                return -EINVAL;
@@ -1823,16 +1819,16 @@ static int es755_put_digital_gain(struct snd_kcontrol *kcontrol,
 
 
 static const char * const es755_path_id_texts[] = {
-       [ES300_PRI] = "PRI", "SEC", "TER", "FEIN", "AECREF", "AUDIN1", "AUDIN2",
-       "RESERVED", "RESERVED",
+       [ES300_PRI] = "PRI", "SEC", "TER", "FEIN", "AECREF", "AUDIN1",
+       "AUDIN2", "RESERVED", "RESERVED",
        [ES300_UITONE1] = "UITONE1", "UITONE2", "UITONE3", "UITONE4", "PASSIN1",
-       "PASSIN2", "PASSIN3", "PASSIN4", "FEIN2", "RESERVED", "RESERVED", "RESERVED",
+       "PASSIN2", "PASSIN3", "PASSIN4", "FEIN2", "RESERVED", "RESERVED",
+       "RESERVED", "RESERVED", "RESERVED", "RESERVED", "RESERVED", "RESERVED",
        "RESERVED", "RESERVED", "RESERVED", "RESERVED", "RESERVED", "RESERVED",
-       "RESERVED", "RESERVED", "RESERVED", "RESERVED", "RESERVED",
-       [ES300_CSOUT1] = "CSOUT1", "CSOUT2", "FEOUT1", "FEOUT2", "AUDOUT1", "AUDOUT2",
-       "RESERVED", "RESERVED",
-       [ES300_MONOUT1] = "MONOUT1", "MONOUT2", "MONOUT3", "MONOUT4", "PASSOUT1",
-       "PASSOUT2", "PASSOUT3", "PASSOUT4",
+       [ES300_CSOUT1] = "CSOUT1", "CSOUT2", "FEOUT1", "FEOUT2", "AUDOUT1",
+       "AUDOUT2", "RESERVED", "RESERVED",
+       [ES300_MONOUT1] = "MONOUT1", "MONOUT2", "MONOUT3", "MONOUT4",
+       "PASSOUT1", "PASSOUT2", "PASSOUT3", "PASSOUT4",
 };
 
 static const struct soc_enum es755_path_id_enum =
@@ -2151,7 +2147,6 @@ static unsigned int es755_codec_read(struct snd_soc_codec *codec,
        int rc;
        int ret = 0;
 
-       pr_debug("%s()\n", __func__);
        if (reg > ES_MAX_REGISTER) {
                /*dev_err(codec->dev, "read out of range reg %d", reg);*/
                return 0;
@@ -2191,9 +2186,9 @@ static unsigned int es755_codec_read(struct snd_soc_codec *codec,
        }
        escore->reg_cache[reg].value = value;
 
-       dev_dbg(escore_priv.dev, "%s(): ***** Can_mpsleep %d MP_sleep requested %d DHWPT mode %d dhwpt_capture_on %d *****\n",
-                       __func__,escore->can_mpsleep,escore->mp_sleep_requested,escore->dhwpt_mode,escore->dhwpt_capture_on);
-       if (escore->mp_sleep_requested && escore->dhwpt_mode && !escore->dhwpt_capture_on && escore->acc_det_status != ES_ACC_BUTTON_PRESSED) {
+       if (escore->mp_sleep_requested && escore->dhwpt_mode &&
+                       !escore->dhwpt_capture_on
+                       && escore->acc_det_status != ES_ACC_BUTTON_PRESSED) {
                pr_debug("%s(): Put chip back into mp_sleep\n", __func__);
                es755_enter_mp_sleep();
        }
@@ -2207,9 +2202,7 @@ static int es755_codec_write(struct snd_soc_codec *codec, unsigned int reg,
        unsigned int value)
 {
        struct escore_priv *escore = &escore_priv;
-       u32 resp;
        int ret = 0;
-       pr_debug("%s()\n", __func__);
 
        if (reg > ES_MAX_REGISTER) {
                /*dev_err(codec->dev, "write out of range reg %d", reg);*/
@@ -2231,9 +2224,7 @@ static int es755_codec_write(struct snd_soc_codec *codec, unsigned int reg,
        }
 
        if (atomic_read(&escore->active_streams) > 0)
-       {
                usleep_range(1000, 1005);
-       }
 
        ret = escore_write(codec, ES_CODEC_ADDR, reg);
        if (ret < 0) {
@@ -2250,9 +2241,9 @@ static int es755_codec_write(struct snd_soc_codec *codec, unsigned int reg,
        }
        escore->reg_cache[reg].value = value;
 
-       dev_dbg(escore_priv.dev, "%s(): ***** Can_mpsleep %d MP_sleep requested %d DHWPT mode %d dhwpt_capture_on %d *****\n",
-                       __func__,escore->can_mpsleep,escore->mp_sleep_requested,escore->dhwpt_mode,escore->dhwpt_capture_on);
-       if (escore->mp_sleep_requested && escore->dhwpt_mode && !escore->dhwpt_capture_on && escore->acc_det_status != ES_ACC_BUTTON_PRESSED) {
+       if (escore->mp_sleep_requested && escore->dhwpt_mode &&
+                       !escore->dhwpt_capture_on &&
+                       escore->acc_det_status != ES_ACC_BUTTON_PRESSED) {
                pr_debug("%s(): Put chip back into mp_sleep\n", __func__);
                es755_enter_mp_sleep();
        }
@@ -2722,7 +2713,7 @@ static int chk_btn_press_event(
                        rc = escore_pm_get_sync();
                        if (rc < 0) {
                                pr_err("%s(): pm_get_sync failed :%d\n",
-                                               __func__, rc);
+                                      __func__, rc);
                                goto err_exit;
                        }
                        escore->acc_det_status = ES_ACC_BUTTON_PRESSED;
@@ -2750,8 +2741,10 @@ static int chk_btn_release_event(
                 */
                if (escore->acc_det_status == ES_ACC_BUTTON_PRESSED) {
                        escore_pm_put_autosuspend();
-                       if (escore->mp_sleep_requested && escore->dhwpt_mode && !escore->dhwpt_capture_on) {
-                               pr_debug("%s(): Put chip back into mp_sleep\n", __func__);
+                       if (escore->mp_sleep_requested && escore->dhwpt_mode
+                                               && !escore->dhwpt_capture_on) {
+                               pr_debug("%s(): Put chip back into mp_sleep\n",
+                                                       __func__);
                                es755_enter_mp_sleep();
                        }
                }
@@ -2815,8 +2808,8 @@ static int es755_codec_intr(struct notifier_block *self, unsigned long action,
        pr_debug("%s(): Event: 0x%04x\n", __func__, (u32)action);
 
        if (escore->dhwpt_mode) {
-               /* Cancel delayed work of MP Sleep, and bring chip to Normal mode
-                * if it is in MP Sleep mode */
+               /* Cancel delayed work of MP Sleep and bring chip to Normal
+                  mode if it is in MP Sleep mode */
                pr_debug("%s(): Bring chip from MP Sleep to Normal mode\n",
                                __func__);
                rc = es755_exit_mp_sleep();
@@ -2888,7 +2881,6 @@ static int es755_codec_intr(struct notifier_block *self, unsigned long action,
                        }
 
                        impd_level = accdet_status_reg.fields.impd_level;
-                       pr_info("%s(): ******* Impd level ****** %d\n",__func__,impd_level);
 
                        mg_select = accdet_status_reg.fields.mg_select;
                        mg_sel_force = accdet_cfg.mic_det_enabled & (0x1);
@@ -2922,7 +2914,7 @@ static int es755_codec_intr(struct notifier_block *self, unsigned long action,
                                        msleep(escore_priv.hs_delay);
                                        pr_debug("%s(): ***Redetect HS MIC with Delay %d\n",
                                                __func__,escore_priv.hs_delay);
-                                       // redetect_HS
+                                       /* redetect_HS */
                                        rc = es755_mic_config(escore);
                                        if (rc < 0) {
                                                pr_err("%s(): MIC config fail %d\n",
@@ -3033,11 +3025,13 @@ static int es755_codec_intr(struct notifier_block *self, unsigned long action,
                         * Put the chip back to autosuspend when user unplugs.
                         */
                        if (escore->acc_det_status == ES_ACC_BUTTON_PRESSED) {
-
                                escore_pm_put_autosuspend();
-
-                               if (escore->mp_sleep_requested && escore->dhwpt_mode && !escore->dhwpt_capture_on) {
-                                       pr_debug("%s(): Put chip back into mp_sleep\n", __func__);
+                               if (escore->mp_sleep_requested
+                                               && escore->dhwpt_mode
+                                               && !escore->dhwpt_capture_on) {
+                                       pr_debug("%s(): %s\n",
+                                                "Put chip back into mp_sleep",
+                                               __func__);
                                        es755_enter_mp_sleep();
                                }
                        }
@@ -3128,7 +3122,7 @@ irqreturn_t es755_irq_work(int irq, void *data)
        int rc, ret;
        u32 cmd = 0;
        u32 event_type = 0;
-       pr_info("%s(): @@@@@@ Entry #####\n", __func__);
+
        pr_debug("%s() Interrupt received\n", __func__);
        if (!escore) {
                pr_err("%s(): Invalid IRQ data\n", __func__);
@@ -3165,10 +3159,9 @@ repeat:
                msleep(ES_PM_CLOCK_STABILIZATION);
        }
 
-
        if (escore->dhwpt_mode) {
-               /* Cancel delayed work of MP Sleep, and bring chip to Normal mode
-                * if it is in MP Sleep mode */
+               /* Cancel delayed work of MP Sleep, and bring chip to
+                  Normal mode if it is in MP Sleep mode */
                pr_debug("%s(): Bring chip from MP Sleep to Normal mode\n",
                                __func__);
                rc = es755_exit_mp_sleep();
@@ -3252,7 +3245,6 @@ irq_exit:
        escore_pm_put_autosuspend();
 err_pm_get_sync:
        escore->intr_recvd = 0;
-       pr_info("%s(): @@@@@@ Exit #####\n", __func__);
        return IRQ_HANDLED;
 }
 
@@ -3336,7 +3328,7 @@ int es755_core_probe(struct device *dev)
        escore_priv.fw_af_filename = fw_af_filename;
 
        escore_priv.selected_endpoint = -1;
-       memset( escore_priv.digital_gain, 0, sizeof(escore_priv.digital_gain) );
+       memset(escore_priv.digital_gain, 0, sizeof(escore_priv.digital_gain));
 
        escore_priv.power_transition_wq =
                create_singlethread_workqueue("escore_power_transition_wq");
index 0e41675..61b29e9 100644 (file)
@@ -456,7 +456,7 @@ void escore_pm_enable(void)
 
        dev_dbg(escore->dev, "%s()\n", __func__);
 
-       if(escore->pm_enable) {
+       if (escore->pm_enable) {
                pr_err("%s(): Already Enabled\n", __func__);
                return;
        }
@@ -469,9 +469,9 @@ void escore_pm_enable(void)
        pm_runtime_use_autosuspend(escore->dev);
        pm_runtime_enable(escore->dev);
        device_init_wakeup(escore->dev, true);
-       if(pm_runtime_get_sync(escore->dev) >= 0) {
+       if (pm_runtime_get_sync(escore->dev) >= 0) {
                ret = pm_runtime_put_sync_autosuspend(escore->dev);
-               if (ret < 0){
+               if (ret < 0) {
                        dev_err(escore->dev,
                                "%s() escore PM put failed ret = %d\n",
                                __func__, ret);
index 111c729..301a676 100644 (file)
@@ -541,7 +541,7 @@ int escore_spi_boot_finish(struct escore_priv *escore)
                pr_debug("%s(): write ES_SYNC_CMD = 0x%08x\n",
                                __func__, sync_cmd);
                rc = escore_spi_cmd(escore, sync_cmd, &sync_ack);
-               pr_debug("%s(): rc=%d, sync_ack = 0x%08x\n", __func__, rc, \
+               pr_debug("%s(): rc=%d, sync_ack = 0x%08x\n", __func__, rc,
                        sync_ack);
                if (rc < 0) {
                        pr_err("%s(): firmware load failed sync write %d\n",
index 40a67d2..8094704 100644 (file)
@@ -62,7 +62,8 @@ static int escore_vs_sleep(struct escore_priv *escore)
                skip_vs_seq = 1;
                skip_vs_load = 1;
                goto vs_set_low_power;
-       } else if (escore->escore_power_state == ES_SET_POWER_STATE_VS_OVERLAY) {
+       } else if (escore->escore_power_state ==
+                               ES_SET_POWER_STATE_VS_OVERLAY) {
                skip_vs_load = 1;
                dev_dbg(escore->dev, "%s() already in VS overlay mode\n",
                                                                __func__);
@@ -135,7 +136,7 @@ static int escore_vs_sleep(struct escore_priv *escore)
                pr_debug("%s() VS firmware is already downloaded", __func__);
 
                /* Setup the Event response */
-               cmd = (ES_SET_EVENT_RESP << 16) | \
+               cmd = (ES_SET_EVENT_RESP << 16) |
                                                escore->pdata->gpio_b_irq_type;
                rc = escore_cmd_nopm(escore, cmd, &rsp);
                if (rc < 0) {
@@ -269,7 +270,7 @@ vs_sleep_err:
        if (!skip_vs_load) {
                vs_load_time = (timespec_sub(vs_load_end, vs_load_start));
                dev_info(escore->dev, "VS firmware load time = %lu.%03lu sec\n",
-                               vs_load_time.tv_sec, (vs_load_time.tv_nsec)/1000000);
+                       vs_load_time.tv_sec, (vs_load_time.tv_nsec)/1000000);
        }
        if (!skip_vs_seq) {
                wdb_time = (timespec_sub(wdb_end, wdb_start));
index a79a982..51466cf 100644 (file)
@@ -342,7 +342,7 @@ int escore_reconfig_intr(struct escore_priv *escore)
                }
        } else {
                /* Setup the Event response */
-               cmd = (ES_SET_EVENT_RESP << 16) | \
+               cmd = (ES_SET_EVENT_RESP << 16) |
                                                escore->pdata->gpio_b_irq_type;
                rc = escore_cmd_nopm(escore, cmd, &resp);
                if (rc < 0) {
@@ -837,9 +837,6 @@ int escore_wakeup(struct escore_priv *escore)
                msleep(ES_PM_CLOCK_STABILIZATION);
        }
 
-       //if (escore->pri_intf == ES_SPI_INTF)
-       //      msleep(ES_WAKEUP_TIME);
-
        do {
                /* Set flag to Wait for API Interrupt */
                escore_set_api_intr_wait(escore);
@@ -875,24 +872,6 @@ int escore_wakeup(struct escore_priv *escore)
                        else
                                msleep(escore->delay.wakeup_to_normal);
 
-/*
-                       if (escore->pri_intf == ES_SPI_INTF) {
-                               if (escore->pdata->gpioa_gpio == -1)
-                                       msleep(ES_WAKEUP_TIME);
-                               rc = escore_cmd_nopm(escore, p_cmd, &rsp);
-                               if (rc < 0) {
-                                       pr_err("%s(): get power state failed" \
-                                               " rc = %d\n", __func__, rc);
-                                       continue;
-                               }
-                               if ((rsp != ES_PS_NORMAL) &&
-                                       (rsp != ES_PS_OVERLAY)) {
-                                       rc = -1;
-                                       continue;
-                               }
-                       }
-*/
-
                        /* Send sync command to verify device is active */
                        rc = escore_cmd_nopm(escore, cmd, &rsp);
                        if (rc < 0) {
@@ -920,9 +899,6 @@ int escore_wakeup(struct escore_priv *escore)
                }
        } while (rc && --retry);
 
-       /* Hack to avoid flase interrupts coming after deep sleep */
-       //msleep(350);
-
        /* Set the Smooth Mute rate to Zero */
        cmd = ES_SET_SMOOTH_MUTE << 16 | ES_SMOOTH_MUTE_ZERO;
        rc = escore_cmd_nopm(escore, cmd, &rsp);
@@ -931,7 +907,6 @@ int escore_wakeup(struct escore_priv *escore)
                        __func__, rc);
                goto escore_wakeup_exit;
        }
-
 escore_wakeup_exit:
        return rc;
 }
index a5bdf64..f1e8cd8 100644 (file)
@@ -246,7 +246,8 @@ enum {
 #define ES_PS_NORMAL (ES_GET_POWER_STATE << 16 | ES_SET_POWER_STATE_NORMAL)
 #define ES_PS_OVERLAY (ES_GET_POWER_STATE << 16 | ES_SET_POWER_STATE_VS_OVERLAY)
 
-#define ES_DIGITAL_GAIN_MAX_NUM 48 /* Maximum number of digital gain allowed, equal to ES300_PASSOUT4+1 */
+/* Maximum number of digital gain allowed, equal to ES300_PASSOUT4+1 */
+#define ES_DIGITAL_GAIN_MAX_NUM 48
 
 enum {
        SBL,
@@ -587,7 +588,8 @@ struct escore_priv {
        u16 algo_preset_two;
 /* endif 705 */
 
-       int selected_endpoint; /* Selected endpoint(pathID) for following digital gain setting */
+       /* Selected endpoint(pathID) for following digital gain setting */
+       int selected_endpoint;
        u32 digital_gain[ES_DIGITAL_GAIN_MAX_NUM];
 
        struct mutex pm_mutex;