[PATCH v4 00/12] hwmon: Add Qualcomm SPMI BCL driver
From: Manaf Meethalavalappu Pallikunhi
Date: Mon Oct 05 2026 - 08:25:05 EST
This series introduces support for the Qualcomm SPMI PMIC Battery Current
Limiting (BCL) hardware monitor present in various Qualcomm PMICs.
The BCL hardware ensures robust battery protection by monitoring battery
conditions in real time and triggering interrupts when predefined
thresholds are crossed. These alerts allow the system to respond
proactively, preventing battery degradation and preserving system
reliability under adverse power conditions.
The driver integrates with the standard hwmon subsystem, exposing battery
measurements and configurable alarm thresholds. This design enables
seamless integration with existing system monitoring tools and thermal
management frameworks.
Key features:
- Battery/system under voltage and over current monitoring support
- Real-time voltage and current readings support
- Configurable threshold-based alarms (warning, critical and emergency)
- Interrupt-driven notifications for threshold violations
- Automatic threshold management with polling-based recovery
- Hardware-specific scaling factors and threshold representations
Voltage and current monitoring can be independently enabled/disabled
by firmware, and the driver automatically detects the enabled features
at probe time.
Dependencies:
- This series depends on the following patch, which is currently present
in linux-next but is not yet in the mainline tree:
https://lore.kernel.org/all/20260813211433.879638-1-linux@xxxxxxxxxxxx/
Signed-off-by: Manaf Meethalavalappu Pallikunhi <manaf.pallikunhi@xxxxxxxxxxxxxxxx>
---
Changes in v4:
- Dropped empty line from pm8350c devicetree change (Abel Vesa)
- Fixed use-after-free in delayed work in tear down path (Sashiko)
- Updated DIV_S64_ROUND_CLOSEST instead of the biased add-500000-then-truncate pattern (Sashiko)
- Updated regmap_bulk_read() for the 16-bit LSB/MSB pair (Sashiko)
- Removed dead code after above fixes
- Link to v3: https://lore.kernel.org/r/20260929-qcom-bcl-hwmon-v3-0-f5ca00889cf7@xxxxxxxxxxxxxxxx
Changes in v3:
- Rebased series and added 3rd alarm (emergency limit alarm) support for all PMICs
- Used static hwmon info building instead of dynamic info (Guenter)
- Removed unnecessary generic labels sysfs (Guenter)
- Renamed struct bcl_channel_cfg fields with _mu suffix for clarity
- Removed linux/mod_devicetable.h include (Uwe)
- Fixed uninitialized cache timestamps (sashiko ai)
- Fixed Integer truncation in threshold writes(sashiko ai)
- Fixed Missing data_field_bits_size in pmh0101_data (sashiko ai)
- Fixed DIV_ROUND_CLOSEST 32-bit architecture issue (sashiko ai)
- Fixed CHANNEL_CURR max_mu values using correct formula
- Fixed critical teardown race conditions
- Added device tree nodes for PM7550 and PM7550BA on Eliza platform
- Link to v2: https://lore.kernel.org/r/20260722-qcom-bcl-hwmon-v2-0-febe2805e17b@xxxxxxxxxxxxxxxx
Changes in v2:
- Reworked the binding from the generic qcom,bcl-hwmon.yaml schema to a
PMIC-specific qcom,pm7250b-bcl.yaml schema using exact compatible strings.(Krzysztof)
- Dropped the DT-configured overcurrent-thresholds-milliamp property.(Konrad)
- Renamed interrupt names from "bcl-max-min"/"bcl-critical" to
"max-min"/"critical".(Krzysztof)
- Limited the binding and driver match table to the supported PMICs:
PM7250B, PM8350C, PM8550, PMH0101, PMIH0108, SMB2360 and SMB2370.(Daniel)
- Folded qcom-bcl-hwmon.h into qcom-bcl-hwmon.c and removed the
macro-generated alarm mapping helpers.(Krzysztof/Bjorn/Daniel)
- Reworked the driver around per-PMIC register descriptors instead of
generic BCL generation/mode descriptors.(Krzysztof/Bjorn)
- Added support for 16-bit voltage/current input registers and
SMB2360/SMB2370 2S/3S battery configuration based scaling.
- Build hwmon channel information dynamically from hardware enable state
instead of registering static voltage/current channel sets.(Daniel)
- Improved alarm IRQ handling with per-alarm locking, wake state tracking,
shutdown guards, and explicit delayed-work cleanup.
- Switched probe/error paths to dev_err_probe() and tightened BCL enable,
regmap-field, and hwmon registration handling.
- Link to v1: https://lore.kernel.org/r/20260206-qcom-bcl-hwmon-v1-0-7b426f0b77a1@xxxxxxxxxxxxxxxx
---
Manaf Meethalavalappu Pallikunhi (12):
dt-bindings: hwmon: Describe Qualcomm BCL hardware
hwmon: Add Qualcomm PMIC BCL driver
arm64: dts: qcom: hamoa-pmic: Enable BCL sensor node
arm64: dts: qcom: pm7250b: Enable BCL sensor node
arm64: dts: qcom: pm7550-eliza: Enable BCL sensor node
arm64: dts: qcom: pm7550ba-eliza: Enable BCL sensor node
arm64: dts: qcom: pm8350c: Enable BCL sensor node
arm64: dts: qcom: pm8550: Enable BCL sensor node
arm64: dts: qcom: pmh0101: Enable BCL sensor node
arm64: dts: qcom: pmih0108-kaanapali: Enable BCL sensor node
arm64: dts: qcom: pmih0108: Enable BCL sensor node
arm64: dts: qcom: smb2370: Enable BCL sensor node
.../bindings/hwmon/qcom,pm7250b-bcl.yaml | 69 +
.../devicetree/bindings/mfd/qcom,spmi-pmic.yaml | 4 +
MAINTAINERS | 8 +
arch/arm64/boot/dts/qcom/hamoa-pmics.dtsi | 22 +
arch/arm64/boot/dts/qcom/pm7250b.dtsi | 11 +
arch/arm64/boot/dts/qcom/pm7550-eliza.dtsi | 11 +
arch/arm64/boot/dts/qcom/pm7550ba-eliza.dtsi | 11 +
arch/arm64/boot/dts/qcom/pm8350c.dtsi | 11 +
arch/arm64/boot/dts/qcom/pm8550.dtsi | 11 +
arch/arm64/boot/dts/qcom/pmh0101.dtsi | 11 +
arch/arm64/boot/dts/qcom/pmih0108-kaanapali.dtsi | 11 +
arch/arm64/boot/dts/qcom/pmih0108.dtsi | 11 +
arch/arm64/boot/dts/qcom/smb2370.dtsi | 11 +
drivers/hwmon/Kconfig | 11 +
drivers/hwmon/Makefile | 1 +
drivers/hwmon/qcom-bcl-hwmon.c | 1448 ++++++++++++++++++++
16 files changed, 1662 insertions(+)
---
base-commit: 6375e61c01e93e35ee7acd336a689ac1fae4b509
change-id: 20260720-qcom-bcl-hwmon-6d602c195eab
Best regards,
--
Manaf Meethalavalappu Pallikunhi <manaf.pallikunhi@xxxxxxxxxxxxxxxx>