aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAbhijeet Kolekar <abhijeet.kolekar@intel.com>2009-10-02 16:44:05 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-10-07 16:39:45 -0400
commit1739d3322008fb95e88ad0530bcc057789107879 (patch)
tree4313490309c954c6edb72d90e73e326dcfd17cce
parentd68b603cf01a6e7d8c85c5a86db751ed3960c0c7 (diff)
iwlwifi: replace iwl_poll_direct_bit with iwl_poll_bit for CSR access
Replace iwl_poll_direct_bit with iwl_poll_bit when accessing CSR registers. There is no need to power up the mac to access CSR registers. Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com> Acked-by: Ben M Cahill <ben.m.cahill@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945.c10
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965.c6
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-5000.c6
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-eeprom.c12
5 files changed, 23 insertions, 13 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c
index c5d1d57b4e0b..ced0e33e44b2 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.c
@@ -999,8 +999,9 @@ static int iwl3945_apm_init(struct iwl_priv *priv)
999 * D0U* --> D0A* state */ 999 * D0U* --> D0A* state */
1000 iwl_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE); 1000 iwl_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE);
1001 1001
1002 ret = iwl_poll_direct_bit(priv, CSR_GP_CNTRL, 1002 ret = iwl_poll_bit(priv, CSR_GP_CNTRL,
1003 CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000); 1003 CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY,
1004 CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000);
1004 if (ret < 0) { 1005 if (ret < 0) {
1005 IWL_DEBUG_INFO(priv, "Failed to init the card\n"); 1006 IWL_DEBUG_INFO(priv, "Failed to init the card\n");
1006 goto out; 1007 goto out;
@@ -1177,8 +1178,9 @@ static int iwl3945_apm_reset(struct iwl_priv *priv)
1177 1178
1178 iwl_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE); 1179 iwl_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE);
1179 1180
1180 iwl_poll_direct_bit(priv, CSR_GP_CNTRL, 1181 iwl_poll_bit(priv, CSR_GP_CNTRL,
1181 CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000); 1182 CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY,
1183 CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000);
1182 1184
1183 iwl_write_prph(priv, APMG_CLK_CTRL_REG, 1185 iwl_write_prph(priv, APMG_CLK_CTRL_REG,
1184 APMG_CLK_VAL_BSM_CLK_RQT); 1186 APMG_CLK_VAL_BSM_CLK_RQT);
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index dd10c426ecc4..f8eed9a4abc1 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -335,7 +335,8 @@ static int iwl4965_apm_init(struct iwl_priv *priv)
335 iwl_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE); 335 iwl_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE);
336 336
337 /* wait for clock stabilization */ 337 /* wait for clock stabilization */
338 ret = iwl_poll_direct_bit(priv, CSR_GP_CNTRL, 338 ret = iwl_poll_bit(priv, CSR_GP_CNTRL,
339 CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY,
339 CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000); 340 CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000);
340 if (ret < 0) { 341 if (ret < 0) {
341 IWL_DEBUG_INFO(priv, "Failed to init the card\n"); 342 IWL_DEBUG_INFO(priv, "Failed to init the card\n");
@@ -411,7 +412,8 @@ static int iwl4965_apm_reset(struct iwl_priv *priv)
411 412
412 iwl_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE); 413 iwl_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE);
413 414
414 ret = iwl_poll_direct_bit(priv, CSR_GP_CNTRL, 415 ret = iwl_poll_bit(priv, CSR_GP_CNTRL,
416 CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY,
415 CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000); 417 CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000);
416 if (ret < 0) 418 if (ret < 0)
417 goto out; 419 goto out;
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c
index d8dadbf04138..98baf8af6da8 100644
--- a/drivers/net/wireless/iwlwifi/iwl-5000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-5000.c
@@ -98,7 +98,8 @@ int iwl5000_apm_init(struct iwl_priv *priv)
98 iwl_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE); 98 iwl_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE);
99 99
100 /* wait for clock stabilization */ 100 /* wait for clock stabilization */
101 ret = iwl_poll_direct_bit(priv, CSR_GP_CNTRL, 101 ret = iwl_poll_bit(priv, CSR_GP_CNTRL,
102 CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY,
102 CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000); 103 CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000);
103 if (ret < 0) { 104 if (ret < 0) {
104 IWL_DEBUG_INFO(priv, "Failed to init the card\n"); 105 IWL_DEBUG_INFO(priv, "Failed to init the card\n");
@@ -138,7 +139,8 @@ int iwl5000_apm_reset(struct iwl_priv *priv)
138 iwl_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE); 139 iwl_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE);
139 140
140 /* wait for clock stabilization */ 141 /* wait for clock stabilization */
141 ret = iwl_poll_direct_bit(priv, CSR_GP_CNTRL, 142 ret = iwl_poll_bit(priv, CSR_GP_CNTRL,
143 CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY,
142 CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000); 144 CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000);
143 if (ret < 0) { 145 if (ret < 0) {
144 IWL_DEBUG_INFO(priv, "Failed to init the card\n"); 146 IWL_DEBUG_INFO(priv, "Failed to init the card\n");
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index 7c0ef8e4ebbf..dc7fd87bed98 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -1338,7 +1338,7 @@ int iwl_apm_stop_master(struct iwl_priv *priv)
1338 /* set stop master bit */ 1338 /* set stop master bit */
1339 iwl_set_bit(priv, CSR_RESET, CSR_RESET_REG_FLAG_STOP_MASTER); 1339 iwl_set_bit(priv, CSR_RESET, CSR_RESET_REG_FLAG_STOP_MASTER);
1340 1340
1341 iwl_poll_direct_bit(priv, CSR_RESET, 1341 iwl_poll_bit(priv, CSR_RESET, CSR_RESET_REG_FLAG_MASTER_DISABLED,
1342 CSR_RESET_REG_FLAG_MASTER_DISABLED, 100); 1342 CSR_RESET_REG_FLAG_MASTER_DISABLED, 100);
1343 1343
1344 spin_unlock_irqrestore(&priv->lock, flags); 1344 spin_unlock_irqrestore(&priv->lock, flags);
diff --git a/drivers/net/wireless/iwlwifi/iwl-eeprom.c b/drivers/net/wireless/iwlwifi/iwl-eeprom.c
index 3d2b93a61e62..8107132ab66c 100644
--- a/drivers/net/wireless/iwlwifi/iwl-eeprom.c
+++ b/drivers/net/wireless/iwlwifi/iwl-eeprom.c
@@ -283,7 +283,8 @@ int iwlcore_eeprom_acquire_semaphore(struct iwl_priv *priv)
283 CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM); 283 CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM);
284 284
285 /* See if we got it */ 285 /* See if we got it */
286 ret = iwl_poll_direct_bit(priv, CSR_HW_IF_CONFIG_REG, 286 ret = iwl_poll_bit(priv, CSR_HW_IF_CONFIG_REG,
287 CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM,
287 CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM, 288 CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM,
288 EEPROM_SEM_TIMEOUT); 289 EEPROM_SEM_TIMEOUT);
289 if (ret >= 0) { 290 if (ret >= 0) {
@@ -322,7 +323,8 @@ static int iwl_init_otp_access(struct iwl_priv *priv)
322 CSR_GP_CNTRL_REG_FLAG_INIT_DONE); 323 CSR_GP_CNTRL_REG_FLAG_INIT_DONE);
323 324
324 /* wait for clock to be ready */ 325 /* wait for clock to be ready */
325 ret = iwl_poll_direct_bit(priv, CSR_GP_CNTRL, 326 ret = iwl_poll_bit(priv, CSR_GP_CNTRL,
327 CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY,
326 CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 328 CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY,
327 25000); 329 25000);
328 if (ret < 0) 330 if (ret < 0)
@@ -345,7 +347,8 @@ static int iwl_read_otp_word(struct iwl_priv *priv, u16 addr, u16 *eeprom_data)
345 347
346 _iwl_write32(priv, CSR_EEPROM_REG, 348 _iwl_write32(priv, CSR_EEPROM_REG,
347 CSR_EEPROM_REG_MSK_ADDR & (addr << 1)); 349 CSR_EEPROM_REG_MSK_ADDR & (addr << 1));
348 ret = iwl_poll_direct_bit(priv, CSR_EEPROM_REG, 350 ret = iwl_poll_bit(priv, CSR_EEPROM_REG,
351 CSR_EEPROM_REG_READ_VALID_MSK,
349 CSR_EEPROM_REG_READ_VALID_MSK, 352 CSR_EEPROM_REG_READ_VALID_MSK,
350 IWL_EEPROM_ACCESS_TIMEOUT); 353 IWL_EEPROM_ACCESS_TIMEOUT);
351 if (ret < 0) { 354 if (ret < 0) {
@@ -538,7 +541,8 @@ int iwl_eeprom_init(struct iwl_priv *priv)
538 _iwl_write32(priv, CSR_EEPROM_REG, 541 _iwl_write32(priv, CSR_EEPROM_REG,
539 CSR_EEPROM_REG_MSK_ADDR & (addr << 1)); 542 CSR_EEPROM_REG_MSK_ADDR & (addr << 1));
540 543
541 ret = iwl_poll_direct_bit(priv, CSR_EEPROM_REG, 544 ret = iwl_poll_bit(priv, CSR_EEPROM_REG,
545 CSR_EEPROM_REG_READ_VALID_MSK,
542 CSR_EEPROM_REG_READ_VALID_MSK, 546 CSR_EEPROM_REG_READ_VALID_MSK,
543 IWL_EEPROM_ACCESS_TIMEOUT); 547 IWL_EEPROM_ACCESS_TIMEOUT);
544 if (ret < 0) { 548 if (ret < 0) {