Loading Documentation/devicetree/bindings/power/qpnp-smbcharger.txt +3 −0 Original line number Diff line number Diff line Loading @@ -297,6 +297,9 @@ Optional Properties: - qcom,override-usb-current A boolean property to override the ICL limit for USB charger(SDP) based on the current reported by USB driver. - qcom,max-pulse-allowed The maximum number of pulses allowed in HVDCP3 mode. It can be used to restrict VBUS to a value. Example: qcom,qpnp-smbcharger { Loading drivers/power/power_supply_sysfs.c +1 −0 Original line number Diff line number Diff line Loading @@ -247,6 +247,7 @@ static struct device_attribute power_supply_attrs[] = { POWER_SUPPLY_ATTR(current_capability), POWER_SUPPLY_ATTR(typec_mode), POWER_SUPPLY_ATTR(allow_hvdcp3), POWER_SUPPLY_ATTR(max_pulse_allowed), POWER_SUPPLY_ATTR(soc_reporting_ready), POWER_SUPPLY_ATTR(ignore_false_negative_isense), POWER_SUPPLY_ATTR(enable_jeita_detection), Loading drivers/power/qpnp-smbcharger.c +8 −0 Original line number Diff line number Diff line Loading @@ -172,6 +172,7 @@ struct smbchg_chip { int n_vbat_samples; /* status variables */ int max_pulse_allowed; int wake_reasons; int previous_soc; int usb_online; Loading Loading @@ -5801,6 +5802,7 @@ static enum power_supply_property smbchg_battery_properties[] = { POWER_SUPPLY_PROP_RERUN_AICL, POWER_SUPPLY_PROP_RESTRICTED_CHARGING, POWER_SUPPLY_PROP_ALLOW_HVDCP3, POWER_SUPPLY_PROP_MAX_PULSE_ALLOWED, }; static int smbchg_battery_set_property(struct power_supply *psy, Loading Loading @@ -6014,6 +6016,9 @@ static int smbchg_battery_get_property(struct power_supply *psy, case POWER_SUPPLY_PROP_ALLOW_HVDCP3: val->intval = chip->allow_hvdcp3_detection; break; case POWER_SUPPLY_PROP_MAX_PULSE_ALLOWED: val->intval = chip->max_pulse_allowed; break; default: return -EINVAL; } Loading Loading @@ -7425,6 +7430,9 @@ static int smb_parse_dt(struct smbchg_chip *chip) if (chip->parallel.min_current_thr_ma != -EINVAL && chip->parallel.min_9v_current_thr_ma != -EINVAL) chip->parallel.avail = true; OF_PROP_READ(chip, chip->max_pulse_allowed, "max-pulse-allowed", rc, 1); /* * use the dt values if they exist, otherwise do not touch the params */ Loading include/linux/power_supply.h +1 −0 Original line number Diff line number Diff line Loading @@ -210,6 +210,7 @@ enum power_supply_property { POWER_SUPPLY_PROP_CURRENT_CAPABILITY, POWER_SUPPLY_PROP_TYPEC_MODE, POWER_SUPPLY_PROP_ALLOW_HVDCP3, POWER_SUPPLY_PROP_MAX_PULSE_ALLOWED, POWER_SUPPLY_PROP_SOC_REPORTING_READY, POWER_SUPPLY_PROP_IGNORE_FALSE_NEGATIVE_ISENSE, POWER_SUPPLY_PROP_ENABLE_JEITA_DETECTION, Loading Loading
Documentation/devicetree/bindings/power/qpnp-smbcharger.txt +3 −0 Original line number Diff line number Diff line Loading @@ -297,6 +297,9 @@ Optional Properties: - qcom,override-usb-current A boolean property to override the ICL limit for USB charger(SDP) based on the current reported by USB driver. - qcom,max-pulse-allowed The maximum number of pulses allowed in HVDCP3 mode. It can be used to restrict VBUS to a value. Example: qcom,qpnp-smbcharger { Loading
drivers/power/power_supply_sysfs.c +1 −0 Original line number Diff line number Diff line Loading @@ -247,6 +247,7 @@ static struct device_attribute power_supply_attrs[] = { POWER_SUPPLY_ATTR(current_capability), POWER_SUPPLY_ATTR(typec_mode), POWER_SUPPLY_ATTR(allow_hvdcp3), POWER_SUPPLY_ATTR(max_pulse_allowed), POWER_SUPPLY_ATTR(soc_reporting_ready), POWER_SUPPLY_ATTR(ignore_false_negative_isense), POWER_SUPPLY_ATTR(enable_jeita_detection), Loading
drivers/power/qpnp-smbcharger.c +8 −0 Original line number Diff line number Diff line Loading @@ -172,6 +172,7 @@ struct smbchg_chip { int n_vbat_samples; /* status variables */ int max_pulse_allowed; int wake_reasons; int previous_soc; int usb_online; Loading Loading @@ -5801,6 +5802,7 @@ static enum power_supply_property smbchg_battery_properties[] = { POWER_SUPPLY_PROP_RERUN_AICL, POWER_SUPPLY_PROP_RESTRICTED_CHARGING, POWER_SUPPLY_PROP_ALLOW_HVDCP3, POWER_SUPPLY_PROP_MAX_PULSE_ALLOWED, }; static int smbchg_battery_set_property(struct power_supply *psy, Loading Loading @@ -6014,6 +6016,9 @@ static int smbchg_battery_get_property(struct power_supply *psy, case POWER_SUPPLY_PROP_ALLOW_HVDCP3: val->intval = chip->allow_hvdcp3_detection; break; case POWER_SUPPLY_PROP_MAX_PULSE_ALLOWED: val->intval = chip->max_pulse_allowed; break; default: return -EINVAL; } Loading Loading @@ -7425,6 +7430,9 @@ static int smb_parse_dt(struct smbchg_chip *chip) if (chip->parallel.min_current_thr_ma != -EINVAL && chip->parallel.min_9v_current_thr_ma != -EINVAL) chip->parallel.avail = true; OF_PROP_READ(chip, chip->max_pulse_allowed, "max-pulse-allowed", rc, 1); /* * use the dt values if they exist, otherwise do not touch the params */ Loading
include/linux/power_supply.h +1 −0 Original line number Diff line number Diff line Loading @@ -210,6 +210,7 @@ enum power_supply_property { POWER_SUPPLY_PROP_CURRENT_CAPABILITY, POWER_SUPPLY_PROP_TYPEC_MODE, POWER_SUPPLY_PROP_ALLOW_HVDCP3, POWER_SUPPLY_PROP_MAX_PULSE_ALLOWED, POWER_SUPPLY_PROP_SOC_REPORTING_READY, POWER_SUPPLY_PROP_IGNORE_FALSE_NEGATIVE_ISENSE, POWER_SUPPLY_PROP_ENABLE_JEITA_DETECTION, Loading