]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
asoc: codec: Audience: Updated driver/firmware.
authorVinod Subbarayalu <vsubbarayalu@nvidia.com>
Thu, 16 Oct 2014 05:28:38 +0000 (22:28 -0700)
committerMitch Luban <mluban@nvidia.com>
Mon, 27 Oct 2014 17:45:59 +0000 (10:45 -0700)
Issues Fixed:
1) Audio corruption during long duration playback
2) Deep sleep support (LP0)

Bug 1554027
bug 200041220
bug 200041237

Change-Id: I86ecac51d6aed3e85809493745033b9ee026fe59
Signed-off-by: Vinod Subbarayalu <vsubbarayalu@nvidia.com>
Reviewed-on: http://git-master/r/558233
Reviewed-by: Srinivas Anne <sanne@nvidia.com>
Tested-by: Srinivas Anne <sanne@nvidia.com>
Reviewed-by: Pierre Gervais <pgervais@nvidia.com>
firmware/audience/es755/audience-es755-fw.bin
sound/soc/codecs/audience/es-d300.c
sound/soc/codecs/audience/es-d300.h
sound/soc/codecs/audience/es755.c
sound/soc/codecs/audience/es755.h
sound/soc/codecs/audience/escore-pm.c
sound/soc/codecs/audience/escore.c
sound/soc/codecs/audience/escore.h

index c5b0a8a8f02c8db1b379b05c992bc9b90eaef275..e2013c8335a78e2ba160e7c826977c75a61172b4 100644 (file)
Binary files a/firmware/audience/es755/audience-es755-fw.bin and b/firmware/audience/es755/audience-es755-fw.bin differ
index 1e94692b9b29cba1f62d28e4f200ad5fb123996b..9dbd7532f963c3d0327ead2c5080ef246c942ad8 100644 (file)
@@ -166,6 +166,7 @@ static const u16 es300_output_mux_text_to_api[] = {
 static const u32 es_base_route_preset[ALGO_MAX] = {
        [VP] = 0x90311771,
        [VP_MM] = 0x90311777,
+       [PASSTHRU_VP] = 0x9031177A,
        [AUDIOZOOM] = 0x90311774,
 #if defined(CONFIG_SND_SOC_ES_SLIM)
        [MM] = 0x90311773,
@@ -210,25 +211,30 @@ static int es300_codec_stop_algo(struct escore_priv *escore)
        case MM:
        case VP_MM:
        case AUDIOZOOM:
-               cmd |= escore->algo_type;
-               break;
        case PASSTHRU:
-       case PASSTHRU_VP:
-       case PASSTHRU_MM:
-       case PASSTHRU_VP_MM:
-       case PASSTHRU_AZ:
-               cmd |= ES_PASSTHRU + (escore->algo_type - PASSTHRU);
+               cmd |= (1 << escore->algo_type);
                break;
-       case VOICEQ:
-               cmd |= ES_VOICESENSE;
+       case PASSTHRU_VP:
+               cmd |= (1 << PASSTHRU);
                break;
+       default:
+               pr_err("%s(): Invalid algo type :%d\n", __func__,
+                               escore->algo_type);
+               ret = -EINVAL;
+               goto exit;
        }
        ret = escore_cmd(escore, cmd, &resp);
        if (ret)
                pr_err("%s: algo stop failed\n", __func__);
 
        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 = 0;
        clear_chn_mgr_cache();
+exit:
        return ret;
 }
 /* Mask to keep track of chmgrs set by UCM */
@@ -275,6 +281,89 @@ static void convert_pt_input_mux_to_cmd(int reg, u32 *msg, u32 *msg_len)
        }
 }
 
+static int convert_vp_pt_input_mux_to_cmd(int reg, u32 *msg, u32 value)
+{
+       int msg_len = 0;
+       u16 port, chnum;
+
+       port = (value >> 9) & 0x1f;
+       chnum = (value >> 4) & 0x1f;
+
+       switch (reg) {
+       case ES_PASSIN1_MUX:
+               msg[0] = ES_API_WORD(ES_SET_MUX_CMD,
+                                       ES300_DATA_PATH(port, chnum, RXCHMGR2));
+               msg[1] = ES_API_WORD(ES_SET_PATH_ID_CMD,
+                               ES300_PATH_ID(RXCHMGR2, ES300_PASSIN1));
+               msg[2] = ES_API_WORD(ES_CONNECT_CMD,
+                                       ES300_ENDPOINT(FILTER_RXCHANMGR2,
+                                                       OUT, RxChMgr_o0));
+               msg[3] = ES_API_WORD(ES_CONNECT_CMD,
+                                       ES300_ENDPOINT(FILTER_PASSTHRU,
+                                                       IN, pass_i0));
+               msg[4] = ES_API_WORD(ES_SET_RATE_CMD,
+                               ES300_RATE(FILTER_RXCHANMGR2, 3));
+               msg[5] = ES_API_WORD(ES_SET_GROUP_CMD,
+                                       ES300_GROUP(FILTER_RXCHANMGR2, 1));
+               msg_len = 24;
+               break;
+       case ES_PASSIN2_MUX:
+               msg[0] = ES_API_WORD(ES_SET_MUX_CMD,
+                                       ES300_DATA_PATH(port, chnum, RXCHMGR3));
+               msg[1] = ES_API_WORD(ES_SET_PATH_ID_CMD,
+                               ES300_PATH_ID(RXCHMGR3, ES300_PASSIN2));
+               msg[2] = ES_API_WORD(ES_CONNECT_CMD,
+                                       ES300_ENDPOINT(FILTER_RXCHANMGR3,
+                                                       OUT, RxChMgr_o0));
+               msg[4] = ES_API_WORD(ES_SET_RATE_CMD,
+                               ES300_RATE(FILTER_RXCHANMGR3, 3));
+               msg[5] = ES_API_WORD(ES_SET_GROUP_CMD,
+                                       ES300_GROUP(FILTER_RXCHANMGR3, 1));
+               msg_len = 24;
+               break;
+       case ES_PRIMARY_MUX:
+               msg[0] = ES_API_WORD(ES_SET_MUX_CMD,
+                                       ES300_DATA_PATH(port, chnum, RXCHMGR0));
+               msg[1] = ES_API_WORD(ES_SET_PATH_ID_CMD,
+                                       ES300_PATH_ID(RXCHMGR0, ES300_PRI));
+               msg[2] = ES_API_WORD(ES_CONNECT_CMD,
+                                       ES300_ENDPOINT(FILTER_RXCHANMGR0,
+                                                       OUT, RxChMgr_o0));
+               msg[3] = ES_API_WORD(ES_CONNECT_CMD,
+                                       ES300_ENDPOINT(FILTER_VP,
+                                                       IN, vp_i1));
+               msg[4] = ES_API_WORD(ES_SET_RATE_CMD,
+                               ES300_RATE(FILTER_RXCHANMGR0, 3));
+               msg[5] = ES_API_WORD(ES_SET_GROUP_CMD,
+                                       ES300_GROUP(FILTER_RXCHANMGR0, 0));
+               msg[6] = ES_API_WORD(ES_SET_RATE_CMD,
+                               ES300_RATE(FILTER_VP, 3));
+               /* Disable VP Algo processing */
+               msg[7] = ES_API_WORD(ES_SET_ALGO_PROC_CMD,
+                               ES300_ALGO_PROC(VP, 0));
+               msg_len = 32;
+               break;
+       case  ES_FEIN_MUX:
+               msg[0] = ES_API_WORD(ES_SET_MUX_CMD,
+                                       ES300_DATA_PATH(port, chnum, RXCHMGR1));
+               msg[1] = ES_API_WORD(ES_SET_PATH_ID_CMD,
+                                       ES300_PATH_ID(RXCHMGR1, ES300_FEIN));
+               msg[2] = ES_API_WORD(ES_CONNECT_CMD,
+                                       ES300_ENDPOINT(FILTER_RXCHANMGR1,
+                                                       OUT, RxChMgr_o0));
+               msg[3] = ES_API_WORD(ES_CONNECT_CMD,
+                                       ES300_ENDPOINT(FILTER_VP,
+                                                       IN, vp_i0));
+               msg[4] = ES_API_WORD(ES_SET_RATE_CMD,
+                               ES300_RATE(FILTER_RXCHANMGR1, 3));
+               msg[5] = ES_API_WORD(ES_SET_GROUP_CMD,
+                                       ES300_GROUP(FILTER_RXCHANMGR1, 0));
+               msg_len = 24;
+               break;
+       }
+       return msg_len;
+}
+
 static int convert_input_mux_to_cmd(struct escore_priv *escore, int reg)
 {
        unsigned int value;
@@ -407,6 +496,12 @@ static int convert_input_mux_to_cmd(struct escore_priv *escore, int reg)
                        update_chmgr_mask = 0;
                }
                break;
+
+       case PASSTHRU_VP:
+                       msg_len = convert_vp_pt_input_mux_to_cmd(reg, msg,
+                                       value);
+               break;
+
        }
        if (update_chmgr_mask)
                chn_mgr_mask |= 1 << ch_mgr;
@@ -414,6 +509,74 @@ static int convert_input_mux_to_cmd(struct escore_priv *escore, int reg)
        return escore_queue_msg_to_list(escore, (char *)msg, msg_len);
 }
 
+static int convert_vp_pt_output_mux_to_cmd(u16 ch_mgr, u8 path_id,
+               u32 *msg, u32 msg_len)
+{
+       u8 i = 2;
+       u8 update_cmds = 1;
+       u16 ep_out = 0, ep_in = 0, filter_in = 0, filter_out = 0;
+       u16 group = 0;
+
+       switch (ch_mgr) {
+       case TXCHMGR0:
+               filter_out = FILTER_VP;
+               filter_in = FILTER_TXCHANMGR0;
+               ep_out = vp_o1;
+               ep_in = TxChMgr_i0;
+               group = 0;
+               break;
+       case TXCHMGR1:
+               filter_out = FILTER_VP;
+               filter_in = FILTER_TXCHANMGR1;
+               ep_out = vp_o0;
+               ep_in = TxChMgr_i0;
+               group = 0;
+               break;
+       case TXCHMGR2:
+               filter_in = FILTER_TXCHANMGR2;
+               ep_in = TxChMgr_i0;
+               filter_out = FILTER_PASSTHRU;
+               ep_out = pass_o0;
+               group = 1;
+               break;
+       case TXCHMGR3:
+               filter_in = FILTER_TXCHANMGR3;
+               ep_in = TxChMgr_i0;
+               filter_out = FILTER_PASSTHRU;
+               ep_out = pass_o1;
+               group = 1;
+               break;
+       default:
+               update_cmds = 0;
+               break;
+       }
+
+       if (update_cmds) {
+
+               /* Connect OUT endpoints */
+               msg[i++] = ES_API_WORD(ES_CONNECT_CMD,
+                               ES300_ENDPOINT(filter_out, OUT, ep_out));
+               msg_len += 4;
+
+               /* Connect IN endpoints */
+               msg[i++] = ES_API_WORD(ES_CONNECT_CMD,
+                               ES300_ENDPOINT(filter_in, IN, ep_in));
+               msg_len += 4;
+
+               /* Set Rate to 48Khz */
+               msg[i++] = ES_API_WORD(ES_SET_RATE_CMD,
+                               ES300_RATE(filter_in, 3));
+               msg_len += 4;
+
+               /* Set Group ID */
+               msg[i++] = ES_API_WORD(ES_SET_GROUP_CMD,
+                               ES300_GROUP(filter_in, group));
+               msg_len += 4;
+       }
+       return msg_len;
+}
+
+
 static int convert_pt_copy_output_mux_to_cmd(u16 ch_mgr, u8 path_id,
                u32 *msg, u32 msg_len)
 {
@@ -598,14 +761,12 @@ static int convert_output_mux_to_cmd(struct escore_priv *escore, int reg)
        ch_mgr = (value >> 8) & 0xf;
 
        /* Need to update the TxChanMgr when 2 CSOUTs are used in route */
-       if (nr_csouts == 2) {
+       if (nr_csouts == 2 && escore->algo_type == VP) {
                if (!strncmp(proc_block_output_texts[mux], "VP FEOUT1", 9))
                        ch_mgr = TXCHMGR2;
                else if (!strncmp(proc_block_output_texts[mux], "VP FEOUT2", 9))
                        ch_mgr = TXCHMGR3;
        }
-       msg[0] |= ES300_DATA_PATH(0, 0, ch_mgr);
-       msg[1] |= ES300_PATH_ID(ch_mgr, path_id);
 
        switch (escore->algo_type) {
        case VP:
@@ -627,8 +788,22 @@ static int convert_output_mux_to_cmd(struct escore_priv *escore, int reg)
                        msg_len = convert_pt_output_mux_to_cmd(ch_mgr,
                                        path_id, msg, msg_len);
                break;
+       case PASSTHRU_VP:
+               if (!strncmp(proc_block_output_texts[mux], "Pass AUDOUT1",
+                               sizeof("Pass AUDOUT1")-1))
+                       ch_mgr = TXCHMGR2;
+               else if (!strncmp(proc_block_output_texts[mux], "Pass AUDOUT2",
+                               sizeof("Pass AUDOUT2")-1))
+                       ch_mgr = TXCHMGR3;
+
+               msg_len = convert_vp_pt_output_mux_to_cmd(ch_mgr, path_id, msg,
+                               msg_len);
+               break;
        }
 
+       msg[0] |= ES300_DATA_PATH(0, 0, ch_mgr);
+       msg[1] |= ES300_PATH_ID(ch_mgr, path_id);
+
        if (update_chmgr_mask)
                chn_mgr_mask |= 1 << ch_mgr;
 
@@ -801,6 +976,16 @@ static int es_set_final_route(struct escore_priv *escore)
        rc = add_algo_base_route(escore);
        if (!rc)
                escore_write_msg_list(escore);
+
+       if (escore->algo_preset != 0) {
+               usleep_range(5000, 5005);
+               pr_debug("%s:add algo preset: %d", __func__,
+                               escore->algo_preset);
+               rc = escore_write(NULL, ES_PRESET, escore->algo_preset);
+               if (rc)
+                       dev_err(escore_priv.dev, "%s(): Set Preset failed:%d\n",
+                               __func__, rc);
+       }
        return rc;
 }
 
@@ -1301,6 +1486,9 @@ static int es300_put_algo_state(struct snd_kcontrol *kcontrol,
        case ES_ALGORITHM_PT:
                algo_type = PASSTHRU;
                break;
+       case ES_ALGORITHM_PT_VP:
+               algo_type = PASSTHRU_VP;
+               break;
        case ES_ALGORITHM_AZ:
                algo_type = AUDIOZOOM;
                break;
@@ -1430,9 +1618,12 @@ static int put_output_route_value(struct snd_kcontrol *kcontrol,
                return -EINVAL;
        }
        /* VP CSOUT signals Tx init and VP FEOUT signals Rx init */
-       if (strncmp(proc_block_output_texts[mux], "VP CSOUT", 8) == 0) {
+       if (strncmp(proc_block_output_texts[mux], "VP CSOUT1", 9) == 0) {
+               es_vp_tx = ES_VP_TX_INIT;
+               nr_csouts = 1;
+       } else if (strncmp(proc_block_output_texts[mux], "VP CSOUT2", 9) == 0) {
                es_vp_tx = ES_VP_TX_INIT;
-               nr_csouts++;
+               nr_csouts = 2;
        } else if (strncmp(proc_block_output_texts[mux], "VP FEOUT1", 9) == 0) {
                es_vp_rx = ES_VP_RX_INIT;
        } else if (strncmp(proc_block_output_texts[mux],
@@ -1526,9 +1717,17 @@ static int get_asr_sel(struct snd_kcontrol *kcontrol,
        return 0;
 }
 
+static int get_reset(struct snd_kcontrol *kcontrol,
+                           struct snd_ctl_elem_value *ucontrol)
+{
+       pr_debug("%s()\n", __func__);
+       return 0;
+}
+
 static int put_reset(struct snd_kcontrol *kcontrol,
                            struct snd_ctl_elem_value *ucontrol)
 {
+       pr_debug("%s()\n", __func__);
        es_d300_reset_cmdcache();
        clear_chn_mgr_cache();
        es_vp_tx = ES_VP_NONE;
@@ -1729,6 +1928,31 @@ static int put_lp_route(struct snd_kcontrol *kcontrol,
        return ret;
 }
 
+static int put_preset_value(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);
+
+       unsigned int value;
+
+       value = ucontrol->value.integer.value[0];
+
+       escore->algo_preset = value;
+
+       return 0;
+}
+
+static int get_preset_value(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);
+       ucontrol->value.integer.value[0] = escore->algo_preset;
+
+       return 0;
+}
+
 static const char * const algorithm_texts[] = {
        "Off", "On"
 };
@@ -1759,6 +1983,10 @@ static const struct soc_enum mm_algorithm_enum =
        SOC_ENUM_SINGLE(ES_ALGORITHM_MM, 0,
                        ARRAY_SIZE(algorithm_texts),
                        algorithm_texts);
+static const struct soc_enum pt_vp_algorithm_enum =
+       SOC_ENUM_SINGLE(ES_ALGORITHM_PT_VP, 0,
+                       ARRAY_SIZE(algorithm_texts),
+                       algorithm_texts);
 static const struct soc_enum pass_algorithm_enum =
        SOC_ENUM_SINGLE(ES_ALGORITHM_PT, 0,
                        ARRAY_SIZE(algorithm_texts),
@@ -1835,6 +2063,8 @@ static const struct snd_kcontrol_new es_d300_snd_controls[] = {
                         es300_get_algo_state, es300_put_algo_state),
        SOC_ENUM_EXT("MM Algorithm", mm_algorithm_enum,
                         es300_get_algo_state, es300_put_algo_state),
+       SOC_ENUM_EXT("PT_VP Algorithm", pt_vp_algorithm_enum,
+                        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,
@@ -1894,7 +2124,10 @@ static const struct snd_kcontrol_new es_d300_snd_controls[] = {
        SOC_ENUM_EXT("Loopback routes commit", lp_commit_enum,
                         get_lp_route, put_lp_route),
        SOC_SINGLE_EXT("Reset", SND_SOC_NOPM, 0, 1, 0,
-                        NULL, put_reset),
+                        get_reset, put_reset),
+       SOC_SINGLE_EXT("Algo Preset",
+                       SND_SOC_NOPM, 0, 65535, 0, get_preset_value,
+                       put_preset_value),
 };
 
 static const struct soc_enum vp_pri_enum =
@@ -3656,7 +3889,7 @@ void es_d300_reset_cmdcache(void)
        int i;
        for (i = 0; i < ALGO_MAX; i++) {
                memset(cachedcmd_list[i], 0x0,
-                       ES_API_ADDR_MAX * sizeof(struct cachedcmd_list *));
+                       ES_API_ADDR_MAX * sizeof(struct cachedcmd_t));
        }
 }
 
index a52706c7c072cdac0c2283a3a1b67240ffed71e3..920aae625a8194db97bfda65db07a53063965d25 100644 (file)
@@ -71,17 +71,17 @@ enum {
 
 /* Algorithm */
 enum {
-       NONE,
        VP,
        MM,
-       VP_MM,
        AUDIOZOOM,
        PASSTHRU,
+       VP_MM,
        PASSTHRU_VP,
        PASSTHRU_MM,
        PASSTHRU_VP_MM,
        PASSTHRU_AZ,
        VOICEQ,
+       NONE,
        ALGO_MAX,
 };
 
@@ -263,6 +263,7 @@ struct es_ch_mgr_max {
 #define ES300_PATH_ID(xchandesg, xpath)        ((xchandesg << 8) | (xpath))
 #define ES300_RATE(filter, rate)       ((rate << 8) | filter)
 #define ES300_GROUP(filter, groupid)   ((filter << 8) | (groupid & 0xf))
+#define ES300_ALGO_PROC(algo, value)   ((value << 0x8) | algo)
 #define ES300_MAX_BASE_ROUTE           ALGO_MAX
 /* Extract chmgr from Datapath */
 #define ES_CHMGR_DATAPATH(datapath)    (datapath & 0x0F)
index e6cee99ccf99395ceb192344a472394a9898a69e..ede02a503dfcd1a49b39343ade78b8e88155acb8 100644 (file)
@@ -410,7 +410,6 @@ static int es755_fw_download(struct escore_priv *es755)
        msleep(20);
 
        if (es755->boot_ops.finish) {
-           u32 resp;
                pr_debug("%s(): calling bus specific boot finish\n", __func__);
                rc = es755->boot_ops.finish(es755);
                if (rc != 0) {
@@ -418,7 +417,6 @@ static int es755_fw_download(struct escore_priv *es755)
                                __func__);
                        goto es755_bootup_failed;
                }
-        es755->bus.ops.high_bw_cmd(es755, 0x807c431f, &resp);
        }
        es755->mode = STANDARD;
 
@@ -2382,40 +2380,41 @@ irqreturn_t es755_irq_work(int irq, void *data)
        /* Delay required for firmware to be ready in case of CVQ mode */
        msleep(50);
 
-       /* If the chip is not awake, the reading of event will wakeup the
-        * chip which will result in interrupt reconfiguration from device
-        * resume. Reconfiguration is deferred till the time interrupt
-        * is processed from the notifier callback.
-        *
-        * The interrupt reconfiguration in this case will be taken care of
-        * by a low priority notifier callback
-        */
-       mutex_lock(&escore->api_mutex);
-       if (escore->escore_power_state != ES_SET_POWER_STATE_NORMAL)
-                       escore->defer_intr_config = 1;
-
        /* Power state change:
         * Interrupt will put the chip into Normal State
         */
 
-       if (escore->escore_power_state == escore->non_vs_sleep_state)
+       if (escore->escore_power_state == escore->non_vs_sleep_state) {
                escore->escore_power_state = ES_SET_POWER_STATE_NORMAL;
-       else if (escore->escore_power_state == ES_SET_POWER_STATE_VS_LOWPWR)
+       } else if (escore->escore_power_state == ES_SET_POWER_STATE_VS_LOWPWR) {
                escore->escore_power_state = ES_SET_POWER_STATE_VS_OVERLAY;
 
+               /* If the chip is not awake, the reading of event will wakeup
+                * the chip which will result in interrupt reconfiguration
+                * from device resume. Reconfiguration is deferred till the
+                * time interrupt is processed from the notifier callback.
+                *
+                * The interrupt reconfiguration in this case will be taken
+                * care of by a low priority notifier callback
+                */
+               escore->defer_intr_config = 1;
+       }
+
        cmd = ES_GET_EVENT << 16;
 
+       mutex_lock(&escore->api_mutex);
        rc = escore->bus.ops.cmd(escore, cmd, &event_type);
        if (rc < 0) {
                pr_err("%s(): Error reading IRQ event: %d\n", __func__, rc);
+               mutex_unlock(&escore->api_mutex);
                goto irq_exit;
        }
+       mutex_unlock(&escore->api_mutex);
 
        event_type &= ES_MASK_INTR_EVENT;
        mutex_lock(&escore->escore_event_type_mutex);
        escore->escore_event_type = event_type;
        mutex_unlock(&escore->escore_event_type_mutex);
-       mutex_unlock(&escore->api_mutex);
 
        if (event_type != ES_NO_EVENT) {
                pr_debug("%s(): Notify subscribers about 0x%04x event",
index 1f75c2750e21e8b56aa86d6bfc99b5295abe2e78..c052c4cabc7238a13083db24f4b7de74671c2f33 100644 (file)
@@ -60,6 +60,7 @@
 #define ES_SET_RATE_CMD                        0xB063
 #define ES_CONNECT_CMD                 0xB064
 #define ES_SET_GROUP_CMD               0xB068
+#define ES_SET_ALGO_PROC_CMD           0xB01C
 
 
 #define ES_API_WORD(upper, lower) ((upper << 16) | lower)
@@ -172,6 +173,7 @@ enum {
        ES_ALGORITHM_VP,
        ES_ALGORITHM_MM,
        ES_ALGORITHM_PT,
+       ES_ALGORITHM_PT_VP,
        ES_ALGORITHM_AZ,
 
        /* PCM Port Parameters*/
index e228e85bba3f9a9d55abda92cf08d7666259f514..029dbf808a3ac5858b1521bf227cf19dc4254f02 100644 (file)
@@ -138,10 +138,6 @@ static int escore_non_vs_resume(struct device *dev)
                goto escore_wakeup_fail_recovery;
        }
 
-       if (!escore->defer_intr_config)
-               blocking_notifier_call_chain(escore->irq_notifier_list,
-                               ES_RECONFIG_INTR_EVENT, escore);
-
        dev_dbg(dev, "%s() - out rc =%d\n", __func__, ret);
 
        escore->escore_power_state = ES_SET_POWER_STATE_NORMAL;
index d3fbb69d286c14b3c46cfe3a466a701446a96466..9d1c5847a924f487f8c3efc93cb57c26c555a686 100644 (file)
@@ -6,6 +6,7 @@
  * published by the Free Software Foundation.
  */
 
+
 #include "escore.h"
 #include "escore-i2c.h"
 #include "escore-slim.h"
@@ -889,6 +890,7 @@ int escore_wakeup(struct escore_priv *escore)
        int retry = 20;
        u32 p_cmd = ES_GET_POWER_STATE << 16;
 
+       mutex_lock(&escore->api_mutex);
        /* Enable the clocks */
        if (escore_priv.pdata->esxxx_clk_cb) {
                escore_priv.pdata->esxxx_clk_cb(1);
@@ -941,7 +943,6 @@ int escore_wakeup(struct escore_priv *escore)
                        }
                }
 
-
                rc = escore_priv.bus.ops.cmd(escore, cmd, &rsp);
                if (rc < 0) {
                        dev_err(escore->dev, "%s() - failed sync cmd resume\n",
@@ -961,10 +962,22 @@ int escore_wakeup(struct escore_priv *escore)
        /* Set the Smooth Mute rate to Zero */
        cmd = ES_SET_SMOOTH_MUTE << 16 | ES_SMOOTH_MUTE_ZERO;
        rc = escore->bus.ops.cmd(escore, cmd, &rsp);
-       if (rc)
+       if (rc) {
                dev_err(escore->dev, "%s(): escore_cmd fail %d\n",
-                                       __func__, rc);
+                               __func__, rc);
+               goto escore_wakeup_exit;
+       }
+
+       /* Setup the Event response */
+       cmd = (ES_SET_EVENT_RESP << 16) |
+               escore->pdata->gpio_b_irq_type;
+       rc = escore->bus.ops.cmd(escore, cmd, &rsp);
+       if (rc < 0)
+               pr_err("%s(): Error %d in setting event response\n",
+                               __func__, rc);
+
 escore_wakeup_exit:
+       mutex_unlock(&escore->api_mutex);
        return rc;
 }
 
@@ -1178,7 +1191,7 @@ int escore_probe(struct escore_priv *escore, struct device *dev, int curr_intf,
        complete(&escore->fw_download);
 #endif
        escore->is_probe_error = 0;
-       //escore_pm_enable();
+       escore_pm_enable();
 
 out:
        return rc;
index fee400b6b13c20b6e6921f98eaa267c7949019fa..58e513d7e56a38d77f45a77aa1dd131be443a8c3 100644 (file)
@@ -525,6 +525,7 @@ struct escore_priv {
        int fw_requested;
        u16 preset;
        u16 cvs_preset;
+       u16 algo_preset;
 /* endif 705 */
 
        struct mutex pm_mutex;