rt2x00: Correct initial value of US_CYC_CNT register for pcie interface
authorRA-Jay Hung <jay_hung@ralinktech.com>
Sun, 30 Jan 2011 12:21:22 +0000 (13:21 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 31 Jan 2011 20:06:24 +0000 (15:06 -0500)
CLOCK CYCLE: Clock cycle count in 1us
PCI:0x21, PCIE:0x7d, USB:0x1e

Signed-off-by: RA-Jay Hung <jay_hung@ralinktech.com>
Acked-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rt2x00/rt2800.h
drivers/net/wireless/rt2x00/rt2800lib.c

index c7e615cebac1e2beb5381a6d8a6906f5075843b4..ec8159ce0ee89769668125ce756260374fff2d3c 100644 (file)
 
 /*
  * US_CYC_CNT
+ * BT_MODE_EN: Bluetooth mode enable
+ * CLOCK CYCLE: Clock cycle count in 1us.
+ * PCI:0x21, PCIE:0x7d, USB:0x1e
  */
 #define US_CYC_CNT                     0x02a4
+#define US_CYC_CNT_BT_MODE_EN          FIELD32(0x00000100)
 #define US_CYC_CNT_CLOCK_CYCLE         FIELD32(0x000000ff)
 
 /*
index 4753fb1b0aafa8415bef06932d759717f64553d6..4c34fceaec117e84f481153fd7ce1727d18b6080 100644 (file)
@@ -2207,6 +2207,10 @@ static int rt2800_init_registers(struct rt2x00_dev *rt2x00dev)
                rt2800_register_read(rt2x00dev, US_CYC_CNT, &reg);
                rt2x00_set_field32(&reg, US_CYC_CNT_CLOCK_CYCLE, 30);
                rt2800_register_write(rt2x00dev, US_CYC_CNT, reg);
+       } else if (rt2x00_is_pcie(rt2x00dev)) {
+               rt2800_register_read(rt2x00dev, US_CYC_CNT, &reg);
+               rt2x00_set_field32(&reg, US_CYC_CNT_CLOCK_CYCLE, 125);
+               rt2800_register_write(rt2x00dev, US_CYC_CNT, reg);
        }
 
        rt2800_register_read(rt2x00dev, HT_FBK_CFG0, &reg);