From patchwork Tue Apr 4 20:50:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rob Herring (Arm)" X-Patchwork-Id: 13200983 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 41E67C761A6 for ; Tue, 4 Apr 2023 20:50:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236319AbjDDUuU (ORCPT ); Tue, 4 Apr 2023 16:50:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232313AbjDDUuT (ORCPT ); Tue, 4 Apr 2023 16:50:19 -0400 Received: from mail-oi1-f180.google.com (mail-oi1-f180.google.com [209.85.167.180]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0F90AC; Tue, 4 Apr 2023 13:50:18 -0700 (PDT) Received: by mail-oi1-f180.google.com with SMTP id b19so25205964oib.7; Tue, 04 Apr 2023 13:50:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680641418; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=cuM6Q6XsNQriUPvaV/azpo/EuSP1O+QRacD+aarjr5s=; b=hg5IOD7kVdbQk8PCjZo82JdaXood30U6qlXNNj4ihEJbm60k14VWdgHkcOgnNxgf9G 8sKY+aA8UBhAh+F3pOhE4sKpu11Ahsmj5gMqKzdzGI+p19n+U2ekCkGL1iKvVBo2edD2 G0bnqr5NNBMErWh9giSzboc876fjPTs9UDoGrl85mgMgFEyWmQlzKfRbCBSVmnRstnBI Vr/baQ/ZmxxHm7xDtGCqoz7OGuzQNVdBmAnVREPHT7otrGNDBRID07vbEuQwsCxWQXCU tlb/OKjHO0l18gSIEoUBnowJIbiu7oNkayvNnFY1UELFgBRxaCTbbi23cKO5hDBloIcH djSg== X-Gm-Message-State: AAQBX9fCsln2eTfqfWWlKn7hRVfgcVMzd5zGlFlRae1i0SmXsG2Z5OjG S2PSpkQHKNJH/Ryv3nm474A1+OTBBg== X-Google-Smtp-Source: AKy350avONUpmrgeg1TMxpSIXnQKKstOT4RgBKsLEkLEaYzGD2/sfVJtO7hTe4RmMvzhMwWBTuyO+w== X-Received: by 2002:a05:6808:23c9:b0:386:94f0:cb27 with SMTP id bq9-20020a05680823c900b0038694f0cb27mr2960463oib.39.1680641417982; Tue, 04 Apr 2023 13:50:17 -0700 (PDT) Received: from robh_at_kernel.org (66-90-144-107.dyn.grandenetworks.net. [66.90.144.107]) by smtp.gmail.com with ESMTPSA id z184-20020a4a49c1000000b005252d376caesm5930652ooa.22.2023.04.04.13.50.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Apr 2023 13:50:17 -0700 (PDT) Received: (nullmailer pid 644399 invoked by uid 1000); Tue, 04 Apr 2023 20:50:16 -0000 From: Rob Herring To: Lars-Peter Clausen , Michael Hennerich , =?utf-8?q?Nuno_S=C3=A1?= , Jonathan Cameron , Krzysztof Kozlowski Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] dt-bindings: iio: temperature: ltc2983: Fix child node unevaluated properties Date: Tue, 4 Apr 2023 15:50:13 -0500 Message-Id: <20230404205014.644336-1-robh@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org The child node schemas are missing 'unevaluatedProperties' constraints, so any unknown properties are allowed. The current structure with multiple patternProperties schemas doesn't work for unevaluatedProperties as each sub-schema is evaluated independently. To fix this, move the sub-schema for all child nodes to a $defs entry and reference it from each named child node. Signed-off-by: Rob Herring --- .../bindings/iio/temperature/adi,ltc2983.yaml | 65 +++++++++++-------- 1 file changed, 38 insertions(+), 27 deletions(-) diff --git a/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml b/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml index f44fc32ce87e..e04f961ab92c 100644 --- a/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml +++ b/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml @@ -18,6 +18,28 @@ description: | https://www.analog.com/media/en/technical-documentation/data-sheets/29861fa.pdf https://www.analog.com/media/en/technical-documentation/data-sheets/ltm2985.pdf +$defs: + sensor-node: + type: object + description: Sensor node common constraints + + properties: + reg: + description: + Channel number. Connects the sensor to the channel with this number + of the device. + minimum: 1 + maximum: 20 + + adi,sensor-type: + description: Type of sensor connected to the device. + $ref: /schemas/types.yaml#/definitions/uint32 + + required: + - reg + - adi,sensor-type + + properties: compatible: oneOf: @@ -64,28 +86,10 @@ properties: const: 0 patternProperties: - "@([0-9a-f]+)$": - type: object - description: Sensor. - - properties: - reg: - description: - Channel number. Connects the sensor to the channel with this number - of the device. - minimum: 1 - maximum: 20 - - adi,sensor-type: - description: Type of sensor connected to the device. - $ref: /schemas/types.yaml#/definitions/uint32 - - required: - - reg - - adi,sensor-type - "^thermocouple@": - type: object + $ref: '#/$defs/sensor-node' + unevaluatedProperties: false + description: Thermocouple sensor. properties: @@ -141,7 +145,9 @@ patternProperties: - adi,custom-thermocouple "^diode@": - type: object + $ref: '#/$defs/sensor-node' + unevaluatedProperties: false + description: Diode sensor. properties: @@ -184,7 +190,8 @@ patternProperties: default: 0 "^rtd@": - type: object + $ref: '#/$defs/sensor-node' + unevaluatedProperties: false description: RTD sensor. properties: @@ -282,7 +289,8 @@ patternProperties: - adi,custom-rtd "^thermistor@": - type: object + $ref: '#/$defs/sensor-node' + unevaluatedProperties: false description: Thermistor sensor. properties: @@ -383,7 +391,8 @@ patternProperties: - adi,custom-thermistor "^adc@": - type: object + $ref: '#/$defs/sensor-node' + unevaluatedProperties: false description: Direct ADC sensor. properties: @@ -397,7 +406,8 @@ patternProperties: type: boolean "^temp@": - type: object + $ref: '#/$defs/sensor-node' + unevaluatedProperties: false description: Active analog temperature sensor. properties: @@ -426,7 +436,8 @@ patternProperties: - adi,custom-temp "^rsense@": - type: object + $ref: '#/$defs/sensor-node' + unevaluatedProperties: false description: Sense resistor sensor. properties: From patchwork Tue Apr 4 20:50:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rob Herring (Arm)" X-Patchwork-Id: 13200984 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D2927C77B6E for ; Tue, 4 Apr 2023 20:50:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236332AbjDDUuV (ORCPT ); Tue, 4 Apr 2023 16:50:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236326AbjDDUuU (ORCPT ); Tue, 4 Apr 2023 16:50:20 -0400 Received: from mail-oi1-f170.google.com (mail-oi1-f170.google.com [209.85.167.170]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06C23B7; Tue, 4 Apr 2023 13:50:20 -0700 (PDT) Received: by mail-oi1-f170.google.com with SMTP id l18so25186782oic.13; Tue, 04 Apr 2023 13:50:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680641419; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=whW3z4bTfKVvXB+tqmvO6N+K4v/ynODppCdzbzwFkuk=; b=lLs5sBfal3O3O39GTctJ3IwqOea2SgRXL6nSOqVEdNXhCcRcuUcIQE++f4RUlxjIN+ QoK1I2EScYjXYucCzDscGHDLhbvTsHqK8BTZCoVzTVWgJWJvBZIm0WwGobiY0+ejlnXW oSv+DFX4/wySX6yk45TlKNTC9U95pP7tXWNza2ts3sqltn85TW4QQjFFqvC9njHPxFaC 34a7FCGBZZ8lhaMCql5HSSbUmiNswnHg8NGG/wsHn3N0qxMTG0F4Y47w+zjtOdFDKF2m 0+BD1OVMj++dGX5nlduVFB69O4PHHojmA/6XHqvPMLwYSrgUHUKY7hAnta3ryH/VZFhh fdjw== X-Gm-Message-State: AAQBX9cHcMNFOTWSmlIjto5Gy4lcrchGx3jCeqVb767YG68Xwo3f6xLl 3StJAkjHDzCxp37ncEujUA== X-Google-Smtp-Source: AKy350ZGY4Gq8rqUno/qIE5NqYr/8S8BjM2PulPS2I1ezrdDu1OCZ9o51R5T8hMfIboqblERIqzz9Q== X-Received: by 2002:a05:6808:1a8a:b0:386:c7b4:461f with SMTP id bm10-20020a0568081a8a00b00386c7b4461fmr1769272oib.59.1680641419214; Tue, 04 Apr 2023 13:50:19 -0700 (PDT) Received: from robh_at_kernel.org (66-90-144-107.dyn.grandenetworks.net. [66.90.144.107]) by smtp.gmail.com with ESMTPSA id r204-20020acadad5000000b00383eaf88e75sm5645144oig.39.2023.04.04.13.50.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Apr 2023 13:50:18 -0700 (PDT) Received: (nullmailer pid 644432 invoked by uid 1000); Tue, 04 Apr 2023 20:50:17 -0000 From: Rob Herring To: Lars-Peter Clausen , Michael Hennerich , =?utf-8?q?Nuno_S=C3=A1?= , Jonathan Cameron , Krzysztof Kozlowski Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] dt-bindings: iio: temperature: ltc2983: Make 'adi,custom-thermocouple' signed Date: Tue, 4 Apr 2023 15:50:14 -0500 Message-Id: <20230404205014.644336-2-robh@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230404205014.644336-1-robh@kernel.org> References: <20230404205014.644336-1-robh@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org The 'adi,custom-thermocouple' property is signed based on the example and driver, so it's type should be int64-matrix rather than uint64-matrix. Signed-off-by: Rob Herring --- .../devicetree/bindings/iio/temperature/adi,ltc2983.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml b/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml index e04f961ab92c..dbb85135fd66 100644 --- a/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml +++ b/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml @@ -127,7 +127,7 @@ patternProperties: description: Used for digitizing custom thermocouples. See Page 59 of the datasheet. - $ref: /schemas/types.yaml#/definitions/uint64-matrix + $ref: /schemas/types.yaml#/definitions/int64-matrix minItems: 3 maxItems: 64 items: