From patchwork Mon Jun 21 22:38:50 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Rodriguez X-Patchwork-Id: 107280 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o5LMctZu005332 for ; Mon, 21 Jun 2010 22:38:55 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754153Ab0FUWiy (ORCPT ); Mon, 21 Jun 2010 18:38:54 -0400 Received: from bombadil.infradead.org ([18.85.46.34]:39294 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751057Ab0FUWix (ORCPT ); Mon, 21 Jun 2010 18:38:53 -0400 Received: from mcgrof by bombadil.infradead.org with local (Exim 4.72 #1 (Red Hat Linux)) id 1OQpdj-00022K-Ru; Mon, 21 Jun 2010 22:38:51 +0000 From: "Luis R. Rodriguez" To: linville@tuxdriver.com Cc: linux-wireless@vger.kernel.org, "Luis R. Rodriguez" , Aeolus Yang , Madhan Jaganathan Subject: [PATCH 4/5] ath9k_hw: dynamically choose the SERDES array for low power Date: Mon, 21 Jun 2010 18:38:50 -0400 Message-Id: <1277159931-7797-5-git-send-email-lrodriguez@atheros.com> X-Mailer: git-send-email 1.6.2.rc1.3.g81d3f In-Reply-To: <1277159931-7797-1-git-send-email-lrodriguez@atheros.com> References: <1277159931-7797-1-git-send-email-lrodriguez@atheros.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Mon, 21 Jun 2010 22:38:55 +0000 (UTC) diff --git a/drivers/net/wireless/ath/ath9k/ar9003_hw.c b/drivers/net/wireless/ath/ath9k/ar9003_hw.c index 99bde5f..0641689 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_hw.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_hw.c @@ -305,11 +305,15 @@ static void ar9003_hw_configpcipowersave(struct ath_hw *ah, */ if (ah->config.pcieSerDesWrite) { unsigned int i; + struct ar5416IniArray *array; - for (i = 0; i < ah->iniPcieSerdesLowPower.ia_rows; i++) { + array = power_off ? &ah->iniPcieSerdes : + &ah->iniPcieSerdesLowPower; + + for (i = 0; i < array->ia_rows; i++) { REG_WRITE(ah, - INI_RA(&ah->iniPcieSerdesLowPower, i, 0), - INI_RA(&ah->iniPcieSerdesLowPower, i, 1)); + INI_RA(array, i, 0), + INI_RA(array, i, 1)); } } }