asoc: codec: Add surge reset routine for wcd939x

Enable wcd939x surge reset routine. Add callback for
the event within mbhc and enable it for wcd939x.

Change-Id: Iabc8c3367ae2eca5982db4526c6860e5eba63b76
Signed-off-by: Eric Rosas <quic_erosas@quicinc.com>
This commit is contained in:
Eric Rosas
2023-05-23 14:35:09 -07:00
committed by Sam Rainey
parent 007970b602
commit 4d7a95f88e
3 changed files with 15 additions and 2 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;
}