diff --git a/btfmcodec/btfm_codec_btadv_interface.c b/btfmcodec/btfm_codec_btadv_interface.c index 3817285e90..0b1bab99df 100644 --- a/btfmcodec/btfm_codec_btadv_interface.c +++ b/btfmcodec/btfm_codec_btadv_interface.c @@ -155,6 +155,7 @@ int btfmcodec_initiate_hwep_configuration(struct btfmcodec_char_device *btfmcode schedule_work(&btfmcodec_dev->wq_hwep_configure); + *status = BTM_WAITING_RSP; ret = wait_event_interruptible_timeout(*rsp_wait_q, *status != BTM_WAITING_RSP, 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); } - ret = btfmcodec_frame_transport_switch_ind_pkt(btfmcodec_dev, - btfmcodec_get_current_transport(state), status); + ret = btfmcodec_frame_prepare_bearer_rsp_pkt(btfmcodec_dev, + btfmcodec_get_current_transport(state), status); if (status != MSG_SUCCESS) return; diff --git a/btfmcodec/btfm_codec_interface.c b/btfmcodec/btfm_codec_interface.c index 88a70f03d7..b23b624225 100644 --- a/btfmcodec/btfm_codec_interface.c +++ b/btfmcodec/btfm_codec_interface.c @@ -18,29 +18,23 @@ static int btfm_codec_get_mixer_control(struct snd_kcontrol *kcontrol, struct snd_soc_component *codec = kcontrol->private_data; struct btfmcodec_data *btfmcodec = snd_soc_component_get_drvdata(codec); 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_ctl_elem_id id = kcontrol->id; int num_mixer_ctrl = hwepinfo->num_mixer_ctrl; int i = 0; BTFMCODEC_DBG(""); - if (states.current_state != IDLE) { - BTFMCODEC_WARN("Received probe when state is :%s", - coverttostring(states.current_state)); - } else { - for (; i < num_mixer_ctrl ; i++) { - BTFMCODEC_DBG("checking mixer_ctrl:%s and current mixer:%s", - id.name, mixer_ctrl[i].name); - if (!strncmp(id.name, mixer_ctrl[i].name, 64)) { - BTFMCODEC_DBG("Matched"); - mixer_ctrl[i].get(kcontrol, ucontrol); - break; - } + for (; i < num_mixer_ctrl ; i++) { + BTFMCODEC_DBG("checking mixer_ctrl:%s and current mixer:%s", + id.name, mixer_ctrl[i].name); + 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; } @@ -51,29 +45,23 @@ static int btfmcodec_put_mixer_control(struct snd_kcontrol *kcontrol, struct snd_soc_component *codec = kcontrol->private_data; struct btfmcodec_data *btfmcodec = snd_soc_component_get_drvdata(codec); 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_ctl_elem_id id = kcontrol->id; int num_mixer_ctrl = hwepinfo->num_mixer_ctrl; int i = 0; BTFMCODEC_DBG(""); - if (states.current_state != IDLE) { - BTFMCODEC_WARN("Received probe when state is :%s", - coverttostring(states.current_state)); - } else { - for (; i < num_mixer_ctrl ; i++) { - BTFMCODEC_DBG("checking mixer_ctrl:%s and current mixer:%s", - id.name, mixer_ctrl[i].name); - if (!strncmp(id.name, mixer_ctrl[i].name, 64)) { - BTFMCODEC_DBG("Matched"); - mixer_ctrl[i].put(kcontrol, ucontrol); - break; - } + for (; i < num_mixer_ctrl ; i++) { + BTFMCODEC_DBG("checking mixer_ctrl:%s and current mixer:%s", + id.name, mixer_ctrl[i].name); + 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; } diff --git a/btfmcodec/include/btfm_codec_pkt.h b/btfmcodec/include/btfm_codec_pkt.h index 3e48b7c839..e8e83f7710 100644 --- a/btfmcodec/include/btfm_codec_pkt.h +++ b/btfmcodec/include/btfm_codec_pkt.h @@ -42,7 +42,7 @@ struct btm_ctrl_pkt { #define BTM_BTFMCODEC_TRANSPORT_SWITCH_FAILED_IND 0x58000002 #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_PREPARE_AUDIO_BEARER_SWITCH_RSP_LEN 2 #define BTM_MASTER_CONFIG_RSP_LEN 2