All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/2] thermal: imx: Add calibration offset support
@ 2026-07-10  3:03 ` HaoNing Cheng
  0 siblings, 0 replies; 11+ messages in thread
From: HaoNing Cheng via B4 Relay @ 2026-07-10  3:03 UTC (permalink / raw)
  To: Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam
  Cc: linux-pm, devicetree, imx, linux-arm-kernel, linux-kernel,
	Haoning CHENG

Some i.MX boards need a small per-design correction to align the
reported CPU temperature with board-level measurements. This series
adds an optional DT property to specify such a calibration offset
and implements the corresponding support in the imx_thermal driver.

Patch 1 documents the new fsl,temp-calibration-offset-millicelsius
property in the i.MX thermal DT binding.

Patch 2 reads this property in the imx_thermal driver and applies
the offset to the i.MX6/6SX/7D calibration formulas. When the
property is absent, the default offset remains 0, preserving the
current behaviour.

Signed-off-by: Haoning CHENG <Haoning.CHENG@cn.bosch.com>
---
Changes in v4:
- dt-bindings: drop maxItems to allow minimum/maximum constraints for
  temp-calibration-offset-millicelsius
- Link to v3: https://patch.msgid.link/20260710-b4-symana21-11221-imx-thermal-support-upstream-6-18-v3-0-db9fc2947c55@cn.bosch.com

Changes in v3:
- dt-bindings: add minimum/maximum (-28580/+28580) for
  temp-calibration-offset-millicelsius, as suggested by Conor Dooley
- Link to v2: https://patch.msgid.link/20260709-b4-symana21-11221-imx-thermal-support-upstream-6-18-v2-0-00ff72495e24@cn.bosch.com

Changes in v2:
- dt-bindings: Removed explicit `$ref: /schemas/types.yaml#/definitions/int32`
  for fsl,temp-calibration-offset-millicelsius; the `-millicelsius` suffix
  already resolves to int32-array via property-units.yaml (Rob).
- dt-bindings: Fixed example indentation.
- driver: Replaced C integer division (/) with DIV_ROUND_CLOSEST() in
  imx_set_alarm_temp() to prevent off-by-one alarm threshold mismatch that
  could cause IRQ storms on i.MX7D.
- driver: Added clamp() bounds check for alarm_value [0, 0x1ff] to avoid
  corrupting adjacent register fields (PANIC_ALARM).
- Link to v1: https://patch.msgid.link/20260709-b4-symana21-11221-imx-thermal-support-upstream-6-18-v1-0-00f88f42930b@cn.bosch.com

To: "Rafael J. Wysocki" <rafael@kernel.org>
To: Daniel Lezcano <daniel.lezcano@linaro.org>
To: Zhang Rui <rui.zhang@intel.com>
To: Lukasz Luba <lukasz.luba@arm.com>
To: Rob Herring <robh@kernel.org>
To: Krzysztof Kozlowski <krzk+dt@kernel.org>
To: Conor Dooley <conor+dt@kernel.org>
To: Shawn Guo <shawnguo@kernel.org>
To: Sascha Hauer <s.hauer@pengutronix.de>
To: Pengutronix Kernel Team <kernel@pengutronix.de>
To: Fabio Estevam <festevam@gmail.com>
Cc: linux-pm@vger.kernel.org
Cc: devicetree@vger.kernel.org
Cc: imx@lists.linux.dev
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org

---
HaoNing Cheng (2):
      dt-bindings: thermal: imx: Document calibration offset property
      thermal/drivers/imx: Add calibration offset support

 .../devicetree/bindings/thermal/imx-thermal.yaml       |  9 +++++++++
 drivers/thermal/imx_thermal.c                          | 18 +++++++++++++-----
 2 files changed, 22 insertions(+), 5 deletions(-)
---
base-commit: c50a940dcde35c647e097e89a9150003abd48329
change-id: 20260709-b4-symana21-11221-imx-thermal-support-upstream-6-18-a084984deb76

Best regards,
--  
Haoning CHENG <Haoning.CHENG@cn.bosch.com>



^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: [PATCH v4 1/2] dt-bindings: thermal: imx: Document calibration offset property
@ 2026-07-13  5:45 CHENG Haoning (BCSC/ENG1)
  0 siblings, 0 replies; 11+ messages in thread
From: CHENG Haoning (BCSC/ENG1) @ 2026-07-13  5:45 UTC (permalink / raw)
  To: Frank Li
  Cc: Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	linux-pm@vger.kernel.org, devicetree@vger.kernel.org,
	imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org

>
> Thanks you for patch, but you have not answer my previous question yet.
>
> "why board difference cause such offset, I suppose it is cause by SoC 
> variance. The offset may difference if you change to another chip. 
> another words, if you have 1000 boards, Is this offset the same?"
>
> Or did you tune this value for each boards?
>
> Frank

Hi Frank,

Sorry for missing your question.

The offset is defined per board design, not per individual chip. All boards
with the same PCB, thermal solution, and enclosure use the same value.
Per-chip variation is already handled by the existing OCOTP calibration
data.

Regards,
Haoning

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2026-07-13  5:45 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-10  3:03 [PATCH v4 0/2] thermal: imx: Add calibration offset support HaoNing Cheng via B4 Relay
2026-07-10  3:03 ` HaoNing Cheng
2026-07-10  3:03 ` [PATCH v4 1/2] dt-bindings: thermal: imx: Document calibration offset property HaoNing Cheng via B4 Relay
2026-07-10  3:03   ` HaoNing Cheng
2026-07-10  7:28   ` Krzysztof Kozlowski
2026-07-10 15:33   ` Frank Li
2026-07-10  3:03 ` [PATCH v4 2/2] thermal/drivers/imx: Add calibration offset support HaoNing Cheng via B4 Relay
2026-07-10  3:03   ` HaoNing Cheng
2026-07-10  3:15   ` sashiko-bot
2026-07-10 15:35   ` Frank Li
  -- strict thread matches above, loose matches on Subject: below --
2026-07-13  5:45 [PATCH v4 1/2] dt-bindings: thermal: imx: Document calibration offset property CHENG Haoning (BCSC/ENG1)

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.