usb: otg: add notify_connect/notify_disconnect callback

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>
This commit is contained in:
Richard Zhao 2012-07-07 22:56:44 +08:00 committed by Greg Kroah-Hartman
parent ca72ae9bf6
commit 526c51382d

View file

@ -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);
};
@ -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)
{