Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
From: Krishna chaitanya chundru <quic_krichai@quicinc.com>
To: "Manivannan Sadhasivam" <manivannan.sadhasivam@linaro.org>,
	"Krzysztof Wilczyński" <kw@linux.com>,
	"Kishon Vijay Abraham I" <kishon@kernel.org>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Jonathan Corbet" <corbet@lwn.net>,
	"Jingoo Han" <jingoohan1@gmail.com>,
	"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
	"Rob Herring" <robh@kernel.org>
Cc: <linux-pci@vger.kernel.org>, <linux-doc@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <linux-arm-msm@vger.kernel.org>,
	<mhi@lists.linux.dev>, <quic_vbadigan@quicinc.com>,
	<quic_ramkri@quicinc.com>, <quic_nitegupt@quicinc.com>,
	<quic_skananth@quicinc.com>, <quic_parass@quicinc.com>,
	"Krishna chaitanya chundru" <quic_krichai@quicinc.com>
Subject: [PATCH v6 2/5] PCI: dwc: Add wakeup host op to pci_epc_ops
Date: Wed, 10 Jul 2024 16:46:09 +0530	[thread overview]
Message-ID: <20240710-wakeup_host-v6-2-ef00f31ea38d@quicinc.com> (raw)
In-Reply-To: <20240710-wakeup_host-v6-0-ef00f31ea38d@quicinc.com>

Add wakeup host op to wake up host from D3cold or D3hot.

Signed-off-by: Krishna chaitanya chundru <quic_krichai@quicinc.com>
---
 drivers/pci/controller/dwc/pcie-designware-ep.c | 12 ++++++++++++
 drivers/pci/controller/dwc/pcie-designware.h    |  1 +
 2 files changed, 13 insertions(+)

diff --git a/drivers/pci/controller/dwc/pcie-designware-ep.c b/drivers/pci/controller/dwc/pcie-designware-ep.c
index 43ba5c6738df..a20b6bec6078 100644
--- a/drivers/pci/controller/dwc/pcie-designware-ep.c
+++ b/drivers/pci/controller/dwc/pcie-designware-ep.c
@@ -440,6 +440,17 @@ dw_pcie_ep_get_features(struct pci_epc *epc, u8 func_no, u8 vfunc_no)
 	return ep->ops->get_features(ep);
 }
 
+static bool dw_pcie_ep_wakeup_host(struct pci_epc *epc, u8 func_no, u8 vfunc_no,
+				   bool send_pme)
+{
+	struct dw_pcie_ep *ep = epc_get_drvdata(epc);
+
+	if (!ep->ops->wakeup_host)
+		return false;
+
+	return ep->ops->wakeup_host(ep, func_no, send_pme);
+}
+
 static const struct pci_epc_ops epc_ops = {
 	.write_header		= dw_pcie_ep_write_header,
 	.set_bar		= dw_pcie_ep_set_bar,
@@ -454,6 +465,7 @@ static const struct pci_epc_ops epc_ops = {
 	.start			= dw_pcie_ep_start,
 	.stop			= dw_pcie_ep_stop,
 	.get_features		= dw_pcie_ep_get_features,
+	.wakeup_host		= dw_pcie_ep_wakeup_host,
 };
 
 /**
diff --git a/drivers/pci/controller/dwc/pcie-designware.h b/drivers/pci/controller/dwc/pcie-designware.h
index 53c4c8f399c8..da15ccd7a3f5 100644
--- a/drivers/pci/controller/dwc/pcie-designware.h
+++ b/drivers/pci/controller/dwc/pcie-designware.h
@@ -365,6 +365,7 @@ struct dw_pcie_ep_ops {
 	 */
 	unsigned int (*get_dbi_offset)(struct dw_pcie_ep *ep, u8 func_no);
 	unsigned int (*get_dbi2_offset)(struct dw_pcie_ep *ep, u8 func_no);
+	bool	(*wakeup_host)(struct dw_pcie_ep *ep, u8 func_no, bool send_pme);
 };
 
 struct dw_pcie_ep_func {

-- 
2.42.0


  parent reply	other threads:[~2024-07-10 11:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-10 11:16 [PATCH v6 0/5] PCI: EPC: Add support to wake up host from D3 states Krishna chaitanya chundru
2024-07-10 11:16 ` [PATCH v6 1/5] PCI: endpoint: Add wakeup host API to EPC core Krishna chaitanya chundru
2024-07-10 12:17   ` Bjorn Helgaas
2024-07-10 11:16 ` Krishna chaitanya chundru [this message]
2024-07-10 11:16 ` [PATCH v6 3/5] PCI: qcom-ep: Add wake up host op to dw_pcie_ep_ops Krishna chaitanya chundru
2024-07-11 17:04   ` Bjorn Helgaas
2024-07-10 11:16 ` [PATCH v6 4/5] PCI: epf-mhi: Add wakeup host op Krishna chaitanya chundru
2024-07-11 16:56   ` Bjorn Helgaas
2024-07-10 11:16 ` [PATCH v6 5/5] bus: mhi: ep: wake up host if the MHI state is in M3 Krishna chaitanya chundru
2024-07-11 16:47   ` Bjorn Helgaas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240710-wakeup_host-v6-2-ef00f31ea38d@quicinc.com \
    --to=quic_krichai@quicinc.com \
    --cc=bhelgaas@google.com \
    --cc=corbet@lwn.net \
    --cc=jingoohan1@gmail.com \
    --cc=kishon@kernel.org \
    --cc=kw@linux.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=mhi@lists.linux.dev \
    --cc=quic_nitegupt@quicinc.com \
    --cc=quic_parass@quicinc.com \
    --cc=quic_ramkri@quicinc.com \
    --cc=quic_skananth@quicinc.com \
    --cc=quic_vbadigan@quicinc.com \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox