From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
To: Sebastian Reichel <sebastian.reichel@collabora.com>
Cc: Vinod Koul <vkoul@kernel.org>,
Manivannan Sadhasivam <mani@kernel.org>,
Neil Armstrong <neil.armstrong@linaro.org>,
Heiko Stuebner <heiko@sntech.de>,
Frank Wang <frank.wang@rock-chips.com>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Philipp Zabel <p.zabel@pengutronix.de>,
Andy Yan <andy.yan@rock-chips.com>,
Dmitry Baryshkov <lumag@kernel.org>,
Yubing Zhang <yubing.zhang@rock-chips.com>,
Alexey Charkov <alchark@flipper.net>,
Igor Paunovic <royalnet026@gmail.com>,
"linux-phy@lists.infradead.org" <linux-phy@lists.infradead.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-rockchip@lists.infradead.org"
<linux-rockchip@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"kernel@collabora.com" <kernel@collabora.com>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>
Subject: Re: [PATCH v14 29/38] usb: dwc3: rockchip: introduce glue driver
Date: Sat, 29 Aug 2026 01:31:17 +0000 [thread overview]
Message-ID: <apIu_Jb1APyI8Jh9@vbox> (raw)
In-Reply-To: <20260813-rockchip-usbdp-cleanup-v14-29-b5ad9c68fa11@collabora.com>
On Thu, Aug 13, 2026, Sebastian Reichel wrote:
> Introduce Rockchip specific glue code for the Synopsys DWC3 USB driver.
> For now this handles things identical to the default glue.
>
> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
> ---
> drivers/usb/dwc3/Kconfig | 11 ++++
> drivers/usb/dwc3/Makefile | 1 +
> drivers/usb/dwc3/core.c | 15 +++++
> drivers/usb/dwc3/dwc3-rockchip.c | 115 +++++++++++++++++++++++++++++++++++++++
> 4 files changed, 142 insertions(+)
>
> diff --git a/drivers/usb/dwc3/Kconfig b/drivers/usb/dwc3/Kconfig
> index 18169727a413..3c120ea9746d 100644
> --- a/drivers/usb/dwc3/Kconfig
> +++ b/drivers/usb/dwc3/Kconfig
> @@ -190,6 +190,17 @@ config USB_DWC3_OCTEON
> Only the host mode is currently supported.
> Say 'Y' or 'M' here if you have one such device.
>
> +config USB_DWC3_ROCKCHIP
> + tristate "Rockchip DWC3 Platform Driver"
> + depends on ARCH_ROCKCHIP || COMPILE_TEST
> + depends on OF
> + default USB_DWC3
> + help
> + Rockchip SoCs with DesignWare Core USB3 IP inside,
> + and IP Core configured for USB 2.0 and USB 3.0 in host
> + or dual-role mode.
> + Say 'Y' or 'M' if you have such device.
> +
> config USB_DWC3_RTK
> tristate "Realtek DWC3 Platform Driver"
> depends on OF && ARCH_REALTEK
> diff --git a/drivers/usb/dwc3/Makefile b/drivers/usb/dwc3/Makefile
> index f37971197203..444e7e7f34b2 100644
> --- a/drivers/usb/dwc3/Makefile
> +++ b/drivers/usb/dwc3/Makefile
> @@ -58,6 +58,7 @@ obj-$(CONFIG_USB_DWC3_IMX8MP) += dwc3-imx8mp.o
> obj-$(CONFIG_USB_DWC3_IMX) += dwc3-imx.o
> obj-$(CONFIG_USB_DWC3_XILINX) += dwc3-xilinx.o
> obj-$(CONFIG_USB_DWC3_OCTEON) += dwc3-octeon.o
> +obj-$(CONFIG_USB_DWC3_ROCKCHIP) += dwc3-rockchip.o
> obj-$(CONFIG_USB_DWC3_RTK) += dwc3-rtk.o
> obj-$(CONFIG_USB_DWC3_GENERIC_PLAT) += dwc3-generic-plat.o
> obj-$(CONFIG_USB_DWC3_GOOGLE) += dwc3-google.o
> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
> index 517aa7f1486d..6e796489a04d 100644
> --- a/drivers/usb/dwc3/core.c
> +++ b/drivers/usb/dwc3/core.c
> @@ -2380,11 +2380,26 @@ int dwc3_core_probe(const struct dwc3_probe_data *data)
> }
> EXPORT_SYMBOL_GPL(dwc3_core_probe);
>
> +/*
> + * List of compatibles, which have "synopsys,dwc3" as a fallback
> + * compatible, but have a vendor specific glue driver that should
> + * be used instead of this one.
> + */
> +static const char *const dwc3_compatible_blocklist[] = {
> + "rockchip,rk3588-dwc3",
> + "rockchip,rk3576-dwc3",
What if the rockchip glue is not built? Are we going to fallback to the
core dwc3 driver? Or are you forcing to use rockchip glue always (ie no
fallback). If it's the former, use IS_ENABLED guard. If it's the latter,
update the kconfig.
> +};
> +
> static int dwc3_probe(struct platform_device *pdev)
> {
> struct dwc3_probe_data probe_data = {};
> struct resource *res;
> struct dwc3 *dwc;
> + int i;
> +
> + for (i = 0; i < ARRAY_SIZE(dwc3_compatible_blocklist); i++)
> + if (device_is_compatible(&pdev->dev, dwc3_compatible_blocklist[i]))
> + return -ENODEV;
>
> res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> if (!res) {
> diff --git a/drivers/usb/dwc3/dwc3-rockchip.c b/drivers/usb/dwc3/dwc3-rockchip.c
> new file mode 100644
> index 000000000000..1df33625b69f
> --- /dev/null
> +++ b/drivers/usb/dwc3/dwc3-rockchip.c
> @@ -0,0 +1,115 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/* Copyright (c) 2026, Collabora Ltd. */
> +#include <linux/module.h>
> +#include <linux/platform_device.h>
> +#include <linux/pm_runtime.h>
> +#include "glue.h"
> +
> +struct dwc3_rockchip {
> + struct dwc3 dwc;
> +};
> +
> +static int dwc3_rockchip_probe(struct platform_device *pdev)
> +{
> + struct dwc3_probe_data probe_data = {};
> + struct resource *res;
> + struct dwc3_rockchip *dwc_rk;
> +
> + res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> + if (!res) {
> + dev_err(&pdev->dev, "missing memory resource\n");
> + return -ENODEV;
> + }
> +
> + dwc_rk = devm_kzalloc(&pdev->dev, sizeof(*dwc_rk), GFP_KERNEL);
> + if (!dwc_rk)
> + return -ENOMEM;
> +
> + dwc_rk->dwc.dev = &pdev->dev;
> + dwc_rk->dwc.glue_ops = NULL;
> +
> + probe_data.dwc = &dwc_rk->dwc;
> + probe_data.res = res;
> + probe_data.properties = DWC3_DEFAULT_PROPERTIES;
> +
> + return dwc3_core_probe(&probe_data);
> +}
> +
> +static void dwc3_rockchip_remove(struct platform_device *pdev)
> +{
> + dwc3_core_remove(platform_get_drvdata(pdev));
> +}
> +
> +#ifdef CONFIG_PM
> +static int dwc3_rockchip_runtime_suspend(struct device *dev)
> +{
> + return dwc3_runtime_suspend(dev_get_drvdata(dev));
> +}
> +
> +static int dwc3_rockchip_runtime_resume(struct device *dev)
> +{
> + return dwc3_runtime_resume(dev_get_drvdata(dev));
> +}
> +
> +static int dwc3_rockchip_runtime_idle(struct device *dev)
> +{
> + return dwc3_runtime_idle(dev_get_drvdata(dev));
> +}
> +#endif
> +
> +#ifdef CONFIG_PM_SLEEP
Use the new PM macros and remove these guards.
> +static int dwc3_rockchip_suspend(struct device *dev)
> +{
> + return dwc3_pm_suspend(dev_get_drvdata(dev));
> +}
> +
> +static int dwc3_rockchip_resume(struct device *dev)
> +{
> + return dwc3_pm_resume(dev_get_drvdata(dev));
> +}
> +
> +static void dwc3_rockchip_complete(struct device *dev)
> +{
> + dwc3_pm_complete(dev_get_drvdata(dev));
> +}
> +
> +static int dwc3_rockchip_prepare(struct device *dev)
> +{
> + return dwc3_pm_prepare(dev_get_drvdata(dev));
> +}
> +#endif
> +
> +static const struct dev_pm_ops dwc3_rockchip_dev_pm_ops = {
> + SET_SYSTEM_SLEEP_PM_OPS(dwc3_rockchip_suspend, dwc3_rockchip_resume)
> + .complete = dwc3_rockchip_complete,
> + .prepare = dwc3_rockchip_prepare,
> + /*
> + * Runtime suspend halts the controller on disconnection. It relies on
> + * platforms with custom connection notification to start the controller
> + * again.
> + */
> + SET_RUNTIME_PM_OPS(dwc3_rockchip_runtime_suspend, dwc3_rockchip_runtime_resume,
> + dwc3_rockchip_runtime_idle)
> +};
> +
> +static const struct of_device_id dwc3_rockchip_of_match[] = {
> + { .compatible = "rockchip,rk3588-dwc3" },
> + { .compatible = "rockchip,rk3576-dwc3" },
> + { }
> +};
> +MODULE_DEVICE_TABLE(of, dwc3_rockchip_of_match);
> +
> +static struct platform_driver dwc3_rockchip_driver = {
> + .probe = dwc3_rockchip_probe,
> + .remove = dwc3_rockchip_remove,
> + .driver = {
> + .name = "dwc3-rockchip",
> + .pm = pm_ptr(&dwc3_rockchip_dev_pm_ops),
> + .of_match_table = dwc3_rockchip_of_match,
> + },
> +};
> +
> +module_platform_driver(dwc3_rockchip_driver);
> +
> +MODULE_LICENSE("GPL");
> +MODULE_DESCRIPTION("DesignWare DWC3 Rockchip Glue Driver");
>
> --
> 2.53.0
>
BR,
Thinh
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
next prev parent reply other threads:[~2026-08-29 1:32 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-13 20:51 [PATCH v14 00/38] phy: rockchip: usbdp: Clean up the mess Sebastian Reichel
2026-08-13 20:51 ` [PATCH v14 01/38] dt-bindings: phy: rockchip-usbdp: add improved ports scheme Sebastian Reichel
2026-08-13 20:51 ` [PATCH v14 02/38] phy: rockchip: usbdp: Update mode_change after error handling Sebastian Reichel
2026-08-13 20:51 ` [PATCH v14 03/38] phy: rockchip: usbdp: Do not lose USB3 PHY status Sebastian Reichel
2026-08-13 20:51 ` [PATCH v14 04/38] phy: rockchip: usbdp: Fix devm_clk_bulk_get_all check Sebastian Reichel
2026-08-13 20:51 ` [PATCH v14 05/38] phy: rockchip: usbdp: Handle missing clock-names DT property gracefully Sebastian Reichel
2026-08-13 20:51 ` [PATCH v14 06/38] phy: rockchip: usbdp: Drop seamless DP takeover Sebastian Reichel
2026-08-13 20:51 ` [PATCH v14 07/38] phy: rockchip: usbdp: Keep clocks running on PHY re-init Sebastian Reichel
2026-08-13 20:51 ` [PATCH v14 08/38] phy: rockchip: usbdp: Amend SSC modulation deviation Sebastian Reichel
2026-08-13 20:51 ` [PATCH v14 09/38] phy: rockchip: usbdp: Fix LFPS detect threshold control Sebastian Reichel
2026-08-13 20:51 ` [PATCH v14 10/38] phy: rockchip: usbdp: Add missing mode_change update Sebastian Reichel
2026-08-13 20:51 ` [PATCH v14 11/38] phy: rockchip: usbdp: Support single-lane DP Sebastian Reichel
2026-08-13 20:51 ` [PATCH v14 12/38] phy: rockchip: usbdp: Limit DP lane count to muxed lanes Sebastian Reichel
2026-08-13 20:51 ` [PATCH v14 13/38] phy: rockchip: usbdp: Rename DP lane functions Sebastian Reichel
2026-08-13 20:51 ` [PATCH v14 14/38] phy: rockchip: usbdp: Use FIELD_PREP_WM16_CONST Sebastian Reichel
2026-08-13 20:51 ` [PATCH v14 15/38] phy: rockchip: usbdp: Cleanup DP lane selection function Sebastian Reichel
2026-08-13 20:51 ` [PATCH v14 16/38] phy: rockchip: usbdp: Register DP aux bridge Sebastian Reichel
2026-08-13 20:52 ` [PATCH v14 17/38] phy: rockchip: usbdp: Drop DP HPD handling Sebastian Reichel
2026-08-13 20:52 ` [PATCH v14 18/38] phy: rockchip: usbdp: Rename mode_change to phy_needs_reinit Sebastian Reichel
2026-08-13 20:52 ` [PATCH v14 19/38] phy: rockchip: usbdp: Re-init the PHY on orientation change Sebastian Reichel
2026-08-13 20:52 ` [PATCH v14 20/38] phy: rockchip: usbdp: Factor out lane_mux_sel setup Sebastian Reichel
2026-08-13 20:52 ` [PATCH v14 21/38] phy: rockchip: usbdp: Properly handle TYPEC_STATE_SAFE and TYPEC_STATE_USB Sebastian Reichel
2026-08-13 20:52 ` [PATCH v14 22/38] phy: rockchip: usbdp: Use guard functions for mutex Sebastian Reichel
2026-08-13 20:52 ` [PATCH v14 23/38] phy: rockchip: usbdp: Hold mutex in DP PHY configure Sebastian Reichel
2026-08-13 20:52 ` [PATCH v14 24/38] phy: rockchip: usbdp: Add some extra debug messages Sebastian Reichel
2026-08-13 20:52 ` [PATCH v14 25/38] phy: rockchip: usbdp: Avoid xHCI SErrors Sebastian Reichel
2026-08-13 20:52 ` [PATCH v14 26/38] phy: rockchip: usbdp: Handle rk_udphy_reset_deassert errors Sebastian Reichel
2026-08-13 20:52 ` [PATCH v14 27/38] phy: rockchip: usbdp: Only enable USB3 when not in high-speed mode Sebastian Reichel
2026-08-13 20:52 ` [PATCH v14 28/38] phy: core: add notifier infrastructure Sebastian Reichel
2026-08-15 12:22 ` Igor Paunovic
2026-08-27 16:16 ` Vinod Koul
2026-08-13 20:52 ` [PATCH v14 29/38] usb: dwc3: rockchip: introduce glue driver Sebastian Reichel
2026-08-15 12:22 ` Igor Paunovic
2026-08-29 1:31 ` Thinh Nguyen [this message]
2026-08-13 20:52 ` [PATCH v14 30/38] usb: dwc3: core: add post PHY registration hook for platform glue Sebastian Reichel
2026-08-15 12:22 ` Igor Paunovic
2026-08-13 20:52 ` [PATCH v14 31/38] usb: dwc3: rockchip: support PHY reset notifications Sebastian Reichel
2026-08-15 12:22 ` Igor Paunovic
2026-08-13 20:52 ` [PATCH v14 32/38] usb: dwc3: rockchip: fix USB-C reconnect in gadget mode Sebastian Reichel
2026-08-13 20:52 ` [PATCH v14 33/38] phy: rockchip: usbdp: Add phy reset notification support Sebastian Reichel
2026-08-13 20:52 ` [PATCH v14 34/38] phy: rockchip: usbdp: Drop -EPROBE_DEFER hack Sebastian Reichel
2026-08-13 20:52 ` [PATCH v14 35/38] phy: rockchip: usbdp: Rename mode to hw_mode Sebastian Reichel
2026-08-13 20:52 ` [PATCH v14 36/38] phy: rockchip: usbdp: Fix power state handling Sebastian Reichel
2026-08-13 20:52 ` [PATCH v14 37/38] phy: rockchip: usbdp: Re-init PHY on mux change Sebastian Reichel
2026-08-13 20:52 ` [PATCH v14 38/38] phy: rockchip: usbdp: Add USB-C state without DP enabled Sebastian Reichel
2026-08-15 12:16 ` [PATCH v14 00/38] phy: rockchip: usbdp: Clean up the mess Igor Paunovic
2026-08-17 16:50 ` Sebastian Reichel
2026-08-17 17:29 ` Igor Paunovic
2026-08-18 9:27 ` Manivannan Sadhasivam
2026-08-18 21:42 ` Sebastian Reichel
2026-08-19 3:31 ` Manivannan Sadhasivam
2026-08-27 16:12 ` Vinod Koul
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=apIu_Jb1APyI8Jh9@vbox \
--to=thinh.nguyen@synopsys.com \
--cc=alchark@flipper.net \
--cc=andy.yan@rock-chips.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=frank.wang@rock-chips.com \
--cc=gregkh@linuxfoundation.org \
--cc=heiko@sntech.de \
--cc=kernel@collabora.com \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-phy@lists.infradead.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=linux-usb@vger.kernel.org \
--cc=lumag@kernel.org \
--cc=mani@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=p.zabel@pengutronix.de \
--cc=robh@kernel.org \
--cc=royalnet026@gmail.com \
--cc=sebastian.reichel@collabora.com \
--cc=vkoul@kernel.org \
--cc=yubing.zhang@rock-chips.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox