Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 62148
b: refs/heads/master
c: fe04d77
h: refs/heads/master
v: v3
  • Loading branch information
Paul Mundt committed Jul 20, 2007
1 parent b41b43b commit 43731c9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f6991b0456416186b578d38717efcda2b012b79c
refs/heads/master: fe04d7798f611bca333df27d44484bdd62eef53f
15 changes: 15 additions & 0 deletions trunk/arch/sh/kernel/cpu/sh4a/clock-sh7722.c
Original file line number Diff line number Diff line change
Expand Up @@ -387,9 +387,24 @@ static int sh7722_frqcr_set_rate(struct clk *clk, unsigned long rate,
return err;
}

static long sh7722_frqcr_round_rate(struct clk *clk, unsigned long rate)
{
unsigned long parent_rate = clk->parent->rate;
int div;

/* look for multiplier/divisor pair */
div = sh7722_find_divisors(parent_rate, rate);
if (div < 0)
return clk->rate;

/* calculate new value of clock rate */
return parent_rate * 2 / div;
}

static struct clk_ops sh7722_frqcr_clk_ops = {
.recalc = sh7722_frqcr_recalc,
.set_rate = sh7722_frqcr_set_rate,
.round_rate = sh7722_frqcr_round_rate,
};

/*
Expand Down

0 comments on commit 43731c9

Please sign in to comment.