Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp5944395ybx; Mon, 11 Nov 2019 01:05:09 -0800 (PST) X-Google-Smtp-Source: APXvYqzNQfhaPYnZmSCH93BrmZuiVY8cLFL8sWVa7auhIOxeVP9/TzE1ghkRG0ebr5ZKG0mqUFbu X-Received: by 2002:a17:906:2786:: with SMTP id j6mr21444408ejc.206.1573463109224; Mon, 11 Nov 2019 01:05:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573463109; cv=none; d=google.com; s=arc-20160816; b=vlyR0JZXnTi0vopK/pfTxbiKq5YqbU5nrOdVzIs2KPwE+vh2p/o+OS2kZq/i67HtG3 FL4GT8m4aKJrPJ8hk6IkU9LLVr4V9sk4Mtx8UUovkqtzfP6FUBLnEjIDrgT0AbOG6Jep mRnzyLiEm6px4ei/lPYKUa3nEqUjkiaGebWR8tI17p/vcoVmisqVmF+7Q3bqMA1EKTD5 annjak+wHMH9oV8eHsw96wDmLIUk00CKu3OU9jD1dZkk1ehHPv22DIY5DYzoFRZFppoh orOWr9OtCzd96MZuXDCVBYY88DOsFY9kZGuZNRh3sRW5BFlLrdNpQZo3c9Uf2/UPTmwk NNGA== 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=NVmpCxUr/ZHLc8hgaacYkznlZ6E/GhRiEnBrtonUGlg=; b=UGK+Crry9YqMNvx84G9UK6a04YiIlsq2e00T9RmtyNO6J/GDxHjf0aDGwuYo76UnNb yHhXglNaPIQ5u0u77+FZthjxoBWW3Du/g8FGvuiSr3Ky9Lp5ShbK0OvFHEGJw0IgBMLH WKFdN+81JOeoXDxbAhb50NlJ2Wa25wCQiMVeSSTVuqrkIofiSmFIRKqAm0J0VCIsMfFl /akBzxj3QfT2Ls1EBv2AC1bE962E4zC2rul8tWx7H9vvfd2EYR2PFHmoxuZp7dt58JYq 3V/oPx9G8chwWU1gZXFUY6nPf5WZa/1QcVvtCpBW6AdXPHoK76jZYXE56TyTGqh8+6md F6KA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h43si9524334edb.89.2019.11.11.01.04.46; Mon, 11 Nov 2019 01:05:09 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727109AbfKKJD4 (ORCPT + 99 others); Mon, 11 Nov 2019 04:03:56 -0500 Received: from sci-ig2.spreadtrum.com ([222.66.158.135]:40286 "EHLO SHSQR01.spreadtrum.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727050AbfKKJDy (ORCPT ); Mon, 11 Nov 2019 04:03:54 -0500 Received: from ig2.spreadtrum.com (bjmbx01.spreadtrum.com [10.0.64.7]) by SHSQR01.spreadtrum.com with ESMTPS id xAB939Qg060876 (version=TLSv1 cipher=AES256-SHA bits=256 verify=NO); Mon, 11 Nov 2019 17:03:10 +0800 (CST) (envelope-from Chunyan.Zhang@unisoc.com) Received: from localhost (10.0.74.88) by BJMBX01.spreadtrum.com (10.0.64.7) with Microsoft SMTP Server (TLS) id 15.0.847.32; Mon, 11 Nov 2019 17:03:28 +0800 From: Chunyan Zhang To: Rob Herring , Mark Rutland CC: , , Orson Zhai , Baolin Wang , Chunyan Zhang , Chunyan Zhang Subject: [PATCH v2 2/5] dt-bindings: serial: Convert sprd-uart to json-schema Date: Mon, 11 Nov 2019 17:02:27 +0800 Message-ID: <20191111090230.3402-3-chunyan.zhang@unisoc.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191111090230.3402-1-chunyan.zhang@unisoc.com> References: <20191111090230.3402-1-chunyan.zhang@unisoc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.0.74.88] X-ClientProxiedBy: shcas04.spreadtrum.com (10.29.35.89) To BJMBX01.spreadtrum.com (10.0.64.7) X-MAIL: SHSQR01.spreadtrum.com xAB939Qg060876 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Convert the sprd-uart binding to DT schema using json-schema. Signed-off-by: Chunyan Zhang --- .../devicetree/bindings/serial/sprd-uart.txt | 32 --------- .../devicetree/bindings/serial/sprd-uart.yaml | 69 +++++++++++++++++++ 2 files changed, 69 insertions(+), 32 deletions(-) delete mode 100644 Documentation/devicetree/bindings/serial/sprd-uart.txt create mode 100644 Documentation/devicetree/bindings/serial/sprd-uart.yaml diff --git a/Documentation/devicetree/bindings/serial/sprd-uart.txt b/Documentation/devicetree/bindings/serial/sprd-uart.txt deleted file mode 100644 index 9607dc616205..000000000000 --- a/Documentation/devicetree/bindings/serial/sprd-uart.txt +++ /dev/null @@ -1,32 +0,0 @@ -* Spreadtrum serial UART - -Required properties: -- compatible: must be one of: - * "sprd,sc9836-uart" - * "sprd,sc9860-uart", "sprd,sc9836-uart" - -- reg: offset and length of the register set for the device -- interrupts: exactly one interrupt specifier -- clock-names: Should contain following entries: - "enable" for UART module enable clock, - "uart" for UART clock, - "source" for UART source (parent) clock. -- clocks: Should contain a clock specifier for each entry in clock-names. - UART clock and source clock are optional properties, but enable clock - is required. - -Optional properties: -- dma-names: Should contain "rx" for receive and "tx" for transmit channels. -- dmas: A list of dma specifiers, one for each entry in dma-names. - -Example: - uart0: serial@0 { - compatible = "sprd,sc9860-uart", - "sprd,sc9836-uart"; - reg = <0x0 0x100>; - interrupts = ; - dma-names = "rx", "tx"; - dmas = <&ap_dma 19>, <&ap_dma 20>; - clock-names = "enable", "uart", "source"; - clocks = <&clk_ap_apb_gates 9>, <&clk_uart0>, <&ext_26m>; - }; diff --git a/Documentation/devicetree/bindings/serial/sprd-uart.yaml b/Documentation/devicetree/bindings/serial/sprd-uart.yaml new file mode 100644 index 000000000000..0cc4668a9b9c --- /dev/null +++ b/Documentation/devicetree/bindings/serial/sprd-uart.yaml @@ -0,0 +1,69 @@ +# SPDX-License-Identifier: GPL-2.0 +# Copyright 2019 Unisoc Inc. +%YAML 1.2 +--- +$id: "http://devicetree.org/schemas/serial/sprd-uart.yaml#" +$schema: "http://devicetree.org/meta-schemas/core.yaml#" + +title: Spreadtrum serial UART + +maintainers: + - Orson Zhai + - Baolin Wang + - Chunyan Zhang + +properties: + compatible: + oneOf: + - items: + - enum: + - sprd,sc9860-uart + - const: sprd,sc9836-uart + - const: sprd,sc9836-uart + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + minItems: 1 + maxItems: 3 + + clock-names: + description: "enable" for UART module enable clock, "uart" for UART + clock, "source" for UART source (parent) clock. + items: + - const: enable + - const: uart + - const: source + + dmas: + minItems: 1 + maxItems: 2 + + dma-names: + minItems: 1 + items: + - const: rx + - const: tx + +required: + - compatible + - reg + - interrupts + +examples: + - | + serial@0 { + compatible = "sprd,sc9860-uart", "sprd,sc9836-uart"; + reg = <0x0 0x100>; + interrupts = ; + dma-names = "rx", "tx"; + dmas = <&ap_dma 19>, <&ap_dma 20>; + clock-names = "enable", "uart", "source"; + clocks = <&clk_ap_apb_gates 9>, <&clk_uart0>, <&ext_26m>; + }; + +... -- 2.20.1