aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-4965.c
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2008-04-16 19:34:49 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-05-07 15:02:10 -0400
commit6f4083aadd57e3da12fa4e67fcadaec23138a315 (patch)
treed824f8591b67b8d575b225928af84d491528736a /drivers/net/wireless/iwlwifi/iwl-4965.c
parent947b13a7ccd31d8adbf41f466d6a1c770461596a (diff)
iwlwifi: cleanup set_pwr_src
This patch cleans up semantic of set_pwr_src set_pwr_src is now part of apm handlers group in iwlcore Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-4965.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index f318c50a1a8f..69a355bbb97a 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -492,7 +492,7 @@ int iwl4965_hw_rxq_stop(struct iwl_priv *priv)
492 return 0; 492 return 0;
493} 493}
494 494
495static int iwl4965_nic_set_pwr_src(struct iwl_priv *priv, int pwr_max) 495static int iwl4965_set_pwr_src(struct iwl_priv *priv, enum iwl_pwr_src src)
496{ 496{
497 int ret; 497 int ret;
498 unsigned long flags; 498 unsigned long flags;
@@ -504,20 +504,21 @@ static int iwl4965_nic_set_pwr_src(struct iwl_priv *priv, int pwr_max)
504 return ret; 504 return ret;
505 } 505 }
506 506
507 if (!pwr_max) { 507 if (src == IWL_PWR_SRC_VAUX) {
508 u32 val; 508 u32 val;
509
510 ret = pci_read_config_dword(priv->pci_dev, PCI_POWER_SOURCE, 509 ret = pci_read_config_dword(priv->pci_dev, PCI_POWER_SOURCE,
511 &val); 510 &val);
512 511
513 if (val & PCI_CFG_PMC_PME_FROM_D3COLD_SUPPORT) 512 if (val & PCI_CFG_PMC_PME_FROM_D3COLD_SUPPORT) {
514 iwl_set_bits_mask_prph(priv, APMG_PS_CTRL_REG, 513 iwl_set_bits_mask_prph(priv, APMG_PS_CTRL_REG,
515 APMG_PS_CTRL_VAL_PWR_SRC_VAUX, 514 APMG_PS_CTRL_VAL_PWR_SRC_VAUX,
516 ~APMG_PS_CTRL_MSK_PWR_SRC); 515 ~APMG_PS_CTRL_MSK_PWR_SRC);
517 } else 516 }
517 } else {
518 iwl_set_bits_mask_prph(priv, APMG_PS_CTRL_REG, 518 iwl_set_bits_mask_prph(priv, APMG_PS_CTRL_REG,
519 APMG_PS_CTRL_VAL_PWR_SRC_VMAIN, 519 APMG_PS_CTRL_VAL_PWR_SRC_VMAIN,
520 ~APMG_PS_CTRL_MSK_PWR_SRC); 520 ~APMG_PS_CTRL_MSK_PWR_SRC);
521 }
521 522
522 iwl_release_nic_access(priv); 523 iwl_release_nic_access(priv);
523 spin_unlock_irqrestore(&priv->lock, flags); 524 spin_unlock_irqrestore(&priv->lock, flags);
@@ -747,7 +748,8 @@ int iwl4965_hw_nic_init(struct iwl_priv *priv)
747 748
748 IWL_DEBUG_INFO("HW Revision ID = 0x%X\n", rev_id); 749 IWL_DEBUG_INFO("HW Revision ID = 0x%X\n", rev_id);
749 750
750 iwl4965_nic_set_pwr_src(priv, 1); 751 rc = priv->cfg->ops->lib->apm_ops.set_pwr_src(priv, IWL_PWR_SRC_VMAIN);
752
751 spin_lock_irqsave(&priv->lock, flags); 753 spin_lock_irqsave(&priv->lock, flags);
752 754
753 if ((rev_id & 0x80) == 0x80 && (rev_id & 0x7f) < 8) { 755 if ((rev_id & 0x80) == 0x80 && (rev_id & 0x7f) < 8) {
@@ -4272,6 +4274,9 @@ static struct iwl_lib_ops iwl4965_lib = {
4272 .is_valid_rtc_data_addr = iwl4965_hw_valid_rtc_data_addr, 4274 .is_valid_rtc_data_addr = iwl4965_hw_valid_rtc_data_addr,
4273 .alive_notify = iwl4965_alive_notify, 4275 .alive_notify = iwl4965_alive_notify,
4274 .load_ucode = iwl4965_load_bsm, 4276 .load_ucode = iwl4965_load_bsm,
4277 .apm_ops = {
4278 .set_pwr_src = iwl4965_set_pwr_src,
4279 },
4275 .eeprom_ops = { 4280 .eeprom_ops = {
4276 .verify_signature = iwlcore_eeprom_verify_signature, 4281 .verify_signature = iwlcore_eeprom_verify_signature,
4277 .acquire_semaphore = iwlcore_eeprom_acquire_semaphore, 4282 .acquire_semaphore = iwlcore_eeprom_acquire_semaphore,