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

Commit 5ccb2da8 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "usb: gadget: ci13xxx: Cancel pending suspend work before resuming h/w"

parents 0519f1dc a3854589
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -206,6 +206,21 @@ static void ci13xxx_msm_notify_event(struct ci13xxx *udc, unsigned event)
	}
}

static bool ci13xxx_cancel_pending_suspend(struct ci13xxx *udc)
{
	struct msm_otg *otg;

	if (udc == NULL)
		return false;

	if (udc->transceiver == NULL)
		return false;

	otg = container_of(udc->transceiver, struct msm_otg, phy);

	return cancel_delayed_work_sync(&otg->suspend_work);
}

static bool ci13xxx_msm_in_lpm(struct ci13xxx *udc)
{
	struct msm_otg *otg;
@@ -258,6 +273,7 @@ static struct ci13xxx_udc_driver ci13xxx_msm_udc_driver = {
				  CI13XXX_IS_OTG,
	.nz_itc			= 0,
	.notify_event		= ci13xxx_msm_notify_event,
	.cancel_pending_suspend = ci13xxx_cancel_pending_suspend,
	.in_lpm                 = ci13xxx_msm_in_lpm,
	.set_fpr_flag           = ci13xxx_msm_set_fpr_flag,
};
+4 −0
Original line number Diff line number Diff line
@@ -3000,6 +3000,10 @@ static int ci13xxx_exit_lpm(struct ci13xxx *udc, bool allow_sleep)
	if (!udc)
		return -ENODEV;

	/* Make sure phy driver is done with its bus suspend handling */
	if (udc->udc_driver->cancel_pending_suspend && allow_sleep)
		udc->udc_driver->cancel_pending_suspend(udc);

	/* Check if the controller is in low power mode state */
	if (udc->udc_driver->in_lpm &&
	    udc->udc_driver->in_lpm(udc) &&
+1 −0
Original line number Diff line number Diff line
@@ -148,6 +148,7 @@ struct ci13xxx_udc_driver {
#define CI13XXX_CONTROLLER_UDC_STARTED_EVENT		6

	void	(*notify_event) (struct ci13xxx *udc, unsigned event);
	bool (*cancel_pending_suspend)(struct ci13xxx *udc);
	bool    (*in_lpm) (struct ci13xxx *udc);
	void    (*set_fpr_flag) (struct ci13xxx *udc);
};