From: Herton Ronaldo Krzesinski Date: Tue, 2 Nov 2010 00:59:35 +0000 (-0200) Subject: rtl8187: move pll reset at start out of ANAPARAM write X-Git-Tag: v2.6.38-rc1~476^2~558^2~62 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=896cae65fc0489b8e42bb7790f64731d53a2cecf;p=platform%2Fkernel%2Flinux-3.10.git 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 Acked-by: Larry Finger Signed-off-by: John W. Linville --- 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;