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

Commit 3f8b9753 authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "mhi: dev: uci: trigger a wake-up event if MHI device is wake capable"

parents 0acdc2d7 ea655014
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",
+3 −0
Original line number Diff line number Diff line
@@ -649,6 +649,9 @@ static void mhi_dl_xfer_cb(struct mhi_device *mhi_dev,
	list_add_tail(&buf->node, &uci_chan->pending);
	spin_unlock_irqrestore(&uci_chan->lock, flags);

	if (mhi_dev->dev.power.wakeup)
		__pm_wakeup_event(mhi_dev->dev.power.wakeup, 0);

	wake_up(&uci_chan->wq);
}