blob: 3cc06b059017b19e49baaca049bc615db699d0e7 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Shaohua Li7d715a62008-02-25 09:46:41 +08002/*
3 * aspm.h
4 *
5 * PCI Express ASPM defines and function prototypes
6 *
7 * Copyright (C) 2007 Intel Corp.
8 * Zhang Yanmin (yanmin.zhang@intel.com)
9 * Shaohua Li (shaohua.li@intel.com)
10 *
11 * For more information, please consult the following manuals (look at
12 * http://www.pcisig.com/ for how to get them):
13 *
14 * PCI Express Specification
15 */
16
17#ifndef LINUX_ASPM_H
18#define LINUX_ASPM_H
19
20#include <linux/pci.h>
21
22#define PCIE_LINK_STATE_L0S 1
23#define PCIE_LINK_STATE_L1 2
24#define PCIE_LINK_STATE_CLKPM 4
25
26#ifdef CONFIG_PCIEASPM
Bjorn Helgaasf39d5b72013-04-12 12:02:59 -060027void pcie_aspm_init_link_state(struct pci_dev *pdev);
28void pcie_aspm_exit_link_state(struct pci_dev *pdev);
29void pcie_aspm_pm_state_change(struct pci_dev *pdev);
30void pcie_aspm_powersave_config_link(struct pci_dev *pdev);
31void pci_disable_link_state(struct pci_dev *pdev, int state);
32void pci_disable_link_state_locked(struct pci_dev *pdev, int state);
Bjorn Helgaasf39d5b72013-04-12 12:02:59 -060033void pcie_no_aspm(void);
Shaohua Li7d715a62008-02-25 09:46:41 +080034#else
35static inline void pcie_aspm_init_link_state(struct pci_dev *pdev)
36{
37}
38static inline void pcie_aspm_exit_link_state(struct pci_dev *pdev)
39{
40}
41static inline void pcie_aspm_pm_state_change(struct pci_dev *pdev)
42{
43}
Naga Chumbalkar1a680b72011-03-21 03:29:08 +000044static inline void pcie_aspm_powersave_config_link(struct pci_dev *pdev)
45{
46}
Shaohua Li7d715a62008-02-25 09:46:41 +080047static inline void pci_disable_link_state(struct pci_dev *pdev, int state)
48{
49}
Shaohua Li5fde2442008-07-23 10:32:24 +080050static inline void pcie_no_aspm(void)
51{
52}
Shaohua Li7d715a62008-02-25 09:46:41 +080053#endif
54
55#ifdef CONFIG_PCIEASPM_DEBUG /* this depends on CONFIG_PCIEASPM */
Bjorn Helgaasf39d5b72013-04-12 12:02:59 -060056void pcie_aspm_create_sysfs_dev_files(struct pci_dev *pdev);
57void pcie_aspm_remove_sysfs_dev_files(struct pci_dev *pdev);
Shaohua Li7d715a62008-02-25 09:46:41 +080058#else
59static inline void pcie_aspm_create_sysfs_dev_files(struct pci_dev *pdev)
60{
61}
62static inline void pcie_aspm_remove_sysfs_dev_files(struct pci_dev *pdev)
63{
64}
65#endif
66#endif /* LINUX_ASPM_H */