aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rtl818x
diff options
context:
space:
mode:
authorHerton Ronaldo Krzesinski <herton@mandriva.com.br>2010-11-01 20:59:35 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-11-15 13:25:43 -0500
commit896cae65fc0489b8e42bb7790f64731d53a2cecf (patch)
treef49253d65e13cf693114feef813ccf823e3dcce1 /drivers/net/wireless/rtl818x
parenta8ff34e37a186ebb7d2d90ee40ef88a3ef95ad47 (diff)
rtl8187: move pll reset at start out of ANAPARAM write
On 8187B start, comment about pll reset, and move it out of ANAPARAM write sequence, so that code is more readable. Signed-off-by: Herton Ronaldo Krzesinski <herton@mandriva.com.br> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rtl818x')
-rw-r--r--drivers/net/wireless/rtl818x/rtl8187_dev.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/net/wireless/rtl818x/rtl8187_dev.c b/drivers/net/wireless/rtl818x/rtl8187_dev.c
index 063374aba863..2b4ee26c6745 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)
742 742
743 rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD, 743 rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD,
744 RTL818X_EEPROM_CMD_CONFIG); 744 RTL818X_EEPROM_CMD_CONFIG);
745
746 reg = rtl818x_ioread8(priv, &priv->map->CONFIG3); 745 reg = rtl818x_ioread8(priv, &priv->map->CONFIG3);
747 reg |= RTL818X_CONFIG3_ANAPARAM_WRITE | RTL818X_CONFIG3_GNT_SELECT; 746 reg |= RTL818X_CONFIG3_ANAPARAM_WRITE | RTL818X_CONFIG3_GNT_SELECT;
748 rtl818x_iowrite8(priv, &priv->map->CONFIG3, reg); 747 rtl818x_iowrite8(priv, &priv->map->CONFIG3, reg);
@@ -752,19 +751,19 @@ static int rtl8187b_init_hw(struct ieee80211_hw *dev)
752 RTL8187B_RTL8225_ANAPARAM_ON); 751 RTL8187B_RTL8225_ANAPARAM_ON);
753 rtl818x_iowrite8(priv, &priv->map->ANAPARAM3, 752 rtl818x_iowrite8(priv, &priv->map->ANAPARAM3,
754 RTL8187B_RTL8225_ANAPARAM3_ON); 753 RTL8187B_RTL8225_ANAPARAM3_ON);
755
756 rtl818x_iowrite8(priv, (u8 *)0xFF61, 0x10);
757 reg = rtl818x_ioread8(priv, (u8 *)0xFF62);
758 rtl818x_iowrite8(priv, (u8 *)0xFF62, reg & ~(1 << 5));
759 rtl818x_iowrite8(priv, (u8 *)0xFF62, reg | (1 << 5));
760
761 reg = rtl818x_ioread8(priv, &priv->map->CONFIG3); 754 reg = rtl818x_ioread8(priv, &priv->map->CONFIG3);
762 reg &= ~RTL818X_CONFIG3_ANAPARAM_WRITE; 755 reg &= ~RTL818X_CONFIG3_ANAPARAM_WRITE;
763 rtl818x_iowrite8(priv, &priv->map->CONFIG3, reg); 756 rtl818x_iowrite8(priv, &priv->map->CONFIG3, reg);
764
765 rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD, 757 rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD,
766 RTL818X_EEPROM_CMD_NORMAL); 758 RTL818X_EEPROM_CMD_NORMAL);
767 759
760 /* Reset PLL sequence on 8187B. Realtek note: reduces power
761 * consumption about 30 mA */
762 rtl818x_iowrite8(priv, (u8 *)0xFF61, 0x10);
763 reg = rtl818x_ioread8(priv, (u8 *)0xFF62);
764 rtl818x_iowrite8(priv, (u8 *)0xFF62, reg & ~(1 << 5));
765 rtl818x_iowrite8(priv, (u8 *)0xFF62, reg | (1 << 5));
766
768 res = rtl8187_cmd_reset(dev); 767 res = rtl8187_cmd_reset(dev);
769 if (res) 768 if (res)
770 return res; 769 return res;