Skip to content

Commit 87a9d0c

Browse files
Mani-Sadhasivamkwilczynski
authored andcommitted
PCI: dwc: Pass DWC PCIe mode to dwc_pcie_debugfs_init()
Upcoming PTM debugfs interface relies on the DWC PCIe mode to expose the relevant debugfs attributes to userspace. So pass the mode to dwc_pcie_debugfs_init() API from host and ep drivers and save it in 'struct dw_pcie::mode'. Signed-off-by: Manivannan Sadhasivam <[email protected]> Signed-off-by: Krzysztof Wilczyński <[email protected]> Link: https://patch.msgid.link/[email protected]
1 parent 1328334 commit 87a9d0c

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

drivers/pci/controller/dwc/pcie-designware-debugfs.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,7 @@ void dwc_pcie_debugfs_deinit(struct dw_pcie *pci)
651651
debugfs_remove_recursive(pci->debugfs->debug_dir);
652652
}
653653

654-
void dwc_pcie_debugfs_init(struct dw_pcie *pci)
654+
void dwc_pcie_debugfs_init(struct dw_pcie *pci, enum dw_pcie_device_mode mode)
655655
{
656656
char dirname[DWC_DEBUGFS_BUF_MAX];
657657
struct device *dev = pci->dev;
@@ -674,4 +674,6 @@ void dwc_pcie_debugfs_init(struct dw_pcie *pci)
674674
err);
675675

676676
dwc_pcie_ltssm_debugfs_init(pci, dir);
677+
678+
pci->mode = mode;
677679
}

drivers/pci/controller/dwc/pcie-designware-ep.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1013,7 +1013,7 @@ int dw_pcie_ep_init_registers(struct dw_pcie_ep *ep)
10131013

10141014
dw_pcie_ep_init_non_sticky_registers(pci);
10151015

1016-
dwc_pcie_debugfs_init(pci);
1016+
dwc_pcie_debugfs_init(pci, DW_PCIE_EP_TYPE);
10171017

10181018
return 0;
10191019

drivers/pci/controller/dwc/pcie-designware-host.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ int dw_pcie_host_init(struct dw_pcie_rp *pp)
567567
if (pp->ops->post_init)
568568
pp->ops->post_init(pp);
569569

570-
dwc_pcie_debugfs_init(pci);
570+
dwc_pcie_debugfs_init(pci, DW_PCIE_RC_TYPE);
571571

572572
return 0;
573573

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,7 @@ struct dw_pcie {
503503
struct gpio_desc *pe_rst;
504504
bool suspended;
505505
struct debugfs_info *debugfs;
506+
enum dw_pcie_device_mode mode;
506507

507508
/*
508509
* If iATU input addresses are offset from CPU physical addresses,
@@ -871,10 +872,11 @@ dw_pcie_ep_get_func_from_ep(struct dw_pcie_ep *ep, u8 func_no)
871872
#endif
872873

873874
#ifdef CONFIG_PCIE_DW_DEBUGFS
874-
void dwc_pcie_debugfs_init(struct dw_pcie *pci);
875+
void dwc_pcie_debugfs_init(struct dw_pcie *pci, enum dw_pcie_device_mode mode);
875876
void dwc_pcie_debugfs_deinit(struct dw_pcie *pci);
876877
#else
877-
static inline void dwc_pcie_debugfs_init(struct dw_pcie *pci)
878+
static inline void dwc_pcie_debugfs_init(struct dw_pcie *pci,
879+
enum dw_pcie_device_mode mode)
878880
{
879881
}
880882
static inline void dwc_pcie_debugfs_deinit(struct dw_pcie *pci)

0 commit comments

Comments
 (0)