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

Commit c924cfcd authored by Bhaumik Bhatt's avatar Bhaumik Bhatt
Browse files

mhi: cntrl: qcom: distinguish between legacy and autonomous suspend modes



Allow for both legacy and autonomous MHI state suspend modes
to be handled by the controller.

Change-Id: Ia8920bf7fe35a0ffe5eab433d1d461a16f6db6a4
Signed-off-by: default avatarBhaumik Bhatt <bbhatt@codeaurora.org>
parent 55b46911
Loading
Loading
Loading
Loading
+9 −6
Original line number Diff line number Diff line
@@ -438,10 +438,11 @@ int mhi_arch_pcie_init(struct mhi_controller *mhi_cntrl)
				return -EINVAL;
		}

		/* register with pcie rc for WAKE# events */
		/* register with pcie rc for WAKE# or link state events */
		reg_event = &arch_info->pcie_reg_event;
		reg_event->events =
			MSM_PCIE_EVENT_WAKEUP | MSM_PCIE_EVENT_L1SS_TIMEOUT;
		reg_event->events = mhi_dev->allow_m1 ?
			(MSM_PCIE_EVENT_WAKEUP) :
			(MSM_PCIE_EVENT_WAKEUP | MSM_PCIE_EVENT_L1SS_TIMEOUT);

		reg_event->user = mhi_dev->pci_dev;
		reg_event->callback = mhi_arch_pci_link_state_cb;
@@ -658,6 +659,7 @@ int mhi_arch_link_suspend(struct mhi_controller *mhi_cntrl)
	MHI_LOG("Entered\n");

	/* disable inactivity timer */
	if (!mhi_dev->allow_m1)
		msm_pcie_l1ss_timeout_disable(pci_dev);

	switch (mhi_dev->suspend_mode) {
@@ -686,7 +688,7 @@ int mhi_arch_link_suspend(struct mhi_controller *mhi_cntrl)
	}

exit_suspend:
	if (ret)
	if (ret && !mhi_dev->allow_m1)
		msm_pcie_l1ss_timeout_enable(pci_dev);

	MHI_LOG("Exited with ret:%d\n", ret);
@@ -762,6 +764,7 @@ int mhi_arch_link_resume(struct mhi_controller *mhi_cntrl)
		return ret;
	}

	if (!mhi_dev->allow_m1)
		msm_pcie_l1ss_timeout_enable(pci_dev);

	MHI_LOG("Exited\n");
+1 −0
Original line number Diff line number Diff line
@@ -702,6 +702,7 @@ static struct mhi_controller *mhi_register_controller(struct pci_dev *pci_dev)
		goto error_register;

	use_bb = of_property_read_bool(of_node, "mhi,use-bb");
	mhi_dev->allow_m1 = of_property_read_bool(of_node, "mhi,allow-m1");

	/*
	 * if s1 translation enabled or using bounce buffer pull iova addr
+1 −0
Original line number Diff line number Diff line
@@ -53,6 +53,7 @@ struct mhi_dev {
	int resn;
	void *arch_info;
	bool powered_on;
	bool allow_m1;
	dma_addr_t iova_start;
	dma_addr_t iova_stop;
	enum mhi_suspend_mode suspend_mode;