[{"id":2668037,"web_url":"http://patchwork.ozlabs.org/comment/2668037/","msgid":"<CAL_JsqJ47D2m-7sF_FKfmf3X0JVw4gs-bxGt2b76oUtUqhdEYw@mail.gmail.com>","list_archive_url":null,"date":"2021-04-16T13:46:42","subject":"Re: Need help converting usb/faraday,fotg210.yaml to yaml","submitter":{"id":67416,"url":"http://patchwork.ozlabs.org/api/people/67416/","name":"Rob Herring","email":"robh+dt@kernel.org"},"content":"On Fri, Apr 16, 2021 at 8:18 AM Corentin Labbe\n<clabbe.montjoie@gmail.com> wrote:\n>\n> Hello\n>\n> I am converting Documentation/devicetree/bindings/usb/faraday,fotg210.txt to yaml with the patch attached below.\n> But validating it give me:\n> Documentation/devicetree/bindings/usb/faraday,fotg210.example.dt.yaml: usb@68000000: 'syscon', 'wakeup-source' do not match any of the regexes: 'pinctrl-[0-9]+'\n\nThese have to be defined at the top level, not just the if/then\nschema. More below...\n\n>\n> I dont know from where came this pinctrl regex.\n\nThe tooling adds it.\n\n> I think this is perhaps due to the if not matched, but still didnt find any solution.\n>\n> Thanks\n>\n> --- a/Documentation/devicetree/bindings/usb/faraday,fotg210.txt\n> +++ /dev/null\n> @@ -1,35 +0,0 @@\n> -Faraday FOTG Host controller\n> -\n> -This OTG-capable USB host controller is found in Cortina Systems\n> -Gemini and other SoC products.\n> -\n> -Required properties:\n> -- compatible: should be one of:\n> -  \"faraday,fotg210\"\n> -  \"cortina,gemini-usb\", \"faraday,fotg210\"\n> -- reg: should contain one register range i.e. start and length\n> -- interrupts: description of the interrupt line\n> -\n> -Optional properties:\n> -- clocks: should contain the IP block clock\n> -- clock-names: should be \"PCLK\" for the IP block clock\n> -\n> -Required properties for \"cortina,gemini-usb\" compatible:\n> -- syscon: a phandle to the system controller to access PHY registers\n> -\n> -Optional properties for \"cortina,gemini-usb\" compatible:\n> -- cortina,gemini-mini-b: boolean property that indicates that a Mini-B\n> -  OTG connector is in use\n> -- wakeup-source: see power/wakeup-source.txt\n> -\n> -Example for Gemini:\n> -\n> -usb@68000000 {\n> -       compatible = \"cortina,gemini-usb\", \"faraday,fotg210\";\n> -       reg = <0x68000000 0x1000>;\n> -       interrupts = <10 IRQ_TYPE_LEVEL_HIGH>;\n> -       clocks = <&cc 12>;\n> -       clock-names = \"PCLK\";\n> -       syscon = <&syscon>;\n> -       wakeup-source;\n> -};\n> diff --git a/Documentation/devicetree/bindings/usb/faraday,fotg210.yaml b/Documentation/devicetree/bindings/usb/faraday,fotg210.yaml\n> new file mode 100644\n> index 000000000000..b5418f29745e\n> --- /dev/null\n> +++ b/Documentation/devicetree/bindings/usb/faraday,fotg210.yaml\n> @@ -0,0 +1,78 @@\n> +# SPDX-License-Identifier: GPL-2.0\n> +%YAML 1.2\n> +---\n> +$id: http://devicetree.org/schemas/usb/faraday,fotg210.yaml#\n> +$schema: http://devicetree.org/meta-schemas/core.yaml#\n> +\n> +title: Faraday FOTG Host controller\n> +\n> +maintainers:\n> +  - Linus Walleij <linus.walleij@linaro.org>\n> +\n> +description: |\n> +    This OTG-capable USB host controller is found in Cortina Systems\n> +    Gemini and other SoC products.\n> +\n> +properties:\n> +  compatible:\n> +    oneOf:\n> +      - const: faraday,fotg210\n> +      - items:\n> +        - const: cortina,gemini-usb\n> +        - const: faraday,fotg210\n> +\n> +  reg:\n> +    maxItems: 1\n> +\n> +  interrupts:\n> +    maxItems: 1\n> +\n> +  clocks:\n> +    maxItems: 1\n> +\n> +  clock-names:\n> +    const: PCLK\n> +\n> +  resets:\n> +    maxItems: 1\n> +\n> +required:\n> +  - compatible\n> +  - reg\n> +  - interrupts\n> +\n> +if:\n> +  properties:\n> +    compatible:\n> +      contains:\n> +        const: cortina,gemini-usb\n> +then:\n> +  properties:\n> +    syscon:\n> +      maxItems: 1\n> +      $ref: /schemas/types.yaml#/definitions/phandle\n> +      description: Phandle to the system controller to access PHY registers\n> +    cortina,gemini-mini-b:\n> +      type: boolean\n> +      description: boolean property that indicates that a Mini-B OTG connector is in use\n> +    wakeup-source:\n> +      type: boolean\n> +      description: see power/wakeup-source.txt\n\nMove these definitions to the top level 'properties'. Then add an else clause:\n\nelse:\n  properties:\n    syscon: false\n    cortina,gemini-mini-b: false\n    wakeup-source: false\n\n> +  required:\n> +    - syscon\n> +\n> +additionalProperties: false\n> +\n> +examples:\n> +  - |\n> +    #include <dt-bindings/interrupt-controller/irq.h>\n> +    usb@68000000 {\n> +      compatible = \"cortina,gemini-usb\", \"faraday,fotg210\";\n> +      reg = <0x68000000 0x1000>;\n> +      interrupts = <10 IRQ_TYPE_LEVEL_HIGH>;\n> +      clocks = <&cc 12>;\n> +      clock-names = \"PCLK\";\n> +      syscon = <&syscon>;\n> +      wakeup-source;\n> +    };\n> +...\n>","headers":{"Return-Path":"<devicetree-owner@vger.kernel.org>","X-Original-To":"incoming-dt@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming-dt@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=23.128.96.18; helo=vger.kernel.org;\n envelope-from=devicetree-owner@vger.kernel.org; receiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=Q6ySTFEu;\n\tdkim-atps=neutral"],"Received":["from vger.kernel.org (vger.kernel.org [23.128.96.18])\n\tby ozlabs.org (Postfix) with ESMTP id 4FMHZH3xCYz9sPf\n\tfor <incoming-dt@patchwork.ozlabs.org>;\n Fri, 16 Apr 2021 23:47:03 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n        id S243346AbhDPNrZ (ORCPT <rfc822;incoming-dt@patchwork.ozlabs.org>);\n        Fri, 16 Apr 2021 09:47:25 -0400","from mail.kernel.org ([198.145.29.99]:48076 \"EHLO mail.kernel.org\"\n        rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n        id S244237AbhDPNrV (ORCPT <rfc822;devicetree@vger.kernel.org>);\n        Fri, 16 Apr 2021 09:47:21 -0400","by mail.kernel.org (Postfix) with ESMTPSA id 80CD46121E;\n        Fri, 16 Apr 2021 13:46:56 +0000 (UTC)","by mail-ej1-f54.google.com with SMTP id mh2so20688036ejb.8;\n        Fri, 16 Apr 2021 06:46:56 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n        s=k20201202; t=1618580816;\n        bh=B/gO4o0ET1Vf4JJJaWbgLKZOakfSU5zu8k7n8XwNkcQ=;\n        h=References:In-Reply-To:From:Date:Subject:To:Cc:From;\n        b=Q6ySTFEuLcZ4Q3HiIU3ZLS6PIYWbzBKE+E85JHkS7+68Ve4YOKQoGeVEy38cC3atV\n         0ZKtTNLMnWqqEl0ibUc1zA/ScBeccX8iQbsdsPNk5hwxVLlEdYwUqdRoweGrS7bLd8\n         no13WO4vVR5+7Z9IAz5cQZtw8cumow1zrXe7xtUSCLUxi1QwRufdCWoVFN0Zfos0H5\n         zSUaPFlcsYBlG8GGyqTq0E+o+jEn8q3mXvhSrdIrUoGr4pEoRuSLwfLpLIcrBQqQ29\n         P7M+rHJJ7SaDWVBU4sOUUz5+/WpDoltGkqoKlRC3Js8EudEN56RmY8+DaGfiNsJfmb\n         HHF7MzdTvYOtA==","X-Gm-Message-State":"AOAM532p5Nh0RRjAt9yCVV4T4aDLa6lQTsU/jYLA4CASNjhUYv6OH80c\n        kN6Djkc8TWaAv4YdX/dac6goK3tcj86tEY18bQ==","X-Google-Smtp-Source":"\n ABdhPJxTDzaPKU8wyeBHLRuKnIcggDRpfumYSFxCw0m75Xt2Xdbw7cBsRkNPQ/1iDsEibfDBKiARfrTWqdXzoIBomOk=","X-Received":"by 2002:a17:907:70d3:: with SMTP id\n yk19mr8343248ejb.108.1618580815150;\n Fri, 16 Apr 2021 06:46:55 -0700 (PDT)","MIME-Version":"1.0","References":"<YHmOvvyxAyOY/fRL@Red>","In-Reply-To":"<YHmOvvyxAyOY/fRL@Red>","From":"Rob Herring <robh+dt@kernel.org>","Date":"Fri, 16 Apr 2021 08:46:42 -0500","X-Gmail-Original-Message-ID":"\n <CAL_JsqJ47D2m-7sF_FKfmf3X0JVw4gs-bxGt2b76oUtUqhdEYw@mail.gmail.com>","Message-ID":"\n <CAL_JsqJ47D2m-7sF_FKfmf3X0JVw4gs-bxGt2b76oUtUqhdEYw@mail.gmail.com>","Subject":"Re: Need help converting usb/faraday,fotg210.yaml to yaml","To":"Corentin Labbe <clabbe.montjoie@gmail.com>","Cc":"devicetree@vger.kernel.org,\n        \"linux-kernel@vger.kernel.org\" <linux-kernel@vger.kernel.org>,\n        Linus Walleij <linus.walleij@linaro.org>","Content-Type":"text/plain; charset=\"UTF-8\"","Precedence":"bulk","List-ID":"<devicetree.vger.kernel.org>","X-Mailing-List":"devicetree@vger.kernel.org"}}]