Re: [PATCH v3 2/2] power: supply: qcom_smbx: add SMB5 support

From: Dmitry Baryshkov

Date: Thu Aug 13 2026 - 11:55:10 EST


On Thu, Aug 13, 2026 at 12:45:42PM +0200, Robin Snyders via B4 Relay wrote:
> From: Casey Connolly <casey.connolly@xxxxxxxxxx>
>
> Introduce support for the SMB5 charger found on PM7250B, PM8150B and
> related Qualcomm PMICs.
>
> SMB5 uses different DCDC status offsets, charger-state encodings and
> electrical ranges. Select these from per-PMIC match data, with PM7250B
> using the PM8150B compatible fallback and parameter block. Read
> overvoltage from the SMB5 status bit, use the already-prescaled IIO
> voltage reading, and convert the SMB5 current-sense voltage to microamps.
> Use battery-info property presence when selecting voltage and current
> targets.
>
> Keep Type-C power-role and VBUS control with the dedicated TCPM and
> regulator drivers. Clear the unsupported HVDCP negotiation modes so stale
> firmware settings cannot raise VBUS. Leave the firmware recharge policy
> unchanged and match the downstream default of ADC-based AICL disabled,
> while enabling periodic hardware AICL with its twelve-second SMB5 rerun
> interval. Preserve the existing three-second SMB2 interval.
>
> Program the battery limits and complete SMB5 input and charging setup
> from the power-supply registration init callback before device_add
> publishes the properties. This makes all public callbacks safe without
> driver-specific probe synchronization.
>
> Suspend USB input and charging before SMB5 initialization. On a later
> failure, restore the original charging-enable state before the
> input-suspend state; leave the input suspended if charging cannot be
> restored. Cancel status work before unregistering the power supply during
> managed teardown. Update the Kconfig description to cover both charger
> generations.

I remember that in SMB2 case the TCPM and charger drivers were
programming the registers from the same block. Is there no such conflict
on the SMB5 platforms? Have you tested that this doesn't break the USB-C
dongles being connected to the device?

>
> On a OnePlus 7T Pro, register reads from the initial implementation
> confirmed the programmed 4.40 V, 1.50 A and 500 mA limits. A 180-second
> guarded charging trace and a subsequent 600-second runtime trace
> completed without crossing the voltage guard.
>
> Signed-off-by: Casey Connolly <casey.connolly@xxxxxxxxxx>
> Co-developed-by: Joel Selvaraj <foss@xxxxxxxxxxxxxxxx>
> Signed-off-by: Joel Selvaraj <foss@xxxxxxxxxxxxxxxx>
> Co-developed-by: Robin Snyders <robin@xxxxxxxxxxx>
> Signed-off-by: Robin Snyders <robin@xxxxxxxxxxx>
> ---
> drivers/power/supply/Kconfig | 8 +-
> drivers/power/supply/qcom_smbx.c | 744 ++++++++++++++++++++++++++++++---------
> 2 files changed, 590 insertions(+), 162 deletions(-)
>

--
With best wishes
Dmitry