diff options
author | Hauke Mehrtens <hauke@hauke-m.de> | 2020-04-19 23:35:17 +0200 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2020-04-21 22:15:13 +0200 |
commit | c89a3f0e275e1bb78bfdd66aa9529c60800fc9bd (patch) | |
tree | a1a2f40f134cb1632e414e3221400db3e69edda6 | |
parent | 6055f62b580bbff65a0193bd0abdf39507ce9fd8 (diff) | |
download | backports-c89a3f0e275e1bb78bfdd66aa9529c60800fc9bd.tar.gz |
backports: pm_qos: Add cpu_latency_qos_* functions
The upstream commit fa048c59bf1b ("PM: QoS: Add CPU latency QoS API
wrappers") add the new cpu_latency_qos_* functions. In the initial
commit they are just calling the functions from the old API. Use this
first step to backport these functions. They are used by the ath10k and
ipw2100 driver.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
-rw-r--r-- | backport/backport-include/linux/pm_qos.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/backport/backport-include/linux/pm_qos.h b/backport/backport-include/linux/pm_qos.h index d5bfc9bc..18cbbace 100644 --- a/backport/backport-include/linux/pm_qos.h +++ b/backport/backport-include/linux/pm_qos.h @@ -13,4 +13,33 @@ #define PM_QOS_DEFAULT_VALUE -1 #endif +#if LINUX_VERSION_IS_LESS(5,7,0) +static inline void cpu_latency_qos_add_request(struct pm_qos_request *req, + s32 value) +{ + pm_qos_add_request(req, PM_QOS_CPU_DMA_LATENCY, value); +} + +static inline void cpu_latency_qos_update_request(struct pm_qos_request *req, + s32 new_value) +{ + pm_qos_update_request(req, new_value); +} + +static inline void cpu_latency_qos_remove_request(struct pm_qos_request *req) +{ + pm_qos_remove_request(req); +} + +static inline bool cpu_latency_qos_request_active(struct pm_qos_request *req) +{ + return pm_qos_request_active(req); +} + +static inline s32 cpu_latency_qos_limit(void) +{ + return pm_qos_request(PM_QOS_CPU_DMA_LATENCY); +} +#endif /* < 5.7 */ + #endif /* _COMPAT_LINUX_PM_QOS_H */ |