From: Felipe Balbi <balbi@ti.com>
To: Paul Zimmerman <Paul.Zimmerman@synopsys.com>
Cc: "balbi@ti.com" <balbi@ti.com>,
Romain Perier <romain.perier@gmail.com>,
Kever Yang <kever.yang@rock-chips.com>,
Dinh Nguyen <dinguyen@opensource.altera.com>,
Heiko Stuebner <heiko@sntech.de>,
"dianders@chromium.org" <dianders@chromium.org>,
"sonnyrao@chromium.org" <sonnyrao@chromium.org>,
"addy.ke@rock-chips.com" <addy.ke@rock-chips.com>,
Eddie Cai <cf@rock-chips.com>,
"xjq@rock-chips.com" <xjq@rock-chips.com>,
"hj@rock-chips.com" <hj@rock-chips.com>,
"dkl@rock-chips.com" <dkl@rock-chips.com>,
"huangtao@rock-chips.com" <huangtao@rock-chips.com>,
"linux-rockchip@lists.infradead.org"
<linux-rockchip@lists.infradead.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] usb: dwc2: add bus suspend/resume for dwc2
Date: Thu, 6 Nov 2014 13:07:44 -0600 [thread overview]
Message-ID: <20141106190744.GA19460@saruman> (raw)
In-Reply-To: <A2CA0424C0A6F04399FB9E1CD98E0304844E9C67@US01WEMBX2.internal.synopsys.com>
[-- Attachment #1: Type: text/plain, Size: 2305 bytes --]
Hi,
On Thu, Nov 06, 2014 at 06:35:53PM +0000, Paul Zimmerman wrote:
> > From: Felipe Balbi [mailto:balbi@ti.com]
> > Sent: Thursday, November 06, 2014 9:40 AM
> >
> > On Thu, Nov 06, 2014 at 06:21:42PM +0100, Romain Perier wrote:
> > >
> > > 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.
>
> I'm sure Felipe meant *without* CONFIG_PM.
oops, that's correct.
> Kever, in that case you should remove the #ifdef CONFIG_PM around the
> .bus_suspend and .bus_resume assignments also, otherwise there will be
> compiler warnings when built without CONFIG_PM. After that, you can
> add my acked-by.
tks
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2014-11-06 19:09 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-06 1:30 [PATCH v2] usb: dwc2: add bus suspend/resume for dwc2 Kever Yang
2014-11-06 17:21 ` Romain Perier
2014-11-06 17:40 ` Felipe Balbi
2014-11-06 18:35 ` Paul Zimmerman
2014-11-06 19:07 ` Felipe Balbi [this message]
2014-11-06 22:11 ` Julius Werner
2014-11-10 12:49 ` Kever Yang
2014-11-10 18:26 ` Julius Werner
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=20141106190744.GA19460@saruman \
--to=balbi@ti.com \
--cc=Paul.Zimmerman@synopsys.com \
--cc=addy.ke@rock-chips.com \
--cc=cf@rock-chips.com \
--cc=dianders@chromium.org \
--cc=dinguyen@opensource.altera.com \
--cc=dkl@rock-chips.com \
--cc=gregkh@linuxfoundation.org \
--cc=heiko@sntech.de \
--cc=hj@rock-chips.com \
--cc=huangtao@rock-chips.com \
--cc=kever.yang@rock-chips.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=linux-usb@vger.kernel.org \
--cc=romain.perier@gmail.com \
--cc=sonnyrao@chromium.org \
--cc=xjq@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