From patchwork Wed May 18 18:25:05 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivo van Doorn X-Patchwork-Id: 794422 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p4IIQb0I002287 for ; Wed, 18 May 2011 18:26:37 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933401Ab1ERS0g (ORCPT ); Wed, 18 May 2011 14:26:36 -0400 Received: from mail-ew0-f46.google.com ([209.85.215.46]:33255 "EHLO mail-ew0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932709Ab1ERS0f (ORCPT ); Wed, 18 May 2011 14:26:35 -0400 Received: by ewy4 with SMTP id 4so526998ewy.19 for ; Wed, 18 May 2011 11:26:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:subject:date:user-agent:cc:mime-version :message-id:content-type:content-transfer-encoding; bh=qwuL+6vxAPHlpWKowO/dc0l7Py4f38gvJlWSMHq1CfA=; b=pvi3Wn4UzPWwaACjtwlm2L2+rcSs+cyUZbmyWUSk4PfEbKNhQxbeESPmxSrqHSXbnz Uw0dsdS0aCsi98FK7aVttjaXFFovR9Sa1A2nYC/dCHrQ9IFqBifvtBAGjJe9kYsDzZse BvEKNf91YjNpVubQiF5a4/jxGZnqpeh8axNIs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:cc:mime-version:message-id :content-type:content-transfer-encoding; b=kQ1HUNdRHI1vKJZBWE2w4C0q1NPTKGtBFy90WwBRzo9IapGRFq20FNMgClLPOnLKRB v69/s1FCOX3AOIjP4/lWbFCtjyhXbSOviMXTSjyJDpuRKKIW3+BpPPqvTmfkLejU0pCP BAxj07aue1K8V1o4OLAbODo2qpVB80zXBmybg= Received: by 10.213.10.143 with SMTP id p15mr790695ebp.98.1305743194323; Wed, 18 May 2011 11:26:34 -0700 (PDT) Received: from localhost.localdomain (g121037.upc-g.chello.nl [80.57.121.37]) by mx.google.com with ESMTPS id 34sm1354242eee.1.2011.05.18.11.26.32 (version=SSLv3 cipher=OTHER); Wed, 18 May 2011 11:26:33 -0700 (PDT) From: Ivo van Doorn To: "John W. Linville" Subject: [PATCH 1/7] rt2x00: Enable PA_PE bits in TX_PIN_CFG according to active band. Date: Wed, 18 May 2011 20:25:05 +0200 User-Agent: KMail/1.13.5 (Linux/2.6.32.26-175.fc12.x86_64; KDE/4.4.5; x86_64; ; ) Cc: linux-wireless@vger.kernel.org, users@rt2x00.serialmonkey.com MIME-Version: 1.0 Message-Id: <201105182025.05979.IvDoorn@gmail.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.6 (demeter1.kernel.org [140.211.167.41]); Wed, 18 May 2011 18:26:38 +0000 (UTC) From: Gertjan van Wingerde (split off from the earlier RT35xx patch submitted by Shiang) There's no point in enabling the PA_PE bits for the bands that we are not active on. Signed-off-by: Shiang Tu Signed-off-by: Gertjan van Wingerde Signed-off-by: Ivo van Doorn --- drivers/net/wireless/rt2x00/rt2800lib.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c index 93fb674..1cad89e 100644 --- a/drivers/net/wireless/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/rt2x00/rt2800lib.c @@ -1795,8 +1795,10 @@ static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev, /* Turn on unused PA or LNA when not using 1T or 1R */ if (rt2x00dev->default_ant.tx_chain_num == 2) { - rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_A1_EN, 1); - rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_G1_EN, 1); + rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_A1_EN, + rf->channel > 14); + rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_G1_EN, + rf->channel <= 14); } /* Turn on unused PA or LNA when not using 1T or 1R */