Commit 0577dad1 authored by Mani Sadhasivam's avatar Mani Sadhasivam
Browse files

PCI: endpoint: Add D_STATE notifier support



Add support to notify the EPF device about the Device State (D_STATE)
event received by the EPC device from the Root complex.

Usage:
======

EPC
---

```
static irqreturn_t pcie_ep_irq(int irq, void *data)
{
...
	case PCIE_EP_INT_D_STATE:
		dstate = dw_pcie_readl_dbi(pci, DBI_CON_STATUS) & 0x3;
		pci_epc_d_state_notify(epc, dstate);
		break;
...
}
```

EPF
---

```
static int pci_epf_notifier(struct notifier_block *nb, unsigned long val,
			    void *data)
{
...
	case D_STATE:
		dstate = data;
		if (dstate == PCIE_EP_D0)
			/* Handle D0 event */
		else if (dstate == PCIE_EP_D3)
			/* Handle D3 event */
		break;
...
}
```

Signed-off-by: default avatarManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
parent d2e4b5a2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment