mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
To: venkat.yadlapati@yahoo.com, Sebastian Reichel <sre@kernel.org>
Cc: linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org,
	linux-kernel@vger.kernel.org, Joonhoe Kim <26rote@gmail.com>
Subject: Re: [PATCH 2/2] power: supply: qcom_battmgr: Don't limit the input current of chargers
Date: Tue, 1 Dec 2026 12:09:05 +0100	[thread overview]
Message-ID: <ce316693-ce9e-4b7d-add5-f220ae1d8e37@oss.qualcomm.com> (raw)
In-Reply-To: <20261116-vantage-battmgr-v1-2-7b59157377b7@yahoo.com>

On 11/15/26 9:20 PM, Venkat Yadlapati via B4 Relay wrote:
> From: Venkat Yadlapati <venkat.yadlapati@yahoo.com>
> 
> 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@yahoo.com>
> ---
>  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

      reply	other threads:[~2026-12-01 11:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-15 20:20 [PATCH 0/2] power: supply: qcom_battmgr: Apply the USB host current limit early Venkat Yadlapati via B4 Relay
2026-11-15 20:20 ` [PATCH 1/2] power: supply: qcom_battmgr: Apply a USB input current limit set early Venkat Yadlapati via B4 Relay
2026-12-01 10:44   ` Konrad Dybcio
2026-11-15 20:20 ` [PATCH 2/2] power: supply: qcom_battmgr: Don't limit the input current of chargers Venkat Yadlapati via B4 Relay
2026-12-01 11:09   ` Konrad Dybcio [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ce316693-ce9e-4b7d-add5-f220ae1d8e37@oss.qualcomm.com \
    --to=konrad.dybcio@oss.qualcomm.com \
    --cc=26rote@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=sre@kernel.org \
    --cc=venkat.yadlapati@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®