diff mbox

[v11,09/15] usb: phy: Add set_wakeup API

Message ID 1393208467-6355-10-git-send-email-peter.chen@freescale.com (mailing list archive)
State New, archived
Headers show

Commit Message

Peter Chen Feb. 24, 2014, 2:21 a.m. UTC
This API is used to set wakeup enable at PHY registers, in that
case, the PHY can be waken up from suspend due to external events,
like vbus change, dp/dm change and id change.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
---
 include/linux/usb/phy.h |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

Comments

Sergei Shtylyov Feb. 24, 2014, 6:41 p.m. UTC | #1
Hello.

On 02/24/2014 05:21 AM, Peter Chen wrote:

> This API is used to set wakeup enable at PHY registers, in that
> case, the PHY can be waken up from suspend due to external events,
> like vbus change, dp/dm change and id change.

> Signed-off-by: Peter Chen <peter.chen@freescale.com>
> ---
>   include/linux/usb/phy.h |   16 ++++++++++++++++
>   1 files changed, 16 insertions(+), 0 deletions(-)

> diff --git a/include/linux/usb/phy.h b/include/linux/usb/phy.h
> index 6c0b1c5..c2c6f49 100644
> --- a/include/linux/usb/phy.h
> +++ b/include/linux/usb/phy.h
> @@ -111,6 +111,13 @@ struct usb_phy {
>   	int	(*set_suspend)(struct usb_phy *x,
>   				int suspend);
>
> +	/*
> +	 * Set wakeup enable for PHY, in that case, the PHY can be
> +	 * waken up from suspend status due to external events,

    s/waken/woken/

WBR, Sergei
Peter Chen Feb. 25, 2014, 2:03 a.m. UTC | #2
> On 02/24/2014 05:21 AM, Peter Chen wrote:
> 
> > This API is used to set wakeup enable at PHY registers, in that case,
> > the PHY can be waken up from suspend due to external events, like vbus
> > change, dp/dm change and id change.
> 
> > Signed-off-by: Peter Chen <peter.chen@freescale.com>
> > ---
> >   include/linux/usb/phy.h |   16 ++++++++++++++++
> >   1 files changed, 16 insertions(+), 0 deletions(-)
> 
> > diff --git a/include/linux/usb/phy.h b/include/linux/usb/phy.h index
> > 6c0b1c5..c2c6f49 100644
> > --- a/include/linux/usb/phy.h
> > +++ b/include/linux/usb/phy.h
> > @@ -111,6 +111,13 @@ struct usb_phy {
> >   	int	(*set_suspend)(struct usb_phy *x,
> >   				int suspend);
> >
> > +	/*
> > +	 * Set wakeup enable for PHY, in that case, the PHY can be
> > +	 * waken up from suspend status due to external events,
> 
>     s/waken/woken/
> 
> WBR, Sergei
> 
> 

Thanks, will change.

Peter
diff mbox

Patch

diff --git a/include/linux/usb/phy.h b/include/linux/usb/phy.h
index 6c0b1c5..c2c6f49 100644
--- a/include/linux/usb/phy.h
+++ b/include/linux/usb/phy.h
@@ -111,6 +111,13 @@  struct usb_phy {
 	int	(*set_suspend)(struct usb_phy *x,
 				int suspend);
 
+	/*
+	 * Set wakeup enable for PHY, in that case, the PHY can be
+	 * waken up from suspend status due to external events,
+	 * like vbus change, dp/dm change and id.
+	 */
+	int	(*set_wakeup)(struct usb_phy *x, bool enabled);
+
 	/* notify phy connect status change */
 	int	(*notify_connect)(struct usb_phy *x,
 			enum usb_device_speed speed);
@@ -265,6 +272,15 @@  usb_phy_set_suspend(struct usb_phy *x, int suspend)
 }
 
 static inline int
+usb_phy_set_wakeup(struct usb_phy *x, bool enabled)
+{
+	if (x && x->set_wakeup)
+		return x->set_wakeup(x, enabled);
+	else
+		return 0;
+}
+
+static inline int
 usb_phy_notify_connect(struct usb_phy *x, enum usb_device_speed speed)
 {
 	if (x && x->notify_connect)