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

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

Merge "mhi: core: exit low power mode before calling client probe"

parents 11e22df5 84ec2b1f
Loading
Loading
Loading
Loading
+13 −5
Original line number Diff line number Diff line
@@ -1313,14 +1313,19 @@ static int mhi_driver_probe(struct device *dev)
	bool auto_start = false;
	int ret;

	/* bring device out of lpm */
	ret = mhi_device_get_sync(mhi_dev);
	if (ret)
		return ret;

	ret = -EINVAL;
	if (ul_chan) {
		/* lpm notification require status_cb */
		if (ul_chan->lpm_notify && !mhi_drv->status_cb)
			return -EINVAL;
			goto exit_probe;

		if (!ul_chan->offload_ch && !mhi_drv->ul_xfer_cb)
			return -EINVAL;
			goto exit_probe;

		ul_chan->xfer_cb = mhi_drv->ul_xfer_cb;
		mhi_dev->status_cb = mhi_drv->status_cb;
@@ -1329,10 +1334,10 @@ static int mhi_driver_probe(struct device *dev)

	if (dl_chan) {
		if (dl_chan->lpm_notify && !mhi_drv->status_cb)
			return -EINVAL;
			goto exit_probe;

		if (!dl_chan->offload_ch && !mhi_drv->dl_xfer_cb)
			return -EINVAL;
			goto exit_probe;

		mhi_event = &mhi_cntrl->mhi_event[dl_chan->er_index];

@@ -1342,7 +1347,7 @@ static int mhi_driver_probe(struct device *dev)
		 * cb whenever there are pending data
		 */
		if (mhi_event->cl_manage && !mhi_drv->status_cb)
			return -EINVAL;
			goto exit_probe;

		dl_chan->xfer_cb = mhi_drv->dl_xfer_cb;

@@ -1356,6 +1361,9 @@ static int mhi_driver_probe(struct device *dev)
	if (!ret && auto_start)
		mhi_prepare_for_transfer(mhi_dev);

exit_probe:
	mhi_device_put(mhi_dev);

	return ret;
}