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

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

Merge "mhi: core: add support for wake capable devices"

parents 4b2606d3 d06d0c33
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -981,6 +981,8 @@ static int of_parse_ch_cfg(struct mhi_controller *mhi_cntrl,
							    "mhi,auto-queue");
							    "mhi,auto-queue");
		mhi_chan->auto_start = of_property_read_bool(child,
		mhi_chan->auto_start = of_property_read_bool(child,
							     "mhi,auto-start");
							     "mhi,auto-start");
		mhi_chan->wake_capable = of_property_read_bool(child,
							"mhi,wake-capable");


		if (mhi_chan->pre_alloc &&
		if (mhi_chan->pre_alloc &&
		    (mhi_chan->dir != DMA_FROM_DEVICE ||
		    (mhi_chan->dir != DMA_FROM_DEVICE ||
+1 −0
Original line number Original line Diff line number Diff line
@@ -588,6 +588,7 @@ struct mhi_chan {
	bool offload_ch;
	bool offload_ch;
	bool pre_alloc;
	bool pre_alloc;
	bool auto_start;
	bool auto_start;
	bool wake_capable; /* channel should wake up system */
	/* functions that generate the transfer ring elements */
	/* functions that generate the transfer ring elements */
	int (*gen_tre)(struct mhi_controller *mhi_cntrl,
	int (*gen_tre)(struct mhi_controller *mhi_cntrl,
		       struct mhi_chan *mhi_chan, void *buf, void *cb,
		       struct mhi_chan *mhi_chan, void *buf, void *cb,
+4 −0
Original line number Original line Diff line number Diff line
@@ -771,6 +771,10 @@ void mhi_create_devices(struct mhi_controller *mhi_cntrl)
		/* add if there is a matching DT node */
		/* add if there is a matching DT node */
		mhi_assign_of_node(mhi_cntrl, mhi_dev);
		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);
		ret = device_add(&mhi_dev->dev);
		if (ret) {
		if (ret) {
			MHI_ERR("Failed to register dev for  chan:%s\n",
			MHI_ERR("Failed to register dev for  chan:%s\n",