Commit 526c5138 authored by Richard Zhao's avatar Richard Zhao Committed by Greg Kroah-Hartman

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: default avatarRichard Zhao <richard.zhao@freescale.com>
Acked-by: default avatarFelipe Balbi <balbi@ti.com>
Tested-by: default avatarSubodh Nijsure <snijsure@grid-net.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ca72ae9b
......@@ -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)
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment