From patchwork Wed Mar 26 20:01:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Merello X-Patchwork-Id: 3895061 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 A61A1BF540 for ; Wed, 26 Mar 2014 20:00:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CE52320221 for ; Wed, 26 Mar 2014 20:00:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EF1582021F for ; Wed, 26 Mar 2014 20:00:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932096AbaCZUAm (ORCPT ); Wed, 26 Mar 2014 16:00:42 -0400 Received: from mail-ee0-f42.google.com ([74.125.83.42]:62343 "EHLO mail-ee0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932092AbaCZUAi (ORCPT ); Wed, 26 Mar 2014 16:00:38 -0400 Received: by mail-ee0-f42.google.com with SMTP id d17so2080528eek.29 for ; Wed, 26 Mar 2014 13:00:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=uQg+DaXXzEljND6LAee2Yy26feRk5y6b8001vx0tfM8=; b=UysPaQvcRXcVAhVWCd0gt8B4/PasJBquUkCYLUm1LpYjObw4s7LzjzwQWwNwIqrMJl 47PAA9Bd3gD8b8zSUlyykeYK2eYr/xkN0aEkCxV//O0PSvjUJiH3JyelgktXFGB09UzF bjTreddCubjx+85hm1SjHoy4rwJ0GGTNv4cQKLJ8HC16gh4+FMmJMDWzZwBrWQIAhE70 P/JmHKTC9u0fjn9tu/OQwghNLW8BGhAT2xm0HM5aYziQGEwqIsu5K+ntm6PD7oR0/5i4 2uYtOtu3D46V2MntHfwKOkMhbooFCk6U7rmKUBTXXRMJyFs7zmfMJohT8yu/a1Qz4+co Xlcw== X-Received: by 10.14.105.4 with SMTP id j4mr64009377eeg.41.1395864037143; Wed, 26 Mar 2014 13:00:37 -0700 (PDT) Received: from localhost.localdomain (host179-124-dynamic.6-79-r.retail.telecomitalia.it. [79.6.124.179]) by mx.google.com with ESMTPSA id o4sm49259004eef.20.2014.03.26.13.00.36 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 26 Mar 2014 13:00:36 -0700 (PDT) From: Andrea Merello To: linville@tuxdriver.com Cc: andrea.merello@gmail.com, linux-wireless@vger.kernel.org, Larry.Finger@lwfinger.net, bernhard@schiffner-limbach.de, dan.carpenter@oracle.com Subject: [PATCH 11/20] rtl8180: add rtl8187se params to eeprom reading Date: Wed, 26 Mar 2014 21:01:47 +0100 Message-Id: <1395864107-4786-1-git-send-email-andrea.merello@gmail.com> X-Mailer: git-send-email 1.8.3.2 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.2 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 rtl8187se nees extra parameters to be read from the eeprom. This patch adds support for it Signed-off-by: Andrea Merello --- drivers/net/wireless/rtl818x/rtl8180/dev.c | 18 +++++++++++++++++- drivers/net/wireless/rtl818x/rtl8180/rtl8180.h | 7 +++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/rtl818x/rtl8180/dev.c b/drivers/net/wireless/rtl818x/rtl8180/dev.c index 06d3c30..740a583 100644 --- a/drivers/net/wireless/rtl818x/rtl8180/dev.c +++ b/drivers/net/wireless/rtl818x/rtl8180/dev.c @@ -1320,7 +1320,10 @@ static void rtl8180_eeprom_read(struct rtl8180_priv *priv) eeprom_93cx6_multiread(&eeprom, 0x7, (__le16 *)priv->mac_addr, 3); - eeprom_cck_table_adr = 0x10; + if (priv->chip_family == RTL818X_CHIP_FAMILY_RTL8187SE) + eeprom_cck_table_adr = 0x30; + else + eeprom_cck_table_adr = 0x10; /* CCK TX power */ for (i = 0; i < 14; i += 2) { @@ -1348,6 +1351,19 @@ static void rtl8180_eeprom_read(struct rtl8180_priv *priv) eeprom_93cx6_read(&eeprom, 0x19, &priv->rfparam); } + if (priv->chip_family == RTL818X_CHIP_FAMILY_RTL8187SE) { + eeprom_93cx6_read(&eeprom, 0x3F, &eeprom_val); + priv->antenna_diversity_en = !!(eeprom_val & 0x100); + priv->antenna_diversity_default = (eeprom_val & 0xC00) == 0x400; + + eeprom_93cx6_read(&eeprom, 0x7C, &eeprom_val); + priv->xtal_out = eeprom_val & 0xF; + priv->xtal_in = (eeprom_val & 0xF0) >> 4; + priv->xtal_cal = !!(eeprom_val & 0x1000); + priv->thermal_meter_val = (eeprom_val & 0xF00) >> 8; + priv->thermal_meter_en = !!(eeprom_val & 0x2000); + } + rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD, RTL818X_EEPROM_CMD_NORMAL); } diff --git a/drivers/net/wireless/rtl818x/rtl8180/rtl8180.h b/drivers/net/wireless/rtl818x/rtl8180/rtl8180.h index d64e75d..d8f92de 100644 --- a/drivers/net/wireless/rtl818x/rtl8180/rtl8180.h +++ b/drivers/net/wireless/rtl818x/rtl8180/rtl8180.h @@ -132,6 +132,13 @@ struct rtl8180_priv { u8 csthreshold; u8 mac_addr[ETH_ALEN]; u8 rf_type; + u8 xtal_out; + u8 xtal_in; + u8 xtal_cal; + u8 thermal_meter_val; + u8 thermal_meter_en; + u8 antenna_diversity_en; + u8 antenna_diversity_default; /* sequence # */ u16 seqno; };