[PATCH 2/2] power: supply: qcom_battmgr: Don't limit the input current of chargers
From: Venkat Yadlapati via B4 Relay
Date: Sun Nov 15 2026 - 15:21:41 EST
From: Venkat Yadlapati <venkat.yadlapati@xxxxxxxxx>
The input current limit of the USB power supply is meant for the current
a USB host grants, e.g. after enumeration. Like the downstream driver,
only apply it to SDP, CDP and USB PD ports, so that a dedicated charger
is never throttled to what a USB controller reports.
Assisted-by: LLM
Signed-off-by: Venkat Yadlapati <venkat.yadlapati@xxxxxxxxx>
---
drivers/power/supply/qcom_battmgr.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/drivers/power/supply/qcom_battmgr.c b/drivers/power/supply/qcom_battmgr.c
index fde9704d0acd..db117cb64a17 100644
--- a/drivers/power/supply/qcom_battmgr.c
+++ b/drivers/power/supply/qcom_battmgr.c
@@ -1152,6 +1152,24 @@ static int qcom_battmgr_usb_set_icl(struct qcom_battmgr *battmgr, u32 icl)
{
int ret;
+ ret = qcom_battmgr_usb_sm8350_update(battmgr, POWER_SUPPLY_PROP_USB_TYPE);
+ if (ret)
+ return ret;
+
+ /*
+ * The limit is meant for the current a USB host grants, e.g. after
+ * enumeration, like the downstream driver don't let it throttle
+ * dedicated chargers.
+ */
+ switch (battmgr->usb.usb_type) {
+ case POWER_SUPPLY_USB_TYPE_SDP:
+ case POWER_SUPPLY_USB_TYPE_CDP:
+ case POWER_SUPPLY_USB_TYPE_PD:
+ break;
+ default:
+ return -EINVAL;
+ }
+
mutex_lock(&battmgr->lock);
ret = qcom_battmgr_request_property(battmgr, BATTMGR_USB_PROPERTY_SET,
USB_INPUT_CURR_LIMIT, icl);
--
2.56.0