Merge "ASoC: wcd: skip impedance detection after SSR"

This commit is contained in:
Linux Build Service Account 2015-04-15 08:37:42 -07:00 committed by Gerrit - the friendly Code Review server
commit 364014aa40
3 changed files with 29 additions and 0 deletions

View file

@ -207,6 +207,7 @@ static void msm8x16_wcd_set_auto_zeroing(struct snd_soc_codec *codec,
bool enable);
static void msm8x16_wcd_configure_cap(struct snd_soc_codec *codec,
bool micbias1, bool micbias2);
static void msm8x16_skip_imped_detect(struct snd_soc_codec *codec);
struct msm8x16_wcd_spmi msm8x16_wcd_modules[MAX_MSM8X16_WCD_DEVICE];
@ -274,6 +275,7 @@ static const struct wcd_mbhc_cb mbhc_cb = {
.set_auto_zeroing = msm8x16_wcd_set_auto_zeroing,
.get_hwdep_fw_cal = msm8x16_wcd_get_hwdep_fw_cal,
.set_cap_mode = msm8x16_wcd_configure_cap,
.skip_imped_detect = msm8x16_skip_imped_detect,
};
static const uint32_t wcd_imped_val[] = {4, 8, 12, 16,
@ -2504,6 +2506,18 @@ static void msm8x16_wcd_set_auto_zeroing(struct snd_soc_codec *codec,
}
}
static void msm8x16_skip_imped_detect(struct snd_soc_codec *codec)
{
struct msm8x16_wcd_priv *msm8x16_wcd;
if (codec != NULL) {
msm8x16_wcd = snd_soc_codec_get_drvdata(codec);
msm8x16_wcd->mbhc.skip_imped_detection = true;
} else {
pr_debug("%s: Codec pointer is NULL\n", __func__);
}
}
static void msm8x16_trim_btn_reg(struct snd_soc_codec *codec)
{
struct msm8x16_wcd_priv *msm8x16_wcd = snd_soc_codec_get_drvdata(codec);

View file

@ -468,6 +468,13 @@ static void wcd_mbhc_calc_impedance(struct wcd_mbhc *mbhc, uint32_t *zl,
bool high = false;
pr_debug("%s: enter\n", __func__);
if (mbhc->skip_imped_detection) {
pr_debug("%s: Skip imped detect RL %d ohm, RR %d ohm\n",
__func__, mbhc->zl, mbhc->zr);
mbhc->skip_imped_detection = false;
goto skip_imped_detect;
}
WCD_MBHC_RSC_ASSERT_LOCKED(mbhc);
reg0 = snd_soc_read(codec, MSM8X16_WCD_A_ANALOG_MBHC_DBNC_TIMER);
@ -652,6 +659,7 @@ exit:
zl, zr, high);
pr_debug("%s: RL %d ohm, RR %d ohm\n", __func__, *zl, *zr);
skip_imped_detect:
pr_debug("%s: Impedance detection completed\n", __func__);
}
@ -1988,6 +1996,10 @@ EXPORT_SYMBOL(wcd_mbhc_start);
void wcd_mbhc_stop(struct wcd_mbhc *mbhc)
{
pr_debug("%s: enter\n", __func__);
if (mbhc->current_plug != MBHC_PLUG_TYPE_NONE) {
if (mbhc->mbhc_cb && mbhc->mbhc_cb->skip_imped_detect)
mbhc->mbhc_cb->skip_imped_detect(mbhc->codec);
}
mbhc->current_plug = MBHC_PLUG_TYPE_NONE;
mbhc->hph_status = 0;
wcd9xxx_spmi_disable_irq(mbhc->intr_ids->hph_left_ocp);
@ -2051,6 +2063,7 @@ int wcd_mbhc_init(struct wcd_mbhc *mbhc, struct snd_soc_codec *codec,
mbhc->is_hs_recording = false;
mbhc->is_extn_cable = false;
mbhc->hph_type = WCD_MBHC_HPH_NONE;
mbhc->skip_imped_detection = false;
if (mbhc->intr_ids == NULL) {
pr_err("%s: Interrupt mapping not provided\n", __func__);

View file

@ -153,6 +153,7 @@ struct wcd_mbhc_cb {
struct firmware_cal * (*get_hwdep_fw_cal)(struct snd_soc_codec *,
enum wcd_cal_type);
void (*set_cap_mode)(struct snd_soc_codec *, bool, bool);
void (*skip_imped_detect)(struct snd_soc_codec *);
};
struct wcd_mbhc {
@ -179,6 +180,7 @@ struct wcd_mbhc {
bool btn_press_intr;
bool is_hs_recording;
bool is_extn_cable;
bool skip_imped_detection;
struct snd_soc_codec *codec;
/* Work to perform MBHC Firmware Read */