st-hal: Support non-LPI without EC

This change adds support to turn off the EC effect when echo
reference is enabled. During playback usecases, the EC effect
will remain on. During car mode, display on, and high performance
mode, the EC effect will be turned off and only noise suppression
will remain active.

Change-Id: If33c53e480cc96f853f659480c0c5218482904b0
diff --git a/st_session.c b/st_session.c
index 8dd1bae..209874f 100644
--- a/st_session.c
+++ b/st_session.c
@@ -2453,10 +2453,14 @@
      * It is possible the BE LPI mode has been updated, but not the FE mode.
      * DSP requires both FE and BE to be in the same mode for any configuration
      * changes between LPI and non-LPI switch, so update the FE mode to the
-     * same as BE mode by re-opening LSM session.
+     * same as BE mode by re-opening LSM session. This is also used for
+     * other transition usecases which require dereg_sm and reg_sm.
      */
-    if (hw_ses->lpi_enable != hw_ses->stdev->lpi_enable) {
+    if (hw_ses->lpi_enable != hw_ses->stdev->lpi_enable ||
+        (hw_ses->barge_in_mode != hw_ses->stdev->barge_in_mode &&
+         !hw_ses->stdev->support_dynamic_ec_update)) {
         hw_ses->lpi_enable = hw_ses->stdev->lpi_enable;
+        hw_ses->barge_in_mode = hw_ses->stdev->barge_in_mode;
         if (!load_sm) {
             load_sm = true;
             status = hw_ses->fptrs->dereg_sm(hw_ses);