iwlwifi: mvm: add soc latency support
Some devices require longer time to stabilize the power and XTAL. This is especially true for devices integrated in the SoC. Add support for a new firmware API that allows the driver to set the latency value accordingly. Change-Id: I6829a46b89e4e701f80a0e4033f4dd41ee44ed12 Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
This commit is contained in:

committed by
Luca Coelho

parent
3af4da165f
commit
cceb45078a
@@ -73,6 +73,7 @@
|
||||
#include "fw/api/datapath.h"
|
||||
#include "fw/api/phy.h"
|
||||
#include "fw/api/config.h"
|
||||
#include "fw/api/soc.h"
|
||||
#include "fw/api/alive.h"
|
||||
#include "fw/api/binding.h"
|
||||
#include "fw/api/cmdhdr.h"
|
||||
|
@@ -5,10 +5,9 @@
|
||||
*
|
||||
* GPL LICENSE SUMMARY
|
||||
*
|
||||
* Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
|
||||
* Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
|
||||
* Copyright(c) 2016 - 2017 Intel Deutschland GmbH
|
||||
* Copyright(c) 2018 - 2019 Intel Corporation
|
||||
* Copyright(c) 2012 - 2014, 2018 - 2020 Intel Corporation
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of version 2 of the GNU General Public License as
|
||||
@@ -28,10 +27,9 @@
|
||||
*
|
||||
* BSD LICENSE
|
||||
*
|
||||
* Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
|
||||
* Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
|
||||
* Copyright(c) 2016 - 2017 Intel Deutschland GmbH
|
||||
* Copyright(c) 2018 - 2019 Intel Corporation
|
||||
* Copyright(c) 2012 - 2014, 2018 - 2020 Intel Corporation
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -89,6 +87,25 @@ struct iwl_mvm_alive_data {
|
||||
u32 scd_base_addr;
|
||||
};
|
||||
|
||||
/* set device type and latency */
|
||||
static int iwl_set_soc_latency(struct iwl_mvm *mvm)
|
||||
{
|
||||
struct iwl_soc_configuration_cmd cmd;
|
||||
int ret;
|
||||
|
||||
cmd.device_type = (mvm->trans->cfg->integrated) ?
|
||||
cpu_to_le32(SOC_CONFIG_CMD_INTEGRATED) :
|
||||
cpu_to_le32(SOC_CONFIG_CMD_DISCRETE);
|
||||
cmd.soc_latency = cpu_to_le32(mvm->trans->cfg->soc_latency);
|
||||
|
||||
ret = iwl_mvm_send_cmd_pdu(mvm, iwl_cmd_id(SOC_CONFIGURATION_CMD,
|
||||
SYSTEM_GROUP, 0), 0,
|
||||
sizeof(cmd), &cmd);
|
||||
if (ret)
|
||||
IWL_ERR(mvm, "Failed to set soc latency: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int iwl_send_tx_ant_cfg(struct iwl_mvm *mvm, u8 valid_tx_ant)
|
||||
{
|
||||
struct iwl_tx_ant_cfg_cmd tx_ant_cmd = {
|
||||
@@ -1103,6 +1120,13 @@ int iwl_mvm_up(struct iwl_mvm *mvm)
|
||||
if (ret)
|
||||
goto error;
|
||||
|
||||
if (fw_has_capa(&mvm->fw->ucode_capa,
|
||||
IWL_UCODE_TLV_CAPA_SOC_LATENCY_SUPPORT)) {
|
||||
ret = iwl_set_soc_latency(mvm);
|
||||
if (ret)
|
||||
goto error;
|
||||
}
|
||||
|
||||
/* Init RSS configuration */
|
||||
if (mvm->trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_22000) {
|
||||
ret = iwl_configure_rxq(mvm);
|
||||
|
Reference in New Issue
Block a user