public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi@ti.com>
To: Romain Perier <romain.perier@gmail.com>
Cc: Kever Yang <kever.yang@rock-chips.com>,
	Paul Zimmerman <paulz@synopsys.com>, Felipe Balbi <balbi@ti.com>,
	Dinh Nguyen <dinguyen@opensource.altera.com>,
	Heiko Stuebner <heiko@sntech.de>, <dianders@chromium.org>,
	<sonnyrao@chromium.org>, <addy.ke@rock-chips.com>,
	Eddie Cai <cf@rock-chips.com>, <xjq@rock-chips.com>,
	<hj@rock-chips.com>, <dkl@rock-chips.com>,
	<huangtao@rock-chips.com>, <linux-rockchip@lists.infradead.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.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 11:40:11 -0600	[thread overview]
Message-ID: <20141106174011.GI16896@saruman> (raw)
In-Reply-To: <CABgxDo+9aZJ8BP3h=3sUUbSBD5R_FQmWF9f8kbzDbZrVG01n1A@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1639 bytes --]

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

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2014-11-06 17:42 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 [this message]
2014-11-06 18:35     ` Paul Zimmerman
2014-11-06 19:07       ` Felipe Balbi
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=20141106174011.GI16896@saruman \
    --to=balbi@ti.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=paulz@synopsys.com \
    --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