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

Commit 647b2d9c authored by Hema HK's avatar Hema HK Committed by Felipe Balbi
Browse files

usb: otg: TWL6030 Save the last event in otg_transceiver



Save the last event in the otg_transceiver so that it can used in the
musb driver and gadget driver to configure the musb and enable the
vbus for host mode and OTG mode, if the device is connected during boot.

Signed-off-by: default avatarHema HK <hemahk@ti.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Paul Walmsley <paul@pwsan.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 070b8ed9
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -262,11 +262,13 @@ static irqreturn_t twl6030_usb_irq(int irq, void *_twl)
			twl->otg.default_a = false;
			twl->otg.default_a = false;
			twl->otg.state = OTG_STATE_B_IDLE;
			twl->otg.state = OTG_STATE_B_IDLE;
			twl->linkstat = status;
			twl->linkstat = status;
			twl->otg.last_event = status;
			blocking_notifier_call_chain(&twl->otg.notifier,
			blocking_notifier_call_chain(&twl->otg.notifier,
						status, twl->otg.gadget);
						status, twl->otg.gadget);
		} else {
		} else {
			status = USB_EVENT_NONE;
			status = USB_EVENT_NONE;
			twl->linkstat = status;
			twl->linkstat = status;
			twl->otg.last_event = status;
			blocking_notifier_call_chain(&twl->otg.notifier,
			blocking_notifier_call_chain(&twl->otg.notifier,
						status, twl->otg.gadget);
						status, twl->otg.gadget);
			if (twl->asleep) {
			if (twl->asleep) {
@@ -299,6 +301,7 @@ static irqreturn_t twl6030_usbotg_irq(int irq, void *_twl)
		twl->otg.default_a = true;
		twl->otg.default_a = true;
		twl->otg.state = OTG_STATE_A_IDLE;
		twl->otg.state = OTG_STATE_A_IDLE;
		twl->linkstat = status;
		twl->linkstat = status;
		twl->otg.last_event = status;
		blocking_notifier_call_chain(&twl->otg.notifier, status,
		blocking_notifier_call_chain(&twl->otg.notifier, status,
							twl->otg.gadget);
							twl->otg.gadget);
	} else  {
	} else  {
+1 −0
Original line number Original line Diff line number Diff line
@@ -66,6 +66,7 @@ struct otg_transceiver {


	u8			default_a;
	u8			default_a;
	enum usb_otg_state	state;
	enum usb_otg_state	state;
	enum usb_xceiv_events	last_event;


	struct usb_bus		*host;
	struct usb_bus		*host;
	struct usb_gadget	*gadget;
	struct usb_gadget	*gadget;