aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/sunxi
diff options
context:
space:
mode:
authorZoltan HERPAI <wigyori@uid0.hu>2014-09-19 00:12:53 +0000
committerZoltan HERPAI <wigyori@uid0.hu>2014-09-19 00:12:53 +0000
commit914948ebaadfe1be40732bf6a74d9803f7baeaf3 (patch)
tree27451ee5af7f026bc25f035240ca6a066f5b8a0d /target/linux/sunxi
parent297462e03c950c9b333f03f92ec2bc217e428afe (diff)
downloadmaster-187ad058-914948ebaadfe1be40732bf6a74d9803f7baeaf3.tar.gz
master-187ad058-914948ebaadfe1be40732bf6a74d9803f7baeaf3.tar.bz2
master-187ad058-914948ebaadfe1be40732bf6a74d9803f7baeaf3.zip
sunxi: backport late clock fixes from 3.15
Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@42615 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/sunxi')
-rw-r--r--target/linux/sunxi/patches-3.14/275-clk-sunxi-late-clock-fixes.patch31
1 files changed, 31 insertions, 0 deletions
diff --git a/target/linux/sunxi/patches-3.14/275-clk-sunxi-late-clock-fixes.patch b/target/linux/sunxi/patches-3.14/275-clk-sunxi-late-clock-fixes.patch
new file mode 100644
index 0000000000..8f3333ab5f
--- /dev/null
+++ b/target/linux/sunxi/patches-3.14/275-clk-sunxi-late-clock-fixes.patch
@@ -0,0 +1,31 @@
+diff --git a/drivers/clk/sunxi/clk-sunxi.c b/drivers/clk/sunxi/clk-sunxi.c
+index a393df1..0393f85 100644
+--- a/drivers/clk/sunxi/clk-sunxi.c
++++ b/drivers/clk/sunxi/clk-sunxi.c
+@@ -326,7 +326,7 @@ static void sun4i_get_apb1_factors(u32 *freq, u32 parent_rate,
+ if (parent_rate < *freq)
+ *freq = parent_rate;
+
+- parent_rate = (parent_rate + (*freq - 1)) / *freq;
++ parent_rate = DIV_ROUND_UP(parent_rate, *freq);
+
+ /* Invalid rate! */
+ if (parent_rate > 32)
+@@ -371,7 +371,7 @@ static void sun4i_get_mod0_factors(u32 *freq, u32 parent_rate,
+ if (*freq > parent_rate)
+ *freq = parent_rate;
+
+- div = parent_rate / *freq;
++ div = DIV_ROUND_UP(parent_rate, *freq);
+
+ if (div < 16)
+ calcp = 0;
+@@ -412,7 +412,7 @@ static void sun7i_a20_get_out_factors(u32 *freq, u32 parent_rate,
+ if (*freq > parent_rate)
+ *freq = parent_rate;
+
+- div = parent_rate / *freq;
++ div = DIV_ROUND_UP(parent_rate, *freq);
+
+ if (div < 32)
+ calcp = 0;