linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Luis R. Rodriguez" <lrodriguez@atheros.com>
To: "linville@tuxdriver.com" <linville@tuxdriver.com>
Cc: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	Sujith Manoharan <Sujith.Manoharan@Atheros.com>,
	Vasanth Thiagarajan <Vasanth.Thiagarajan@Atheros.com>,
	Luis Rodriguez <Luis.Rodriguez@Atheros.com>
Subject: Re: [PATCH v3 04/12] ath9k_hw: fix RF analog setup for AR9271
Date: Fri, 12 Mar 2010 22:05:16 -0800	[thread overview]
Message-ID: <20100313060516.GA6579@tux> (raw)
In-Reply-To: <1268459216-22372-5-git-send-email-lrodriguez@atheros.com>

On Fri, Mar 12, 2010 at 09:46:48PM -0800, Luis R. Rodriguez wrote:
> From: Sujith <Sujith.Manoharan@atheros.com>
> 
> AR9271 is a single chip and as such does not have external radios.
> Devices with external radio require additional programming, skip
> this for AR9271 as we do for other single chips.
> 
> Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
> Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
> ---
>  drivers/net/wireless/ath/ath9k/hw.c  |    6 +++---
>  drivers/net/wireless/ath/ath9k/phy.c |    6 +++---
>  2 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
> index b1a4a83..a0ef990 100644
> --- a/drivers/net/wireless/ath/ath9k/hw.c
> +++ b/drivers/net/wireless/ath/ath9k/hw.c
> @@ -517,7 +517,7 @@ static int ath9k_hw_post_init(struct ath_hw *ah)
>  		  ah->eep_ops->get_eeprom_ver(ah),
>  		  ah->eep_ops->get_eeprom_rev(ah));
>  
> -        if (!AR_SREV_9280_10_OR_LATER(ah)) {
> +	if (!AR_SREV_9280_10_OR_LATER(ah) && !AR_SREV_9271(ah)) {
>  		ecode = ath9k_hw_rf_alloc_ext_banks(ah);
>  		if (ecode) {
>  			ath_print(ath9k_hw_common(ah), ATH_DBG_FATAL,
> @@ -917,7 +917,7 @@ int ath9k_hw_init(struct ath_hw *ah)
>  	ath9k_hw_init_cal_settings(ah);
>  
>  	ah->ani_function = ATH9K_ANI_ALL;
> -	if (AR_SREV_9280_10_OR_LATER(ah)) {
> +	if (AR_SREV_9280_10_OR_LATER(ah) || AR_SREV_9271(ah)) {
>  		ah->ani_function &= ~ATH9K_ANI_NOISE_IMMUNITY_LEVEL;
>  		ah->ath9k_hw_rf_set_freq = &ath9k_hw_ar9280_set_channel;
>  		ah->ath9k_hw_spur_mitigate_freq = &ath9k_hw_9280_spur_mitigate;
> @@ -1266,7 +1266,7 @@ void ath9k_hw_deinit(struct ath_hw *ah)
>  	ath9k_hw_setpower(ah, ATH9K_PM_FULL_SLEEP);
>  
>  free_hw:
> -	if (!AR_SREV_9280_10_OR_LATER(ah))
> +	if (!AR_SREV_9280_10_OR_LATER(ah) && !AR_SREV_9271(ah))
>  		ath9k_hw_rf_free_ext_banks(ah);
>  	kfree(ah);
>  	ah = NULL;
> diff --git a/drivers/net/wireless/ath/ath9k/phy.c b/drivers/net/wireless/ath/ath9k/phy.c
> index c3b5939..b761330 100644
> --- a/drivers/net/wireless/ath/ath9k/phy.c
> +++ b/drivers/net/wireless/ath/ath9k/phy.c
> @@ -839,7 +839,7 @@ int ath9k_hw_rf_alloc_ext_banks(struct ath_hw *ah)
>  
>  	struct ath_common *common = ath9k_hw_common(ah);
>  
> -	BUG_ON(AR_SREV_9280_10_OR_LATER(ah));
> +	BUG_ON(AR_SREV_9280_10_OR_LATER(ah) || AR_SREV_9271(ah));
>  
>  	ATH_ALLOC_BANK(ah->analogBank0Data, ah->iniBank0.ia_rows);
>  	ATH_ALLOC_BANK(ah->analogBank1Data, ah->iniBank1.ia_rows);
> @@ -870,7 +870,7 @@ ath9k_hw_rf_free_ext_banks(struct ath_hw *ah)
>  		bank = NULL; \
>  	} while (0);
>  
> -	BUG_ON(AR_SREV_9280_10_OR_LATER(ah));
> +	BUG_ON(AR_SREV_9280_10_OR_LATER(ah) || AR_SREV_9271(ah));
>  
>  	ATH_FREE_BANK(ah->analogBank0Data);
>  	ATH_FREE_BANK(ah->analogBank1Data);
> @@ -910,7 +910,7 @@ bool ath9k_hw_set_rf_regs(struct ath_hw *ah, struct ath9k_channel *chan,
>  	 * for single chip devices, that is AR9280 or anything
>  	 * after that.
>  	 */
> -	if (AR_SREV_9280_10_OR_LATER(ah))
> +	if (AR_SREV_9280_10_OR_LATER(ah) || AR_SREV_9271(ah))
>  		return true;
>  
>  	/* Setup rf parameters */
> -- 

Hah actually now that I think about it, I bet the driver works just
fine without this patch, its the same reason why AR_SREV_9280_10_OR_LATER(ah)
adds AR9271...  please test without this patch. This should be one less
code change.

When I reviewed the phy stuff last I meant to add an alias to
AR_SREV_9280_10_OR_LATER() as "AR_SREV_SINGLE_CHIP(ah)" in hopes
that it clarifies this code entry is usually meant for that,
and then remove all the useless double checks spread all over
the HAL.

  Luis

  reply	other threads:[~2010-03-13  6:05 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-13  5:46 [PATCH v3 00/12] ath9k_hw: complete support for AR9271 Luis R. Rodriguez
2010-03-13  5:46 ` [PATCH v3 01/12] ath9k_hw: update initialization values " Luis R. Rodriguez
2010-03-13  5:46 ` [PATCH v3 02/12] ath9k_hw: add GPIO setup code " Luis R. Rodriguez
2010-03-13  5:46 ` [PATCH v3 03/12] ath9k_hw: skip chip tests " Luis R. Rodriguez
2010-03-13  5:46 ` [PATCH v3 04/12] ath9k_hw: fix RF analog setup " Luis R. Rodriguez
2010-03-13  6:05   ` Luis R. Rodriguez [this message]
2010-03-15 21:35     ` Luis R. Rodriguez
2010-03-13  5:46 ` [PATCH v3 05/12] ath9k_hw: fix TX descriptor " Luis R. Rodriguez
2010-03-13  5:46 ` [PATCH v3 06/12] ath9k_hw: Fix full sleep " Luis R. Rodriguez
2010-03-13  5:46 ` [PATCH v3 07/12] ath9k_hw: fix noisefloor history buffer usage on AR9271 Luis R. Rodriguez
2010-03-13  5:46 ` [PATCH v3 08/12] ath9k_hw: restrict valid nf readings for AR9271 to -114 Luis R. Rodriguez
2010-03-13  5:46 ` [PATCH v3 09/12] ath9k_hw: use the skip count for PA calibration on AR9271 Luis R. Rodriguez
2010-03-13  5:46 ` [PATCH v3 10/12] ath9k_hw: always set the core clock for AR9271 Luis R. Rodriguez
2010-03-13  5:46 ` [PATCH v3 11/12] ath9k_hw: add HTC init hardware call for special resets " Luis R. Rodriguez
2010-03-13  5:46 ` [PATCH v3 12/12] ath9k_hw: fix hardware deinit Luis R. Rodriguez
2010-03-13  5:56 ` [PATCH v3 00/12] ath9k_hw: complete support for AR9271 Luis R. Rodriguez
2010-03-15 21:43 ` Luis R. Rodriguez
2010-03-15 23:25   ` Luis R. Rodriguez
2010-03-15 23:49     ` Luis R. Rodriguez
2010-03-15 23:51       ` Luis R. Rodriguez
2010-03-15 23:52       ` Felix Fietkau
2010-03-15 23:55         ` Luis R. Rodriguez
2010-03-15 23:55           ` Luis R. Rodriguez
2010-03-16  0:05           ` Felix Fietkau
2010-03-16  0:09             ` Luis R. Rodriguez
2010-03-16  0:38               ` Luis R. Rodriguez
2010-03-16  3:22                 ` Sujith
2010-03-16  3:51                   ` Luis R. Rodriguez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100313060516.GA6579@tux \
    --to=lrodriguez@atheros.com \
    --cc=Luis.Rodriguez@Atheros.com \
    --cc=Sujith.Manoharan@Atheros.com \
    --cc=Vasanth.Thiagarajan@Atheros.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).