Loading drivers/power/supply/qcom/qpnp-smb5.c +5 −7 Original line number Diff line number Diff line Loading @@ -1482,14 +1482,12 @@ static int smb5_configure_typec(struct smb_charger *chg) } /* * Across reboot, standard typeC cables get detected as legacy cables * due to VBUS attachment prior to CC attach/dettach. To handle this, * "early_usb_attach" flag is used, which assumes that across reboot, * the cable connected can be standard typeC. However, its jurisdiction * is limited to PD capable designs only. Hence, for non-PD type designs * reset legacy cable detection by disabling/enabling typeC mode. * Across reboot, standard typeC cables get detected as legacy * cables due to VBUS attachment prior to CC attach/detach. * Reset the legacy detection logic by enabling/disabling the typeC mode. */ if (chg->pd_not_supported && (value & TYPEC_LEGACY_CABLE_STATUS_BIT)) { if (value & TYPEC_LEGACY_CABLE_STATUS_BIT) { val = QTI_POWER_SUPPLY_TYPEC_PR_NONE; rc = smblib_set_prop_typec_power_role(chg, val); if (rc < 0) { Loading drivers/power/supply/qcom/smb5-lib.c +2 −1 Original line number Diff line number Diff line Loading @@ -4537,7 +4537,8 @@ int smblib_set_prop_typec_power_role(struct smb_charger *chg, int val) smblib_dbg(chg, PR_MISC, "power role change: %d --> %d!", chg->power_role, val); if (chg->power_role == val) { /* Force the power-role if the initial value is NONE, for the legacy cable detection WA. */ if (chg->power_role == val && chg->power_role != QTI_POWER_SUPPLY_TYPEC_PR_NONE) { smblib_dbg(chg, PR_MISC, "power role already in %d, ignore!", chg->power_role); return 0; Loading Loading
drivers/power/supply/qcom/qpnp-smb5.c +5 −7 Original line number Diff line number Diff line Loading @@ -1482,14 +1482,12 @@ static int smb5_configure_typec(struct smb_charger *chg) } /* * Across reboot, standard typeC cables get detected as legacy cables * due to VBUS attachment prior to CC attach/dettach. To handle this, * "early_usb_attach" flag is used, which assumes that across reboot, * the cable connected can be standard typeC. However, its jurisdiction * is limited to PD capable designs only. Hence, for non-PD type designs * reset legacy cable detection by disabling/enabling typeC mode. * Across reboot, standard typeC cables get detected as legacy * cables due to VBUS attachment prior to CC attach/detach. * Reset the legacy detection logic by enabling/disabling the typeC mode. */ if (chg->pd_not_supported && (value & TYPEC_LEGACY_CABLE_STATUS_BIT)) { if (value & TYPEC_LEGACY_CABLE_STATUS_BIT) { val = QTI_POWER_SUPPLY_TYPEC_PR_NONE; rc = smblib_set_prop_typec_power_role(chg, val); if (rc < 0) { Loading
drivers/power/supply/qcom/smb5-lib.c +2 −1 Original line number Diff line number Diff line Loading @@ -4537,7 +4537,8 @@ int smblib_set_prop_typec_power_role(struct smb_charger *chg, int val) smblib_dbg(chg, PR_MISC, "power role change: %d --> %d!", chg->power_role, val); if (chg->power_role == val) { /* Force the power-role if the initial value is NONE, for the legacy cable detection WA. */ if (chg->power_role == val && chg->power_role != QTI_POWER_SUPPLY_TYPEC_PR_NONE) { smblib_dbg(chg, PR_MISC, "power role already in %d, ignore!", chg->power_role); return 0; Loading