mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-10 14:19:09 -04:00
Merge "power: supply: qcom: Disable suspend on collapse on USB removal"
This commit is contained in:
commit
b05a0f59ef
3 changed files with 19 additions and 13 deletions
|
|
@ -218,7 +218,6 @@ struct smb_dt_props {
|
|||
int term_current_src;
|
||||
int term_current_thresh_hi_ma;
|
||||
int term_current_thresh_lo_ma;
|
||||
int disable_suspend_on_collapse;
|
||||
};
|
||||
|
||||
struct smb5 {
|
||||
|
|
@ -556,7 +555,7 @@ static int smb5_parse_dt_misc(struct smb5 *chip, struct device_node *node)
|
|||
of_property_read_u32(node, "qcom,connector-internal-pull-kohm",
|
||||
&chg->connector_pull_up);
|
||||
|
||||
chip->dt.disable_suspend_on_collapse = of_property_read_bool(node,
|
||||
chg->disable_suspend_on_collapse = of_property_read_bool(node,
|
||||
"qcom,disable-suspend-on-collapse");
|
||||
chg->smb_pull_up = -EINVAL;
|
||||
of_property_read_u32(node, "qcom,smb-internal-pull-kohm",
|
||||
|
|
@ -2148,7 +2147,7 @@ static int smb5_init_hw(struct smb5 *chip)
|
|||
mask = USBIN_AICL_PERIODIC_RERUN_EN_BIT | USBIN_AICL_ADC_EN_BIT
|
||||
| USBIN_AICL_EN_BIT | SUSPEND_ON_COLLAPSE_USBIN_BIT;
|
||||
val = USBIN_AICL_PERIODIC_RERUN_EN_BIT | USBIN_AICL_EN_BIT;
|
||||
if (!chip->dt.disable_suspend_on_collapse)
|
||||
if (!chg->disable_suspend_on_collapse)
|
||||
val |= SUSPEND_ON_COLLAPSE_USBIN_BIT;
|
||||
if (chip->dt.adc_based_aicl)
|
||||
val |= USBIN_AICL_ADC_EN_BIT;
|
||||
|
|
|
|||
|
|
@ -1354,12 +1354,15 @@ static void smblib_uusb_removal(struct smb_charger *chg)
|
|||
smblib_err(chg, "Couldn't restore max pulses rc=%d\n",
|
||||
rc);
|
||||
|
||||
rc = smblib_masked_write(chg, USBIN_AICL_OPTIONS_CFG_REG,
|
||||
SUSPEND_ON_COLLAPSE_USBIN_BIT,
|
||||
SUSPEND_ON_COLLAPSE_USBIN_BIT);
|
||||
if (rc < 0)
|
||||
smblib_err(chg, "Couldn't turn on SUSPEND_ON_COLLAPSE_USBIN_BIT rc=%d\n",
|
||||
if (!chg->disable_suspend_on_collapse) {
|
||||
rc = smblib_masked_write(chg, USBIN_AICL_OPTIONS_CFG_REG,
|
||||
SUSPEND_ON_COLLAPSE_USBIN_BIT,
|
||||
SUSPEND_ON_COLLAPSE_USBIN_BIT);
|
||||
if (rc < 0)
|
||||
smblib_err(chg,
|
||||
"Couldn't turn on SUSPEND_ON_COLLAPSE_USBIN_BIT rc=%d\n",
|
||||
rc);
|
||||
}
|
||||
|
||||
chg->qc2_unsupported_voltage = QC2_COMPLIANT;
|
||||
}
|
||||
|
|
@ -6458,12 +6461,15 @@ static void typec_src_removal(struct smb_charger *chg)
|
|||
smblib_err(chg, "Couldn't restore max pulses rc=%d\n",
|
||||
rc);
|
||||
|
||||
rc = smblib_masked_write(chg, USBIN_AICL_OPTIONS_CFG_REG,
|
||||
SUSPEND_ON_COLLAPSE_USBIN_BIT,
|
||||
SUSPEND_ON_COLLAPSE_USBIN_BIT);
|
||||
if (rc < 0)
|
||||
smblib_err(chg, "Couldn't turn on SUSPEND_ON_COLLAPSE_USBIN_BIT rc=%d\n",
|
||||
if (!chg->disable_suspend_on_collapse) {
|
||||
rc = smblib_masked_write(chg, USBIN_AICL_OPTIONS_CFG_REG,
|
||||
SUSPEND_ON_COLLAPSE_USBIN_BIT,
|
||||
SUSPEND_ON_COLLAPSE_USBIN_BIT);
|
||||
if (rc < 0)
|
||||
smblib_err(chg,
|
||||
"Couldn't turn on SUSPEND_ON_COLLAPSE_USBIN_BIT rc=%d\n",
|
||||
rc);
|
||||
}
|
||||
|
||||
chg->qc2_unsupported_voltage = QC2_COMPLIANT;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -594,6 +594,7 @@ struct smb_charger {
|
|||
bool apsd_ext_timeout;
|
||||
bool qc3p5_detected;
|
||||
int qc3p5_detected_mw;
|
||||
bool disable_suspend_on_collapse;
|
||||
|
||||
/* workaround flag */
|
||||
int real_charger_type;
|
||||
|
|
|
|||
Loading…
Reference in a new issue