Peter Chen <peter.chen@xxxxxxx> writes: > Add imx glue layer runtime pm implementation, and the runtime > pm is default off. > > Signed-off-by: Peter Chen <peter.chen@xxxxxxx> > --- > drivers/usb/cdns3/cdns3-imx.c | 179 +++++++++++++++++++++++++++++++++- > 1 file changed, 177 insertions(+), 2 deletions(-) > > diff --git a/drivers/usb/cdns3/cdns3-imx.c b/drivers/usb/cdns3/cdns3-imx.c > index aba988e71958..9d247de8e7eb 100644 > --- a/drivers/usb/cdns3/cdns3-imx.c > +++ b/drivers/usb/cdns3/cdns3-imx.c > @@ -15,6 +15,8 @@ > #include <linux/io.h> > #include <linux/of_platform.h> > #include <linux/iopoll.h> > +#include <linux/pm_runtime.h> > +#include "core.h" > > #define USB3_CORE_CTRL1 0x00 > #define USB3_CORE_CTRL2 0x04 > @@ -66,11 +68,30 @@ > #define CLK_VALID_COMPARE_BITS (0xf << 28) > #define PHY_REFCLK_REQ (1 << 0) > > +/* OTG registers definition */ > +#define OTGSTS 0x4 looks like a blank line here would (mildly) aid readability. > +/* OTGSTS */ > +#define OTG_NRDY (1 << 11) > + > +/* xHCI registers definition */ > +#define XECP_PM_PMCSR 0x8018 > +#define XECP_AUX_CTRL_REG1 0x8120 > + > +/* Register bits definition */ > +/* XECP_AUX_CTRL_REG1 */ > +#define CFG_RXDET_P3_EN (1 << 15) > + > +/* XECP_PM_PMCSR */ > +#define PS_MASK (3 << 0) > +#define PS_D0 0 > +#define PS_D1 (1 << 0) > + > struct cdns_imx { > struct device *dev; > void __iomem *noncore; > struct clk_bulk_data *clks; > int num_clks; > + struct platform_device *cdns3_pdev; do you really need the entire platform_device? Why don't you use container_of to get the platform_device from the device pointer? We already have a generic to_platform_device(), right? Or are those referring to different devices? Also, it seems like that pointer isn't used, at least not in $subject -- balbi
Attachment:
signature.asc
Description: PGP signature