lkml.org 
[lkml]   [2014]   [Nov]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] usb: dwc2: add bus suspend/resume for dwc2
On Thu, Nov 06, 2014 at 06:21:42PM +0100, Romain Perier wrote:
> Hi Kever,
>
>
> 2014-11-06 2:30 GMT+01:00 Kever Yang <kever.yang@rock-chips.com>:
> >
> > +static int _dwc2_hcd_suspend(struct usb_hcd *hcd)
> > +{
> > + struct dwc2_hsotg *hsotg = dwc2_hcd_to_hsotg(hcd);
> > + u32 hprt0;
> > +
> > + if (!((hsotg->op_state == OTG_STATE_B_HOST) ||
> > + (hsotg->op_state == OTG_STATE_A_HOST)))
> > + return 0;
> > +
> > + if (hsotg->lx_state != DWC2_L0)
> > + return 0;
> > +
> > + hprt0 = dwc2_read_hprt0(hsotg);
> > + if (hprt0 & HPRT0_CONNSTS)
> > + dwc2_port_suspend(hsotg, 1);
> > +
> > + return 0;
> > +}
> > +
> > +static int _dwc2_hcd_resume(struct usb_hcd *hcd)
> > +{
> > + struct dwc2_hsotg *hsotg = dwc2_hcd_to_hsotg(hcd);
> > + u32 hprt0;
> > +
> > + if (!((hsotg->op_state == OTG_STATE_B_HOST) ||
> > + (hsotg->op_state == OTG_STATE_A_HOST)))
> > + return 0;
> > +
> > + if (hsotg->lx_state != DWC2_L2)
> > + return 0;
> > +
> > + hprt0 = dwc2_read_hprt0(hsotg);
> > + if ((hprt0 & HPRT0_CONNSTS) && (hprt0 & HPRT0_SUSP))
> > + dwc2_port_resume(hsotg);
> > +
> > + return 0;
> > +}
>
> Could you also define these functions under #ifdef CONFIG_PM ?

please don't. I'm actually considering ripping all ifdefs from all these
drivers and also stop using SIMPLE_DEV_PM_OPS or any of its friends.

There's really nobody today would would build a kernel with CONFIG_PM.

--
balbi
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2014-11-06 19:21    [W:0.096 / U:1.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site