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:
Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Loading
Please sign in to comment