Loading Documentation/devicetree/bindings/power/smb358-charger.txt +2 −0 Original line number Diff line number Diff line Loading @@ -73,6 +73,8 @@ Optional Properties: specified in micro-volts. - qcom,batt-id-rpullup-kohm The pull-up resistor connected on the battery-ID (vref) line. - qcom,using-vbat-sns Bool property to indicate that VBAT sense can be done by PMIC. Example: i2c@f9967000 { Loading drivers/power/smb358-charger.c +7 −2 Original line number Diff line number Diff line Loading @@ -208,6 +208,7 @@ struct smb358_charger { bool chg_autonomous_mode; bool disable_apsd; bool using_pmic_therm; bool pmic_vbat_sns; bool battery_missing; const char *bms_psy_name; bool resume_completed; Loading Loading @@ -1007,7 +1008,9 @@ static int smb358_get_prop_batt_temp(struct smb358_charger *chip) int rc = 0; struct qpnp_vadc_result results; if (!smb358_get_prop_batt_present(chip) || !chip->vadc_dev) if (!smb358_get_prop_batt_present(chip) || !chip->vadc_dev || !chip->using_pmic_therm) return DEFAULT_TEMP; rc = qpnp_vadc_read(chip->vadc_dev, LR_MUX1_BATT_THERM, &results); Loading @@ -1027,7 +1030,7 @@ smb358_get_prop_battery_voltage_now(struct smb358_charger *chip) int rc = 0; struct qpnp_vadc_result results; if (!chip->vadc_dev) if (!chip->vadc_dev || !chip->pmic_vbat_sns) return 0; rc = qpnp_vadc_read(chip->vadc_dev, VBAT_SNS, &results); Loading Loading @@ -2191,6 +2194,8 @@ static int smb_parse_dt(struct smb358_charger *chip) chip->using_pmic_therm = of_property_read_bool(node, "qcom,using-pmic-therm"); chip->pmic_vbat_sns = of_property_read_bool(node, "qcom,using-vbat-sns"); chip->bms_controlled_charging = of_property_read_bool(node, "qcom,bms-controlled-charging"); Loading Loading
Documentation/devicetree/bindings/power/smb358-charger.txt +2 −0 Original line number Diff line number Diff line Loading @@ -73,6 +73,8 @@ Optional Properties: specified in micro-volts. - qcom,batt-id-rpullup-kohm The pull-up resistor connected on the battery-ID (vref) line. - qcom,using-vbat-sns Bool property to indicate that VBAT sense can be done by PMIC. Example: i2c@f9967000 { Loading
drivers/power/smb358-charger.c +7 −2 Original line number Diff line number Diff line Loading @@ -208,6 +208,7 @@ struct smb358_charger { bool chg_autonomous_mode; bool disable_apsd; bool using_pmic_therm; bool pmic_vbat_sns; bool battery_missing; const char *bms_psy_name; bool resume_completed; Loading Loading @@ -1007,7 +1008,9 @@ static int smb358_get_prop_batt_temp(struct smb358_charger *chip) int rc = 0; struct qpnp_vadc_result results; if (!smb358_get_prop_batt_present(chip) || !chip->vadc_dev) if (!smb358_get_prop_batt_present(chip) || !chip->vadc_dev || !chip->using_pmic_therm) return DEFAULT_TEMP; rc = qpnp_vadc_read(chip->vadc_dev, LR_MUX1_BATT_THERM, &results); Loading @@ -1027,7 +1030,7 @@ smb358_get_prop_battery_voltage_now(struct smb358_charger *chip) int rc = 0; struct qpnp_vadc_result results; if (!chip->vadc_dev) if (!chip->vadc_dev || !chip->pmic_vbat_sns) return 0; rc = qpnp_vadc_read(chip->vadc_dev, VBAT_SNS, &results); Loading Loading @@ -2191,6 +2194,8 @@ static int smb_parse_dt(struct smb358_charger *chip) chip->using_pmic_therm = of_property_read_bool(node, "qcom,using-pmic-therm"); chip->pmic_vbat_sns = of_property_read_bool(node, "qcom,using-vbat-sns"); chip->bms_controlled_charging = of_property_read_bool(node, "qcom,bms-controlled-charging"); Loading