1 --- a/drivers/net/wireless/rt2x00/rt2800lib.c
2 +++ b/drivers/net/wireless/rt2x00/rt2800lib.c
3 @@ -8185,6 +8185,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 @@ -8271,7 +8292,10 @@ static int rt2800_probe_hw_mode(struct r
34 spec->num_channels = 14;
35 - spec->channels = rf_vals_3x;
36 + if (spec->clk_is_20mhz)
37 + spec->channels = rf_vals_xtal20mhz_3x;
39 + spec->channels = rf_vals_3x;
43 @@ -8455,6 +8479,19 @@ static int rt2800_probe_rt(struct rt2x00
47 +int rt2800_probe_clk(struct rt2x00_dev *rt2x00dev)
49 + struct rt2x00_platform_data *pdata = rt2x00dev->dev->platform_data;
50 + struct hw_mode_spec *spec = &rt2x00dev->spec;
55 + spec->clk_is_20mhz = pdata->clk_is_20mhz;
60 int rt2800_probe_hw(struct rt2x00_dev *rt2x00dev)
62 struct rt2800_drv_data *drv_data = rt2x00dev->drv_data;
63 @@ -8497,6 +8534,15 @@ int rt2800_probe_hw(struct rt2x00_dev *r
64 rt2800_register_write(rt2x00dev, GPIO_CTRL, reg);
69 + if (rt2x00_is_soc(rt2x00dev)) {
70 + retval = rt2800_probe_clk(rt2x00dev);
76 * Initialize hw specifications.
78 retval = rt2800_probe_hw_mode(rt2x00dev);
79 --- a/drivers/net/wireless/rt2x00/rt2x00.h
80 +++ b/drivers/net/wireless/rt2x00/rt2x00.h
81 @@ -398,6 +398,7 @@ static inline struct rt2x00_intf* vif_to
82 * @channels: Device/chipset specific channel values (See &struct rf_channel).
83 * @channels_info: Additional information for channels (See &struct channel_info).
84 * @ht: Driver HT Capabilities (See &ieee80211_sta_ht_cap).
85 + * @clk_is_20mhz: External crystal of WiSoC is 20MHz instead of 40MHz
88 unsigned int supported_bands;
89 @@ -414,6 +415,7 @@ struct hw_mode_spec {
90 const struct channel_info *channels_info;
92 struct ieee80211_sta_ht_cap ht;
97 --- a/include/linux/rt2x00_platform.h
98 +++ b/include/linux/rt2x00_platform.h
99 @@ -18,6 +18,7 @@ struct rt2x00_platform_data {
106 #endif /* _RT2X00_PLATFORM_H */