Commit 8d8db7db authored by Manivannan Sadhasivam's avatar Manivannan Sadhasivam Committed by Bjorn Helgaas
Browse files

PCI: qcom: Rename PERST# assert/deassert helpers for uniformity



Rename the PERST# assert/deassert helpers from
qcom_ep_reset_{assert/deassert}() to qcom_pcie_perst_{assert/deassert}() to
maintain uniformity.

Signed-off-by: default avatarManivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Reviewed-by: default avatarBartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Link: https://patch.msgid.link/20260115-pci-pwrctrl-rework-v5-15-9d26da3ce903@oss.qualcomm.com
parent 2fd60a2e
Loading
Loading
Loading
Loading
+12 −12
Original line number Diff line number Diff line
@@ -294,7 +294,7 @@ struct qcom_pcie {

#define to_qcom_pcie(x)		dev_get_drvdata((x)->dev)

static void qcom_perst_assert(struct qcom_pcie *pcie, bool assert)
static void __qcom_pcie_perst_assert(struct qcom_pcie *pcie, bool assert)
{
	struct qcom_pcie_perst *perst;
	struct qcom_pcie_port *port;
@@ -308,16 +308,16 @@ static void qcom_perst_assert(struct qcom_pcie *pcie, bool assert)
	usleep_range(PERST_DELAY_US, PERST_DELAY_US + 500);
}

static void qcom_ep_reset_assert(struct qcom_pcie *pcie)
static void qcom_pcie_perst_assert(struct qcom_pcie *pcie)
{
	qcom_perst_assert(pcie, true);
	__qcom_pcie_perst_assert(pcie, true);
}

static void qcom_ep_reset_deassert(struct qcom_pcie *pcie)
static void qcom_pcie_perst_deassert(struct qcom_pcie *pcie)
{
	/* Ensure that PERST has been asserted for at least 100 ms */
	/* Ensure that PERST# has been asserted for at least 100 ms */
	msleep(PCIE_T_PVPERL_MS);
	qcom_perst_assert(pcie, false);
	__qcom_pcie_perst_assert(pcie, false);
}

static int qcom_pcie_start_link(struct dw_pcie *pci)
@@ -654,9 +654,9 @@ static int qcom_pcie_assert_perst(struct dw_pcie *pci, bool assert)
	struct qcom_pcie *pcie = to_qcom_pcie(pci);

	if (assert)
		qcom_ep_reset_assert(pcie);
		qcom_pcie_perst_assert(pcie);
	else
		qcom_ep_reset_deassert(pcie);
		qcom_pcie_perst_deassert(pcie);

	return 0;
}
@@ -1308,7 +1308,7 @@ static int qcom_pcie_host_init(struct dw_pcie_rp *pp)
	struct qcom_pcie *pcie = to_qcom_pcie(pci);
	int ret;

	qcom_ep_reset_assert(pcie);
	qcom_pcie_perst_assert(pcie);

	ret = pcie->cfg->ops->init(pcie);
	if (ret)
@@ -1324,7 +1324,7 @@ static int qcom_pcie_host_init(struct dw_pcie_rp *pp)
			goto err_disable_phy;
	}

	qcom_ep_reset_deassert(pcie);
	qcom_pcie_perst_deassert(pcie);

	if (pcie->cfg->ops->config_sid) {
		ret = pcie->cfg->ops->config_sid(pcie);
@@ -1335,7 +1335,7 @@ static int qcom_pcie_host_init(struct dw_pcie_rp *pp)
	return 0;

err_assert_reset:
	qcom_ep_reset_assert(pcie);
	qcom_pcie_perst_assert(pcie);
err_disable_phy:
	qcom_pcie_phy_power_off(pcie);
err_deinit:
@@ -1349,7 +1349,7 @@ static void qcom_pcie_host_deinit(struct dw_pcie_rp *pp)
	struct dw_pcie *pci = to_dw_pcie_from_pp(pp);
	struct qcom_pcie *pcie = to_qcom_pcie(pci);

	qcom_ep_reset_assert(pcie);
	qcom_pcie_perst_assert(pcie);
	qcom_pcie_phy_power_off(pcie);
	pcie->cfg->ops->deinit(pcie);
}