Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
@@ -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)
{