Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp416061pxb; Fri, 16 Apr 2021 08:42:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwPL9frwHIgXLi1npuYVs9T4/P1Gv9C9jPRtEl5seRO3vcxupNOJxOsSqt5E6l8g1+KqBXT X-Received: by 2002:a17:902:c408:b029:e7:3242:5690 with SMTP id k8-20020a170902c408b02900e732425690mr10262691plk.85.1618587762215; Fri, 16 Apr 2021 08:42:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618587762; cv=none; d=google.com; s=arc-20160816; b=HNppmD42D10c1g74Uubx+61qoASgAka4AzRPVgt8gx8qvNBj+NVvms+rxkVh769wvk 4X2FCRdkvs9eYCJUx5A/Gs1Zi/SdPQrrUNCPZ14Kwnal8OTNvGkxPKp0dnIrOJxDwa0H +MZZxaDyHBAwgAnJ3jS79AHE6f5HsnzC+0YVe1DMf6be585aFIAlyqezCaciFkdeb3OJ +ZXsoI/FlfVHe0dIgejDvSkqblRPlZ1fPOOUSq1pu00zsxAVXJKscxNg3hgPfEh6ClDS dc1U0UlHCD53EeLGg2YdTVoUgca8cN48xCjauz5Foh+0zvlRFWcgUltL7j1njSmuLww+ HA3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=V1LT7ckORnqktxyFFJov19dECloQyXzDxWxudm5hT1U=; b=j8dcHkQrSvv/EVgo93JVJiKgmBruBb38qxraMj+++Idjt3AceDxm1N4BPGTr4KVDdd Ll53M9ejELjODrfnLxm1OZJpoLbVwG5oZTsNwDQNj5NCLHwKv5LQMjyDC2WMdlGo/RDV MfTHBPO7w+2IzCQ1cYTaAJLbqXEe+yRfMBgFJU8M9RXX5TkbyjaL6FzGImTh05AodXJN wGOLCx1iygYkTD+1FvxKOvfJwT3n96GPiLlK8v1iFgiMUkql5yV1vs0NFiG1XuYtVdv3 CCssU1Lzf+b94NFsARSMTVg3/LQovZR5cY3L+eRwgrnoRsvQps5Ir1M3l42GxkIMb8+2 QFxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Q6ySTFEu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j6si6917182pgm.340.2021.04.16.08.42.30; Fri, 16 Apr 2021 08:42:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Q6ySTFEu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235180AbhDPNr0 (ORCPT + 99 others); Fri, 16 Apr 2021 09:47:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:48076 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244237AbhDPNrV (ORCPT ); Fri, 16 Apr 2021 09:47:21 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 80CD46121E; Fri, 16 Apr 2021 13:46:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1618580816; bh=B/gO4o0ET1Vf4JJJaWbgLKZOakfSU5zu8k7n8XwNkcQ=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Q6ySTFEuLcZ4Q3HiIU3ZLS6PIYWbzBKE+E85JHkS7+68Ve4YOKQoGeVEy38cC3atV 0ZKtTNLMnWqqEl0ibUc1zA/ScBeccX8iQbsdsPNk5hwxVLlEdYwUqdRoweGrS7bLd8 no13WO4vVR5+7Z9IAz5cQZtw8cumow1zrXe7xtUSCLUxi1QwRufdCWoVFN0Zfos0H5 zSUaPFlcsYBlG8GGyqTq0E+o+jEn8q3mXvhSrdIrUoGr4pEoRuSLwfLpLIcrBQqQ29 P7M+rHJJ7SaDWVBU4sOUUz5+/WpDoltGkqoKlRC3Js8EudEN56RmY8+DaGfiNsJfmb HHF7MzdTvYOtA== Received: by mail-ej1-f54.google.com with SMTP id mh2so20688036ejb.8; Fri, 16 Apr 2021 06:46:56 -0700 (PDT) X-Gm-Message-State: AOAM532p5Nh0RRjAt9yCVV4T4aDLa6lQTsU/jYLA4CASNjhUYv6OH80c kN6Djkc8TWaAv4YdX/dac6goK3tcj86tEY18bQ== X-Received: by 2002:a17:907:70d3:: with SMTP id yk19mr8343248ejb.108.1618580815150; Fri, 16 Apr 2021 06:46:55 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Rob Herring Date: Fri, 16 Apr 2021 08:46:42 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Need help converting usb/faraday,fotg210.yaml to yaml To: Corentin Labbe Cc: devicetree@vger.kernel.org, "linux-kernel@vger.kernel.org" , Linus Walleij Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 16, 2021 at 8:18 AM Corentin Labbe wrote: > > Hello > > I am converting Documentation/devicetree/bindings/usb/faraday,fotg210.txt to yaml with the patch attached below. > But validating it give me: > Documentation/devicetree/bindings/usb/faraday,fotg210.example.dt.yaml: usb@68000000: 'syscon', 'wakeup-source' do not match any of the regexes: 'pinctrl-[0-9]+' These have to be defined at the top level, not just the if/then schema. More below... > > I dont know from where came this pinctrl regex. The tooling adds it. > I think this is perhaps due to the if not matched, but still didnt find any solution. > > Thanks > > --- a/Documentation/devicetree/bindings/usb/faraday,fotg210.txt > +++ /dev/null > @@ -1,35 +0,0 @@ > -Faraday FOTG Host controller > - > -This OTG-capable USB host controller is found in Cortina Systems > -Gemini and other SoC products. > - > -Required properties: > -- compatible: should be one of: > - "faraday,fotg210" > - "cortina,gemini-usb", "faraday,fotg210" > -- reg: should contain one register range i.e. start and length > -- interrupts: description of the interrupt line > - > -Optional properties: > -- clocks: should contain the IP block clock > -- clock-names: should be "PCLK" for the IP block clock > - > -Required properties for "cortina,gemini-usb" compatible: > -- syscon: a phandle to the system controller to access PHY registers > - > -Optional properties for "cortina,gemini-usb" compatible: > -- cortina,gemini-mini-b: boolean property that indicates that a Mini-B > - OTG connector is in use > -- wakeup-source: see power/wakeup-source.txt > - > -Example for Gemini: > - > -usb@68000000 { > - compatible = "cortina,gemini-usb", "faraday,fotg210"; > - reg = <0x68000000 0x1000>; > - interrupts = <10 IRQ_TYPE_LEVEL_HIGH>; > - clocks = <&cc 12>; > - clock-names = "PCLK"; > - syscon = <&syscon>; > - wakeup-source; > -}; > diff --git a/Documentation/devicetree/bindings/usb/faraday,fotg210.yaml b/Documentation/devicetree/bindings/usb/faraday,fotg210.yaml > new file mode 100644 > index 000000000000..b5418f29745e > --- /dev/null > +++ b/Documentation/devicetree/bindings/usb/faraday,fotg210.yaml > @@ -0,0 +1,78 @@ > +# SPDX-License-Identifier: GPL-2.0 > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/usb/faraday,fotg210.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Faraday FOTG Host controller > + > +maintainers: > + - Linus Walleij > + > +description: | > + This OTG-capable USB host controller is found in Cortina Systems > + Gemini and other SoC products. > + > +properties: > + compatible: > + oneOf: > + - const: faraday,fotg210 > + - items: > + - const: cortina,gemini-usb > + - const: faraday,fotg210 > + > + reg: > + maxItems: 1 > + > + interrupts: > + maxItems: 1 > + > + clocks: > + maxItems: 1 > + > + clock-names: > + const: PCLK > + > + resets: > + maxItems: 1 > + > +required: > + - compatible > + - reg > + - interrupts > + > +if: > + properties: > + compatible: > + contains: > + const: cortina,gemini-usb > +then: > + properties: > + syscon: > + maxItems: 1 > + $ref: /schemas/types.yaml#/definitions/phandle > + description: Phandle to the system controller to access PHY registers > + cortina,gemini-mini-b: > + type: boolean > + description: boolean property that indicates that a Mini-B OTG connector is in use > + wakeup-source: > + type: boolean > + description: see power/wakeup-source.txt Move these definitions to the top level 'properties'. Then add an else clause: else: properties: syscon: false cortina,gemini-mini-b: false wakeup-source: false > + required: > + - syscon > + > +additionalProperties: false > + > +examples: > + - | > + #include > + usb@68000000 { > + compatible = "cortina,gemini-usb", "faraday,fotg210"; > + reg = <0x68000000 0x1000>; > + interrupts = <10 IRQ_TYPE_LEVEL_HIGH>; > + clocks = <&cc 12>; > + clock-names = "PCLK"; > + syscon = <&syscon>; > + wakeup-source; > + }; > +... >