summaryrefslogtreecommitdiff
path: root/package/mac80211/patches/615-rt2x00-fix_20mhz_clk.patch
diff options
context:
space:
mode:
authorblogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73>2013-04-03 10:00:29 +0000
committerblogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73>2013-04-03 10:00:29 +0000
commitf2e3cfef1c91db04d324897fea0498b4bdf11f12 (patch)
tree0d03f58727d9ac0145d752983a13748e831e28d1 /package/mac80211/patches/615-rt2x00-fix_20mhz_clk.patch
parent70938841ae71165ca8c2a93c9b1d24e18cc08a75 (diff)
[mac80211] several patches to make OF work on rt2x00
Signed-off-by: John Crispin <blogic@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@36178 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/mac80211/patches/615-rt2x00-fix_20mhz_clk.patch')
-rw-r--r--package/mac80211/patches/615-rt2x00-fix_20mhz_clk.patch31
1 files changed, 31 insertions, 0 deletions
diff --git a/package/mac80211/patches/615-rt2x00-fix_20mhz_clk.patch b/package/mac80211/patches/615-rt2x00-fix_20mhz_clk.patch
new file mode 100644
index 0000000000..281dd2e6d1
--- /dev/null
+++ b/package/mac80211/patches/615-rt2x00-fix_20mhz_clk.patch
@@ -0,0 +1,31 @@
+Index: compat-wireless-2013-02-22/drivers/net/wireless/rt2x00/rt2800lib.c
+===================================================================
+--- compat-wireless-2013-02-22.orig/drivers/net/wireless/rt2x00/rt2800lib.c 2013-04-02 10:56:56.245205151 +0200
++++ compat-wireless-2013-02-22/drivers/net/wireless/rt2x00/rt2800lib.c 2013-04-02 11:24:06.057243987 +0200
+@@ -38,6 +38,7 @@
+ #include <linux/kernel.h>
+ #include <linux/module.h>
+ #include <linux/slab.h>
++#include <linux/clk.h>
+
+ #include "rt2x00.h"
+ #include "rt2800lib.h"
+@@ -5505,13 +5506,14 @@
+
+ int rt2800_probe_clk(struct rt2x00_dev *rt2x00dev)
+ {
+- struct rt2x00_platform_data *pdata = rt2x00dev->dev->platform_data;
+ struct hw_mode_spec *spec = &rt2x00dev->spec;
++ struct clk *clk = clk_get(rt2x00dev->dev, NULL);
+
+- if (!pdata)
+- return -EINVAL;
++ if (IS_ERR(clk))
++ return PTR_ERR(clk);
+
+- spec->clk_is_20mhz = pdata->clk_is_20mhz;
++ if (clk_get_rate(clk) == 20000000)
++ spec->clk_is_20mhz = 1;
+
+ return 0;
+ }