1 --- a/drivers/net/wireless/rt2x00/rt2800lib.c
2 +++ b/drivers/net/wireless/rt2x00/rt2800lib.c
3 @@ -5886,6 +5886,27 @@ static const struct rf_channel rf_vals_5
8 + * RF value list for rt3xxx with Xtal20MHz
9 + * Supports: 2.4 GHz (all) (RF3322)
11 +static const struct rf_channel rf_vals_xtal20mhz_3x[] = {
21 + {10, 0xEB, 2, 0x14},
22 + {11, 0xEC, 2, 0x14},
23 + {12, 0xED, 2, 0x14},
24 + {13, 0xEE, 2, 0x14},
25 + {14, 0xF0, 2, 0x18},
28 static int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
30 struct hw_mode_spec *spec = &rt2x00dev->spec;
31 @@ -5964,7 +5985,6 @@ static int rt2800_probe_hw_mode(struct r
32 rt2x00_rf(rt2x00dev, RF3022) ||
33 rt2x00_rf(rt2x00dev, RF3290) ||
34 rt2x00_rf(rt2x00dev, RF3320) ||
35 - rt2x00_rf(rt2x00dev, RF3322) ||
36 rt2x00_rf(rt2x00dev, RF5360) ||
37 rt2x00_rf(rt2x00dev, RF5370) ||
38 rt2x00_rf(rt2x00dev, RF5372) ||
39 @@ -5972,6 +5992,12 @@ static int rt2800_probe_hw_mode(struct r
40 rt2x00_rf(rt2x00dev, RF5392)) {
41 spec->num_channels = 14;
42 spec->channels = rf_vals_3x;
43 + } else if (rt2x00_rf(rt2x00dev, RF3322)) {
44 + spec->num_channels = 14;
45 + if (spec->clk_is_20mhz)
46 + spec->channels = rf_vals_xtal20mhz_3x;
48 + spec->channels = rf_vals_3x;
49 } else if (rt2x00_rf(rt2x00dev, RF3052)) {
50 spec->supported_bands |= SUPPORT_BAND_5GHZ;
51 spec->num_channels = ARRAY_SIZE(rf_vals_3x);
52 @@ -6120,6 +6146,19 @@ static int rt2800_probe_rt(struct rt2x00
56 +int rt2800_probe_clk(struct rt2x00_dev *rt2x00dev)
58 + struct rt2x00_platform_data *pdata = rt2x00dev->dev->platform_data;
59 + struct hw_mode_spec *spec = &rt2x00dev->spec;
64 + spec->clk_is_20mhz = pdata->clk_is_20mhz;
69 int rt2800_probe_hw(struct rt2x00_dev *rt2x00dev)
72 @@ -6149,6 +6188,15 @@ int rt2800_probe_hw(struct rt2x00_dev *r
73 rt2800_register_write(rt2x00dev, GPIO_CTRL, reg);
78 + if (rt2x00_is_soc(rt2x00dev)) {
79 + retval = rt2800_probe_clk(rt2x00dev);
85 * Initialize hw specifications.
87 retval = rt2800_probe_hw_mode(rt2x00dev);
88 --- a/drivers/net/wireless/rt2x00/rt2x00.h
89 +++ b/drivers/net/wireless/rt2x00/rt2x00.h
90 @@ -420,6 +420,7 @@ static inline struct rt2x00_intf* vif_to
91 * @channels: Device/chipset specific channel values (See &struct rf_channel).
92 * @channels_info: Additional information for channels (See &struct channel_info).
93 * @ht: Driver HT Capabilities (See &ieee80211_sta_ht_cap).
94 + * @clk_is_20mhz: External crystal of WiSoC is 20MHz instead of 40MHz
97 unsigned int supported_bands;
98 @@ -436,6 +437,7 @@ struct hw_mode_spec {
99 const struct channel_info *channels_info;
101 struct ieee80211_sta_ht_cap ht;
106 --- a/include/linux/rt2x00_platform.h
107 +++ b/include/linux/rt2x00_platform.h
108 @@ -18,6 +18,7 @@ struct rt2x00_platform_data {
115 #endif /* _RT2X00_PLATFORM_H */