wcd939x-usbss: update AUDIO mode on AATC usecase

update AUDIO mode to FSM when AATC plug detects and restore
to MANUAL once plug-out.

Change-Id: I2b31b67ab713823d2dca07327c141c386ac3b394
Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com>
This commit is contained in:
Prasad Kumpatla 2022-11-23 11:20:44 +05:30 committed by Gerrit - the friendly Code Review server
parent 77e6e012b8
commit ba335150d7

View File

@ -31,7 +31,7 @@ static const char * const supply_names[] = {
"vdd-usb-cp",
};
static int audio_fsm_mode = WCD_USBSS_AUDIO_FSM;
static int audio_fsm_mode = WCD_USBSS_AUDIO_MANUAL;
/* Linearlizer coefficients for 32ohm load */
static const struct wcd_usbss_reg_mask_val coeff_init[] = {
@ -167,6 +167,8 @@ static int wcd_usbss_switch_update_defaults(struct wcd_usbss_ctxt *priv)
regmap_update_bits(priv->regmap, WCD_USBSS_SWITCH_SELECT0, 0x3C, 0x14);
/* Enable DNL_SWITCHES and DPR_SWITCHES */
regmap_write_bits(priv->regmap, WCD_USBSS_SWITCH_SETTINGS_ENABLE, 0x18, 0x18);
/* Once plug-out done, restore to MANUAL mode */
audio_fsm_mode = WCD_USBSS_AUDIO_MANUAL;
return 0;
}
@ -278,6 +280,8 @@ int wcd_usbss_switch_update(enum wcd_usbss_cable_types ctype,
case WCD_USBSS_USB:
break;
case WCD_USBSS_AATC:
/* for AATC plug-in, change mode to FSM */
audio_fsm_mode = WCD_USBSS_AUDIO_FSM;
/* Disable all switches */
regmap_update_bits(wcd_usbss_ctxt_->regmap,
WCD_USBSS_SWITCH_SETTINGS_ENABLE, 0x7F, 0x00);