From patchwork Wed Sep 1 09:18:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 12469037 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4AB41C432BE for ; Wed, 1 Sep 2021 10:38:41 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 10E6360724 for ; Wed, 1 Sep 2021 10:38:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 10E6360724 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cerno.tech Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=BstrgO6gH5eXMm5nUBMEiPtnRAyV0xrPxkK/jmtU50s=; b=sj+yRcPZNsnPm4 l52+vEDZY7xUqkqooj4IhfnIhQgdWPVYmTJGiFqE1ewkk8n3nxvZBXVDqlOo10dSt0Qzg1KdYBaXN UN6XvIxjg1/JdhYhUVXZUrQ6z73xQVhGY6UZPWz77V9Fvo0jrAd6JgiVZyIq24bU10UfH8uia9y2W GcOusVTVDWzk99dTu1n6IyRHMDCR8CeuYamKhBQ7E66TjfStjTgfy2Ix7U0UcAL+6jKuKm7YI3SGZ JxtB75rYmmYUlxvjHAHa7YKZmAlHx9eBYKcU1movEYr9rPUAtlpZHn4jDnZZlg6Ul4br7QBG26oTi 4aqkCX0dWXrSB0x9WFgw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mLNau-005Gkl-G7; Wed, 01 Sep 2021 10:35:49 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mLMPc-004qGV-Pq for linux-arm-kernel@lists.infradead.org; Wed, 01 Sep 2021 09:20:08 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 1BEB45C0242; Wed, 1 Sep 2021 05:20:04 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Wed, 01 Sep 2021 05:20:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=MMkLkx9sHjeMk rZIhjk8jiHn82H34IoH35eXeBxzYjo=; b=iQvtHwWsC+v6+q/v3nDz9Ye49xuPy K4qLgzaXL+t/UUjgDPmE0zNm9tJ3uxrXiYmvroTHkG5QVUVJpjQPcPXHd0JQd9A7 LY6/QCyiKQFK1L4aqPror7n08bWXJUmbq+raMhDf5NDkmOsMGTP/oQmqfwPJH8Z0 vQhJ92Q7x1rb9ShqgvkohKZBZRqufXhIzI+2P27yS9hrK1dmVID4xKLAJBSFpWm/ wl+acchx6NB/BBXFBeQ4sFZtLgRlmJNOI6DFhmSkpmOEJ9SaZLLnObpuj8Hzo1xK 166Hi08TdNCdQkT962dViMwSBscs8zvoCgzaK6ADnz6N5FsaC5jvqGZag== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=MMkLkx9sHjeMkrZIhjk8jiHn82H34IoH35eXeBxzYjo=; b=SiRbZNJ9 hNINWgpk7V9srRw9c6zSytVXj9dcqG9jjhUxHyPHAHQZGYhpBmKOIB4AQy//v/vP QAaCMzNQiqXYJ7c7iocco2tm2U2efnlMoVAOtW2U3wWa8FmVlyXuL71rAaAqzjzK Tz71FWUGbDE7SrjiL8gwKaPeGCCjmIXLycPdeQnim1vRM3ZP3KgE9FULlMLcTvEb UbK3gbK+NtOymbbUPUoOByXdrYmnSfiifPBBNwo9VdArF4TMF/Min3KLdo/CUmRW UJ3/wdx899VYgjC9ObScpsySDpbAmlqyrQlaAp8LUAZr1JArhYxM1oixZJWs20No 4qJz8I15ZVS04g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddruddvfedgudehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne govehorghsthgrlhdqhfeguddvqddtvdculdduhedtmdenucfjughrpefhvffufffkofgj fhgggfestdekredtredttdenucfhrhhomhepofgrgihimhgvucftihhprghrugcuoehmrg igihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrghtthgvrhhnpeevjeeijedtvefg fffgjeeugffguedtleetkeegteeufedtuddttdfgfffhgfeuffenucffohhmrghinhepug gvvhhitggvthhrvggvrdhorhhgnecuvehluhhsthgvrhfuihiivgepieenucfrrghrrghm pehmrghilhhfrhhomhepmhgrgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 1 Sep 2021 05:20:03 -0400 (EDT) From: Maxime Ripard To: devicetree@vger.kernel.org, Rob Herring , Frank Rowand , Chen-Yu Tsai , Maxime Ripard , =?utf-8?q?Jernej_=C5=A0krabec?= Cc: linux-arm-kernel@lists.infradead.org, linux-sunxi@googlegroups.com, Daniel Mack , Evgeniy Polyakov Subject: [PATCH v2 38/52] dt-bindings: w1: Convert 1-Wire GPIO binding to a schema Date: Wed, 1 Sep 2021 11:18:38 +0200 Message-Id: <20210901091852.479202-39-maxime@cerno.tech> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210901091852.479202-1-maxime@cerno.tech> References: <20210901091852.479202-1-maxime@cerno.tech> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210901_022004_955441_BC63C7C3 X-CRM114-Status: GOOD ( 19.47 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Bitbanged 1-Wire buses are supported by Linux thanks to their device tree binding. Now that we have the DT validation in place, let's convert the device tree bindings for that driver over to a YAML schema. Cc: Daniel Mack Cc: Evgeniy Polyakov Signed-off-by: Maxime Ripard --- Changes from v1: - Changed additionalproperties to make sure all the other items in the schema are nodes --- .../devicetree/bindings/w1/w1-gpio.txt | 27 ------------ .../devicetree/bindings/w1/w1-gpio.yaml | 44 +++++++++++++++++++ 2 files changed, 44 insertions(+), 27 deletions(-) delete mode 100644 Documentation/devicetree/bindings/w1/w1-gpio.txt create mode 100644 Documentation/devicetree/bindings/w1/w1-gpio.yaml diff --git a/Documentation/devicetree/bindings/w1/w1-gpio.txt b/Documentation/devicetree/bindings/w1/w1-gpio.txt deleted file mode 100644 index 3d6554eac240..000000000000 --- a/Documentation/devicetree/bindings/w1/w1-gpio.txt +++ /dev/null @@ -1,27 +0,0 @@ -w1-gpio devicetree bindings - -Required properties: - - - compatible: "w1-gpio" - - gpios: one or two GPIO specs: - - the first one is used as data I/O pin - - the second one is optional. If specified, it is used as - enable pin for an external pin pullup. - -Optional properties: - - - linux,open-drain: if specified, the data pin is considered in - open-drain mode. - -Also refer to the generic w1.txt document. - -Examples: - - onewire { - compatible = "w1-gpio"; - gpios = <&gpio 0 GPIO_ACTIVE_HIGH>; - - battery { - // ... - }; - }; diff --git a/Documentation/devicetree/bindings/w1/w1-gpio.yaml b/Documentation/devicetree/bindings/w1/w1-gpio.yaml new file mode 100644 index 000000000000..7ba1c2fd4722 --- /dev/null +++ b/Documentation/devicetree/bindings/w1/w1-gpio.yaml @@ -0,0 +1,44 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/w1/w1-gpio.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Bitbanged GPIO 1-Wire Bus Device Tree Bindings + +maintainers: + - Daniel Mack + +properties: + compatible: + const: w1-gpio + + gpios: + minItems: 1 + maxItems: 2 + items: + - description: Data I/O pin + - description: Enable pin for an external pull-up resistor + + linux,open-drain: + type: boolean + description: > + If specified, the data pin is considered in open-drain mode. + +required: + - compatible + - gpios + +additionalProperties: + type: object + +examples: + - | + #include + + onewire { + compatible = "w1-gpio"; + gpios = <&gpio 0 GPIO_ACTIVE_HIGH>; + }; + +...