Merge "asoc: codec: Add surge reset routine for wcd939x"

This commit is contained in:
qctecmdr
2023-06-29 19:10:27 -07:00
committed by Gerrit - the friendly Code Review server
3 changed files with 14 additions and 1 deletions

View File

@@ -1733,7 +1733,7 @@ static int wcd_mbhc_usbc_ana_event_handler(struct notifier_block *nb,
mbhc->mbhc_cb->lock_sleep(mbhc, false);
}
#endif
} else {
} else if (mode < TYPEC_MAX_ACCESSORY) {
#if IS_ENABLED(CONFIG_QCOM_WCD_USBSS_I2C)
WCD_MBHC_REG_READ(WCD_MBHC_L_DET_EN, l_det_en);
WCD_MBHC_REG_READ(WCD_MBHC_MECH_DETECTION_TYPE, detection_type);
@@ -1748,6 +1748,9 @@ static int wcd_mbhc_usbc_ana_event_handler(struct notifier_block *nb,
dev_dbg(mbhc->component->dev, "leave, %s: mode = %lu\n", __func__, mode);
}
#endif
} else if (mode == TYPEC_MAX_ACCESSORY) {
if (mbhc->mbhc_cb->surge_reset_routine)
mbhc->mbhc_cb->surge_reset_routine(mbhc);
}
return 0;
}

View File

@@ -1319,6 +1319,14 @@ static void wcd939x_mbhc_bcs_enable(struct wcd_mbhc *mbhc,
wcd939x_disable_bcs_before_slow_insert(mbhc->component, true);
}
static void wcd939x_surge_reset_routine(struct wcd_mbhc *mbhc)
{
struct wcd939x_priv *wcd939x = snd_soc_component_get_drvdata(mbhc->component);
regcache_mark_dirty(wcd939x->regmap);
regcache_sync(wcd939x->regmap);
}
static const struct wcd_mbhc_cb mbhc_cb = {
.request_irq = wcd939x_mbhc_request_irq,
.irq_control = wcd939x_mbhc_irq_control,
@@ -1344,6 +1352,7 @@ static const struct wcd_mbhc_cb mbhc_cb = {
.mbhc_moisture_polling_ctrl = wcd939x_mbhc_moisture_polling_ctrl,
.mbhc_moisture_detect_en = wcd939x_mbhc_moisture_detect_en,
.bcs_enable = wcd939x_mbhc_bcs_enable,
.surge_reset_routine = wcd939x_surge_reset_routine,
};
static int wcd939x_get_hph_type(struct snd_kcontrol *kcontrol,

View File

@@ -530,6 +530,7 @@ struct wcd_mbhc_cb {
bool (*mbhc_get_moisture_status)(struct wcd_mbhc *mbhc);
void (*mbhc_moisture_polling_ctrl)(struct wcd_mbhc *mbhc, bool enable);
void (*mbhc_moisture_detect_en)(struct wcd_mbhc *mbhc, bool enable);
void (*surge_reset_routine)(struct wcd_mbhc *mbhc);
};
struct wcd_mbhc_fn {