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

Commit d19af7aa authored by Sujeev Dias's avatar Sujeev Dias Committed by Gerrit - the friendly Code Review server
Browse files

mhi: core: add support for wake capable devices



Some MHI channels has time sensitive data and must
meet required deadline. Configure those channels as
wakeup device.

CRs-Fixed: 2348867
Change-Id: Id9cf7ff54d9bf7e4c44a83bca8de5cb9936c12a8
Signed-off-by: default avatarSujeev Dias <sdias@codeaurora.org>
parent 94da5973
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -989,6 +989,8 @@ static int of_parse_ch_cfg(struct mhi_controller *mhi_cntrl,
							    "mhi,auto-queue");
		mhi_chan->auto_start = of_property_read_bool(child,
							     "mhi,auto-start");
		mhi_chan->wake_capable = of_property_read_bool(child,
							"mhi,wake-capable");

		if (mhi_chan->pre_alloc &&
		    (mhi_chan->dir != DMA_FROM_DEVICE ||
+1 −0
Original line number Diff line number Diff line
@@ -594,6 +594,7 @@ struct mhi_chan {
	bool offload_ch;
	bool pre_alloc;
	bool auto_start;
	bool wake_capable; /* channel should wake up system */
	/* functions that generate the transfer ring elements */
	int (*gen_tre)(struct mhi_controller *, struct mhi_chan *, void *,
		       void *, size_t, enum MHI_FLAGS);
+4 −0
Original line number Diff line number Diff line
@@ -780,6 +780,10 @@ void mhi_create_devices(struct mhi_controller *mhi_cntrl)
		/* add if there is a matching DT node */
		mhi_assign_of_node(mhi_cntrl, mhi_dev);

		/* init wake source */
		if (mhi_dev->dl_chan && mhi_dev->dl_chan->wake_capable)
			device_init_wakeup(&mhi_dev->dev, true);

		ret = device_add(&mhi_dev->dev);
		if (ret) {
			MHI_ERR("Failed to register dev for  chan:%s\n",