From patchwork Sat Oct 12 15:25:23 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Lo X-Patchwork-Id: 3031721 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id EBC6DBF924 for ; Sat, 12 Oct 2013 15:30:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 472292039A for ; Sat, 12 Oct 2013 15:30:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 102EF20396 for ; Sat, 12 Oct 2013 15:30:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752187Ab3JLPaL (ORCPT ); Sat, 12 Oct 2013 11:30:11 -0400 Received: from 220-133-188-53.HINET-IP.hinet.net ([220.133.188.53]:42965 "EHLO ns.kevlo.org" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752034Ab3JLPaK (ORCPT ); Sat, 12 Oct 2013 11:30:10 -0400 Received: from ns.kevlo.org (localhost [127.0.0.1]) by ns.kevlo.org (8.14.6/8.14.6) with ESMTP id r9CFPQnW004170; Sat, 12 Oct 2013 23:25:27 +0800 (CST) (envelope-from kevlo@ns.kevlo.org) Received: (from kevlo@localhost) by ns.kevlo.org (8.14.6/8.14.6/Submit) id r9CFPOeX004169; Sat, 12 Oct 2013 23:25:24 +0800 (CST) (envelope-from kevlo) Date: Sat, 12 Oct 2013 23:25:23 +0800 From: Kevin Lo To: John Linville Cc: linux-wireless@vger.kernel.org, users@rt2x00.serialmonkey.com Subject: [PATCH v2] rt2x00: rt2800lib: fix RF registers for RT5390/RT5392 Message-ID: <20131012152523.GA4156@ns.kevlo.org> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Update rf registers to use the same values that the MediaTek/Ralink reference driver DPO_RT5572_LinuxSTA_2.6.1.3_20121022 uses. References: RF5390RegTable in chips/rt5390.c RF5392RegTable in chips/rt5390.c Tested on TP-Link TL-WN727N and D-Link DWA-140 Rev.b3 usb wifi dongles. Signed-off-by: Kevin Lo Acked-by: Stanislaw Gruszka --- Changes since v1: - the previous patch was malformed - add Stanislaw's Acked-by tag --- -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c index a114cab..373efde 100644 --- a/drivers/net/wireless/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/rt2x00/rt2800lib.c @@ -6476,7 +6476,7 @@ static void rt2800_init_rfcsr_5390(struct rt2x00_dev *rt2x00dev) rt2800_rfcsr_write(rt2x00dev, 28, 0x00); rt2800_rfcsr_write(rt2x00dev, 29, 0x10); - rt2800_rfcsr_write(rt2x00dev, 30, 0x00); + rt2800_rfcsr_write(rt2x00dev, 30, 0x10); rt2800_rfcsr_write(rt2x00dev, 31, 0x80); rt2800_rfcsr_write(rt2x00dev, 32, 0x80); rt2800_rfcsr_write(rt2x00dev, 33, 0x00); @@ -6514,7 +6514,7 @@ static void rt2800_init_rfcsr_5390(struct rt2x00_dev *rt2x00dev) rt2800_rfcsr_write(rt2x00dev, 56, 0x22); rt2800_rfcsr_write(rt2x00dev, 57, 0x80); rt2800_rfcsr_write(rt2x00dev, 58, 0x7f); - rt2800_rfcsr_write(rt2x00dev, 59, 0x63); + rt2800_rfcsr_write(rt2x00dev, 59, 0x8f); rt2800_rfcsr_write(rt2x00dev, 60, 0x45); if (rt2x00_rt_rev_gte(rt2x00dev, RT5390, REV_RT5390F)) @@ -6534,7 +6534,6 @@ static void rt2800_init_rfcsr_5392(struct rt2x00_dev *rt2x00dev) rt2800_rf_init_calibration(rt2x00dev, 2); rt2800_rfcsr_write(rt2x00dev, 1, 0x17); - rt2800_rfcsr_write(rt2x00dev, 2, 0x80); rt2800_rfcsr_write(rt2x00dev, 3, 0x88); rt2800_rfcsr_write(rt2x00dev, 5, 0x10); rt2800_rfcsr_write(rt2x00dev, 6, 0xe0);