Skip to content

Commit

Permalink
usb: otg: add notify_connect/notify_disconnect callback
Browse files Browse the repository at this point in the history
This let usb phy driver has a chance to change hw settings when connect
status change.

Signed-off-by: Richard Zhao <richard.zhao@freescale.com>
Acked-by: Felipe Balbi <balbi@ti.com>
Tested-by: Subodh Nijsure <snijsure@grid-net.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Richard Zhao authored and Greg Kroah-Hartman committed Jul 9, 2012
1 parent ca72ae9 commit 526c513
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions include/linux/usb/otg.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ struct usb_phy {
int (*set_suspend)(struct usb_phy *x,
int suspend);

/* notify phy connect status change */
int (*notify_connect)(struct usb_phy *x, int port);
int (*notify_disconnect)(struct usb_phy *x, int port);
};


Expand Down Expand Up @@ -276,6 +279,24 @@ usb_phy_set_suspend(struct usb_phy *x, int suspend)
return 0;
}

static inline int
usb_phy_notify_connect(struct usb_phy *x, int port)
{
if (x->notify_connect)
return x->notify_connect(x, port);
else
return 0;
}

static inline int
usb_phy_notify_disconnect(struct usb_phy *x, int port)
{
if (x->notify_disconnect)
return x->notify_disconnect(x, port);
else
return 0;
}

static inline int
otg_start_srp(struct usb_otg *otg)
{
Expand Down

0 comments on commit 526c513

Please sign in to comment.