From patchwork Mon Sep 27 07:35:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 12519281 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E8DFBC433EF for ; Mon, 27 Sep 2021 07:37:42 +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 AE970610E8 for ; Mon, 27 Sep 2021 07:37:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org AE970610E8 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: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:In-Reply-To:References: List-Owner; bh=pbMHSnygZpE3T8IkWh4ZP0zx08yHzsxEKyauTFpucgw=; b=JpXM6RXKpIxCbz KtxOTt9L8DTEaOfdQVCK7EuIpfJCYQi0eq1i9UkBHrE1ris3ByweN0kolWeKQe4Fp6h/LvCogWTTP LwFG3v/rqkqQfkww09v6ae8pfbhjhgO1xbslZ5vgs71QRTbnryqYVYFJQNDjVbMtEpI2H7qjKOPdE /YYbAXlikKPF5nO6XC7pnexuCz9bixGlE9hqYm7GrzdZio+NTIT0/jRg8EoSva5NTQMzz9SRVtaaQ OzmOTlhYYVIiDxH8QmT4l7ETixp1P6nPDjrrErMhVI9L9gjAI7ot0SkFfCes2x/OltLzouiHkMMxB myqAVUa5d5pk34x+9EZA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mUlAr-001phG-Ec; Mon, 27 Sep 2021 07:35:41 +0000 Received: from new2-smtp.messagingengine.com ([66.111.4.224]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mUlAZ-001peS-PF for linux-arm-kernel@lists.infradead.org; Mon, 27 Sep 2021 07:35:25 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.nyi.internal (Postfix) with ESMTP id B54D1580BC8; Mon, 27 Sep 2021 03:35:18 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Mon, 27 Sep 2021 03:35:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=fm3; bh=A3s6y6hwUMyIsQsNqVih3FBF+C v0Sh+tj8l+5TZsS2s=; b=gIapKDZrG8up5olyj6wbCLcBdEwo/Y5AgkwiJHh8CV QwSwdAawQGspb0vrbJ+avuIZETCo5ST1q4imPNocYQN3HEZtWUT1qD1zfiLC6veU 0BoBnxdSBf4pCjGM4pgvsYYSSKEtJOtBy8YYwXD5JakpUVpAd0mK9JHaPt/wXd1R lF/QE2e4yJVJDsB+7DIIU+94/uuUPmAiLSDgcqQ1vIUjEyNVoHLp+yaiwbeacwpk Yt1OJO8/sgZJDoTsbGE5P4iIo1xsugHuup8XBvZ7yeEKiUISfNk+Kw5WI6SWMU5E 8mmRciJnAjTJTL/uM4PL6OBVTKbLvZc+TefkzmQw9sBA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=A3s6y6hwUMyIsQsNq Vih3FBF+Cv0Sh+tj8l+5TZsS2s=; b=jmliwDtCSclO1qYwqirLRNl+Fx5sM/YoX qQn9eDIP1uP9OEUgCDYezwk+viWGe1mzIJHNLYqvZdj9+RWASOKi7lMoaLvb95db dxqwnkuaVN9crhF4OEOYJQ7AqYIyyqTc7/yJkVrDIbs3eRTWTyTdf04eZiraoLoK 36qU7dkpFykoBjnQCEXapIZ1q67yNzh8h3WvLtXOcCJGGxe0/fc3XOmbBOrT8Ygh GWcZbyM1+OomQ1eXTc9x8JJof060TO7VuOzO4cLs139nU/c0JcAOp2TMKdm2y1Ur +/QS1uJIQLszWy6wzR2DZWwK0YNTJr8bPkYDTAL5aq5lOR1cgHQnQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudejjedguddulecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enogevohgrshhtrghlqdfhgeduvddqtddvucdludehtddmnecujfgurhephffvufffkffo ggfgsedtkeertdertddtnecuhfhrohhmpeforgigihhmvgcutfhiphgrrhguuceomhgrgi himhgvsegtvghrnhhordhtvggthheqnecuggftrfgrthhtvghrnhephffhhfevtddthefg ieeigeffudehkefgtdeufedvtdduheduieekvddvfedvkeetnecuffhomhgrihhnpeguvg hvihgtvghtrhgvvgdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhep mhgrihhlfhhrohhmpehmrgigihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 27 Sep 2021 03:35:17 -0400 (EDT) From: Maxime Ripard To: Chen-Yu Tsai , Maxime Ripard , =?utf-8?q?Jernej_=C5=A0krabec?= , Rob Herring , Frank Rowand Cc: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-sunxi@lists.linux.dev, Dongjin Kim , Greg Kroah-Hartman , linux-usb@vger.kernel.org, Rob Herring Subject: [RESEND v2 1/2] dt-bindings: usb: Convert SMSC USB3503 binding to a schema Date: Mon, 27 Sep 2021 09:35:13 +0200 Message-Id: <20210927073514.14334-1-maxime@cerno.tech> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210927_003523_949761_ED9C7567 X-CRM114-Status: GOOD ( 22.78 ) 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 The SMSC USB3503 USB Hub Controller is supported by Linux thanks to its 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: Dongjin Kim Cc: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org Reviewed-by: Rob Herring Signed-off-by: Maxime Ripard --- Changes from v1: - Added maximum number of items for clocks and gpios - Fixed the example node name --- .../devicetree/bindings/usb/smsc,usb3503.yaml | 108 ++++++++++++++++++ .../devicetree/bindings/usb/usb3503.txt | 39 ------- 2 files changed, 108 insertions(+), 39 deletions(-) create mode 100644 Documentation/devicetree/bindings/usb/smsc,usb3503.yaml delete mode 100644 Documentation/devicetree/bindings/usb/usb3503.txt diff --git a/Documentation/devicetree/bindings/usb/smsc,usb3503.yaml b/Documentation/devicetree/bindings/usb/smsc,usb3503.yaml new file mode 100644 index 000000000000..39228a506b93 --- /dev/null +++ b/Documentation/devicetree/bindings/usb/smsc,usb3503.yaml @@ -0,0 +1,108 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/usb/smsc,usb3503.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: SMSC USB3503 High-Speed Hub Controller Device Tree Bindings + +maintainers: + - Dongjin Kim + +properties: + compatible: + enum: + - smsc,usb3503 + - smsc,usb3503a + + reg: + maxItems: 1 + + connect-gpios: + maxItems: 1 + description: > + GPIO for connect + + intn-gpios: + maxItems: 1 + description: > + GPIO for interrupt + + reset-gpios: + maxItems: 1 + description: > + GPIO for reset + + disabled-ports: + $ref: /schemas/types.yaml#/definitions/uint32-array + minItems: 1 + maxItems: 3 + items: + minimum: 1 + maximum: 3 + description: > + Specifies the ports unused using their port number. Do not describe this + property if all ports have to be enabled. + + initial-mode: + enum: [1, 2] + description: > + Specifies initial mode. 1 for Hub mode, 2 for standby mode. + + clocks: + maxItems: 1 + description: > + Clock used for driving REFCLK signal. If not provided the driver assumes + that clock signal is always available, its rate is specified by REF_SEL + pins and a value from the primary reference clock frequencies table is + used. + + clock-names: + const: refclk + + refclk-frequency: + $ref: /schemas/types.yaml#/definitions/uint32 + description: > + Frequency of the REFCLK signal as defined by REF_SEL pins. If not + provided, driver will not set rate of the REFCLK signal and assume that a + value from the primary reference clock frequencies table is used. + +required: + - compatible + +additionalProperties: false + +examples: + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + usb-hub@8 { + compatible = "smsc,usb3503"; + reg = <0x08>; + connect-gpios = <&gpx3 0 1>; + disabled-ports = <2 3>; + intn-gpios = <&gpx3 4 1>; + reset-gpios = <&gpx3 5 1>; + initial-mode = <1>; + clocks = <&clks 80>; + clock-names = "refclk"; + }; + }; + + - | + #include + + usb-hub { + /* I2C is not connected */ + compatible = "smsc,usb3503"; + initial-mode = <1>; /* initialize in HUB mode */ + disabled-ports = <1>; + intn-gpios = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */ + reset-gpios = <&pio 4 16 GPIO_ACTIVE_LOW>; /* PE16 */ + connect-gpios = <&pio 4 17 GPIO_ACTIVE_HIGH>; /* PE17 */ + refclk-frequency = <19200000>; + }; + +... diff --git a/Documentation/devicetree/bindings/usb/usb3503.txt b/Documentation/devicetree/bindings/usb/usb3503.txt deleted file mode 100644 index 057dd384d473..000000000000 --- a/Documentation/devicetree/bindings/usb/usb3503.txt +++ /dev/null @@ -1,39 +0,0 @@ -SMSC USB3503 High-Speed Hub Controller - -Required properties: -- compatible: Should be "smsc,usb3503" or "smsc,usb3503a". - -Optional properties: -- reg: Specifies the i2c slave address, it is required and should be 0x08 - if I2C is used. -- connect-gpios: Should specify GPIO for connect. -- disabled-ports: Should specify the ports unused. - '1' or '2' or '3' are available for this property to describe the port - number. 1~3 property values are possible to be described. - Do not describe this property if all ports have to be enabled. -- intn-gpios: Should specify GPIO for interrupt. -- reset-gpios: Should specify GPIO for reset. -- initial-mode: Should specify initial mode. - (1 for HUB mode, 2 for STANDBY mode) -- refclk: Clock used for driving REFCLK signal (optional, if not provided - the driver assumes that clock signal is always available, its - rate is specified by REF_SEL pins and a value from the primary - reference clock frequencies table is used). Use clocks and - clock-names in order to assign it -- refclk-frequency: Frequency of the REFCLK signal as defined by REF_SEL - pins (optional, if not provided, driver will not set rate of the - REFCLK signal and assume that a value from the primary reference - clock frequencies table is used) - -Examples: - usb3503@8 { - compatible = "smsc,usb3503"; - reg = <0x08>; - connect-gpios = <&gpx3 0 1>; - disabled-ports = <2 3>; - intn-gpios = <&gpx3 4 1>; - reset-gpios = <&gpx3 5 1>; - initial-mode = <1>; - clocks = <&clks 80>; - clock-names = "refclk"; - }; From patchwork Mon Sep 27 07:35:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 12519283 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 84A4CC433EF for ; Mon, 27 Sep 2021 07:37:54 +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 5254A60F4F for ; Mon, 27 Sep 2021 07:37:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5254A60F4F 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=L4F8nkDfIZ7WRmK8mXFIqoVFj872lDZ09lz9Y2x1ry8=; b=l7IR332fO18D+d kuDvutkRTnKdnMufCfY0Goprg2JYTheSfc5nhQiu2b1SapH6TSFAoAChbYO/r2rIym1WqRAXKCGvV KMivMF+9KsmcvIuPW5Bnql+GzHQ65htEIf2iNbaKuT5EXrSrccVQwDMITGrVund7BjfrF+MeGnV3d OYqtsGhjWhOlFGS5HWwjN9QcEk+TDG85Q9obgWnNBaYvMaAibVX8SCFEq/e18OGPoXI+IpObdL010 1sxJifqHWUNbrpe0HEnt7Q79+h80anKNlalRXEUAsaFlOf869SN1X6cyktNwcK4WhF3V1TUY0vCqc RjZeC5gBWKj1at7wOwqA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mUlAh-001pgU-Bw; Mon, 27 Sep 2021 07:35:31 +0000 Received: from new2-smtp.messagingengine.com ([66.111.4.224]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mUlAZ-001pej-S7 for linux-arm-kernel@lists.infradead.org; Mon, 27 Sep 2021 07:35:25 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailnew.nyi.internal (Postfix) with ESMTP id 53A0A580BDD; Mon, 27 Sep 2021 03:35:21 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Mon, 27 Sep 2021 03:35:21 -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=3v8ypuwgp+UVL BlnX3yZhpFVxptbvBS5y5LkJwvOoxg=; b=O+q+GLcBTUeF3L8pCNn39b1vl+A/Q GOZ4Omj4i3+pJlVXROBsuzUjshOxfipchnAVN0M5taFaCRvwpCSokzLiJ2NA2TGv VPiXlH33z9qGjvVqN7KGaoNeO+T+LTqUvYwCxmhr6+OApNi0Lg4gwsE76o9HsVKZ ykfOpqQRAuUWv5mmsD4E9iGtLqg33Ur4imeEZ6YOsmdqjKm4ODFLtRRfDrIZ8noz LXjjvFtpajcc2xc1Eq7ejiN/hLU8tYrJazfN/Xt5Z6/2Z+gMHFODiFbRVXDhJ1Qy z2gMoRkHWHegDgvgyufJ0oaR6avphK6ZFHbscGXMN5qg7nmXiQzCvm/4A== 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=3v8ypuwgp+UVLBlnX3yZhpFVxptbvBS5y5LkJwvOoxg=; b=CVWIV1nM D74h+udd8yC3gMTid6bOmumzDDz6peFapI/d6LsjcwoVn97moMXoFsh1FIb4dpNT CFol8UTLifCz/ydozY/xWbPTxTcOpgouM1oB5saSQDhO7HBKyngvUsIOLCgKyEzu VZi1ckoC9p17KyXbOd8Hgm4pB+HF7rrI8gcWhdWnQRxhb5DU6Q7jH+3Tn0e118yL 3gXoxnzQc2Qlc14jBCdMn/5uxrnc/VwRtj3LJXClShgvwxsgV3ebaNH5N+mFDWSq qCLWvoUW2qNBEOlzXRS8Gvgvl4tm5X/QDeaql2DNTzu2ihdxSol/QmBReX8+fHr/ 3DzngJeOCzw9Mg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudejjedguddulecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepofgrgihi mhgvucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrg htthgvrhhnpedvkeelveefffekjefhffeuleetleefudeifeehuddugffghffhffehveev heehvdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hmrgigihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 27 Sep 2021 03:35:20 -0400 (EDT) From: Maxime Ripard To: Chen-Yu Tsai , Maxime Ripard , =?utf-8?q?Jernej_=C5=A0krabec?= , Rob Herring , Frank Rowand Cc: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-sunxi@lists.linux.dev, Felipe Balbi , Greg Kroah-Hartman , linux-usb@vger.kernel.org, Rob Herring Subject: [RESEND v2 2/2] dt-bindings: usb: dwc3: Fix usb-phy check Date: Mon, 27 Sep 2021 09:35:14 +0200 Message-Id: <20210927073514.14334-2-maxime@cerno.tech> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210927073514.14334-1-maxime@cerno.tech> References: <20210927073514.14334-1-maxime@cerno.tech> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210927_003524_055013_1B5CD460 X-CRM114-Status: GOOD ( 11.51 ) 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 The original binding was allowing any combination of usb2-phy and usb3-phy in the phys and phy-names properties. However, the current binding enforces that those properties must be a list of usb2-phy and usb3-phy, with exactly one element, effectively making usb2-phy the only value being valid. Let's rework the properties description to allow either one or two element picked with values either usb2-phy or usb3-phy. The rest of the tooling makes sure that we don't get any duplicate value, so this should be what we want. Cc: Felipe Balbi Cc: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org Reviewed-by: Rob Herring Signed-off-by: Maxime Ripard --- Documentation/devicetree/bindings/usb/snps,dwc3.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml index 1040d06cc0d7..25ac2c93dc6c 100644 --- a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml +++ b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml @@ -73,15 +73,15 @@ properties: phys: minItems: 1 - items: - - description: USB2/HS PHY - - description: USB3/SS PHY + maxItems: 2 phy-names: minItems: 1 + maxItems: 2 items: - - const: usb2-phy - - const: usb3-phy + enum: + - usb2-phy + - usb3-phy resets: minItems: 1