Re: [PATCH v5 02/20] dt-bindings: thermal: tsens: support per-sensor calibration cells

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 01/01/2023 17:56, Krzysztof Kozlowski wrote:
On 29/12/2022 12:49, Dmitry Baryshkov wrote:
On Thu, 29 Dec 2022 at 10:35, Krzysztof Kozlowski
<krzysztof.kozlowski@xxxxxxxxxx> wrote:

On 29/12/2022 04:00, Dmitry Baryshkov wrote:
Allow specifying the exact calibration mode and calibration data as nvmem
cells, rather than specifying just a single calibration data blob.

Note, unlike the vendor kernel the calibration data uses hw_ids rather
than software sensor indices (to match actual tsens usage in
thermal zones).

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxx>
---
  .../bindings/thermal/qcom-tsens.yaml          | 95 +++++++++++++++++--
  1 file changed, 85 insertions(+), 10 deletions(-)

diff --git a/Documentation/devicetree/bindings/thermal/qcom-tsens.yaml b/Documentation/devicetree/bindings/thermal/qcom-tsens.yaml
index f3660af0b3bf..4bb689f4602d 100644
--- a/Documentation/devicetree/bindings/thermal/qcom-tsens.yaml
+++ b/Documentation/devicetree/bindings/thermal/qcom-tsens.yaml
@@ -81,18 +81,63 @@ properties:
      maxItems: 2

    nvmem-cells:
-    minItems: 1
-    maxItems: 2
-    description:
-      Reference to an nvmem node for the calibration data
+    oneOf:
+      - minItems: 1
+        maxItems: 2
+        description:
+          Reference to an nvmem node for the calibration data
+      - minItems: 5
+        maxItems: 35
+        description: |
+          Reference to nvmem cells for the calibration mode, two calibration
+          bases and two cells per each sensor

    nvmem-cell-names:
-    minItems: 1
-    items:
-      - const: calib
-      - enum:
-          - calib_backup
-          - calib_sel
+    oneOf:
+      - minItems: 1
+        items:
+          - const: calib
+          - enum:
+              - calib_backup
+              - calib_sel
+      - minItems: 5
+        items:
+          enum:

This should not be an enum but a list of const... unless "holes" are
expected (e.g. s0_p1 and s5_p2, without ones in between).

Yes, this is the case. See the msm8916.dtsi changes. There is no
sensor with hw_id 3, so the sequence is: ... s2_p1, s2_p2, s4_p1,
s4_p2,....

Same applies to the msm8939 (no sensor #4).

Note: if there was support for the prefixItems, I'd have probably
marked mode/base1/base2 to be the first items of the array.

Then how about list of const items and patterns? Would be similar number
of lines, just a bit more complicated pattern instead of simple string
to enum.

Ack, this sounds good. I'll send it in the v6.

BTW: do you know if there are any plans to add support for prefixItems?


Best regards,
Krzysztof


--
With best wishes
Dmitry




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux