Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp6975381rwb; Tue, 15 Nov 2022 06:12:39 -0800 (PST) X-Google-Smtp-Source: AA0mqf4YD2DC5z4zeBEjs0fhlHnJqZayqy5LsLTMIuogCf+aK920ymuG1ryFiCH2/T2O0wzdtcDh X-Received: by 2002:a17:902:aa4c:b0:170:f343:ba14 with SMTP id c12-20020a170902aa4c00b00170f343ba14mr4251853plr.70.1668521559146; Tue, 15 Nov 2022 06:12:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668521559; cv=none; d=google.com; s=arc-20160816; b=l8f1MNUqO3hdaWoekiQJLwWCicDJRmjNMN473riy/hT/r9vVxHGXFFVEP/w1KrQhui vZLqKef1Jr4KWdWUiWkbKBvada80vLDN4M8d5Br9U8hFh88IhI9xERihmzc9Pcmr9f3z 9swTJHRQfhboJrpAMDEol4MmfZndgMcfrlD8ABL9PMQHFxI6fA82Axb23HxKTfG875QY t4nJ2GAlQ5xS8uqiDnY0xHWgyaXtONvkZ5w1wIbwpSNVZrtM8Xhl9qLb+ZqJb7tHNu/M kKAKy77yLrP48g4S4aA+vI/W0LFOoUC0Jw+oeAT3+B4gRx3GDb74dYp18BiXjDhovPup jSuA== 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=m52RNtELDDNqeiQtokfOg67uyM39sRsLuDiZvZRE3B0=; b=Uzsw3GfstvG+lyNP7jsUC2NEh2dhz5oeTB8KTwKJeRzf65Ap1GP2O+WhfMrdc2ykt8 b5QAdYmZaGVkJuXN8IJx8iuq1MkqQfe0xfq+Fhu0RMdo6l9GLRppvji8ZcPvcLExUSaX rEUE/KzHmIVyIlM/8UcUpQl0TCwdOGaMBZo1nK4f1h8lmLoeVHef3oBxmeijxsWnDsmt T/nOoCiq7sTSWGUmv/gElXLFmjngWVhya8m9AcLzT39MUsMbW3EXfD8EG6Wmy1EIcRIi vroDo9Y922q5tlHbN2g4u5Lr8hxIHAEi8+P9h+QXxK/N1Wwr9u5ykLqABWs86PenrvVb 9wEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=NudmAyB0; 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 m5-20020a1709026bc500b001784c98bfddsi11700326plt.24.2022.11.15.06.12.26; Tue, 15 Nov 2022 06:12:39 -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=NudmAyB0; 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 S238551AbiKOOEi (ORCPT + 89 others); Tue, 15 Nov 2022 09:04:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231294AbiKOOEe (ORCPT ); Tue, 15 Nov 2022 09:04:34 -0500 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::221]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 246AD2B249; Tue, 15 Nov 2022 06:04:27 -0800 (PST) Received: (Authenticated sender: herve.codina@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 80E43240007; Tue, 15 Nov 2022 14:04:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1668521066; 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=m52RNtELDDNqeiQtokfOg67uyM39sRsLuDiZvZRE3B0=; b=NudmAyB06AsNNnCsJt4iwJTc6oYb518K4zCuIOTgbH8Jph8xyl9lERBCB2rnRwhIGlKBQp 0SCkDrVS9j7Y6KCJBn7R/kjc9dvG7aYqFHfIRuJSmjqhK2bOqQeAl44Si8MpfBCh22fcNk NlRqtIHOgh45m2guJrdSSJ7SxCHrVVUvxxzkG6xjm6yA9uxRs9d4YUexh8zpT6WRdv0RTk PGhDPkAejvpA8OGDZ98Mz+prO9BXnSRl7YWadgkJb8aicuF1+vFP11gcp+xcyUH9SQ0rym SAsKehe8H7y8d99gTxn8KMhegCxtNBHK1+2Xsdo4DLgiWtxwdUHLQ2QRvebGqQ== Date: Tue, 15 Nov 2022 15:04:17 +0100 From: Herve Codina To: Krzysztof Kozlowski Cc: Geert Uytterhoeven , 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 v2 2/7] dt-bindings: clock: renesas,r9a06g032-sysctrl: Add h2mode property Message-ID: <20221115150417.513955a7@bootlin.com> In-Reply-To: References: <20221114111513.1436165-1-herve.codina@bootlin.com> <20221114111513.1436165-3-herve.codina@bootlin.com> Organization: Bootlin X-Mailer: Claws Mail 4.1.1 (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,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 Krzysztof, On Tue, 15 Nov 2022 14:07:52 +0100 Krzysztof Kozlowski wrote: > On 15/11/2022 14:05, Krzysztof Kozlowski wrote: > > On 14/11/2022 12:15, Herve Codina wrote: =20 > >> Add the h2mode property to force the USBs mode ie: > >> - 2 hosts > >> or > >> - 1 host and 1 device > >> > >> Signed-off-by: Herve Codina > >> --- > >> .../bindings/clock/renesas,r9a06g032-sysctrl.yaml | 10 ++++++++++ > >> 1 file changed, 10 insertions(+) > >> > >> diff --git a/Documentation/devicetree/bindings/clock/renesas,r9a06g032= -sysctrl.yaml b/Documentation/devicetree/bindings/clock/renesas,r9a06g032-s= ysctrl.yaml > >> index 95bf485c6cec..f9e0a58aa4fb 100644 > >> --- a/Documentation/devicetree/bindings/clock/renesas,r9a06g032-sysctr= l.yaml > >> +++ b/Documentation/devicetree/bindings/clock/renesas,r9a06g032-sysctr= l.yaml > >> @@ -39,6 +39,16 @@ properties: > >> '#power-domain-cells': > >> const: 0 > >> =20 > >> + 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 alrea= dy present > >> + in the CFG_USB register (from reset or set by the bootloader). > >> + $ref: /schemas/types.yaml#/definitions/uint32 > >> + enum: [0, 1] =20 > >=20 > > 0/1 are quite cryptic. Why not making it a string which is easy to read > > and understand? Can be something like "two-hosts" and "one-host". Or > > anything you find more readable... =20 >=20 > ...but actually you should rather make it a property of your USB > controller, not clock controller. You have two controllers and we have a > generic property for them - dr_mode. >=20 > Best regards, > Krzysztof >=20 IMHO, this property in the USB controllers does not make sense. Indeed each controller cannot have a different 'mode'. Some controllers are USB host only (EHCI and OHCI) and the USBF controller I worked on is device only. 'h2mode' allows to choose between host or device on one of the USB but not at the USB controller level. This property should be handle outside the USB controller nodes. Currently, this node (declared as a clock node) is in fact a sysctrl node and can do some configuration not related to clocks. I agree with you something related to choosing USB Host/Device in a clock node seems strange. Some discussion were already opened related to this property and how to handle it: https://lore.kernel.org/all/20221107182642.05a09f2f@bootlin.com/ https://lore.kernel.org/all/20221107173614.474707d7@bootlin.com/ Regards, Herv=C3=A9 --=20 Herv=C3=A9 Codina, Bootlin Embedded Linux and Kernel engineering https://bootlin.com