Re: [PATCH 2/2] power: supply: qcom_battmgr: Don't limit the input current of chargers
From: Konrad Dybcio
Date: Tue Dec 01 2026 - 06:09:16 EST
On 11/15/26 9:20 PM, Venkat Yadlapati via B4 Relay wrote:
> 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;
msm-5.10 doesn't allow SDP here. What's your downstream tree?
It also has a provision to reset this limit whenever the psy
type changes
Konrad