From patchwork Mon Mar 17 13:49:30 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Frattaroli X-Patchwork-Id: 14019495 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3DD1BC35FFF for ; Mon, 17 Mar 2025 14:08:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=S2ET4O/oVwXTAQhhTGiEJeTUqBKiYsQuM/sWjBNIX38=; b=YNyaz1RbAJIWs/tRDsfwzjDabb N4fY1Bit0NXtVddhmD7pz9ShluIr0X/FvI5KNauWZRXvynM6qnwz23ZGB6l1pzkWhETaN8eFTDgFg CPKUaZ/rKzjq7dUrmedq+nIy9Ylw4uKWvnVxHTvnkH/2bfEgGqF8hiHh/AZ1j5W2FUV8ERD9X57dZ n1AMcD/cp6yqMJpj5j8NLIyRIOC9nWV1+IclOqEsWPE3y35UvVxszGYm0ONnh6SGpvRJ/b3Lwcui/ B4jOx/Bu8kZhE8vxylyZNRKdarzEm/OrE43LeSIyHmYErDWaxdVc2Ask0QxCgkK7WINk9BlKTObcV NdvxA3Yw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tuB8o-00000002rAW-2I3n; Mon, 17 Mar 2025 14:08:30 +0000 Received: from sender4-pp-f112.zoho.com ([136.143.188.112]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tuArj-00000002o21-0e6D; Mon, 17 Mar 2025 13:50:53 +0000 ARC-Seal: i=1; a=rsa-sha256; t=1742219439; cv=none; d=zohomail.com; s=zohoarc; b=WJ+pC0Et7XU7/svaMLtOw/h1d5jI52+ERjmiriKnwP8bF01krtsdhzmXc8eMQmKtv0GfOSU52p6CDExAm65TjQ/qS4+vKsmVBS6E9Lz3+Acoe9U1H6jbMYxhYwYDX5ltzJAvhqRQsVwcwa4mcrxLKOglTWqHmchvPAMxPqLgOEA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1742219439; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=S2ET4O/oVwXTAQhhTGiEJeTUqBKiYsQuM/sWjBNIX38=; b=B5hORr5XjYPNDpIf98wd248Ku3Sc50vnX+gw3VhKP7qDlM+hfsL/tCmCztFeSJMzi+zRhlWl9s2CTq5JjO4+gSvB3zjPyYf8FYR0iRdYeh6H+iBzJHUKYr2zAFMP0VM3ubWYK8opA5zwkxnibmu0Wdsx9XJ0iHSWhj+EFgAja2g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=collabora.com; spf=pass smtp.mailfrom=nicolas.frattaroli@collabora.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1742219439; s=zohomail; d=collabora.com; i=nicolas.frattaroli@collabora.com; h=From:From:Date:Date:Subject:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Message-Id:References:In-Reply-To:To:To:Cc:Cc:Reply-To; bh=S2ET4O/oVwXTAQhhTGiEJeTUqBKiYsQuM/sWjBNIX38=; b=RCr9UtSgkH7jlJt4hnx/cxLp1PkO+5B3d6Z/OZtccalZgzv9JfeoyZ6nTg1H16y/ QkonetP8/OrU+b2HiMG2+B2JJQN9qEwjV1oaqRcnXK4/H1BUSETs+05EC9/9ZZ3p0YZ 4z/112ir14kj61eHAkPvuug3oe4OvA+81JbPAC3U= Received: by mx.zohomail.com with SMTPS id 1742219437296886.9802912897627; Mon, 17 Mar 2025 06:50:37 -0700 (PDT) From: Nicolas Frattaroli Date: Mon, 17 Mar 2025 14:49:30 +0100 Subject: [PATCH v4 5/7] dt-bindings: thermal: rockchip: document otp thermal trim MIME-Version: 1.0 Message-Id: <20250317-rk3576-tsadc-upstream-v4-5-c5029ce55d74@collabora.com> References: <20250317-rk3576-tsadc-upstream-v4-0-c5029ce55d74@collabora.com> In-Reply-To: <20250317-rk3576-tsadc-upstream-v4-0-c5029ce55d74@collabora.com> To: "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner , Jonas Karlman Cc: Sebastian Reichel , kernel@collabora.com, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Nicolas Frattaroli X-Mailer: b4 0.14.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250317_065051_222131_F11E2195 X-CRM114-Status: UNSURE ( 9.22 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Several Rockchip SoCs, such as the RK3576, can store calibration trim data for thermal sensors in OTP cells. This capability should be documented. Such a rockchip thermal sensor may reference cell handles that store both a chip-wide trim for all the sensors, as well as cell handles for each individual sensor channel pointing to that specific sensor's trim value. Additionally, the thermal sensor may optionally reference cells which store the base in terms of degrees celsius and decicelsius that the trim is relative to. Each SoC that implements this appears to have a slightly different combination of chip-wide trim, base, base fractional part and per-channel trim, so which ones do which is documented in the bindings. Reviewed-by: Rob Herring (Arm) Signed-off-by: Nicolas Frattaroli --- .../bindings/thermal/rockchip-thermal.yaml | 61 ++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/Documentation/devicetree/bindings/thermal/rockchip-thermal.yaml b/Documentation/devicetree/bindings/thermal/rockchip-thermal.yaml index 49ceed68c92ce5a32ed8d4f39bd88fd052de0e80..573f447cc26ed7100638277598b0e745d436fd01 100644 --- a/Documentation/devicetree/bindings/thermal/rockchip-thermal.yaml +++ b/Documentation/devicetree/bindings/thermal/rockchip-thermal.yaml @@ -40,6 +40,17 @@ properties: - const: tsadc - const: apb_pclk + nvmem-cells: + items: + - description: cell handle to where the trim's base temperature is stored + - description: + cell handle to where the trim's tenths of Celsius base value is stored + + nvmem-cell-names: + items: + - const: trim_base + - const: trim_base_frac + resets: minItems: 1 maxItems: 3 @@ -51,6 +62,12 @@ properties: - const: tsadc - const: tsadc-phy + "#address-cells": + const: 1 + + "#size-cells": + const: 0 + "#thermal-sensor-cells": const: 1 @@ -72,6 +89,27 @@ properties: $ref: /schemas/types.yaml#/definitions/uint32 enum: [0, 1] +patternProperties: + "@[0-9a-f]+$": + type: object + properties: + reg: + maxItems: 1 + description: sensor ID, a.k.a. channel number + + nvmem-cells: + items: + - description: handle of cell containing calibration data + + nvmem-cell-names: + items: + - const: trim + + required: + - reg + + unevaluatedProperties: false + required: - compatible - reg @@ -80,6 +118,29 @@ required: - clock-names - resets +allOf: + - if: + not: + properties: + compatible: + contains: + const: rockchip,rk3568-tsadc + then: + properties: + nvmem-cells: false + nvmem-cell-names: false + - if: + not: + properties: + compatible: + contains: + enum: + - rockchip,rk3568-tsadc + - rockchip,rk3576-tsadc + then: + patternProperties: + "@[0-9a-f]+$": false + unevaluatedProperties: false examples: