Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1292331rwd; Thu, 1 Jun 2023 13:19:19 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4Tto2O7CoDBRzTADUOtJnNzISA4KNtpsjSHLIJl8YZHtHEA2R0dNHRra8RQGf2gMGpo4ds X-Received: by 2002:a05:6a20:e30b:b0:10c:5745:3f4e with SMTP id nb11-20020a056a20e30b00b0010c57453f4emr6656364pzb.56.1685650758728; Thu, 01 Jun 2023 13:19:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685650758; cv=none; d=google.com; s=arc-20160816; b=mzYPP3Z45pOq2S4B7AnQhaU1nwdYghHCrthxzfqL8/rIn5HDCDAFYjS3x7/KlKFN2d 3qgCBwCVJL7MKHTQyphz7MBgBuYY3PRPb7hAAWN4xCi1UlTjHhvxa/RjkXslZnZQzXUH jciqoXddKkWgPGz5hxfa2CFA4frV2UYhp+Ic513FVoWl07+Fdtg/o1hFfRDDOFMwHCp8 fIqxL22/VmniUeDUXvSGYN6DUYTEZRH44Tp6SPv4OIN1K+6Sujz25eqGdQLHBQPxOd73 IqlEUWo5cvZSYWEJ8JJVoIS0j1TaRbEScREn/q/h3+ZX/YOh4xB9JbrYkxtQvhMHIPQY I9og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=KysOIp+DLkvCtVTpWEdgo1yuV/FINp+fShtftYKw8rI=; b=kGOIrCPbUfgTjV00xE7DrKS46/9RJWnA5Tx7qwSNCwY0ULIlrqR+EKfwAS6jJ8yU2z WIwJjP2qF5slyt+HnLlrqgnoJ0ahu30ud4ReuVBtSRGz1ER2p5wT5ZSyDIGGnr9FJobf dAdFX9ax63/xPWEbaTp1vldIsLzTFdpj3trNfj/FdntK220098fLo/pw0lL5oRnT+qgy w9n15g3IzPj8wbQcdaHOWwYq2biNpgIS/a05uR9xDosH8zNuaplVTyi4xUuEFBJG+zmi iU6DVbKKVSjy4ZToPyvHc7J264uRoNsvNmkm+JR31T0fJqfg+QOm0Y77ZoTPOrnc2cYB voug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="UVty/Lni"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j22-20020a637a56000000b00518cf8916e2si3436936pgn.415.2023.06.01.13.19.04; Thu, 01 Jun 2023 13:19:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="UVty/Lni"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S231303AbjFAUNn (ORCPT + 99 others); Thu, 1 Jun 2023 16:13:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230268AbjFAUNm (ORCPT ); Thu, 1 Jun 2023 16:13:42 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03A251A1; Thu, 1 Jun 2023 13:13:41 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 828FB646C7; Thu, 1 Jun 2023 20:13:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 51289C43443; Thu, 1 Jun 2023 20:13:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685650420; bh=DCSJXIhqlYYsF0jNkPfKzV5MfwJ9SAulhFSDDwt8Qu0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=UVty/LniZ4Eoxr0CcFWpQoP2bAkQ1mhsCOQqj4ha1ew5zBwoHHjDYmCdN/Ak2d/dJ cjMdf+VqC2k8mlHM97czldDGclv4vyblevvuCSZdMiF5oBc0G0ehqJArE/0N6gl6Hb H7EeaAkIY1SDGnH5Qh8VLw8i3mj2MRMIGw41D2HAuIciKuMBHWBKcvYi+ctUaO7Mpx d3fsqN8NZ0H+z4Ruz7X9YhWYVS4qKEX5/SqVNxi4lSO+Cgb3/XpdwvKZ+KHGctcOqV l4+uHUlRWAHFh2fLi7C7p2XCoAh1kyI2Birw2cGQu/wwzivUTcIpJwAg9rSVgnSzxN 8tFGadTrIX/DA== Date: Thu, 1 Jun 2023 21:13:33 +0100 From: Conor Dooley To: Stanley =?utf-8?B?Q2hhbmdb5piM6IKy5b63XQ==?= Cc: Conor Dooley , Greg Kroah-Hartman , Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Alan Stern , Flavio Suligoi , Mathias Nyman , Douglas Anderson , Matthias Kaehlcke , Ray Chi , Michael Grzeschik , "linux-phy@lists.infradead.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-usb@vger.kernel.org" Subject: Re: [PATCH v2 3/3] dt-bindings: phy: realtek: Add the doc about the Realtek SoC USB 2.0/3.0 PHY Message-ID: <20230601-starry-nurture-5aecf1f332ac@spud> References: <20230525022617.30537-1-stanley_chang@realtek.com> <20230525022617.30537-3-stanley_chang@realtek.com> <20230529-impurity-dismount-bca5c9100c9b@spud> <44015844858c42a79e0e7f9207d01496@realtek.com> <202305310146.34V1kevI7026106@rtits1.realtek.com.tw> <96a7905208c148debe3791636034a038@realtek.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="oafWaJor0Kq+VBSZ" Content-Disposition: inline In-Reply-To: <96a7905208c148debe3791636034a038@realtek.com> X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --oafWaJor0Kq+VBSZ Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 01, 2023 at 02:24:28AM +0000, Stanley Chang[=E6=98=8C=E8=82=B2= =E5=BE=B7] wrote: > Hi Conor, >=20 > > > > You have device-specific compatibles, which is great, but you also = allow > > > > only those two generic ones. I had a _brief_ look at the driver, an= d it > > > > seems like there is no decision making done based on the compatible= s, > > > > only on the properties. Is that correct? > > > > If it is, I would understand having "realtek,usb3phy" as a fallback > > > > compatible for "realtek,rtd1619-usb3phy", but I do not get the curr= ent > > > > setup. > > > > > > This driver is compatible with all Realtek RTD SoCs without specifyin= g different settings. > > > So use "realtek,usb3phy" as fallback compatible for all SoCs. > > > This is the compatible name we use. > > > Other compatible names simply indicate that the driver supports the S= oCs. > >=20 > > Then you should write the binding such that having fallback compatibles > > is permitted. Try plugging > > compatible =3D "realtek,rtd1295-usb2phy", "realtek,rtd-usb2phy", "realt= ek,usb2phy"; > > into your example below and see what happens. > >=20 > > > The name "usbNphy" and "rtd-usbNphy" seem to be more generic for all = RTD SoCs, > > > but they are not device-specific compatible. > > > Do you have a better suggestion? > >=20 > > Write the binding so that having fallback compatibles in the DT actually > > works, don't add the SoC-specific ones merely as indicators that those > > SoCs are supported and don't permit "realtek,usbNphy" or > > "realtek,rtd-usbNphy" in isolation ;) > > >=20 > As far as I understand what you mean. > I should follow other docs to define compatible. > Reference: > Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml > drivers/phy/mediatek/phy-mtk-xsphy.c >=20 > For example: >=20 > compatible: > items: > - enum: > - realtek,rtd1295-usb2phy > - realtek,rtd1395-usb2phy > - realtek,rtd1619-usb2phy > - realtek,rtd1319-usb2phy > - realtek,rtd1619b-usb2phy > - realtek,rtd1312c-usb2phy > - realtek,rtd1319d-usb2phy > - realtek,rtd1315e-usb2phy > - const: realtek,usb2phy >=20 > examples: > - > dwc3_u3drd_usb2phy: dwc3_u3drd_usb2phy@98013e14 { > compatible =3D "realtek,rtd1319-usb2phy", "realtek,usb2phy"; > =20 > And use only "Realtek, usb2phy" in the driver. > static const struct of_device_id usbphy_rtk_dt_match[] =3D { > { .compatible =3D "realtek,usb2phy", }, > {}, > }; Yes, this would be a vast improvement, thanks. --oafWaJor0Kq+VBSZ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZHj77QAKCRB4tDGHoIJi 0rr9AQCJvO7utcVmJn6jLUWkmuB24q/OS1WxIkdUIU9nFqMwCAEAjyvUtBKHzjkE 0gbFxWfaaRIrhWYzxPppdQHgaYpl2QU= =mWjQ -----END PGP SIGNATURE----- --oafWaJor0Kq+VBSZ--