aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/usb/otg.h
diff options
context:
space:
mode:
authorRichard Zhao <richard.zhao@freescale.com>2012-07-07 22:56:44 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-07-09 09:55:09 -0700
commit526c51382d59144a3704970ab111d668e604a10f (patch)
tree0b36e45f6d5c0c3effa096d88f8709aec1530b0e /include/linux/usb/otg.h
parentusb: chipidea: select USB_EHCI_ROOT_HUB_TT in USB_CHIPIDEA_HOST of Kconfig (diff)
downloadlinux-dev-526c51382d59144a3704970ab111d668e604a10f.tar.xz
linux-dev-526c51382d59144a3704970ab111d668e604a10f.zip
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>
Diffstat (limited to 'include/linux/usb/otg.h')
-rw-r--r--include/linux/usb/otg.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h
index 0cb2ec2e50c0..45824be0a2f9 100644
--- a/include/linux/usb/otg.h
+++ b/include/linux/usb/otg.h
@@ -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);
};
@@ -277,6 +280,24 @@ usb_phy_set_suspend(struct usb_phy *x, int suspend)
}
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)
{
if (otg && otg->start_srp)