[PATCH v2 00/10] hwmon: Add Qualcomm SPMI BCL driver
Manaf Meethalavalappu Pallikunhi <[email protected]> Wed, 22 Jul 2026 00:00:05 +0530
| Newsgroups | dev.linux.lists.mfd,org.kernel.vger.linux-arm-msm,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-hwmon,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
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 and critical levels) - 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. Signed-off-by: Manaf Meethalavalappu Pallikunhi <[email protected]> --- 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/[email protected] --- Manaf Meethalavalappu Pallikunhi (10): dt-bindings: hwmon: Describe Qualcomm BCL hardware hwmon: Add Qualcomm PMIC BCL driver arm64: dts: qcom: pm7250b: Enable BCL sensor node arm64: dts: qcom: hamoa-pmic: Enable BCL sensor node arm64: dts: qcom: pm8350c: Enable BCL sensor node arm64: dts: qcom: pmh0101: Enable BCL sensor node arm64: dts: qcom: pm8550: 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 | 64 + .../devicetree/bindings/mfd/qcom,spmi-pmic.yaml | 4 + MAINTAINERS | 8 + arch/arm64/boot/dts/qcom/hamoa-pmics.dtsi | 9 + arch/arm64/boot/dts/qcom/pm7250b.dtsi | 9 + arch/arm64/boot/dts/qcom/pm8350c.dtsi | 10 + arch/arm64/boot/dts/qcom/pm8550.dtsi | 9 + arch/arm64/boot/dts/qcom/pmh0101.dtsi | 9 + arch/arm64/boot/dts/qcom/pmih0108-kaanapali.dtsi | 9 + arch/arm64/boot/dts/qcom/pmih0108.dtsi | 9 + arch/arm64/boot/dts/qcom/smb2370.dtsi | 9 + drivers/hwmon/Kconfig | 11 + drivers/hwmon/Makefile | 1 + drivers/hwmon/qcom-bcl-hwmon.c | 1443 ++++++++++++++++++++ 14 files changed, 1604 insertions(+) --- base-commit: 3fe08b9796f36ef437ab9328e7dd1e5ff2d66603 change-id: 20260720-qcom-bcl-hwmon-6d602c195eab Best regards, -- Manaf Meethalavalappu Pallikunhi <[email protected]>