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: 14019622 X-Patchwork-Delegate: daniel.lezcano@linaro.org Received: from sender4-pp-f112.zoho.com (sender4-pp-f112.zoho.com [136.143.188.112]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9126223F369; Mon, 17 Mar 2025 13:50:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.188.112 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742219461; cv=pass; b=s7oUI3exvsZby2V4tNH2m9i/bUJaxk6+1BGj2m/z19xHQDQt55QNT2yUcWV+4fRgz/hRioYI8tefnjSV0REOFGlXiDQVR9RsuaWfUbk+tr5pHhowLpFr+4I+gCCi2u0qiLpPR09WuJrLgb8bQyviP/gTtG8SKjHHc60gyCkFNWc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742219461; c=relaxed/simple; bh=Gx607IrmeguTL/ctuwJczi9Z/p3sjAnOIiho+1SPvGE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=gofdiy2xbVxW6SsqQkssOGuO4yUV4pKmU7xnAHyAVIskF7xJyRLLUXscEBoSTp2TV5j135x5dnehNjJ6uGfSBmT1cX93zfTGcrxQ5OAtP7wQuQb+JntMn2VvEwmGcyHsrEyE9xfyw4orBFSeeMoL6xvE//rIqhDkEFkm/hIS368= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (1024-bit key) header.d=collabora.com header.i=nicolas.frattaroli@collabora.com header.b=RCr9UtSg; arc=pass smtp.client-ip=136.143.188.112 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=collabora.com header.i=nicolas.frattaroli@collabora.com header.b="RCr9UtSg" 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 Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 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: