From patchwork Sat Oct 31 18:24:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11871611 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 09FEF92C for ; Sat, 31 Oct 2020 18:26:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E30C120709 for ; Sat, 31 Oct 2020 18:26:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604168796; bh=U1dh3AOQV2DXiOJH4cpAjoDC8XqoWAgV4iaJYvGXQtg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=fCTj12RmXO8k/rXWaStDKsnfzyCKhGgm7k6ARccZvwFFyEFJ86TCOcAyvA365cKdq Ez+Tu/F/QZSlw/dxoVBSBjxvDHj0cuFFKidHZ42EBYbqzxJr3EqGz95N8NyrtAT6F/ x19dgAejZkUf3wxizMd7s+rUT6yiAfezeUQQBfMQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728222AbgJaS0g (ORCPT ); Sat, 31 Oct 2020 14:26:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:51474 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727967AbgJaS0g (ORCPT ); Sat, 31 Oct 2020 14:26:36 -0400 Received: from localhost.localdomain (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BF5D3206E5; Sat, 31 Oct 2020 18:26:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604168795; bh=U1dh3AOQV2DXiOJH4cpAjoDC8XqoWAgV4iaJYvGXQtg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TryrTrDxC0xSVC3Omn3nqpQKjoikf2Zd2F4cH4+DJRhMlfSl3I1IE115ySymNamTY JcO4sG1eVrL/UjFa25Ca0gtNVu8eRHE6FV29iQzIb8eM1AUsEgsGLhHgmIPIucpow4 RTjZTELc7iq6OQviUAM3mfAQSoiPRi+Jif/8YWhs= From: Jonathan Cameron To: linux-iio@vger.kernel.org, Rob Herring , devicetree@vger.kernel.org Cc: Jonathan Cameron Subject: [PATCH 1/3] dt-bindings:iio:adc: convert adc.txt to yaml Date: Sat, 31 Oct 2020 18:24:21 +0000 Message-Id: <20201031182423.742798-2-jic23@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201031182423.742798-1-jic23@kernel.org> References: <20201031182423.742798-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron Each driver that uses this will need to use a $ref We can't always enable it like most of the generic bindings due to channel@X matching far more widely than IIO. Signed-off-by: Jonathan Cameron --- .../devicetree/bindings/iio/adc/adc.txt | 23 ----------- .../devicetree/bindings/iio/adc/adc.yaml | 38 +++++++++++++++++++ 2 files changed, 38 insertions(+), 23 deletions(-) diff --git a/Documentation/devicetree/bindings/iio/adc/adc.txt b/Documentation/devicetree/bindings/iio/adc/adc.txt deleted file mode 100644 index 5bbaa330a250..000000000000 --- a/Documentation/devicetree/bindings/iio/adc/adc.txt +++ /dev/null @@ -1,23 +0,0 @@ -Common ADCs properties - -Optional properties for child nodes: -- bipolar : Boolean, if set the channel is used in bipolar mode. -- diff-channels : Differential channels muxed for this ADC. The first value - specifies the positive input pin, the second value the negative - input pin. - -Example: - adc@0 { - compatible = "some,adc"; - ... - channel@0 { - bipolar; - diff-channels = <0 1>; - ... - }; - - channel@1 { - diff-channels = <2 3>; - ... - }; - }; diff --git a/Documentation/devicetree/bindings/iio/adc/adc.yaml b/Documentation/devicetree/bindings/iio/adc/adc.yaml new file mode 100644 index 000000000000..328a4318feee --- /dev/null +++ b/Documentation/devicetree/bindings/iio/adc/adc.yaml @@ -0,0 +1,38 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/iio/adc/adc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Generic IIO bindings for ADC channels + +maintainers: + - Jonathan Cameron + +description: + A few properties are defined in a common way ADC channels. + +properties: + $nodename: + pattern: "^channel(@[0-9a-f]+)?$" + description: + A channel index should match reg. + + reg: + maxItems: 1 + + bipolar: + $ref: /schemas/types.yaml#/definitions/flag + description: If provided, the channel is to be used in bipolar mode. + + diff-channels: + $ref: /schemas/types.yaml#/definitions/uint32-array + maxItems: 2 + minItems: 2 + description: + Many ADCs have dual Muxes to allow different input pins to be routed + to both the positive and negative inputs of a differential ADC. + The first value specifies the positive input pin, the second + specifies the negative input pin. + +additionalProperties: true From patchwork Sat Oct 31 18:24:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11871613 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3B59A1130 for ; Sat, 31 Oct 2020 18:26:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 208FB206F9 for ; Sat, 31 Oct 2020 18:26:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604168798; bh=b9Dh/bWwe6lmZSkFVinTczSbW5JZfK3sKEJgcUr6r5Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ujFk1piAKf3wm8I8sIeZFbBoygoAyKqtz9E1L+BKAZozT3LpQEfmCa7Eae8Emeb0w qaof+6wmZCc/Q8b4VgwE6j/kA4rU3HM1Kp9zQ1DQ3PHKMogTtjH/3o5ZPRiQoopwN6 IEDaThg4rSuUbKLV68boSjT0mH5/s5BfR0QqXY9o= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728240AbgJaS0h (ORCPT ); Sat, 31 Oct 2020 14:26:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:51506 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727967AbgJaS0h (ORCPT ); Sat, 31 Oct 2020 14:26:37 -0400 Received: from localhost.localdomain (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 17EB0206E3; Sat, 31 Oct 2020 18:26:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604168797; bh=b9Dh/bWwe6lmZSkFVinTczSbW5JZfK3sKEJgcUr6r5Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rmRU2eXv5KRFzNrbMzv2zZcJ1d6i0OqyifW9bpuf0xtrI/OwYav7W/QWiCyQR8Snk VrlTrAW6LHKfM8HYHy4rMgRHgaPPIZmcIAIpLiAbzlsCE9zCP/pe1+XIKlbYjPRPMa 1PS6lU4CnEdmKi6Wvj93IpuPjDxu6L8mReLBCoOo= From: Jonathan Cameron To: linux-iio@vger.kernel.org, Rob Herring , devicetree@vger.kernel.org Cc: Jonathan Cameron , Michael Hennerich Subject: [PATCH 2/3] dt-bindings:iio:adc:adi,ad7124: Use the new adc.yaml channel binding Date: Sat, 31 Oct 2020 18:24:22 +0000 Message-Id: <20201031182423.742798-3-jic23@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201031182423.742798-1-jic23@kernel.org> References: <20201031182423.742798-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron This both ensures this binding is compliant with the generic properties and reduces the amount we need to specify in this separate binding. Whilst here mark the child node as additionalProperties: false Signed-off-by: Jonathan Cameron Cc: Michael Hennerich --- .../devicetree/bindings/iio/adc/adi,ad7124.yaml | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ad7124.yaml b/Documentation/devicetree/bindings/iio/adc/adi,ad7124.yaml index f1c574c896cb..fb3d0dae9bae 100644 --- a/Documentation/devicetree/bindings/iio/adc/adi,ad7124.yaml +++ b/Documentation/devicetree/bindings/iio/adc/adi,ad7124.yaml @@ -63,10 +63,10 @@ required: patternProperties: "^channel@([0-9]|1[0-5])$": + $ref: "adc.yaml" type: object description: | Represents the external channels which are connected to the ADC. - See Documentation/devicetree/bindings/iio/adc/adc.txt. properties: reg: @@ -88,15 +88,9 @@ patternProperties: $ref: /schemas/types.yaml#/definitions/uint32 enum: [0, 1, 3] - diff-channels: - description: see Documentation/devicetree/bindings/iio/adc/adc.txt - items: - minimum: 0 - maximum: 15 + diff-channels: true - bipolar: - description: see Documentation/devicetree/bindings/iio/adc/adc.txt - type: boolean + bipolar: true adi,buffered-positive: description: Enable buffered mode for positive input. @@ -110,6 +104,8 @@ patternProperties: - reg - diff-channels + additionalProperties: false + additionalProperties: false examples: From patchwork Sat Oct 31 18:24:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11871615 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C55C21130 for ; Sat, 31 Oct 2020 18:26:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9F2ED20719 for ; Sat, 31 Oct 2020 18:26:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604168799; bh=iG4tEeMkuEN1CjPDrAJAVJqqu/0GAuYu7rHxJfcwEh8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=rRdo7NONRS2Ov4Q8yrzyETwAJnvI0O3RLsxaot8fHlxhmTkUyKlArEBZRMrFp0bSj cvWEQFWqGEhI8PMe8LM8lPL/QLLW0OZ/PHWHVShCw8z5aqNcHhnsdDOhpVZjEQWjaP EvVVIfPtEgXHZS+fKlLGfCnZo0XP0blNhQWnVdbs= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728263AbgJaS0j (ORCPT ); Sat, 31 Oct 2020 14:26:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:51548 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727967AbgJaS0j (ORCPT ); Sat, 31 Oct 2020 14:26:39 -0400 Received: from localhost.localdomain (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8837520709; Sat, 31 Oct 2020 18:26:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604168798; bh=iG4tEeMkuEN1CjPDrAJAVJqqu/0GAuYu7rHxJfcwEh8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wqS9/8BwBiYbW0ULplEDBToNq1SznyfAKwUbxV6XQeYTSwDigiVowT8Ktx3TzeQ9Q enr/GAIrB4QSDbI+IUiGfRk1g4sQdoHIsVMX1WxnzsRkThugBwGmyOOJAQXySGok0H 7EIv99V96O4Nmekn4dp/Q+cYTl94tJFwzey4iBtM= From: Jonathan Cameron To: linux-iio@vger.kernel.org, Rob Herring , devicetree@vger.kernel.org Cc: Jonathan Cameron , Marcelo Schmitt Subject: [PATCH 3/3] dt-bindings:iio:adc:adi,ad7292: Use new adc.yaml binding for channels. Date: Sat, 31 Oct 2020 18:24:23 +0000 Message-Id: <20201031182423.742798-4-jic23@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201031182423.742798-1-jic23@kernel.org> References: <20201031182423.742798-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron Also add additionalProperties: false for the child nodes. Signed-off-by: Jonathan Cameron Cc: Marcelo Schmitt --- Documentation/devicetree/bindings/iio/adc/adi,ad7292.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ad7292.yaml b/Documentation/devicetree/bindings/iio/adc/adi,ad7292.yaml index 108d202b288f..a3e39a40c9b3 100644 --- a/Documentation/devicetree/bindings/iio/adc/adi,ad7292.yaml +++ b/Documentation/devicetree/bindings/iio/adc/adi,ad7292.yaml @@ -45,10 +45,10 @@ required: patternProperties: "^channel@[0-7]$": + $ref: "adc.yaml" type: object description: | Represents the external channels which are connected to the ADC. - See Documentation/devicetree/bindings/iio/adc/adc.txt. properties: reg: @@ -58,13 +58,13 @@ patternProperties: - minimum: 0 maximum: 7 - diff-channels: - description: see Documentation/devicetree/bindings/iio/adc/adc.txt - maxItems: 1 + diff-channels: true required: - reg + additionalProperties: true + additionalProperties: false examples: