Loading arch/arm/boot/dts/qcom/msm-pmi8994.dtsi +1 −1 Original line number Diff line number Diff line Loading @@ -312,7 +312,7 @@ status = "okay"; qcom,bcl-lm-threshold-ma = <127>; qcom,bcl-mh-threshold-ma = <405>; qcom,fg-iterm-ma = <100>; qcom,fg-iterm-ma = <125>; qcom,fg-chg-iterm-ma = <100>; qcom,cycle-counter-en; qcom,capacity-learning-on; Loading drivers/power/smb1351-charger.c +22 −8 Original line number Diff line number Diff line Loading @@ -1352,14 +1352,7 @@ static int smb1351_parallel_set_chg_present(struct smb1351_charger *chip, int present) { int rc; u8 reg; /* Check if SMB1351 is present */ rc = smb1351_read_reg(chip, CHG_REVISION_REG, ®); if (rc) { pr_debug("Failed to detect smb1351-parallel-charger, may be absent\n"); return -ENODEV; } u8 reg, mask = 0; if (present == chip->parallel_charger_present) { pr_debug("present %d -> %d, skipping\n", Loading @@ -1368,6 +1361,13 @@ static int smb1351_parallel_set_chg_present(struct smb1351_charger *chip, } if (present) { /* Check if SMB1351 is present */ rc = smb1351_read_reg(chip, CHG_REVISION_REG, ®); if (rc) { pr_debug("Failed to detect smb1351-parallel-charger, may be absent\n"); return -ENODEV; } rc = smb1351_enable_volatile_writes(chip); if (rc) { pr_err("Couldn't configure for volatile rc = %d\n", rc); Loading Loading @@ -1419,6 +1419,20 @@ static int smb1351_parallel_set_chg_present(struct smb1351_charger *chip, return rc; } /* * setup USB 2.0/3.0 detection and USB 500/100 * command polarity */ reg = USB_2_3_MODE_SEL_BY_I2C | USB_CMD_POLARITY_500_1_100_0; mask = USB_2_3_MODE_SEL_BIT | USB_5_1_CMD_POLARITY_BIT; rc = smb1351_masked_write(chip, CHG_OTH_CURRENT_CTRL_REG, mask, reg); if (rc) { pr_err("Couldn't set CHG_OTH_CURRENT_CTRL_REG rc=%d\n", rc); return rc; } /* set fast charging current limit */ chip->fastchg_current_max_ma = SMB1351_CHG_FAST_MIN_MA; rc = smb1351_fastchg_current_set(chip, Loading Loading
arch/arm/boot/dts/qcom/msm-pmi8994.dtsi +1 −1 Original line number Diff line number Diff line Loading @@ -312,7 +312,7 @@ status = "okay"; qcom,bcl-lm-threshold-ma = <127>; qcom,bcl-mh-threshold-ma = <405>; qcom,fg-iterm-ma = <100>; qcom,fg-iterm-ma = <125>; qcom,fg-chg-iterm-ma = <100>; qcom,cycle-counter-en; qcom,capacity-learning-on; Loading
drivers/power/smb1351-charger.c +22 −8 Original line number Diff line number Diff line Loading @@ -1352,14 +1352,7 @@ static int smb1351_parallel_set_chg_present(struct smb1351_charger *chip, int present) { int rc; u8 reg; /* Check if SMB1351 is present */ rc = smb1351_read_reg(chip, CHG_REVISION_REG, ®); if (rc) { pr_debug("Failed to detect smb1351-parallel-charger, may be absent\n"); return -ENODEV; } u8 reg, mask = 0; if (present == chip->parallel_charger_present) { pr_debug("present %d -> %d, skipping\n", Loading @@ -1368,6 +1361,13 @@ static int smb1351_parallel_set_chg_present(struct smb1351_charger *chip, } if (present) { /* Check if SMB1351 is present */ rc = smb1351_read_reg(chip, CHG_REVISION_REG, ®); if (rc) { pr_debug("Failed to detect smb1351-parallel-charger, may be absent\n"); return -ENODEV; } rc = smb1351_enable_volatile_writes(chip); if (rc) { pr_err("Couldn't configure for volatile rc = %d\n", rc); Loading Loading @@ -1419,6 +1419,20 @@ static int smb1351_parallel_set_chg_present(struct smb1351_charger *chip, return rc; } /* * setup USB 2.0/3.0 detection and USB 500/100 * command polarity */ reg = USB_2_3_MODE_SEL_BY_I2C | USB_CMD_POLARITY_500_1_100_0; mask = USB_2_3_MODE_SEL_BIT | USB_5_1_CMD_POLARITY_BIT; rc = smb1351_masked_write(chip, CHG_OTH_CURRENT_CTRL_REG, mask, reg); if (rc) { pr_err("Couldn't set CHG_OTH_CURRENT_CTRL_REG rc=%d\n", rc); return rc; } /* set fast charging current limit */ chip->fastchg_current_max_ma = SMB1351_CHG_FAST_MIN_MA; rc = smb1351_fastchg_current_set(chip, Loading