Merge "ASoC: mbhc: Modify special headset detection"
This commit is contained in:
commit
4c332132fc
1 changed files with 35 additions and 2 deletions
|
@ -53,7 +53,7 @@
|
||||||
|
|
||||||
#define WCD_MBHC_BTN_PRESS_COMPL_TIMEOUT_MS 50
|
#define WCD_MBHC_BTN_PRESS_COMPL_TIMEOUT_MS 50
|
||||||
#define ANC_DETECT_RETRY_CNT 7
|
#define ANC_DETECT_RETRY_CNT 7
|
||||||
#define WCD_MBHC_SPL_HS_CNT 2
|
#define WCD_MBHC_SPL_HS_CNT 1
|
||||||
|
|
||||||
static int det_extn_cable_en;
|
static int det_extn_cable_en;
|
||||||
module_param(det_extn_cable_en, int,
|
module_param(det_extn_cable_en, int,
|
||||||
|
@ -1162,7 +1162,7 @@ static void wcd_correct_swch_plug(struct work_struct *work)
|
||||||
bool wrk_complete = false;
|
bool wrk_complete = false;
|
||||||
int pt_gnd_mic_swap_cnt = 0;
|
int pt_gnd_mic_swap_cnt = 0;
|
||||||
int no_gnd_mic_swap_cnt = 0;
|
int no_gnd_mic_swap_cnt = 0;
|
||||||
bool is_pa_on = false, spl_hs = false;
|
bool is_pa_on = false, spl_hs = false, spl_hs_reported = false;
|
||||||
bool micbias2 = false;
|
bool micbias2 = false;
|
||||||
bool micbias1 = false;
|
bool micbias1 = false;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
@ -1368,6 +1368,16 @@ correct_plug_type:
|
||||||
plug_type);
|
plug_type);
|
||||||
if (!(plug_type == MBHC_PLUG_TYPE_GND_MIC_SWAP)) {
|
if (!(plug_type == MBHC_PLUG_TYPE_GND_MIC_SWAP)) {
|
||||||
plug_type = MBHC_PLUG_TYPE_HEADSET;
|
plug_type = MBHC_PLUG_TYPE_HEADSET;
|
||||||
|
if (!spl_hs_reported &&
|
||||||
|
spl_hs_count == WCD_MBHC_SPL_HS_CNT) {
|
||||||
|
spl_hs_reported = true;
|
||||||
|
WCD_MBHC_RSC_LOCK(mbhc);
|
||||||
|
wcd_mbhc_find_plug_and_report(mbhc,
|
||||||
|
plug_type);
|
||||||
|
WCD_MBHC_RSC_UNLOCK(mbhc);
|
||||||
|
continue;
|
||||||
|
} else if (spl_hs_reported)
|
||||||
|
continue;
|
||||||
/*
|
/*
|
||||||
* Report headset only if not already reported
|
* Report headset only if not already reported
|
||||||
* and if there is not button press without
|
* and if there is not button press without
|
||||||
|
@ -1442,6 +1452,29 @@ exit:
|
||||||
!mbhc->micbias_enable)
|
!mbhc->micbias_enable)
|
||||||
mbhc->mbhc_cb->mbhc_micbias_control(codec, MIC_BIAS_2,
|
mbhc->mbhc_cb->mbhc_micbias_control(codec, MIC_BIAS_2,
|
||||||
MICB_DISABLE);
|
MICB_DISABLE);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If plug type is corrected from special headset to headphone,
|
||||||
|
* clear the micbias enable flag, set micbias back to 1.8V and
|
||||||
|
* disable micbias.
|
||||||
|
*/
|
||||||
|
if (plug_type == MBHC_PLUG_TYPE_HEADPHONE &&
|
||||||
|
mbhc->micbias_enable) {
|
||||||
|
if (mbhc->mbhc_cb->mbhc_micbias_control)
|
||||||
|
mbhc->mbhc_cb->mbhc_micbias_control(
|
||||||
|
codec, MIC_BIAS_2,
|
||||||
|
MICB_DISABLE);
|
||||||
|
if (mbhc->mbhc_cb->mbhc_micb_ctrl_thr_mic)
|
||||||
|
mbhc->mbhc_cb->mbhc_micb_ctrl_thr_mic(
|
||||||
|
codec,
|
||||||
|
MIC_BIAS_2, false);
|
||||||
|
if (mbhc->mbhc_cb->set_micbias_value) {
|
||||||
|
mbhc->mbhc_cb->set_micbias_value(codec);
|
||||||
|
WCD_MBHC_REG_UPDATE_BITS(WCD_MBHC_MICB_CTRL, 0);
|
||||||
|
}
|
||||||
|
mbhc->micbias_enable = false;
|
||||||
|
}
|
||||||
|
|
||||||
if (mbhc->mbhc_cb->micbias_enable_status) {
|
if (mbhc->mbhc_cb->micbias_enable_status) {
|
||||||
micbias1 = mbhc->mbhc_cb->micbias_enable_status(mbhc,
|
micbias1 = mbhc->mbhc_cb->micbias_enable_status(mbhc,
|
||||||
MIC_BIAS_1);
|
MIC_BIAS_1);
|
||||||
|
|
Loading…
Add table
Reference in a new issue