From patchwork Wed Jul 4 00:11:43 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xose Vazquez Perez X-Patchwork-Id: 1153631 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id C6D223FE80 for ; Wed, 4 Jul 2012 00:12:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752606Ab2GDALu (ORCPT ); Tue, 3 Jul 2012 20:11:50 -0400 Received: from mail-wg0-f44.google.com ([74.125.82.44]:48718 "EHLO mail-wg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751754Ab2GDALu (ORCPT ); Tue, 3 Jul 2012 20:11:50 -0400 Received: by wgbdr13 with SMTP id dr13so6793099wgb.1 for ; Tue, 03 Jul 2012 17:11:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:x-mailer; bh=jadYvnT0J23EWqk5qj80EP5hmqaY4dfyT8ARKIlC734=; b=b7RhCVVVFcN9RrHQgDsfv1Gw6OBQ/6vBBQlvjqy2oBAH8OwSa4HXDDcjLVngezmNQG aJ9cBhSCCxUIV26uo1ozscDyuoph0iXTUHVokmt7rZrZ7LjbP8W0kNCVm0HbDrOo4lw5 IdQ7nuzS9tN8AgTbzEBC7EoZ6Zct11Q6lTUDnq0/c/wJns0dKdpX8Vus8MFH/f4iiJVD e2HESUTWBM0B9N8ghcC7ujN2u0E2bgSA+FbDhGS4wylkhgmxMyVF2WAsSUuOzkazD/Is +DHSV+hsFwRcQT9MjLlXH9XeLjcwxeZYVJC2KKyT5SH5qMwWCodrmKZqNBTZ7wwznP60 GZjQ== Received: by 10.180.107.103 with SMTP id hb7mr29135232wib.3.1341360709216; Tue, 03 Jul 2012 17:11:49 -0700 (PDT) Received: from localhost (90.64.218.87.dynamic.jazztel.es. [87.218.64.90]) by mx.google.com with ESMTPS id fu8sm33755338wib.5.2012.07.03.17.11.47 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 03 Jul 2012 17:11:48 -0700 (PDT) From: Xose Vazquez Perez To: linux-wireless@vger.kernel.org, xose.vazquez@gmail.com, users@rt2x00.serialmonkey.com Subject: [PATCH POC] wireless: rt2x00: rt2800: add support for RT5370G Date: Wed, 4 Jul 2012 02:11:43 +0200 Message-Id: <1341360703-18029-1-git-send-email-xose.vazquez@gmail.com> X-Mailer: git-send-email 1.7.10.4 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Proof of concept !! untested !! do not apply !! I haven't the hardware to test it. RT5370G has hardware RX antenna diversity like RT5390R. based on 2012_03_22_RT5572_Linux_STA_v2.6.0.0_DPO Signed-off-by: Xose Vazquez Perez --- drivers/net/wireless/rt2x00/rt2800.h | 3 ++- drivers/net/wireless/rt2x00/rt2800lib.c | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/rt2x00/rt2800.h b/drivers/net/wireless/rt2x00/rt2800.h index b483c23..fe62275 100644 --- a/drivers/net/wireless/rt2x00/rt2800.h +++ b/drivers/net/wireless/rt2x00/rt2800.h @@ -77,7 +77,8 @@ #define REV_RT3090E 0x0211 #define REV_RT3390E 0x0211 #define REV_RT5390F 0x0502 -#define REV_RT5390R 0x1502 +#define REV_RT5370G 0x0503 /* hardware RX antenna diversity */ +#define REV_RT5390R 0x1502 /* hardware RX antenna diversity */ /* * Signal information. diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c index dfc90d3..e27b203 100644 --- a/drivers/net/wireless/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/rt2x00/rt2800lib.c @@ -3363,8 +3363,9 @@ static int rt2800_init_bbp(struct rt2x00_dev *rt2x00dev) rt2800_register_write(rt2x00dev, GPIO_CTRL_CFG, reg); } - /* This chip has hardware antenna diversity*/ - if (rt2x00_rt_rev_gte(rt2x00dev, RT5390, REV_RT5390R)) { + /* These chips have hardware RX antenna diversity */ + if (rt2x00_rt_rev_gte(rt2x00dev, RT5390, REV_RT5390R) || + rt2x00_rt_rev_gte(rt2x00dev, RT5390, REV_RT5370G)) { rt2800_bbp_write(rt2x00dev, 150, 0); /* Disable Antenna Software OFDM */ rt2800_bbp_write(rt2x00dev, 151, 0); /* Disable Antenna Software CCK */ rt2800_bbp_write(rt2x00dev, 154, 0); /* Clear previously selected antenna */ @@ -4305,7 +4306,8 @@ int rt2800_init_eeprom(struct rt2x00_dev *rt2x00dev) rt2x00dev->default_ant.rx = ANTENNA_A; } - if (rt2x00_rt_rev_gte(rt2x00dev, RT5390, REV_RT5390R)) { + if (rt2x00_rt_rev_gte(rt2x00dev, RT5390, REV_RT5390R) || + rt2x00_rt_rev_gte(rt2x00dev, RT5390, REV_RT5370G)) { rt2x00dev->default_ant.tx = ANTENNA_HW_DIVERSITY; /* Unused */ rt2x00dev->default_ant.rx = ANTENNA_HW_DIVERSITY; /* Unused */ }