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

Commit ef37df78 authored by Dov Levenglick's avatar Dov Levenglick Committed by Gerrit - the friendly Code Review server
Browse files

usb: dwc: dbm: indicates coming out of L1 with an interrupt



The DBM, in some versions, indicates via hardware interrupt
that a packet has been received on the DL (IN) path and that
the software should take the DWC controller out of L1 into L0.

Change-Id: I13180cffbe7040760842ebd345749d2a469adee2
Signed-off-by: default avatarDov Levenglick <dovl@codeaurora.org>
parent 3fc0e794
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -371,6 +371,10 @@ static bool reset_ep_after_lpm(void)
	return dbm_data->dbm_reset_ep_after_lpm;
}

static bool l1_lpm_interrupt(void)
{
	return true;
}


static int msm_dbm_probe(struct platform_device *pdev)
@@ -424,6 +428,7 @@ static int msm_dbm_probe(struct platform_device *pdev)
	dbm->enable = enable;
	dbm->ep_soft_reset = usb_ep_soft_reset;
	dbm->reset_ep_after_lpm = reset_ep_after_lpm;
	dbm->l1_lpm_interrupt = l1_lpm_interrupt;

	platform_set_drvdata(pdev, dbm);

+13 −1
Original line number Diff line number Diff line
@@ -90,6 +90,12 @@ struct dbm {
	/* Check whether the USB DBM requires ep reset after lpm suspend */
	bool (*reset_ep_after_lpm)(void);

	/*
	 * Indicates whether the DBM notifies the software about the need to
	 * come out of L1 state by interrupt
	 */
	bool (*l1_lpm_interrupt)(void);

};

struct dbm *usb_get_dbm_by_phandle(struct device *dev,
@@ -180,7 +186,6 @@ static inline int dbm_ep_soft_reset(struct dbm *dbm, u8 usb_ep,
	return dbm->ep_soft_reset(usb_ep, enter_reset);
}


static inline bool dbm_reset_ep_after_lpm(struct dbm *dbm)
{
	/* Default (backward compatible) setting is false */
@@ -188,4 +193,11 @@ static inline bool dbm_reset_ep_after_lpm(struct dbm *dbm)
	return dbm->reset_ep_after_lpm();
}

static inline bool dbm_l1_lpm_interrupt(struct dbm *dbm)
{
	/* Default (backward compatible) setting is false */
	CHECK_DBM_PTR_BOOL(dbm, l1_lpm_interrupt, false);
	return dbm->l1_lpm_interrupt();
}

#endif /* __DBM_H */