Skip to content

Commit e17291c

Browse files
FROMLIST: PCI: dwc: Add host_start_link() & host_start_link() hooks for dwc glue drivers
Add host_start_link() and host_stop_link() functions to dwc glue drivers to register with start_link() and stop_link() of pci ops, allowing for better control over the link initialization and shutdown process. Link: https://lore.kernel.org/lkml/[email protected]/ Signed-off-by: Krishna Chaitanya Chundru <[email protected]>
1 parent 28ce835 commit e17291c

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

drivers/pci/controller/dwc/pcie-designware.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,8 @@ struct dw_pcie_ops {
484484
enum dw_pcie_ltssm (*get_ltssm)(struct dw_pcie *pcie);
485485
int (*start_link)(struct dw_pcie *pcie);
486486
void (*stop_link)(struct dw_pcie *pcie);
487+
int (*host_start_link)(struct dw_pcie *pcie);
488+
void (*host_stop_link)(struct dw_pcie *pcie);
487489
};
488490

489491
struct debugfs_info {
@@ -743,6 +745,20 @@ static inline void dw_pcie_stop_link(struct dw_pcie *pci)
743745
pci->ops->stop_link(pci);
744746
}
745747

748+
static inline int dw_pcie_host_start_link(struct dw_pcie *pci)
749+
{
750+
if (pci->ops && pci->ops->host_start_link)
751+
return pci->ops->host_start_link(pci);
752+
753+
return 0;
754+
}
755+
756+
static inline void dw_pcie_host_stop_link(struct dw_pcie *pci)
757+
{
758+
if (pci->ops && pci->ops->host_stop_link)
759+
pci->ops->host_stop_link(pci);
760+
}
761+
746762
static inline enum dw_pcie_ltssm dw_pcie_get_ltssm(struct dw_pcie *pci)
747763
{
748764
u32 val;

0 commit comments

Comments
 (0)