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

Commit b0992afa authored by Sujeev Dias's avatar Sujeev Dias
Browse files

mhi: core: provide helper function to check MHI device status



Provide a helper function for client to check if external device
in active state or not.

CRs-Fixed: 2361223
Change-Id: I80f320eb1ce1d6b704af1800a387702dc948aaa2
Signed-off-by: default avatarSujeev Dias <sdias@codeaurora.org>
parent 4b54d9aa
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -629,6 +629,19 @@ enum mhi_dev_state mhi_get_mhi_state(struct mhi_controller *mhi_cntrl);
void mhi_set_mhi_state(struct mhi_controller *mhi_cntrl,
		       enum mhi_dev_state state);


/**
 * mhi_is_active - helper function to determine if MHI in active state
 * @mhi_dev: client device
 */
static inline bool mhi_is_active(struct mhi_device *mhi_dev)
{
	struct mhi_controller *mhi_cntrl = mhi_dev->mhi_cntrl;

	return (mhi_cntrl->dev_state >= MHI_STATE_M0 &&
		mhi_cntrl->dev_state <= MHI_STATE_M3);
}

#ifndef CONFIG_ARCH_QCOM

#ifdef CONFIG_MHI_DEBUG