btfmcodec: Update bearer response instead of ind

This change will send bearer response instead of transport
failed indications.
Update correct codeid and smaple rate for seamles transitions

Change-Id: I4b91f5e158c02d4f2dc1852cc58cec959d028497
Signed-off-by: Balakrishna Godavarthi <quic_bgodavar@quicinc.com>
This commit is contained in:
Balakrishna Godavarthi
2023-06-12 21:11:10 +05:30
committed by Gerrit - the friendly Code Review server
parent f42a9a1f35
commit c49fc215ed
3 changed files with 22 additions and 33 deletions

View File

@@ -155,6 +155,7 @@ int btfmcodec_initiate_hwep_configuration(struct btfmcodec_char_device *btfmcode
schedule_work(&btfmcodec_dev->wq_hwep_configure); schedule_work(&btfmcodec_dev->wq_hwep_configure);
*status = BTM_WAITING_RSP;
ret = wait_event_interruptible_timeout(*rsp_wait_q, ret = wait_event_interruptible_timeout(*rsp_wait_q,
*status != BTM_WAITING_RSP, *status != BTM_WAITING_RSP,
msecs_to_jiffies(BTM_MASTER_CONFIG_RSP_TIMEOUT)); msecs_to_jiffies(BTM_MASTER_CONFIG_RSP_TIMEOUT));
@@ -190,8 +191,8 @@ void btfmcodec_configure_hwep(struct btfmcodec_char_device *btfmcodec_dev)
btfmcodec_revert_current_state(state); btfmcodec_revert_current_state(state);
} }
ret = btfmcodec_frame_transport_switch_ind_pkt(btfmcodec_dev, ret = btfmcodec_frame_prepare_bearer_rsp_pkt(btfmcodec_dev,
btfmcodec_get_current_transport(state), status); btfmcodec_get_current_transport(state), status);
if (status != MSG_SUCCESS) if (status != MSG_SUCCESS)
return; return;

View File

@@ -18,29 +18,23 @@ static int btfm_codec_get_mixer_control(struct snd_kcontrol *kcontrol,
struct snd_soc_component *codec = kcontrol->private_data; struct snd_soc_component *codec = kcontrol->private_data;
struct btfmcodec_data *btfmcodec = snd_soc_component_get_drvdata(codec); struct btfmcodec_data *btfmcodec = snd_soc_component_get_drvdata(codec);
struct hwep_data *hwepinfo = btfmcodec->hwep_info; struct hwep_data *hwepinfo = btfmcodec->hwep_info;
struct btfmcodec_state_machine states = btfmcodec->states;
struct snd_kcontrol_new *mixer_ctrl = hwepinfo->mixer_ctrl; struct snd_kcontrol_new *mixer_ctrl = hwepinfo->mixer_ctrl;
struct snd_ctl_elem_id id = kcontrol->id; struct snd_ctl_elem_id id = kcontrol->id;
int num_mixer_ctrl = hwepinfo->num_mixer_ctrl; int num_mixer_ctrl = hwepinfo->num_mixer_ctrl;
int i = 0; int i = 0;
BTFMCODEC_DBG(""); BTFMCODEC_DBG("");
if (states.current_state != IDLE) { for (; i < num_mixer_ctrl ; i++) {
BTFMCODEC_WARN("Received probe when state is :%s", BTFMCODEC_DBG("checking mixer_ctrl:%s and current mixer:%s",
coverttostring(states.current_state)); id.name, mixer_ctrl[i].name);
} else { if (!strncmp(id.name, mixer_ctrl[i].name, 64)) {
for (; i < num_mixer_ctrl ; i++) { BTFMCODEC_DBG("Matched");
BTFMCODEC_DBG("checking mixer_ctrl:%s and current mixer:%s", mixer_ctrl[i].get(kcontrol, ucontrol);
id.name, mixer_ctrl[i].name); break;
if (!strncmp(id.name, mixer_ctrl[i].name, 64)) {
BTFMCODEC_DBG("Matched");
mixer_ctrl[i].get(kcontrol, ucontrol);
break;
}
} }
if (num_mixer_ctrl == i)
return 0;
} }
if (num_mixer_ctrl == i)
return 0;
return 1; return 1;
} }
@@ -51,29 +45,23 @@ static int btfmcodec_put_mixer_control(struct snd_kcontrol *kcontrol,
struct snd_soc_component *codec = kcontrol->private_data; struct snd_soc_component *codec = kcontrol->private_data;
struct btfmcodec_data *btfmcodec = snd_soc_component_get_drvdata(codec); struct btfmcodec_data *btfmcodec = snd_soc_component_get_drvdata(codec);
struct hwep_data *hwepinfo = btfmcodec->hwep_info; struct hwep_data *hwepinfo = btfmcodec->hwep_info;
struct btfmcodec_state_machine states = btfmcodec->states;
struct snd_kcontrol_new *mixer_ctrl = hwepinfo->mixer_ctrl; struct snd_kcontrol_new *mixer_ctrl = hwepinfo->mixer_ctrl;
struct snd_ctl_elem_id id = kcontrol->id; struct snd_ctl_elem_id id = kcontrol->id;
int num_mixer_ctrl = hwepinfo->num_mixer_ctrl; int num_mixer_ctrl = hwepinfo->num_mixer_ctrl;
int i = 0; int i = 0;
BTFMCODEC_DBG(""); BTFMCODEC_DBG("");
if (states.current_state != IDLE) { for (; i < num_mixer_ctrl ; i++) {
BTFMCODEC_WARN("Received probe when state is :%s", BTFMCODEC_DBG("checking mixer_ctrl:%s and current mixer:%s",
coverttostring(states.current_state)); id.name, mixer_ctrl[i].name);
} else { if (!strncmp(id.name, mixer_ctrl[i].name, 64)) {
for (; i < num_mixer_ctrl ; i++) { BTFMCODEC_DBG("Matched");
BTFMCODEC_DBG("checking mixer_ctrl:%s and current mixer:%s", mixer_ctrl[i].put(kcontrol, ucontrol);
id.name, mixer_ctrl[i].name); break;
if (!strncmp(id.name, mixer_ctrl[i].name, 64)) {
BTFMCODEC_DBG("Matched");
mixer_ctrl[i].put(kcontrol, ucontrol);
break;
}
} }
if (num_mixer_ctrl == i)
return 0;
} }
if (num_mixer_ctrl == i)
return 0;
return 1; return 1;
} }

View File

@@ -42,7 +42,7 @@ struct btm_ctrl_pkt {
#define BTM_BTFMCODEC_TRANSPORT_SWITCH_FAILED_IND 0x58000002 #define BTM_BTFMCODEC_TRANSPORT_SWITCH_FAILED_IND 0x58000002
#define BTM_MASTER_CONFIG_REQ_LEN 13 #define BTM_MASTER_CONFIG_REQ_LEN 13
#define BTM_MASTER_CONFIG_RSP_TIMEOUT 1000 #define BTM_MASTER_CONFIG_RSP_TIMEOUT 5000
#define BTM_HEADER_LEN 8 #define BTM_HEADER_LEN 8
#define BTM_PREPARE_AUDIO_BEARER_SWITCH_RSP_LEN 2 #define BTM_PREPARE_AUDIO_BEARER_SWITCH_RSP_LEN 2
#define BTM_MASTER_CONFIG_RSP_LEN 2 #define BTM_MASTER_CONFIG_RSP_LEN 2