Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[drm/drm-misc.git] / drivers / infiniband / hw / hfi1 / aspm.h
blobc8d92dc13daa2f9572a9d1ed53c2b3f1e961a3eb
1 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
2 /*
3 * Copyright(c) 2015-2017 Intel Corporation.
4 */
6 #ifndef _ASPM_H
7 #define _ASPM_H
9 #include "hfi.h"
11 extern uint aspm_mode;
13 enum aspm_mode {
14 ASPM_MODE_DISABLED = 0, /* ASPM always disabled, performance mode */
15 ASPM_MODE_ENABLED = 1, /* ASPM always enabled, power saving mode */
16 ASPM_MODE_DYNAMIC = 2, /* ASPM enabled/disabled dynamically */
19 void aspm_init(struct hfi1_devdata *dd);
20 void aspm_exit(struct hfi1_devdata *dd);
21 void aspm_hw_disable_l1(struct hfi1_devdata *dd);
22 void __aspm_ctx_disable(struct hfi1_ctxtdata *rcd);
23 void aspm_disable_all(struct hfi1_devdata *dd);
24 void aspm_enable_all(struct hfi1_devdata *dd);
26 static inline void aspm_ctx_disable(struct hfi1_ctxtdata *rcd)
28 /* Quickest exit for minimum impact */
29 if (likely(!rcd->aspm_intr_supported))
30 return;
32 __aspm_ctx_disable(rcd);
35 #endif /* _ASPM_H */