diff options
author | Bhalchandra Gajare <gajare@codeaurora.org> | 2016-04-18 19:14:12 -0700 |
---|---|---|
committer | Kyle Yan <kyan@codeaurora.org> | 2016-05-24 14:26:34 -0700 |
commit | 703d92d617c0caa16cce718f73eb5e650513a88b (patch) | |
tree | aef541d0be6e894683edf910f37f121da955e036 /sound/soc/codecs | |
parent | d9d99a4c5ee6bda519b58a7d4d4be0762a1364ae (diff) |
ASoC: wcd_cpe_core: Connect to input AFE port during LSM start
Currently the AFE input port is connected to LSM while sending operation
mode parameter to CPE. It is possible that in certain cases, the operation
mode does not need to be sent at all. In such case, the input port still
needs to be connected. Fix this by moving the connection to AFE input port
during LSM_START so everytime LSM is started, it is connected to the
correct AFE port.
CRs-fixed: 1012715
Change-Id: I6dbc344d5d7063c7cfd2fb29c2c39fdee1250bbf
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
Diffstat (limited to 'sound/soc/codecs')
-rw-r--r-- | sound/soc/codecs/wcd_cpe_core.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/sound/soc/codecs/wcd_cpe_core.c b/sound/soc/codecs/wcd_cpe_core.c index ddc428dfdb64..58fca9131b3c 100644 --- a/sound/soc/codecs/wcd_cpe_core.c +++ b/sound/soc/codecs/wcd_cpe_core.c @@ -3119,7 +3119,7 @@ static int wcd_cpe_lsm_set_params(struct wcd_cpe_core *core, if (ret) { pr_err("%s: fail to sent acdb cal, err = %d", __func__, ret); - return ret; + goto err_ret; } /* Send operation mode */ @@ -3129,22 +3129,11 @@ static int wcd_cpe_lsm_set_params(struct wcd_cpe_core *core, det_mode.detect_failure = detect_failure; ret = wcd_cpe_send_param_opmode(core, session, &det_mode, &ids); - if (ret) { + if (ret) dev_err(core->dev, "%s: Failed to set opmode, err=%d\n", __func__, ret); - goto err_ret; - } - /* Send connect to port */ - ids.module_id = CPE_LSM_MODULE_ID_VOICE_WAKEUP; - ids.param_id = CPE_LSM_PARAM_ID_CONNECT_TO_PORT; - ret = wcd_cpe_send_param_connectport(core, session, - NULL, &ids, CPE_AFE_PORT_1_TX); - if (ret) - dev_err(core->dev, - "%s: Failed to set connectPort, err=%d\n", - __func__, ret); err_ret: return ret; } @@ -3354,7 +3343,19 @@ static int wcd_cpe_cmd_lsm_start(void *core_handle, if (ret) return ret; - /* Send connect to port */ + /* Send connect to port (input) */ + ids.module_id = CPE_LSM_MODULE_ID_VOICE_WAKEUP; + ids.param_id = CPE_LSM_PARAM_ID_CONNECT_TO_PORT; + ret = wcd_cpe_send_param_connectport(core, session, + NULL, &ids, CPE_AFE_PORT_1_TX); + if (ret) { + dev_err(core->dev, + "%s: Failed to set connectPort, err=%d\n", + __func__, ret); + return ret; + } + + /* Send connect to port (output) */ ids.module_id = CPE_LSM_MODULE_FRAMEWORK; ids.param_id = CPE_LSM_PARAM_ID_CONNECT_TO_PORT; ret = wcd_cpe_send_param_connectport(core, session, |