mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-15 01:01:56 -04:00
modules: cspl: move usecase switch checks to DSP
There is a corner case in separate earpiece and speaker system, where speaker path isn't open (so DSP isn't enabled yet) when usecase switches but AP consumes the event and doesn't send again to DSP when DSP enabled. Send usecase switches to DSP everytime, let it decide to switch or ignore. Change-Id: I014d4d607f5a134970c3f8e43d41c296b62b3a46 Signed-off-by: Yoon (Seungyoon) Lee <w22905@motorola.com> Reviewed-on: https://gerrit.mot.com/1259187 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Seungyoon Lee <yoon@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
5bbd7c61d0
commit
338a4245bf
1 changed files with 14 additions and 12 deletions
|
|
@ -457,6 +457,7 @@ static int msm_crus_se_enable_get(struct snd_kcontrol *kcontrol,
|
|||
static int msm_crus_se_usecase(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
int ret = 0;
|
||||
struct crus_rx_run_case_ctrl_t case_ctrl;
|
||||
const int crus_set = ucontrol->value.integer.value[0];
|
||||
struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
|
||||
|
|
@ -470,19 +471,18 @@ static int msm_crus_se_usecase(struct snd_kcontrol *kcontrol,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (cirrus_se_usecase != crus_se_usecase_dt_index[crus_set]) {
|
||||
case_ctrl.status_l = 0;
|
||||
case_ctrl.status_r = 0;
|
||||
case_ctrl.atemp = 0;
|
||||
case_ctrl.value = crus_se_usecase_dt_index[crus_set];
|
||||
|
||||
ret = crus_set_param(cirrus_ff_port, CIRRUS_SE,
|
||||
CRUS_PARAM_RX_SET_USECASE, sizeof(case_ctrl),
|
||||
(void *)&case_ctrl);
|
||||
|
||||
if (ret == 0)
|
||||
cirrus_se_usecase = crus_se_usecase_dt_index[crus_set];
|
||||
|
||||
case_ctrl.status_l = 0;
|
||||
case_ctrl.status_r = 0;
|
||||
case_ctrl.atemp = 0;
|
||||
case_ctrl.value = cirrus_se_usecase;
|
||||
|
||||
crus_set_param(cirrus_ff_port, CIRRUS_SE,
|
||||
CRUS_PARAM_RX_SET_USECASE, sizeof(case_ctrl),
|
||||
(void *)&case_ctrl);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -496,8 +496,10 @@ static int msm_crus_se_usecase_get(struct snd_kcontrol *kcontrol,
|
|||
crus_get_param(cirrus_ff_port, CIRRUS_SE, CRUS_PARAM_RX_GET_USECASE,
|
||||
sizeof(struct crus_single_data_t), (void *)&crus_usecase);
|
||||
|
||||
if (crus_usecase.value == 0) {
|
||||
/* QDSP/LPASS default */
|
||||
pr_debug("Usecase from qdsp returned as %d\n", crus_usecase.value);
|
||||
|
||||
if (crus_usecase.value < 0) {
|
||||
/* QDSP/LPASS default, module isn't running */
|
||||
ucontrol->value.integer.value[0] = 0;
|
||||
} else {
|
||||
ucontrol->value.integer.value[0] =
|
||||
|
|
|
|||
Loading…
Reference in a new issue