60720a721e30eeaad06bfd6bdefdc08315b84aa1
[openwrt/staging/hauke.git] / package / kernel / mac80211 / patches / ath11k / 900-ath11k-control-thermal-support-via-symbol.patch
1 From 703d6551f71e7290619d6effe2a25a64e10538b7 Mon Sep 17 00:00:00 2001
2 From: Robert Marko <robimarko@gmail.com>
3 Date: Thu, 15 Dec 2022 12:20:52 +0100
4 Subject: [PATCH] ath11k: control thermal support via symbol
5
6 Currently, thermal support will get built if CONFIG_THERMAL is reachable,
7 however this is not suitable for OpenWrt as with ALL_KMODS being set to y
8 ATH11K_THERMAL wont get selected and so hwmon and thermal kmods wont get
9 pulled in resulting in a build-failure.
10
11 So, to avoid that, lets do what is already done for ath10k and add a
12 config symbol into backports for enabling thermal support.
13
14 Signed-off-by: Robert Marko <robimarko@gmail.com>
15 ---
16 drivers/net/wireless/ath/ath11k/Kconfig | 7 +++++++
17 drivers/net/wireless/ath/ath11k/Makefile | 2 +-
18 drivers/net/wireless/ath/ath11k/thermal.h | 2 +-
19 local-symbols | 1 +
20 4 files changed, 10 insertions(+), 2 deletions(-)
21
22 --- a/drivers/net/wireless/ath/ath11k/Kconfig
23 +++ b/drivers/net/wireless/ath/ath11k/Kconfig
24 @@ -61,3 +61,10 @@ config ATH11K_SPECTRAL
25 Enable ath11k spectral scan support
26
27 Say Y to enable access to the FFT/spectral data via debugfs.
28 +
29 +config ATH11K_THERMAL
30 + bool "ath11k thermal sensors and throttling support"
31 + depends on ATH11K
32 + depends on THERMAL
33 + help
34 + Enable ath11k thermal sensors and throttling support.
35 --- a/drivers/net/wireless/ath/ath11k/Makefile
36 +++ b/drivers/net/wireless/ath/ath11k/Makefile
37 @@ -22,7 +22,7 @@ ath11k-y += core.o \
38 ath11k-$(CPTCFG_ATH11K_DEBUGFS) += debugfs.o debugfs_htt_stats.o debugfs_sta.o
39 ath11k-$(CPTCFG_NL80211_TESTMODE) += testmode.o
40 ath11k-$(CPTCFG_ATH11K_TRACING) += trace.o
41 -ath11k-$(CONFIG_THERMAL) += thermal.o
42 +ath11k-$(CPTCFG_ATH11K_THERMAL) += thermal.o
43 ath11k-$(CPTCFG_ATH11K_SPECTRAL) += spectral.o
44 ath11k-$(CONFIG_PM) += wow.o
45
46 --- a/drivers/net/wireless/ath/ath11k/thermal.h
47 +++ b/drivers/net/wireless/ath/ath11k/thermal.h
48 @@ -25,7 +25,7 @@ struct ath11k_thermal {
49 int temperature;
50 };
51
52 -#if IS_REACHABLE(CONFIG_THERMAL)
53 +#if IS_REACHABLE(CPTCFG_ATH11K_THERMAL)
54 int ath11k_thermal_register(struct ath11k_base *sc);
55 void ath11k_thermal_unregister(struct ath11k_base *sc);
56 int ath11k_thermal_set_throttling(struct ath11k *ar, u32 throttle_state);
57 --- a/local-symbols
58 +++ b/local-symbols
59 @@ -174,6 +174,7 @@ ATH11K_DEBUG=
60 ATH11K_DEBUGFS=
61 ATH11K_TRACING=
62 ATH11K_SPECTRAL=
63 +ATH11K_THERMAL=
64 WLAN_VENDOR_ATMEL=
65 ATMEL=
66 PCI_ATMEL=