mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Venkat Yadlapati <venkat.yadlapati@yahoo.com>
To: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Cc: Sebastian Reichel <sre@kernel.org>,
	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 21:38:53 +0530	[thread overview]
Message-ID: <20261201160910.169252-2-venkat.yadlapati@yahoo.com> (raw)
In-Reply-To: <ce316693-ce9e-4b7d-add5-f220ae1d8e37@oss.qualcomm.com>

On 12/1/26 4:39 PM, Konrad Dybcio wrote:
> On 11/15/26 9:20 PM, Venkat Yadlapati via B4 Relay wrote:
>> +	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?

The Motorola kernel for the Signature (SM8845):

https://github.com/MotorolaMobilityLLC/kernel-msm/blob/MMI-A171WVH.21-16-16/drivers/power/supply/qti_battery_charger.c

Its usb_psy_set_icl() reads USB_ADAP_TYPE and allows SDP, PD and CDP:

	/* Allow this only for SDP, CDP or USB_PD and not for other charger types */
	switch (pst->prop[USB_ADAP_TYPE]) {
	case POWER_SUPPLY_USB_TYPE_SDP:
	case POWER_SUPPLY_USB_TYPE_PD:
	case POWER_SUPPLY_USB_TYPE_CDP:
		break;

SDP is also the case this series is about: the phone connected to a
computer, where dwc3 reports 500 mA (USB 2.0) or 900 mA (USB 3.x)
after enumeration and the firmware otherwise stays at 100 mA.

> It also has a provision to reset this limit whenever the psy
> type changes

Right. As far as I can see, the reset there only clears the cached
value (bcdev->usb_icl_ua), in usb_psy_set_icl() for other types and in
the notification handler when the type stops being SDP/CDP/PD. That
cache is only used to re-apply the last limit after the firmware
restarts. Nothing is written to the firmware when the type changes.

v2 keeps no cached value once the service is up, so the reset has
nothing to clear yet. If v3 goes with the late registration you
suggested on 1/2, it keeps no cache at all. Re-applying the limit
after a firmware restart, the way downstream does, would need the
cache, and then the reset on a type change as well. Do you want that
in this series, or as a separate change?

Thanks,
Venkat

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

Thread overview: 7+ 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-12-01 16:08     ` Venkat Yadlapati
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
2026-12-01 16:08     ` Venkat Yadlapati [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=20261201160910.169252-2-venkat.yadlapati@yahoo.com \
    --to=venkat.yadlapati@yahoo.com \
    --cc=26rote@gmail.com \
    --cc=konrad.dybcio@oss.qualcomm.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=sre@kernel.org \
    /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®