From patchwork Tue Nov 2 00:59:35 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herton Ronaldo Krzesinski X-Patchwork-Id: 296412 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 oA210OnX030090 for ; Tue, 2 Nov 2010 01:00:24 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753926Ab0KBBAV (ORCPT ); Mon, 1 Nov 2010 21:00:21 -0400 Received: from perninha.conectiva.com.br ([187.115.55.249]:47851 "EHLO perninha.conectiva.com.br" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753622Ab0KBBAP (ORCPT ); Mon, 1 Nov 2010 21:00:15 -0400 Received: from localhost (perninha.conectiva.com.br [127.0.0.1]) by perninha.conectiva.com.br (Postfix) with ESMTP id C02611634D; Mon, 1 Nov 2010 23:00:10 -0200 (BRST) X-Virus-Scanned: amavisd-new at conectiva.com.br Received: from perninha.conectiva.com.br ([127.0.0.1]) by localhost (perninha.conectiva.com.br [127.0.0.1]) (amavisd-new, port 10025) with LMTP id ttL4GD1Dr0Wu; Mon, 1 Nov 2010 23:00:10 -0200 (BRST) Received: from fox.conectiva (firewall.conectiva [187.115.55.253]) by perninha.conectiva.com.br (Postfix) with ESMTP id DFA8F1634F; Mon, 1 Nov 2010 23:00:07 -0200 (BRST) Received: from gotham.conectiva (gotham.conectiva [10.0.2.23]) by fox.conectiva (Postfix) with ESMTP id 49FB12F330; Mon, 1 Nov 2010 22:00:06 -0300 (BRT) From: Herton Ronaldo Krzesinski To: linux-wireless@vger.kernel.org Cc: Larry Finger , Hin-Tak Leung , John W Linville , Herton Ronaldo Krzesinski Subject: [PATCH 5/9] rtl8187: move pll reset at start out of ANAPARAM write Date: Mon, 1 Nov 2010 22:59:35 -0200 Message-Id: <1288659579-4986-6-git-send-email-herton@mandriva.com.br> X-Mailer: git-send-email 1.7.3.2 In-Reply-To: <1288659579-4986-1-git-send-email-herton@mandriva.com.br> References: <1288659579-4986-1-git-send-email-herton@mandriva.com.br> 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.3 (demeter1.kernel.org [140.211.167.41]); Tue, 02 Nov 2010 01:00:24 +0000 (UTC) diff --git a/drivers/net/wireless/rtl818x/rtl8187_dev.c b/drivers/net/wireless/rtl818x/rtl8187_dev.c index 063374a..2b4ee26 100644 --- a/drivers/net/wireless/rtl818x/rtl8187_dev.c +++ b/drivers/net/wireless/rtl818x/rtl8187_dev.c @@ -742,7 +742,6 @@ static int rtl8187b_init_hw(struct ieee80211_hw *dev) rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD, RTL818X_EEPROM_CMD_CONFIG); - reg = rtl818x_ioread8(priv, &priv->map->CONFIG3); reg |= RTL818X_CONFIG3_ANAPARAM_WRITE | RTL818X_CONFIG3_GNT_SELECT; rtl818x_iowrite8(priv, &priv->map->CONFIG3, reg); @@ -752,19 +751,19 @@ static int rtl8187b_init_hw(struct ieee80211_hw *dev) RTL8187B_RTL8225_ANAPARAM_ON); rtl818x_iowrite8(priv, &priv->map->ANAPARAM3, RTL8187B_RTL8225_ANAPARAM3_ON); - - rtl818x_iowrite8(priv, (u8 *)0xFF61, 0x10); - reg = rtl818x_ioread8(priv, (u8 *)0xFF62); - rtl818x_iowrite8(priv, (u8 *)0xFF62, reg & ~(1 << 5)); - rtl818x_iowrite8(priv, (u8 *)0xFF62, reg | (1 << 5)); - reg = rtl818x_ioread8(priv, &priv->map->CONFIG3); reg &= ~RTL818X_CONFIG3_ANAPARAM_WRITE; rtl818x_iowrite8(priv, &priv->map->CONFIG3, reg); - rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD, RTL818X_EEPROM_CMD_NORMAL); + /* Reset PLL sequence on 8187B. Realtek note: reduces power + * consumption about 30 mA */ + rtl818x_iowrite8(priv, (u8 *)0xFF61, 0x10); + reg = rtl818x_ioread8(priv, (u8 *)0xFF62); + rtl818x_iowrite8(priv, (u8 *)0xFF62, reg & ~(1 << 5)); + rtl818x_iowrite8(priv, (u8 *)0xFF62, reg | (1 << 5)); + res = rtl8187_cmd_reset(dev); if (res) return res;