diff options
author | Maya Erez <qca_merez@qca.qualcomm.com> | 2017-12-14 18:53:08 +0200 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2018-01-09 10:03:21 +0200 |
commit | 594b59ec70e14f9cdb901f9e2c7c6a771c6231fa (patch) | |
tree | 8c060bcb0c9df1949b26c823d7bfee95b6e38c97 /drivers/net/wireless/ath/wil6210/main.c | |
parent | 38e4c25d606920f4120c4f050657fa8ee736c8d7 (diff) | |
download | linux-594b59ec70e14f9cdb901f9e2c7c6a771c6231fa.tar.gz linux-594b59ec70e14f9cdb901f9e2c7c6a771c6231fa.tar.bz2 linux-594b59ec70e14f9cdb901f9e2c7c6a771c6231fa.zip |
wil6210: set platform features based on FW capabilities
In some cases the platform should be aware of the FW capabilities
to decide which feature to enable.
For example, FW can control the external REF clock for power saving.
Driver should notify the platform about that, to allow platform
power management optimization.
Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/ath/wil6210/main.c')
-rw-r--r-- | drivers/net/wireless/ath/wil6210/main.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/wil6210/main.c b/drivers/net/wireless/ath/wil6210/main.c index bafd8d515618..7a8f8c209af8 100644 --- a/drivers/net/wireless/ath/wil6210/main.c +++ b/drivers/net/wireless/ath/wil6210/main.c @@ -771,6 +771,7 @@ static void wil_collect_fw_info(struct wil6210_priv *wil) void wil_refresh_fw_capabilities(struct wil6210_priv *wil) { struct wiphy *wiphy = wil_to_wiphy(wil); + int features; wil->keep_radio_on_during_sleep = test_bit(WIL_PLATFORM_CAPA_RADIO_ON_IN_SUSPEND, @@ -792,6 +793,16 @@ void wil_refresh_fw_capabilities(struct wil6210_priv *wil) wiphy->max_sched_scan_ie_len = WMI_MAX_IE_LEN; wiphy->max_sched_scan_plans = WMI_MAX_PLANS_NUM; } + + if (wil->platform_ops.set_features) { + features = (test_bit(WMI_FW_CAPABILITY_REF_CLOCK_CONTROL, + wil->fw_capabilities) && + test_bit(WIL_PLATFORM_CAPA_EXT_CLK, + wil->platform_capa)) ? + BIT(WIL_PLATFORM_FEATURE_FW_EXT_CLK_CONTROL) : 0; + + wil->platform_ops.set_features(wil->platform_handle, features); + } } void wil_mbox_ring_le2cpus(struct wil6210_mbox_ring *r) |