diff options
author | Vinicius Costa Gomes <vinicius.gomes@intel.com> | 2021-07-27 06:36:55 +0300 |
---|---|---|
committer | Tony Nguyen <anthony.l.nguyen@intel.com> | 2021-08-24 21:36:13 +0300 |
commit | 014408cd624e9fd2820f4a593b710325ee05fec9 (patch) | |
tree | 87b6e088042f95030f03c5e464c0d813c980ddcb /drivers/pci/pcie | |
parent | 1d71eb53e45187f58089d32b51e27784c791d90e (diff) | |
download | linux-014408cd624e9fd2820f4a593b710325ee05fec9.tar.xz |
PCI: Add pcie_ptm_enabled()
Add a predicate that returns if PCIe PTM (Precision Time Measurement)
is enabled.
It will only return true if it's enabled in all the ports in the path
from the device to the root.
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Diffstat (limited to 'drivers/pci/pcie')
-rw-r--r-- | drivers/pci/pcie/ptm.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/pci/pcie/ptm.c b/drivers/pci/pcie/ptm.c index 95d4eef2c9e8..8a4ad974c5ac 100644 --- a/drivers/pci/pcie/ptm.c +++ b/drivers/pci/pcie/ptm.c @@ -204,3 +204,12 @@ int pci_enable_ptm(struct pci_dev *dev, u8 *granularity) return 0; } EXPORT_SYMBOL(pci_enable_ptm); + +bool pcie_ptm_enabled(struct pci_dev *dev) +{ + if (!dev) + return false; + + return dev->ptm_enabled; +} +EXPORT_SYMBOL(pcie_ptm_enabled); |