Thread (4 messages) 4 messages, 3 authors, 2012-10-22
DORMANTno replies

[PATCH] ARM: tegra30: clocks: add AHB and APB clocks

From: Joseph Lo <hidden>
Date: 2012-10-22 07:17:56
Also in: linux-tegra

On Mon, 2012-10-22 at 12:38 +0800, Prashant Gaikwad wrote:
On Friday 19 October 2012 12:08 PM, Joseph Lo wrote:
quoted
Adding the AHB and APB bus clock control interface for Tegra30.

Signed-off-by: Joseph Lo<redacted>
---
  arch/arm/mach-tegra/common.c              |    4 +
  arch/arm/mach-tegra/tegra30_clocks.c      |  106 +++++++++++++++++++++++++++++
  arch/arm/mach-tegra/tegra30_clocks.h      |    1 +
  arch/arm/mach-tegra/tegra30_clocks_data.c |   46 +++++++++++++
  4 files changed, 157 insertions(+), 0 deletions(-)
<snip>
quoted
+
+static long tegra30_bus_clk_round_rate(struct clk_hw *hw, unsigned long rate,
+				unsigned long *prate)
+{
+	unsigned long parent_rate = *prate;
+	s64 divider;
+
+	if (rate>= parent_rate)
+		return rate;
+
return parent_rate?
Prashant,

Yes, thanks.
quoted
+	divider = parent_rate;
+	divider += rate - 1;
+	do_div(divider, rate);
+
+	if (divider<  0)
+		return divider;
+
+	if (divider>  4)
+		divider = 4;
+	do_div(parent_rate, divider);
+
+	return parent_rate;
+}
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help