Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4448573rdb; Mon, 11 Dec 2023 22:23:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IEipx+J1zXIa5wu7dqi89x1SUdMSaqJdV3mn5mI8Gg8AtuukbWnqotA2OdJ4Pt+n4wgc4Nb X-Received: by 2002:a81:84c8:0:b0:5d3:9f4d:dae0 with SMTP id u191-20020a8184c8000000b005d39f4ddae0mr3591858ywf.24.1702362199460; Mon, 11 Dec 2023 22:23:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702362199; cv=none; d=google.com; s=arc-20160816; b=MhpC6Ru3R+lPiL7q7ILmh1Ke1SVax8yemF8AWL4AihnidAALI1iensT79dN4YZNpR0 oA6c4VdhDCcgFFyfGKX0Zh+ReLZq7hYLOdTHaSVzzvwJxvVTtvBXSiRjAxEE/4F2h7dg uWcP+NBOPvO41t/rsIh1/ERKA13KCweLie5xE+Xi9O4cMxM0ztoq/HfZEU/7AwQL4NOv egj+znwmHyNaR8kE/6gQBc9LXnhAuKess2hWAgiVeYZ6L3t+Ma5xmVZCX5/C8e1yZ+FK Y5iO99XHZlcl6p9NBoMcbaIbD3F99j2viewsGH8IDsDqGa1c+GgdAobRoT9rE6KK7BBJ uXGA== 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=trvLPWdMf9ONBuz1cwMATx3gpPUiFzy4m+MU7IJ3tNw=; fh=n/7IIMEPNzp8MW81ND8IieOthIwlJjNyqWfdSXDNTbM=; b=ZTLEN8f2Rmz/9R8ME2aYVSSraeJauEtHErbZXeSa9+GzW1g64waIGnIffQ5+l90uNg Axy4nYzzw+/fceEwqAJQQN/JHyk8i9zNtkVJwQRxoGF1fHn23ICyBn4yHPs7SF3Ps+m+ gGSEvOr3v46vpm/GzeFmf1vRMfBIMpYxAVZTnNRsiFDYbyCq4/ICEfIoy9LVvqLlEaDG uoIcuYazRNJlCnG+SFNi29+IHMGpZD1alfuxDGz+z70l2YTfL6noY5uPpqBpl+JOzM4m gHguMl/NdKnH25dbQ/PSjPlZQONNXQ3r9easFgz3FKNpyh7ztXqpvPPAm5PQBN5cUSGn gpRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=GeMJuoqa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id d5-20020a170902654500b001d06d5f9ad1si7340043pln.59.2023.12.11.22.23.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 22:23:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=GeMJuoqa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 9809D8057942; Mon, 11 Dec 2023 22:23:16 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230070AbjLLGXB (ORCPT + 99 others); Tue, 12 Dec 2023 01:23:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229455AbjLLGW7 (ORCPT ); Tue, 12 Dec 2023 01:22:59 -0500 Received: from mail-oa1-x34.google.com (mail-oa1-x34.google.com [IPv6:2001:4860:4864:20::34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78361C3; Mon, 11 Dec 2023 22:23:05 -0800 (PST) Received: by mail-oa1-x34.google.com with SMTP id 586e51a60fabf-1fab887fab8so4026973fac.0; Mon, 11 Dec 2023 22:23:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702362185; x=1702966985; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=trvLPWdMf9ONBuz1cwMATx3gpPUiFzy4m+MU7IJ3tNw=; b=GeMJuoqaSXmh1ZQcy0Stc32bnyJK3eQoMQwldFaC+OQU2kmeiQfapaKxsyjVYTKNjG 1Uv3p0JbVyKNXzD/2JyjylVM1l0AqWKD8JxtP1vFYaIM4HcwiaOtu90jnD9PYKxcWxNh +sDg/gDWxd3KpiveNOnYQDXwrhTggdSt6gI3uncqWXOH+lXRayZVOhiJowBuDdymwa2D OGeVIXtVbi3MgULtrxK5ZtTQfIBq39i/D1dyhHyICQSBoozfpMAnHmkXupn/4Q87/09g 0+PwGoKob+g7aqsFjVoVS/XkFmXLYUucDDyfndcANmX2oiFZY8T1OISxNlTuRxKNwP1Q znmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702362185; x=1702966985; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=trvLPWdMf9ONBuz1cwMATx3gpPUiFzy4m+MU7IJ3tNw=; b=G23yMl1XOO/ExhjHCPxc+PKXqui9FuvsiTllnPdvyW8YWeGXy5nEoT/CiMfx8hoiCT tZ4UYVrcx8ScRzfL3qD3AQnxDK392ni1wQ+k36ufnWCJ4RItX5kr/AsLo0sZf/86lAmF tjbSeLSF6s/+OdnL+Hsu04f72jU2mVvqhVLYI4Y3wV4+6ClgSu7Q+PWfKtrkzgE151dX I8YRGK29HjRdHfEB0uKqVwWc0fhWAHZieW4+tXLxMS/SQI+/LfhcklL/SME0Y3CFphSD 29lZaJk30Kwf1OVqDJnLWtez8YLxeWl77gF40sQcBX0914ozJQcmkRC+wEQT7mxqiaVn NAJQ== X-Gm-Message-State: AOJu0Yzrk5tNpqptHyrIjD7K0gkTnu9Iigxv4qftDDNM5LutOVO+cV6M p1WhqMcpPnSpbaho4iim+B07MRUwp4iHzctGHTI= X-Received: by 2002:a05:6870:70a4:b0:1fb:75c:4016 with SMTP id v36-20020a05687070a400b001fb075c4016mr7403693oae.118.1702362184693; Mon, 11 Dec 2023 22:23:04 -0800 (PST) MIME-Version: 1.0 References: <20231204144429.45197-1-linux.amoon@gmail.com> <20231204144429.45197-2-linux.amoon@gmail.com> <20231206135311.GA2043711-robh@kernel.org> <21673bfd-bb87-4c7d-a53f-337c263f3a00@linaro.org> <604e653d-c1e2-45c7-b121-8a6b4be5c6bb@linaro.org> <1a78d453-62a2-410a-a40f-1ff0c2b62e86@linaro.org> <2e688f4e-11d7-4f8e-b8ec-58f4a97304a8@linaro.org> In-Reply-To: <2e688f4e-11d7-4f8e-b8ec-58f4a97304a8@linaro.org> From: Anand Moon Date: Tue, 12 Dec 2023 11:52:48 +0530 Message-ID: Subject: Re: [PATCH v6 1/2] dt-bindings: usb: Add the binding example for the Genesys Logic GL3523 hub To: Krzysztof Kozlowski Cc: Rob Herring , Greg Kroah-Hartman , Krzysztof Kozlowski , Conor Dooley , Icenowy Zheng , Neil Armstrong , linux-amlogic@lists.infradead.org, Conor Dooley , linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 11 Dec 2023 22:23:16 -0800 (PST) Hi Krzysztof, On Fri, 8 Dec 2023 at 17:47, Krzysztof Kozlowski wrote: > > On 08/12/2023 12:19, Anand Moon wrote: > > Hi Krzysztof, > > > > On Fri, 8 Dec 2023 at 13:14, Krzysztof Kozlowski > > wrote: > >> > >> On 08/12/2023 01:24, Anand Moon wrote: > >>>>>>> > >>>>>>> If I move reset-gpios to required, I observe the below warning. > >>>>>>> > >>>>>>> DTC_CHK Documentation/devicetree/bindings/usb/maxim,max33359.example.dtb > >>>>>>> /home/alarm/linux-amlogic-5.y-devel/Documentation/devicetree/bindings/usb/usb-device.example.dtb: > >>>>>>> hub@1: 'reset-gpio' is a required property > >>>>>>> from schema $id: http://devicetree.org/schemas/usb/genesys,gl850g.yaml# > >>>>>> > >>>>>> Where are the properties defined? If you open the binding you see: > >>>>>> nowhere. You cannot define properties in some variant with "true". > >>>>>> Please define all of them in top-level and only narrow/constrain when > >>>>>> applicable. > >>>>>> > >>>>> What I meant is the example below, required meant applicable for both > >>>>> the binding > >>>>> But it shows me the above warning. > >>>> > >>>> My explanation stands... So again: > >>>> > >>>>>> Please define all of them in top-level and only narrow/constrain when > >>>>>> applicable. > >>>> > >>> Apologies, But I have tried this multiple times but have not been able > >>> to fix the device tree warning > >> > >> Did you document all properties in top-level "properties:" block? > >> > > Yes, I have, > > > > Can you suggest a couple of examples to follow? > > I looked at some of the YAML files but could not fix my issue. > > 99% of bindings. Look also at example-schema. > > You can also attach here complete patch for fast look / short review. > Please find the modified patch, I have tried a few things but none resolve the binding warning. I am not able to debug this. -Thanks Anand -----8<----------8<----------8<----------8<----------8<----------8<----- diff --git a/Documentation/devicetree/bindings/usb/genesys,gl850g.yaml b/Documentation/devicetree/bindings/usb/genesys,gl850g.yaml index ee08b9c3721f..7f75fa3c1945 100644 --- a/Documentation/devicetree/bindings/usb/genesys,gl850g.yaml +++ b/Documentation/devicetree/bindings/usb/genesys,gl850g.yaml @@ -9,9 +9,6 @@ title: Genesys Logic USB hub controller maintainers: - Icenowy Zheng -allOf: - - $ref: usb-device.yaml# - properties: compatible: enum: @@ -27,11 +24,47 @@ properties: vdd-supply: description: - the regulator that provides 3.3V core power to the hub. + The regulator that provides 3.3V or 5.0V core power to the hub. + + peer-hub: + $ref: /schemas/types.yaml#/definitions/phandle + description: + For onboard hub controllers that support USB 3.x and USB 2.0 hubs with + shared resets and power supplies, this property is used to identify the + hubs with which these are shared. required: - compatible - reg + - vdd-supply + - reset-gpios + - peer-hub + +allOf: + - $ref: usb-device.yaml# + + - if: + properties: + compatible: + contains: + enum: + - usb5e3,608 + then: + properties: + peer-hub: false + vdd-supply: false + + - if: + properties: + compatible: + contains: + enum: + - usb5e3,610 + - usb5e3,620 + then: + properties: + peer-hub: true + vdd-supply: true additionalProperties: false @@ -49,3 +82,29 @@ examples: reset-gpios = <&pio 7 2 GPIO_ACTIVE_LOW>; }; }; + + - | + #include + usb { + dr_mode = "host"; + #address-cells = <1>; + #size-cells = <0>; + + /* 2.0 hub on port 1 */ + hub_2_0: hub@1 { + compatible = "usb5e3,610"; + reg = <1>; + peer-hub = <&hub_3_0>; + reset-gpios = <&gpio 20 GPIO_ACTIVE_LOW>; + vdd-supply = <&vcc_5v>; + }; + + /* 3.1 hub on port 4 */ + hub_3_0: hub@2 { + compatible = "usb5e3,620"; + reg = <2>; + peer-hub = <&hub_2_0>; + reset-gpios = <&gpio 20 GPIO_ACTIVE_LOW>; + vdd-supply = <&vcc_5v>; + }; + };