Lines Matching full:ptm
14 * If the next upstream device supports PTM, return it; otherwise return
15 * NULL. PTM Messages are local, so both link partners must support it.
22 * Switch Downstream Ports are not permitted to have a PTM in pci_upstream_ptm()
23 * capability; their PTM behavior is controlled by the Upstream in pci_upstream_ptm()
37 * Find the PTM Capability (if present) and extract the information we need
42 u16 ptm; in pci_ptm_init() local
49 ptm = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_PTM); in pci_ptm_init()
50 if (!ptm) in pci_ptm_init()
53 dev->ptm_cap = ptm; in pci_ptm_init()
56 pci_read_config_dword(dev, ptm + PCI_PTM_CAP, &cap); in pci_ptm_init()
61 * furthest upstream Time Source as the PTM Root. For Endpoints, in pci_ptm_init()
63 * reported by the PTM Root and all intervening PTM Time Sources." in pci_ptm_init()
90 u16 ptm = dev->ptm_cap; in pci_save_ptm_state() local
94 if (!ptm) in pci_save_ptm_state()
102 pci_read_config_dword(dev, ptm + PCI_PTM_CTRL, cap); in pci_save_ptm_state()
107 u16 ptm = dev->ptm_cap; in pci_restore_ptm_state() local
111 if (!ptm) in pci_restore_ptm_state()
119 pci_write_config_dword(dev, ptm + PCI_PTM_CTRL, *cap); in pci_restore_ptm_state()
122 /* Enable PTM in the Control register if possible */
125 u16 ptm = dev->ptm_cap; in __pci_enable_ptm() local
129 if (!ptm) in __pci_enable_ptm()
133 * A device uses local PTM Messages to request time information in __pci_enable_ptm()
134 * from a PTM Root that's farther upstream. Every device along the in __pci_enable_ptm()
135 * path must support PTM and have it enabled so it can handle the in __pci_enable_ptm()
136 * messages. Therefore, if this device is not a PTM Root, the in __pci_enable_ptm()
137 * upstream link partner must have PTM enabled before we can enable in __pci_enable_ptm()
138 * PTM. in __pci_enable_ptm()
146 pci_read_config_dword(dev, ptm + PCI_PTM_CTRL, &ctrl); in __pci_enable_ptm()
154 pci_write_config_dword(dev, ptm + PCI_PTM_CTRL, ctrl); in __pci_enable_ptm()
166 * Return: zero if successful, or -EINVAL if @dev lacks a PTM Capability or
167 * is not a PTM Root and lacks an upstream path of PTM-enabled devices.
195 pci_info(dev, "PTM enabled%s, %s granularity\n", in pci_enable_ptm()
204 u16 ptm = dev->ptm_cap; in __pci_disable_ptm() local
207 if (!ptm) in __pci_disable_ptm()
210 pci_read_config_dword(dev, ptm + PCI_PTM_CTRL, &ctrl); in __pci_disable_ptm()
212 pci_write_config_dword(dev, ptm + PCI_PTM_CTRL, ctrl); in __pci_disable_ptm()
231 * Disable PTM, but preserve dev->ptm_enabled so we silently re-enable it on
240 /* If PTM was enabled before suspend, re-enable it when resuming */