|
|
Log in / Subscribe / Register

thermal: qcom: add PM8901 PMIC temperature-alarm driver

From:  Herman van Hazendonk <github.com-AT-herrie.org>
To:  Amit Kucheria <amitk-AT-kernel.org>, Conor Dooley <conor+dt-AT-kernel.org>, Daniel Lezcano <daniel.lezcano-AT-kernel.org>, devicetree-AT-vger.kernel.org, Krzysztof Kozlowski <krzk+dt-AT-kernel.org>, Lee Jones <lee-AT-kernel.org>, linux-arm-msm-AT-vger.kernel.org, linux-kernel-AT-vger.kernel.org, linux-pm-AT-vger.kernel.org, Lukasz Luba <lukasz.luba-AT-arm.com>, "Rafael J. Wysocki" <rafael-AT-kernel.org>, Rob Herring <robh-AT-kernel.org>, Satya Priya <quic_c_skakit-AT-quicinc.com>, Thara Gopinath <thara.gopinath-AT-gmail.com>, van Hazendonk <github.com-AT-herrie.org>, Zhang Rui <rui.zhang-AT-intel.com>
Subject:  [PATCH v2 0/3] thermal: qcom: add PM8901 PMIC temperature-alarm driver
Date:  Sun, 31 May 2026 06:09:13 +0200
Message-ID:  <cover.1780197411.git.github.com@herrie.org>
Archive-link:  Article

Hi all,

Self-review (with Sashiko AI assist) caught issues in v1 before
maintainer review reached them; re-rolling promptly. v1:

  https://lore.kernel.org/linux-arm-msm/cover.1780148149.gi...

v2 changes:

  - NEW patch 1/3: extend the qcom,pm8xxx parent schema with a
    `temp-alarm@[0-9a-f]+$` patternProperty so the new sub-node
    validates as a recognised child of the PMIC. Without this, any
    board DT instantiating the temp-alarm sub-node fails
    dt_binding_check (CI bot caught this on v1).

  - patch 2/3: thermal binding YAML rewritten:
      * add `allOf: $ref: /schemas/thermal/thermal-sensor.yaml#`;
      * rewrite the example so the parent qcom,pm8901 node itself
        satisfies its own schema (reg, address-cells, interrupts,
        interrupt-controller) - addresses the CI bot's `'interrupts'
        is a required property` complaint on the embedded pmic node;
      * reword the commit message; v1 incorrectly said the binding
        describes the "GIC interrupt" and "parent PMIC reference"
        (the interrupts are actually PMIC-internal, and the parent
        relationship is the standard DT parent-child hierarchy).

  - patch 3/3: driver fixes:
      * defer the SW-override switch (which disables PMIC HW
        auto-shutdown) to the very end of probe and install a devm
        action that restores HW auto-shutdown on unbind, so the part
        is never left without any thermal protection if an earlier
        probe step fails;
      * fix the first-read temperature comment: the formula computes
        the lower bound of the current stage, not the midpoint;
      * snapshot chip->stage/thresh/temp under chip->lock before
        printing the boot banner so the values are consistent now
        that the ISR is live;
      * drop the explicit ->remove(), the new devm restore action
        replaces it.

dt_binding_check passes on both the parent qcom,pm8xxx and the new
qcom,pm8901-temp-alarm. Driver passes checkpatch with zero warnings
or errors.

Thanks,
Herman

Herman van Hazendonk (3):
  dt-bindings: mfd: qcom-pm8xxx: allow temp-alarm subnode
  dt-bindings: thermal: qcom: add pm8901-temp-alarm
  thermal: qcom: add PM8901 PMIC temperature-alarm driver

 .../devicetree/bindings/mfd/qcom-pm8xxx.yaml  |   4 +
 .../thermal/qcom,pm8901-temp-alarm.yaml       |  90 ++++
 drivers/thermal/qcom/Kconfig                  |  12 +
 drivers/thermal/qcom/Makefile                 |   1 +
 drivers/thermal/qcom/qcom-pm8901-tm.c         | 408 ++++++++++++++++++
 5 files changed, 515 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/thermal/qcom,pm8901-temp-alarm.yaml
 create mode 100644 drivers/thermal/qcom/qcom-pm8901-tm.c

-- 
2.43.0




Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds