rt2800: move 3290 specific bbp initialization
authorStanislaw Gruszka <stf_xl@wp.pl>
Sat, 18 May 2013 12:03:54 +0000 (14:03 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 24 May 2013 17:18:21 +0000 (13:18 -0400)
Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Acked-by: Helmut Schaa <helmut.schaa@googlemail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rt2x00/rt2800lib.c

index 2d00fd88075ca41953f2fb559fec93090dbbbfef..527c11478d9da7b9d7d28091c4b238dbac96d25c 100644 (file)
@@ -4084,6 +4084,8 @@ static void rt2800_init_bbp_30xx(struct rt2x00_dev *rt2x00dev)
 
 static void rt2800_init_bbp_3290(struct rt2x00_dev *rt2x00dev)
 {
+       u8 value;
+
        rt2800_bbp4_mac_if_ctrl(rt2x00dev);
 
        rt2800_bbp_write(rt2x00dev, 31, 0x08);
@@ -4128,6 +4130,27 @@ static void rt2800_init_bbp_3290(struct rt2x00_dev *rt2x00dev)
        rt2800_bbp_write(rt2x00dev, 106, 0x03);
 
        rt2800_bbp_write(rt2x00dev, 128, 0x12);
+
+       rt2800_bbp_write(rt2x00dev, 67, 0x24);
+       rt2800_bbp_write(rt2x00dev, 143, 0x04);
+       rt2800_bbp_write(rt2x00dev, 142, 0x99);
+       rt2800_bbp_write(rt2x00dev, 150, 0x30);
+       rt2800_bbp_write(rt2x00dev, 151, 0x2e);
+       rt2800_bbp_write(rt2x00dev, 152, 0x20);
+       rt2800_bbp_write(rt2x00dev, 153, 0x34);
+       rt2800_bbp_write(rt2x00dev, 154, 0x40);
+       rt2800_bbp_write(rt2x00dev, 155, 0x3b);
+       rt2800_bbp_write(rt2x00dev, 253, 0x04);
+
+       rt2800_bbp_read(rt2x00dev, 47, &value);
+       rt2x00_set_field8(&value, BBP47_TSSI_ADC6, 1);
+       rt2800_bbp_write(rt2x00dev, 47, value);
+
+       /* Use 5-bit ADC for Acquisition and 8-bit ADC for data */
+       rt2800_bbp_read(rt2x00dev, 3, &value);
+       rt2x00_set_field8(&value, BBP3_ADC_MODE_SWITCH, 1);
+       rt2x00_set_field8(&value, BBP3_ADC_INIT_MODE, 1);
+       rt2800_bbp_write(rt2x00dev, 3, value);
 }
 
 static void rt2800_init_bbp_3352(struct rt2x00_dev *rt2x00dev)
@@ -4462,29 +4485,6 @@ static void rt2800_init_bbp(struct rt2x00_dev *rt2x00dev)
                return;
        }
 
-       if (rt2x00_rt(rt2x00dev, RT3290)) {
-               rt2800_bbp_write(rt2x00dev, 67, 0x24);
-               rt2800_bbp_write(rt2x00dev, 143, 0x04);
-               rt2800_bbp_write(rt2x00dev, 142, 0x99);
-               rt2800_bbp_write(rt2x00dev, 150, 0x30);
-               rt2800_bbp_write(rt2x00dev, 151, 0x2e);
-               rt2800_bbp_write(rt2x00dev, 152, 0x20);
-               rt2800_bbp_write(rt2x00dev, 153, 0x34);
-               rt2800_bbp_write(rt2x00dev, 154, 0x40);
-               rt2800_bbp_write(rt2x00dev, 155, 0x3b);
-               rt2800_bbp_write(rt2x00dev, 253, 0x04);
-
-               rt2800_bbp_read(rt2x00dev, 47, &value);
-               rt2x00_set_field8(&value, BBP47_TSSI_ADC6, 1);
-               rt2800_bbp_write(rt2x00dev, 47, value);
-
-               /* Use 5-bit ADC for Acquisition and 8-bit ADC for data */
-               rt2800_bbp_read(rt2x00dev, 3, &value);
-               rt2x00_set_field8(&value, BBP3_ADC_MODE_SWITCH, 1);
-               rt2x00_set_field8(&value, BBP3_ADC_INIT_MODE, 1);
-               rt2800_bbp_write(rt2x00dev, 3, value);
-       }
-
        if (rt2x00_rt(rt2x00dev, RT5390) ||
            rt2x00_rt(rt2x00dev, RT5392)) {
                int ant, div_mode;