[PATCH v5 2/2] usb: dwc3: add generic driver to support flattened
Ze Huang
huang.ze at linux.dev
Sat Jul 12 00:30:27 PDT 2025
On Fri, Jul 11, 2025 at 11:37:32PM +0000, Thinh Nguyen wrote:
> On Sat, Jul 05, 2025, Ze Huang wrote:
> > To support flattened dwc3 dt model and drop the glue layer, introduce the
> > `dwc3-generic` driver. This enables direct binding of the DWC3 core driver
> > and offers an alternative to the existing glue driver `dwc3-of-simple`.
> >
> > Signed-off-by: Ze Huang <huang.ze at linux.dev>
> > ---
> > drivers/usb/dwc3/Kconfig | 11 +++
> > drivers/usb/dwc3/Makefile | 1 +
> > drivers/usb/dwc3/dwc3-generic-plat.c | 182 +++++++++++++++++++++++++++++++++++
> > 3 files changed, 194 insertions(+)
> >
[...]
> > +static const struct dev_pm_ops dwc3_generic_dev_pm_ops = {
> > + SET_SYSTEM_SLEEP_PM_OPS(dwc3_generic_suspend, dwc3_generic_resume)
> > + SET_RUNTIME_PM_OPS(dwc3_generic_runtime_suspend, dwc3_generic_runtime_resume,
> > + dwc3_generic_runtime_idle)
> > +};
> > +
> > +static const struct of_device_id dwc3_generic_of_match[] = {
> > + { .compatible = "spacemit,k1-dwc3", },
> > + { /* sentinel */ }
> > +};
> > +MODULE_DEVICE_TABLE(of, dwc3_generic_of_match);
> > +
> > +static struct platform_driver dwc3_generic_driver = {
> > + .probe = dwc3_generic_probe,
> > + .remove = dwc3_generic_remove,
> > + .driver = {
> > + .name = "dwc3-generic-plat",
> > + .of_match_table = dwc3_generic_of_match,
> > + .pm = &dwc3_generic_dev_pm_ops,
>
> You're still not using the new pm_ptr()/pm_sleep_ptr. The kernel build
> bot will complain about the maybe unused functions.
Thanks for your patience.
I found they are caused by using SET_RUNTIME_PM_OPS and SET_SYSTEM_SLEEP_PM_OPS macros.
I'll replace them with new RUNTIME_PM_OPS/SYSTEM_SLEEP_PM_OPS and wrap the
dwc3_generic_dev_pm_ops with pm_ptr()
>
> BR,
> Thinh
More information about the linux-riscv
mailing list