From patchwork Tue Sep 22 03:59:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Porter X-Patchwork-Id: 520830 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 692191401AD for ; Tue, 22 Sep 2015 13:59:36 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757746AbbIVD7e (ORCPT ); Mon, 21 Sep 2015 23:59:34 -0400 Received: from mail-ig0-f180.google.com ([209.85.213.180]:34120 "EHLO mail-ig0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757776AbbIVD71 (ORCPT ); Mon, 21 Sep 2015 23:59:27 -0400 Received: by igcpb10 with SMTP id pb10so92465602igc.1 for ; Mon, 21 Sep 2015 20:59:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=iB7zpZhdSJ7+/jhQ+Q2YgEyobpOdt9DWqcx7HX37fXw=; b=GrvXSj0GrPK3fWeGSuXzm4w95a0+9+iDBD3OS1RlzCXbygOLto4lkUe2sA1pMfpKvP M5Ncpt4ucozfFjd2y0s1DlkDsKSONWLiuMv1C7O1co0Q1jKqQCsg2Mayfrlih2NZGMGH Tu0BPOgCbZBUUmYkfjnXi9G2kkvWQfepJJ3feK9exrhnkYjLmtwkKX8ciZWMS4ySlbI1 kdUfHxiYfLRZdc7+Bu9xODzbDB34gVA2uoXt8rBhYQ7A0cF8wxc5eEWkKzahyrPcNedi 2qofddt/sCjeKUzT0tVVXI8N7+3bu8SY6JwS4K4lthCsyQVG5jgv+PDCM575di9h3Wnf 4Z2Q== X-Gm-Message-State: ALoCoQmYnhnLVIFAcEZVUN1lvyEqDJztDhecwxtS0JhP3+f0Ek7RMk3wpNAaNZnns9btIyYqs9yu X-Received: by 10.50.122.42 with SMTP id lp10mr13341562igb.75.1442894366725; Mon, 21 Sep 2015 20:59:26 -0700 (PDT) Received: from bacon.ohporter.com (cpe-107-10-23-53.neo.res.rr.com. [107.10.23.53]) by smtp.gmail.com with ESMTPSA id y100sm544883ioi.29.2015.09.21.20.59.25 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 21 Sep 2015 20:59:26 -0700 (PDT) From: Matt Porter To: Devicetree List , Devicetree Spec List , Grant Likely , Frank Rowand , Rob Herring Cc: Mark Rutland , Pantelis Antoniou , Behan Webster , David Gibson , Tim Bird , Nicolas Ferre Subject: [RFC PATCH v2 3/3] Documentation: dt-bindings: add example DT binding document Date: Mon, 21 Sep 2015 23:59:18 -0400 Message-Id: <1442894358-15606-4-git-send-email-mporter@konsulko.com> X-Mailer: git-send-email 2.5.1 In-Reply-To: <1442894358-15606-1-git-send-email-mporter@konsulko.com> References: <1442894358-15606-1-git-send-email-mporter@konsulko.com> Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add a skeleton DT binding document that serves as the canonical example for implementing YAML-based DT bindings documentation. The skeleton binding illustrates use of all fields and variations described in the dt-binding-format.txt documentation. Signed-off-by: Matt Porter --- Documentation/devicetree/bindings/skeleton.yaml | 138 ++++++++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 Documentation/devicetree/bindings/skeleton.yaml diff --git a/Documentation/devicetree/bindings/skeleton.yaml b/Documentation/devicetree/bindings/skeleton.yaml new file mode 100644 index 0000000..d7a27cb --- /dev/null +++ b/Documentation/devicetree/bindings/skeleton.yaml @@ -0,0 +1,138 @@ +%YAML 1.2 +--- +version: 1 + +id: skel-device + +title: Skeleton Device + +maintainer: + - name: Skeleton Person + +description: > + The Skeleton Device binding represents the SK11 device produced by + the Skeleton Corporation. The binding can also support compatible + clones made by second source vendors. + +# This binding inherits property characteristics from the generic +# spi-slave binding + +inherits: + - id: spi-slave + +properties: + +# The compatible property is a reserved name. The type is always "string" +# and should not be repeated device binding. + + - name: "compatible" + constraint: | + "skel,sk11" || "faux,fx11" , BASE("skel,sk11") + description: FX11 is a clone of the original SK11 device + +# The reg property is a reserved name. The type is always "int" and +# should not be repeated in a device binding. Constraints are defined +# only in the context of the parent node's address, size, and ranges +# cells. The description is inherited from the spi-slave binding. + + - name: "reg" + +# spi-max-frequency needs the device-specific constraint to be supplied + + - name: "spi-max-frequency" + constraint: | + if (compatible == "skel,sk11") c <= 10000000 else c <= 1000000 + +# This property overrides the generic binding description with +# a device specific description in order to mention the chip's +# h/w cfg strapping pins. + + - name: "spi-cs-high" + description: > + Set if skeleton device configuration pins are set for chip + select polarity high + +# Device specific properties don't inherit characteristic from a generic +# binding so category, type, constraint, and description must be specified +# if needed. + + - name: "skel,deprecated1" + category: deprecated + type: int + constraint: | + (c >= 100000) && (c <= 200000) + description: > + First of two deprecated properties. + +# There are no constraints for properties of empty type + + - name: "skel,deprecated2" + category: deprecated + type: empty + description: > + Second of two deprecated properties. + +# This example could be auto-generated rather than explicitly included +# in the yaml source. + +example: + - dts: | + sk11@0 { + compatible = "skel,sk11"; + reg = <0>; + spi-max-frequency = <1000000>; + spi-cs-high; + }; +... + +--- +version: 1 + +id: skel-mini + +title: Skeleton Mini Device + +maintainer: + - name: Rogue Developer + +description: > + The Skeleton Mini Device binding represents the SK47x series devices + produced by the Skeleton Corporation. + +properties: + - name: "compatible" + category: required + constraint: | + "skel,sk472" || skel,sk473" || "skel,sk474" , BASE("skel,sk472") + deprecated: "skel,sk47x" + description: > + SK472 is the original part in the family. SK473/4 are later releases + with minor register changes. + + - name: "reg" + category: required + description: Address and size of Skeleton Mini register range. + + - name: "skel,sync-mode" + category: optional + type: empty + description: Enable synchronous transfer mode + +example: + - dts: | + sk472@beef0000 { + compatible = "skel,sk472"; + reg = <0xbeef0000 0x100>; + }; + description: > + Demonstrates an SK472 in normal mode. + + - dts: | + sk474@dead0000 { + compatible = "skel,sk474", "skel,sk472"; + reg = <0xdead0000 0x100>; + skel,sync-mode; + }; + description: > + Demonstrates an SK474 in synchronous mode. +...