Commit 8d425517 authored by Emmanuel Grumbach's avatar Emmanuel Grumbach Committed by Wey-Yi Guy

iwlwifi: make a static inline to read the RF kill register

Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: default avatarWey-Yi Guy <wey-yi.w.guy@intel.com>
parent 0586a11b
...@@ -430,4 +430,10 @@ trans_pcie_get_cmd_string(struct iwl_trans_pcie *trans_pcie, u8 cmd) ...@@ -430,4 +430,10 @@ trans_pcie_get_cmd_string(struct iwl_trans_pcie *trans_pcie, u8 cmd)
return trans_pcie->command_names[cmd]; return trans_pcie->command_names[cmd];
} }
static inline bool iwl_is_rfkill_set(struct iwl_trans *trans)
{
return !(iwl_read32(trans, CSR_GP_CNTRL) &
CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW);
}
#endif /* __iwl_trans_int_pcie_h__ */ #endif /* __iwl_trans_int_pcie_h__ */
...@@ -648,8 +648,7 @@ void iwl_irq_tasklet(struct iwl_trans *trans) ...@@ -648,8 +648,7 @@ void iwl_irq_tasklet(struct iwl_trans *trans)
if (inta & CSR_INT_BIT_RF_KILL) { if (inta & CSR_INT_BIT_RF_KILL) {
bool hw_rfkill; bool hw_rfkill;
hw_rfkill = !(iwl_read32(trans, CSR_GP_CNTRL) & hw_rfkill = iwl_is_rfkill_set(trans);
CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW);
IWL_WARN(trans, "RF_KILL bit toggled to %s.\n", IWL_WARN(trans, "RF_KILL bit toggled to %s.\n",
hw_rfkill ? "disable radio" : "enable radio"); hw_rfkill ? "disable radio" : "enable radio");
......
...@@ -981,8 +981,7 @@ static int iwl_trans_pcie_start_fw(struct iwl_trans *trans, ...@@ -981,8 +981,7 @@ static int iwl_trans_pcie_start_fw(struct iwl_trans *trans,
} }
/* If platform's RF_KILL switch is NOT set to KILL */ /* If platform's RF_KILL switch is NOT set to KILL */
hw_rfkill = !(iwl_read32(trans, CSR_GP_CNTRL) & hw_rfkill = iwl_is_rfkill_set(trans);
CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW);
iwl_op_mode_hw_rf_kill(trans->op_mode, hw_rfkill); iwl_op_mode_hw_rf_kill(trans->op_mode, hw_rfkill);
if (hw_rfkill) { if (hw_rfkill) {
...@@ -1422,8 +1421,7 @@ static int iwl_trans_pcie_start_hw(struct iwl_trans *trans) ...@@ -1422,8 +1421,7 @@ static int iwl_trans_pcie_start_hw(struct iwl_trans *trans)
iwl_apm_init(trans); iwl_apm_init(trans);
hw_rfkill = !(iwl_read32(trans, CSR_GP_CNTRL) & hw_rfkill = iwl_is_rfkill_set(trans);
CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW);
iwl_op_mode_hw_rf_kill(trans->op_mode, hw_rfkill); iwl_op_mode_hw_rf_kill(trans->op_mode, hw_rfkill);
return err; return err;
...@@ -1562,8 +1560,7 @@ static int iwl_trans_pcie_resume(struct iwl_trans *trans) ...@@ -1562,8 +1560,7 @@ static int iwl_trans_pcie_resume(struct iwl_trans *trans)
{ {
bool hw_rfkill; bool hw_rfkill;
hw_rfkill = !(iwl_read32(trans, CSR_GP_CNTRL) & hw_rfkill = iwl_is_rfkill_set(trans);
CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW);
if (hw_rfkill) if (hw_rfkill)
iwl_enable_rfkill_int(trans); iwl_enable_rfkill_int(trans);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment