diff options
author | Ben Cahill <ben.m.cahill@intel.com> | 2009-10-30 17:36:06 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-11-02 15:39:44 -0500 |
commit | 88521364cc04b67f36748983545b9fe1d4ba4a15 (patch) | |
tree | 439c03a036e51326fd472f33932884047c0f3ee1 /drivers | |
parent | 5220af0c3b44f5d6e32661e5bb49154c514dbf4f (diff) |
iwlwifi: remove power-wasting calls to apm_ops.init()
To save power, don't run apm_ops.init() until needed at "up" time.
EEPROM (5000 and earlier devices) may be read without running apm_ops.init(),
but OTP reads (6000 and newer devices) require a powered-up chip.
Therefore, remove apm_ops.init() from the general path in XXXX_pci_probe(),
and call it only if device uses OTP. Once done with OTP read, call
apm_ops.stop() to reset chip and save power until "up" time comes around.
NOTE: This patch depends on removal of priv->lock from iwl_apm_stop();
lock does not get initialized until later in flow. See patch
"remove unneeded locks from apm_stop()".
Signed-off-by: Ben Cahill <ben.m.cahill@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-eeprom.c | 11 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl3945-base.c | 7 |
3 files changed, 11 insertions, 13 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index 05d1070e22d0..6daaad1e4bc9 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -3113,12 +3113,6 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
3113 | goto out_iounmap; | 3113 | goto out_iounmap; |
3114 | } | 3114 | } |
3115 | 3115 | ||
3116 | /* amp init */ | ||
3117 | err = priv->cfg->ops->lib->apm_ops.init(priv); | ||
3118 | if (err < 0) { | ||
3119 | IWL_ERR(priv, "Failed to init APMG\n"); | ||
3120 | goto out_iounmap; | ||
3121 | } | ||
3122 | /***************** | 3116 | /***************** |
3123 | * 4. Read EEPROM | 3117 | * 4. Read EEPROM |
3124 | *****************/ | 3118 | *****************/ |
diff --git a/drivers/net/wireless/iwlwifi/iwl-eeprom.c b/drivers/net/wireless/iwlwifi/iwl-eeprom.c index 9429cb1c69bd..8a0709e81a9f 100644 --- a/drivers/net/wireless/iwlwifi/iwl-eeprom.c +++ b/drivers/net/wireless/iwlwifi/iwl-eeprom.c | |||
@@ -533,6 +533,10 @@ int iwl_eeprom_init(struct iwl_priv *priv) | |||
533 | goto err; | 533 | goto err; |
534 | } | 534 | } |
535 | if (priv->nvm_device_type == NVM_DEVICE_TYPE_OTP) { | 535 | if (priv->nvm_device_type == NVM_DEVICE_TYPE_OTP) { |
536 | |||
537 | /* OTP reads require powered-up chip */ | ||
538 | priv->cfg->ops->lib->apm_ops.init(priv); | ||
539 | |||
536 | ret = iwl_init_otp_access(priv); | 540 | ret = iwl_init_otp_access(priv); |
537 | if (ret) { | 541 | if (ret) { |
538 | IWL_ERR(priv, "Failed to initialize OTP access.\n"); | 542 | IWL_ERR(priv, "Failed to initialize OTP access.\n"); |
@@ -563,6 +567,13 @@ int iwl_eeprom_init(struct iwl_priv *priv) | |||
563 | e[cache_addr / 2] = eeprom_data; | 567 | e[cache_addr / 2] = eeprom_data; |
564 | cache_addr += sizeof(u16); | 568 | cache_addr += sizeof(u16); |
565 | } | 569 | } |
570 | |||
571 | /* | ||
572 | * Now that OTP reads are complete, reset chip to save | ||
573 | * power until we load uCode during "up". | ||
574 | */ | ||
575 | priv->cfg->ops->lib->apm_ops.stop(priv); | ||
576 | |||
566 | } else { | 577 | } else { |
567 | /* eeprom is an array of 16bit values */ | 578 | /* eeprom is an array of 16bit values */ |
568 | for (addr = 0; addr < sz; addr += sizeof(u16)) { | 579 | for (addr = 0; addr < sz; addr += sizeof(u16)) { |
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index 5c80a83eb2e1..23b31e6dcacd 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -4000,13 +4000,6 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e | |||
4000 | */ | 4000 | */ |
4001 | spin_lock_init(&priv->reg_lock); | 4001 | spin_lock_init(&priv->reg_lock); |
4002 | 4002 | ||
4003 | /* amp init */ | ||
4004 | err = priv->cfg->ops->lib->apm_ops.init(priv); | ||
4005 | if (err < 0) { | ||
4006 | IWL_DEBUG_INFO(priv, "Failed to init the card\n"); | ||
4007 | goto out_iounmap; | ||
4008 | } | ||
4009 | |||
4010 | /*********************** | 4003 | /*********************** |
4011 | * 4. Read EEPROM | 4004 | * 4. Read EEPROM |
4012 | * ********************/ | 4005 | * ********************/ |