From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C716AC5478A for ; Wed, 21 Feb 2024 19:15:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=uCb/5T4OmNfJ2LpToXMWmCJwp3roBs0MOhTBculH7XI=; b=iN/SGVd8mrU25K dcwvfeIK6l5hRcqSfVG7O0+ndX/wh1rsxbhVHYcUGeYE5D8F2Kr2yD6FQ3Rx97hj5JJVJ8S6f5cY3 yIz44jLE+vO0s/MvNPix+OJqGYSJM+7wya2l/tGu69EzdLfPfI/o16KVrRxkusbIAxsPF8Fwl7e/C 2NiUwIQDv7Ixi0AJvgpjaHDpU2movjcj+D7HBicvaWttMqmRMBYkIXDNQvHDs00e40JVQCE+14NkZ 7DyPOdaiMQV6AtQTUL+lr9aGeN/FEi2S1DpTMmAOtxqdabSo8Ar15NdWPryhOgBpebnFr6x6lO1Ab 72zOeVt1AbIiVOt+e67Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rcs3E-00000002EoQ-1b9S; Wed, 21 Feb 2024 19:14:40 +0000 Received: from mail-il1-x12a.google.com ([2607:f8b0:4864:20::12a]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rcs2y-00000002EhE-38ZE for linux-arm-kernel@lists.infradead.org; Wed, 21 Feb 2024 19:14:31 +0000 Received: by mail-il1-x12a.google.com with SMTP id e9e14a558f8ab-36519980c04so11435195ab.3 for ; Wed, 21 Feb 2024 11:14:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1708542854; x=1709147654; darn=lists.infradead.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=F8zo1lAc255qtifgNzkIgJxhJdd7u+u9JZEwC1bq2rM=; b=CPwt40yW1Ic6IMujpZR69lcImWWaWYkmHsrzG9Az05/rb1XwReBLvHtcIfa+1FXvt5 V1G3zJ/Zt3b3hSkbzmrLtNIf/SProhAuMtJEXo9RWE1+VnTb/7o781+XBeMG8DqERjx/ p49BqiGYekw/+KrYIlgNlEq3gDEaIv1M0+CE8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708542854; x=1709147654; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=F8zo1lAc255qtifgNzkIgJxhJdd7u+u9JZEwC1bq2rM=; b=ogDnG/xccYT8+Fil8kMTf4QrI4ENH20fGUzkzVDxyB3Vr1Hm5trm16xowaudDV29vp mxKrLOhn+Y7FWdyzz0IPSqm65X8Bc+d/RqdRfvgPPYpaRIP4MhE2QGekpYdbtfcw5VLC Wcw+T6Afqryhwm2kn/o8Yv7pbHQiycslKwbdSly8KQOZPXEtcP79jbfCwXfUMoWosaGu VMNUf6fh+xBjtb/Y7LDve1hrnmljA8rKHgGg9jE9MH5WxtfaiJ0ZLHpc/2F8EMtHe/Iq GZSoEOl3i7O9Cg1KbNLhVWHxbH6ICJtu0gaFa4H51jH6HQf/zrhm6cRiSQWTN2OGkoiR w82g== X-Forwarded-Encrypted: i=1; AJvYcCXM06f9YHh3S0nFnLTx/XoKvFa5Z2/vvcTRFRdHDVgRRzxN4kwun9fxIhJMWL6jqaG4AOpHSv3aSsDueQIUFAKHWkXQ1PomfUSRifv3C8HnUOOHklY= X-Gm-Message-State: AOJu0Yx8bTghocBAYZ+ZmeJB2t03Rh/KoHxK2ZYIrSkhXfZY0Yf1hPpC uJvVQhRP3uv53pgekwxk6WjeNh6ZL7mCLemltPgR4XOpmaCKXynOoSk0+q60jA== X-Google-Smtp-Source: AGHT+IFe6kiWbZW0h5n9v9hgmN46vZNuLBrbQZ0k9xGnJtql/CBhynZKD+fF5/hyYxlbaLjYE4SkGA== X-Received: by 2002:a05:6e02:12e6:b0:365:32db:ca6d with SMTP id l6-20020a056e0212e600b0036532dbca6dmr10729260iln.22.1708542853903; Wed, 21 Feb 2024 11:14:13 -0800 (PST) Received: from localhost (147.220.222.35.bc.googleusercontent.com. [35.222.220.147]) by smtp.gmail.com with UTF8SMTPSA id t41-20020a05663834a900b004716652f89asm2812188jal.130.2024.02.21.11.14.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 21 Feb 2024 11:14:13 -0800 (PST) Date: Wed, 21 Feb 2024 19:14:12 +0000 From: Matthias Kaehlcke To: Javier Carrasco Cc: Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Greg Kroah-Hartman , Helen Koike , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Catalin Marinas , Will Deacon , Russell King , linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, Matthias Kaehlcke Subject: Re: [PATCH v4 1/8] usb: misc: onboard_hub: rename to onboard_dev Message-ID: References: <20240220-onboard_xvf3500-v4-0-dc1617cc5dd4@wolfvision.net> <20240220-onboard_xvf3500-v4-1-dc1617cc5dd4@wolfvision.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240220-onboard_xvf3500-v4-1-dc1617cc5dd4@wolfvision.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240221_111424_981997_FB5403FB X-CRM114-Status: GOOD ( 38.85 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Feb 20, 2024 at 03:05:45PM +0100, Javier Carrasco wrote: > This patch prepares onboad_hub to support non-hub devices by renaming > the driver files and their content, the headers and their references. > > The comments and descriptions have been slightly modified to keep > coherence and account for the specific cases that only affect onboard > hubs (e.g. peer-hub). > > The "hub" variables in functions where "dev" (and similar names) variables > already exist have been renamed to onboard_dev for clarity, which adds a > few lines in cases where more than 80 characters are used. > > No new functionality has been added. > > Signed-off-by: Javier Carrasco > --- > ...-usb-hub => sysfs-bus-platform-onboard-usb-dev} | 4 +- > MAINTAINERS | 4 +- > drivers/usb/core/Makefile | 4 +- > drivers/usb/core/hub.c | 8 +- > drivers/usb/core/hub.h | 2 +- > drivers/usb/misc/Kconfig | 16 +- > drivers/usb/misc/Makefile | 2 +- > drivers/usb/misc/onboard_usb_dev.c | 518 +++++++++++++++++++++ > .../misc/{onboard_usb_hub.h => onboard_usb_dev.h} | 28 +- > ...ard_usb_hub_pdevs.c => onboard_usb_dev_pdevs.c} | 47 +- > drivers/usb/misc/onboard_usb_hub.c | 501 -------------------- > include/linux/usb/onboard_dev.h | 18 + > include/linux/usb/onboard_hub.h | 18 - > 13 files changed, 594 insertions(+), 576 deletions(-) > > diff --git a/Documentation/ABI/testing/sysfs-bus-platform-onboard-usb-hub b/Documentation/ABI/testing/sysfs-bus-platform-onboard-usb-dev > similarity index 67% > rename from Documentation/ABI/testing/sysfs-bus-platform-onboard-usb-hub > rename to Documentation/ABI/testing/sysfs-bus-platform-onboard-usb-dev > index 42deb0552065..cd31f76362e7 100644 > --- a/Documentation/ABI/testing/sysfs-bus-platform-onboard-usb-hub > +++ b/Documentation/ABI/testing/sysfs-bus-platform-onboard-usb-dev > @@ -4,5 +4,5 @@ KernelVersion: 5.20 > Contact: Matthias Kaehlcke > linux-usb@vger.kernel.org > Description: > - (RW) Controls whether the USB hub remains always powered > - during system suspend or not. > \ No newline at end of file > + (RW) Controls whether the USB device remains always powered > + during system suspend or not. With patch "[2/8] usb: misc: onboard_dev: add support for non-hub devices" this attribute isn't honed for non-hub devices. With that I'd say leave the existing comment unchanged, but add a note that this attribute only exists for hubs. That will also require a change in the patch mentioned above to omit the creation of the attribute for non-hub devices. > diff --git a/drivers/usb/misc/onboard_usb_dev.c b/drivers/usb/misc/onboard_usb_dev.c > new file mode 100644 > index 000000000000..2103af2cb2a6 > --- /dev/null > +++ b/drivers/usb/misc/onboard_usb_dev.c > > ... > > +/* > + * Returns the onboard_dev platform device that is associated with the USB > + * device passed as parameter. > + */ > +static struct onboard_dev *_find_onboard_dev(struct device *dev) > +{ > + struct platform_device *pdev; > + struct device_node *np; > + struct onboard_dev *onboard_dev; > + > + pdev = of_find_device_by_node(dev->of_node); > + if (!pdev) { > + np = of_parse_phandle(dev->of_node, "peer-hub", 0); > + if (!np) { > + dev_err(dev, "failed to find device node for peer hub\n"); > + return ERR_PTR(-EINVAL); > + } > + > + pdev = of_find_device_by_node(np); > + of_node_put(np); > + > + if (!pdev) > + return ERR_PTR(-ENODEV); > + } > + > + onboard_dev = dev_get_drvdata(&pdev->dev); > + put_device(&pdev->dev); > + > + /* > + * The presence of drvdata ('hub') indicates that the platform driver drop "('hub')" > diff --git a/drivers/usb/misc/onboard_usb_hub_pdevs.c b/drivers/usb/misc/onboard_usb_dev_pdevs.c > similarity index 69% > rename from drivers/usb/misc/onboard_usb_hub_pdevs.c > rename to drivers/usb/misc/onboard_usb_dev_pdevs.c > index ed22a18f4ab7..ca56f67393f1 100644 > --- a/drivers/usb/misc/onboard_usb_hub_pdevs.c > +++ b/drivers/usb/misc/onboard_usb_dev_pdevs.c > > ... > > /** > - * onboard_hub_create_pdevs -- create platform devices for onboard USB hubs > - * @parent_hub : parent hub to scan for connected onboard hubs > - * @pdev_list : list of onboard hub platform devices owned by the parent hub > + * onboard_dev_create_pdevs -- create platform devices for onboard USB devices > + * @parent_hub : parent hub to scan for connected onboard devices > + * @pdev_list : list of onboard platform devices owned by the parent hub > * > - * Creates a platform device for each supported onboard hub that is connected to > - * the given parent hub. The platform device is in charge of initializing the > - * hub (enable regulators, take the hub out of reset, ...) and can optionally > - * control whether the hub remains powered during system suspend or not. > + * Creates a platform device for each supported onboard device that is connected > + * to the given parent hub. The platform device is in charge of initializing the > + * device (enable regulators, take the device out of reset, ...) and can > + * optionally control whether the device remains powered during system suspend > + * or not. The last part isn't/won't be true for non-hub devices. Please change it to something like ". For onboard hubs the platform device can optionally control ..." _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel