aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/rtl818x/rtl8180/dev.c40
-rw-r--r--drivers/net/wireless/rtl818x/rtl8180/rtl8180.h1
-rw-r--r--drivers/net/wireless/rtl818x/rtl8180/rtl8225.c1
3 files changed, 42 insertions, 0 deletions
diff --git a/drivers/net/wireless/rtl818x/rtl8180/dev.c b/drivers/net/wireless/rtl818x/rtl8180/dev.c
index 740a58308a90..a3b67e656e59 100644
--- a/drivers/net/wireless/rtl818x/rtl8180/dev.c
+++ b/drivers/net/wireless/rtl818x/rtl8180/dev.c
@@ -523,6 +523,46 @@ static void rtl8180_tx(struct ieee80211_hw *dev,
523 } 523 }
524} 524}
525 525
526static void rtl8180_set_anaparam3(struct rtl8180_priv *priv, u16 anaparam3)
527{
528 u8 reg;
529
530 rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD,
531 RTL818X_EEPROM_CMD_CONFIG);
532
533 reg = rtl818x_ioread8(priv, &priv->map->CONFIG3);
534 rtl818x_iowrite8(priv, &priv->map->CONFIG3,
535 reg | RTL818X_CONFIG3_ANAPARAM_WRITE);
536
537 rtl818x_iowrite16(priv, &priv->map->ANAPARAM3, anaparam3);
538
539 rtl818x_iowrite8(priv, &priv->map->CONFIG3,
540 reg & ~RTL818X_CONFIG3_ANAPARAM_WRITE);
541
542 rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD,
543 RTL818X_EEPROM_CMD_NORMAL);
544}
545
546void rtl8180_set_anaparam2(struct rtl8180_priv *priv, u32 anaparam2)
547{
548 u8 reg;
549
550 rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD,
551 RTL818X_EEPROM_CMD_CONFIG);
552
553 reg = rtl818x_ioread8(priv, &priv->map->CONFIG3);
554 rtl818x_iowrite8(priv, &priv->map->CONFIG3,
555 reg | RTL818X_CONFIG3_ANAPARAM_WRITE);
556
557 rtl818x_iowrite32(priv, &priv->map->ANAPARAM2, anaparam2);
558
559 rtl818x_iowrite8(priv, &priv->map->CONFIG3,
560 reg & ~RTL818X_CONFIG3_ANAPARAM_WRITE);
561
562 rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD,
563 RTL818X_EEPROM_CMD_NORMAL);
564}
565
526void rtl8180_set_anaparam(struct rtl8180_priv *priv, u32 anaparam) 566void rtl8180_set_anaparam(struct rtl8180_priv *priv, u32 anaparam)
527{ 567{
528 u8 reg; 568 u8 reg;
diff --git a/drivers/net/wireless/rtl818x/rtl8180/rtl8180.h b/drivers/net/wireless/rtl818x/rtl8180/rtl8180.h
index d8f92de19634..0ef3fc758928 100644
--- a/drivers/net/wireless/rtl818x/rtl8180/rtl8180.h
+++ b/drivers/net/wireless/rtl818x/rtl8180/rtl8180.h
@@ -145,6 +145,7 @@ struct rtl8180_priv {
145 145
146void rtl8180_write_phy(struct ieee80211_hw *dev, u8 addr, u32 data); 146void rtl8180_write_phy(struct ieee80211_hw *dev, u8 addr, u32 data);
147void rtl8180_set_anaparam(struct rtl8180_priv *priv, u32 anaparam); 147void rtl8180_set_anaparam(struct rtl8180_priv *priv, u32 anaparam);
148void rtl8180_set_anaparam2(struct rtl8180_priv *priv, u32 anaparam2);
148 149
149static inline u8 rtl818x_ioread8(struct rtl8180_priv *priv, u8 __iomem *addr) 150static inline u8 rtl818x_ioread8(struct rtl8180_priv *priv, u8 __iomem *addr)
150{ 151{
diff --git a/drivers/net/wireless/rtl818x/rtl8180/rtl8225.c b/drivers/net/wireless/rtl818x/rtl8180/rtl8225.c
index 1c0fe238d995..9bda5bc78eda 100644
--- a/drivers/net/wireless/rtl818x/rtl8180/rtl8225.c
+++ b/drivers/net/wireless/rtl818x/rtl8180/rtl8225.c
@@ -282,6 +282,7 @@ static void rtl8225_rf_set_tx_power(struct ieee80211_hw *dev, int channel)
282 282
283 msleep(1); /* FIXME: optional? */ 283 msleep(1); /* FIXME: optional? */
284 284
285 /* TODO: use set_anaparam2 dev.c_func*/
285 /* anaparam2 on */ 286 /* anaparam2 on */
286 rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD, RTL818X_EEPROM_CMD_CONFIG); 287 rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD, RTL818X_EEPROM_CMD_CONFIG);
287 reg = rtl818x_ioread8(priv, &priv->map->CONFIG3); 288 reg = rtl818x_ioread8(priv, &priv->map->CONFIG3);