From patchwork Mon Dec 3 21:31:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rob Herring \(Arm\)" X-Patchwork-Id: 152777 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp7320408ljp; Mon, 3 Dec 2018 13:35:26 -0800 (PST) X-Google-Smtp-Source: AFSGD/W0PrWho5GZ1pthzpK+JIPN6x1rr3meGH3Z+/v8dyFmoRFp0AmWsCiMK3NxYYmpsJg0fGT+ X-Received: by 2002:a62:5182:: with SMTP id f124mr17683408pfb.238.1543872926078; Mon, 03 Dec 2018 13:35:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543872926; cv=none; d=google.com; s=arc-20160816; b=qXtW7U2vs1EJbHrIbwGRtW2RZNs43MSE/loHIMZLN88Xhf/3T1OdryXdOEKvusX4yB EAHnRCu+YI3tiALjhdLZPLo3OsGmY+eWA8aWaRr7fe7d5TOvHsjRPcFZFfPQoxZ3lzjP 5lNbpYdApiV8APSzSS7ast55F4dPxTeOu6dDZeHJnyDb3zNif20PHHCbB1d0/jq3qjKG 41fMGdEGOLV9kWfvkEUyU6KTFt1HjKycYI2SZTufOnFyG619oZluOfOB5p357dZQagi4 DkN+KIB+HIcf0HBw+z5CTpzzeeN219+5D4ccYjd25TrDRDEFr+jBK2IQxHBw9jTtGZ0n DKgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=r8hHjlrgRb6o1Gybi9b4yXPPCrMqQy6hVm/Nzderzac=; b=V8C8zJKdxdYw6BJwZq0d0kgG1NqAaFAz6z/ozWSMvUWgE7RNbE/I4W8xETsdnTKhsv TGs3g/oRzvn0Cy0mPhiPCWGrSqUIbyaXuSYa2wwQNJ9up2ydROnDXUwWWKlh+VUkWWd4 9VvSGi3R7osJfpwFw9uvUIMGdjAAgh4qyYsXwsfJCO0FzH9U+yFoqosyj4FvWQACbHHP ptxMstnZNbt42n1sI1lmKkS/CJ4KRij8eXdYWAXLVrsn0/0q8aHG8I05RpEmIR/wveI9 VqyEbN0VyYIiTDqRmzpI6UPVQmQfcyKTUG6FFuGIi/zOBUqQ2NN1P7cgMH0GZsgz+LxR KeKw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y10si13709264plt.406.2018.12.03.13.35.25; Mon, 03 Dec 2018 13:35:26 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726081AbeLCVch (ORCPT + 32 others); Mon, 3 Dec 2018 16:32:37 -0500 Received: from mail-ot1-f67.google.com ([209.85.210.67]:43096 "EHLO mail-ot1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726051AbeLCVcd (ORCPT ); Mon, 3 Dec 2018 16:32:33 -0500 Received: by mail-ot1-f67.google.com with SMTP id a11so13090690otr.10; Mon, 03 Dec 2018 13:32:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=r8hHjlrgRb6o1Gybi9b4yXPPCrMqQy6hVm/Nzderzac=; b=ptLiPrNOzrMfQ08Zdm8Ih1WvSK5XljBmdf8tUqhjWmHQOhqODVinezUyoD6FbnobOs kFtFU0ak2hmie0CXxAoqr7cAPZf6vL1tPqcRvTtBaDIP/QwmHRoG1554tg+fhF+uSyat 3sTsH3pOhP9nJd2JlXQ9HIYP5zaHgTc9Dx4YwyG0ym/oTBHsx02eEarDfpaHkVE77N/s D4igU0UPkmAa8DIyBX8xRpQtSSaXFZV98gIPbNHjZSU21lTl1XzR4CQLg6noY2VzlyMp dEWGP2TNAiJ2OCcj4e9Vpx4oRDXPAj9znhArQ40b6zLmuz0EH+/Y8G5OreDiu3FW1uvQ Bl1A== X-Gm-Message-State: AA+aEWZQJQ2RToRZ/8CRSTgn/Q6LaBpGk+/sCCmcayUuus/bDv+iTI7b PdpDpQrmyrOHmsUdZXrd+v6DdKc= X-Received: by 2002:a9d:6c11:: with SMTP id f17mr10582822otq.38.1543872751944; Mon, 03 Dec 2018 13:32:31 -0800 (PST) Received: from xps15.herring.priv (24-155-109-49.dyn.grandenetworks.net. [24.155.109.49]) by smtp.googlemail.com with ESMTPSA id c78sm8545501oig.30.2018.12.03.13.32.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Dec 2018 13:32:31 -0800 (PST) From: Rob Herring To: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Sean Hudson , Frank Rowand , linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, Grant Likely , Kumar Gala , arm@kernel.org Subject: [PATCH v2 05/34] dt-bindings: i2c: Convert i2c-gpio binding to json-schema Date: Mon, 3 Dec 2018 15:31:54 -0600 Message-Id: <20181203213223.16986-6-robh@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181203213223.16986-1-robh@kernel.org> References: <20181203213223.16986-1-robh@kernel.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Convert the i2c-gpio binding to DT schema format using json-schema. This serves as an example of how to include other schema (i2c-controller.yaml in this case). Signed-off-by: Rob Herring --- .../devicetree/bindings/i2c/i2c-gpio.txt | 46 ------------ .../devicetree/bindings/i2c/i2c-gpio.yaml | 73 +++++++++++++++++++ 2 files changed, 73 insertions(+), 46 deletions(-) delete mode 100644 Documentation/devicetree/bindings/i2c/i2c-gpio.txt create mode 100644 Documentation/devicetree/bindings/i2c/i2c-gpio.yaml -- 2.19.1 diff --git a/Documentation/devicetree/bindings/i2c/i2c-gpio.txt b/Documentation/devicetree/bindings/i2c/i2c-gpio.txt deleted file mode 100644 index 38a05562d1d2..000000000000 --- a/Documentation/devicetree/bindings/i2c/i2c-gpio.txt +++ /dev/null @@ -1,46 +0,0 @@ -Device-Tree bindings for i2c gpio driver - -Required properties: - - compatible = "i2c-gpio"; - - sda-gpios: gpio used for the sda signal, this should be flagged as - active high using open drain with (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN) - from since the signal is by definition - open drain. - - scl-gpios: gpio used for the scl signal, this should be flagged as - active high using open drain with (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN) - from since the signal is by definition - open drain. - -Optional properties: - - i2c-gpio,scl-output-only: scl as output only - - i2c-gpio,delay-us: delay between GPIO operations (may depend on each platform) - - i2c-gpio,timeout-ms: timeout to get data - -Deprecated properties, do not use in new device tree sources: - - gpios: sda and scl gpio, alternative for {sda,scl}-gpios - - i2c-gpio,sda-open-drain: this means that something outside of our - control has put the GPIO line used for SDA into open drain mode, and - that something is not the GPIO chip. It is essentially an - inconsistency flag. - - i2c-gpio,scl-open-drain: this means that something outside of our - control has put the GPIO line used for SCL into open drain mode, and - that something is not the GPIO chip. It is essentially an - inconsistency flag. - -Example nodes: - -#include - -i2c@0 { - compatible = "i2c-gpio"; - sda-gpios = <&pioA 23 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; - scl-gpios = <&pioA 24 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; - i2c-gpio,delay-us = <2>; /* ~100 kHz */ - #address-cells = <1>; - #size-cells = <0>; - - rv3029c2@56 { - compatible = "rv3029c2"; - reg = <0x56>; - }; -}; diff --git a/Documentation/devicetree/bindings/i2c/i2c-gpio.yaml b/Documentation/devicetree/bindings/i2c/i2c-gpio.yaml new file mode 100644 index 000000000000..da6129090a8e --- /dev/null +++ b/Documentation/devicetree/bindings/i2c/i2c-gpio.yaml @@ -0,0 +1,73 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/i2c/i2c-gpio.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Bindings for GPIO bitbanged I2C + +maintainers: + - Wolfram Sang + +allOf: + - $ref: /schemas/i2c/i2c-controller.yaml# + +properties: + compatible: + items: + - const: i2c-gpio + + sda-gpios: + description: + gpio used for the sda signal, this should be flagged as + active high using open drain with (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN) + from since the signal is by definition + open drain. + maxItems: 1 + + scl-gpios: + description: + gpio used for the scl signal, this should be flagged as + active high using open drain with (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN) + from since the signal is by definition + open drain. + maxItems: 1 + + i2c-gpio,scl-output-only: + description: scl as output only + type: boolean + + i2c-gpio,delay-us: + description: delay between GPIO operations (may depend on each platform) + $ref: /schemas/types.yaml#/definitions/uint32 + + i2c-gpio,timeout-ms: + description: timeout to get data + $ref: /schemas/types.yaml#/definitions/uint32 + + # Deprecated properties, do not use in new device tree sources: + gpios: + minItems: 2 + maxItems: 2 + description: sda and scl gpio, alternative for {sda,scl}-gpios + + i2c-gpio,sda-open-drain: + # Generate a warning if present + not: true + description: this means that something outside of our control has put + the GPIO line used for SDA into open drain mode, and that something is + not the GPIO chip. It is essentially an inconsistency flag. + + i2c-gpio,scl-open-drain: + # Generate a warning if present + not: true + description: this means that something outside of our control has put the + GPIO line used for SCL into open drain mode, and that something is not + the GPIO chip. It is essentially an inconsistency flag. + +required: + - compatible + - sda-gpios + - scl-gpios + +...