Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2177326rwb; Mon, 7 Nov 2022 10:03:25 -0800 (PST) X-Google-Smtp-Source: AMsMyM7RKm5icOYJvlmHPym6/RTV6IirbV+pVLkngMiX/ekZMyLWUZ1FLJBQZAqMusyp9nvNUghj X-Received: by 2002:a50:fd94:0:b0:461:5131:d3c with SMTP id o20-20020a50fd94000000b0046151310d3cmr50226421edt.112.1667844205538; Mon, 07 Nov 2022 10:03:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667844205; cv=none; d=google.com; s=arc-20160816; b=BgDGT9SUmBCisRpF/jwVQnYjFLFo7JfX6VW82NoT9rk8Iy6hxIpzss5w/qWsawh1wM qiObbAyOKeCnadu0ivpg3SqZnOJeF9hFuPia1vByDgC5m0vTwMJPw2u60BA3SVFX/CM8 Wo8C1y3Ui5jWsK8lJvff6v3tRudwjed2qzJF7nqz9OalzWI1GnK/MAVka2Ga6AzquQIa Q9znhUdho1SuTS7XpHt6lAcs4exXGQrk6SpiGMHq06GgOJ5ruHFM7f/iJIucix/BFNJC vkpmIngjoFJOtlpGwd8CXUnLCA1RHUlbVoIokR5FKClsuT/k6XabaHoG+gYt9LgEj0sh Q3Cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=Zv+yUunUjsjy2ElQRsQJL+bVnY9BR/J89WhE/UA/CSM=; b=ysoBtamLxxLz+IHFu0BZB97W2ZMm8Kgcv7eFGqLe59Jjx3qVmEyeKRqaMGT+XkwsBh RUnSHR6IeI8UDnUBeABLQsPYFpkg1KQKTTmBDTeoGKteDjrcnEKga8I6lfMEiU0V7iKW mG3zxnfDSJW5N8FeatPkTH5idPBrvE/Ev1Z03jcgeO4Gf5vQTtIgra2HJqem/sbyMyOA uEAQTIrasxxQAofPciBNnr43UpY6y0zoWZFDGv7migEYISZZepnbeHSigUyMZVGQLtOM gF2fWZ4ONq5KfmTQKXFyv7TYbrAdGLcDVocOp2DdCcU5qvun7OrWog6pT/Un5hzVpoKB BUtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=gGVonuLc; 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=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hp25-20020a1709073e1900b00782b261ea21si11900204ejc.729.2022.11.07.10.03.02; Mon, 07 Nov 2022 10:03:25 -0800 (PST) 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=@bootlin.com header.s=gm1 header.b=gGVonuLc; 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=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232704AbiKGR04 (ORCPT + 92 others); Mon, 7 Nov 2022 12:26:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232881AbiKGR0v (ORCPT ); Mon, 7 Nov 2022 12:26:51 -0500 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA76323BEB; Mon, 7 Nov 2022 09:26:49 -0800 (PST) Received: (Authenticated sender: herve.codina@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id A023C24000A; Mon, 7 Nov 2022 17:26:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1667842007; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Zv+yUunUjsjy2ElQRsQJL+bVnY9BR/J89WhE/UA/CSM=; b=gGVonuLcssp6dLp7SlC1kwVDa35VVpmaTyA4BQ+tc43/U6b2FhrXPTp7Qw19hfxwslGtuB omk03iWiaTXKAl2+wbgcZ7mJJ1eDHuoKqKERRQIplI+QJg+vD5GjXb58ey3fmgSeGnwQx0 fcnEap3BQkwsXWZj2menKRqe5BPjBahPjbAcgxQf5FxrviqgI5+vKFOlV+QDM0dmnD+4n9 9wBd5FZwMHpVbhrY3wziYE1svF0mLr9+4lD+hKJ4JI37S4o+msPn/iutZ0+l0liDhRGLlU /hKEtywwQouaGOvt9AkiXbXr6RDJx+72CDSY6yti5y6gQ+rd+lW2yafzI51n7w== Date: Mon, 7 Nov 2022 18:26:42 +0100 From: Herve Codina To: Geert Uytterhoeven Cc: Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Greg Kroah-Hartman , Magnus Damm , Gareth Williams , linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, Thomas Petazzoni , Miquel Raynal Subject: Re: [PATCH 2/7] dt-bindings: clock: renesas,r9a06g032-sysctrl: Add h2mode property Message-ID: <20221107182642.05a09f2f@bootlin.com> In-Reply-To: References: <20221107135825.583877-1-herve.codina@bootlin.com> <20221107135825.583877-3-herve.codina@bootlin.com> Organization: Bootlin X-Mailer: Claws Mail 4.1.0 (GTK 3.24.34; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS 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 Hi Geert, On Mon, 7 Nov 2022 16:14:10 +0100 Geert Uytterhoeven wrote: > Hi Herv=C3=A9, >=20 > On Mon, Nov 7, 2022 at 2:59 PM Herve Codina wr= ote: > > Add the h2mode property to force the USBs mode ie: > > - 2 hosts > > or > > - 1 host and 1 device > > > > Signed-off-by: Herve Codina =20 >=20 > Thanks for your patch! >=20 > > --- a/Documentation/devicetree/bindings/clock/renesas,r9a06g032-sysctrl= .yaml > > +++ b/Documentation/devicetree/bindings/clock/renesas,r9a06g032-sysctrl= .yaml > > @@ -39,6 +39,16 @@ properties: > > '#power-domain-cells': > > const: 0 > > > > + renesas,h2mode: > > + description: | > > + Configure the USBs mode. > > + - <0> : the USBs are in 1 host and 1 device mode. > > + - <1> : the USBs are in 2 host mode. > > + If the property is not present, the value used is the one alread= y present > > + in the CFG_USB register (from reset or set by the bootloader). > > + $ref: /schemas/types.yaml#/definitions/uint32 > > + enum: [0, 1] > > + > > '#address-cells': > > const: 1 =20 >=20 > While the H2MODE register bit is indeed located in the sysctrl's > address space, and handling it here makes it simpler for the drivers > (especially w.r.t. the default handling), this is really a property > of the switchable usbh/f core... > Perhaps it can be moved there? Or not? Moving the property outside sysctrl (and so its handling) will not be that easy especially if some more operations are needed (as you mention in your patch 3/4 review). Not sure about what is the best thing to do. (a) Keep it simple and stay in sysctrl or (b) Create an usb_role_switch driver. >=20 > Gr{oetje,eeting}s, >=20 > Geert >=20 > -- > Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m6= 8k.org >=20 > In personal conversations with technical people, I call myself a hacker. = But > when I'm talking to journalists I just say "programmer" or something like= that. > -- Linus Torvalds --=20 Herv=C3=A9 Codina, Bootlin Embedded Linux and Kernel engineering https://bootlin.com