Commit c2b0a300 authored by Russell King's avatar Russell King

[ARM] clk_* functions take frequencies in Hz not kHz

parent a311c218
...@@ -76,7 +76,10 @@ EXPORT_SYMBOL(clk_get_rate); ...@@ -76,7 +76,10 @@ EXPORT_SYMBOL(clk_get_rate);
long clk_round_rate(struct clk *clk, unsigned long rate) long clk_round_rate(struct clk *clk, unsigned long rate)
{ {
return rate; struct icst525_vco vco;
vco = icst525_khz_to_vco(clk->params, rate / 1000);
return icst525_khz(clk->params, vco) * 1000;
} }
EXPORT_SYMBOL(clk_round_rate); EXPORT_SYMBOL(clk_round_rate);
...@@ -86,8 +89,8 @@ int clk_set_rate(struct clk *clk, unsigned long rate) ...@@ -86,8 +89,8 @@ int clk_set_rate(struct clk *clk, unsigned long rate)
if (clk->setvco) { if (clk->setvco) {
struct icst525_vco vco; struct icst525_vco vco;
vco = icst525_khz_to_vco(clk->params, rate); vco = icst525_khz_to_vco(clk->params, rate / 1000);
clk->rate = icst525_khz(clk->params, vco); clk->rate = icst525_khz(clk->params, vco) * 1000;
printk("Clock %s: setting VCO reg params: S=%d R=%d V=%d\n", printk("Clock %s: setting VCO reg params: S=%d R=%d V=%d\n",
clk->name, vco.s, vco.r, vco.v); clk->name, vco.s, vco.r, vco.v);
......
...@@ -87,8 +87,8 @@ int clk_set_rate(struct clk *clk, unsigned long rate) ...@@ -87,8 +87,8 @@ int clk_set_rate(struct clk *clk, unsigned long rate)
if (clk->setvco) { if (clk->setvco) {
struct icst525_vco vco; struct icst525_vco vco;
vco = icst525_khz_to_vco(clk->params, rate); vco = icst525_khz_to_vco(clk->params, rate / 1000);
clk->rate = icst525_khz(clk->params, vco); clk->rate = icst525_khz(clk->params, vco) * 1000;
printk("Clock %s: setting VCO reg params: S=%d R=%d V=%d\n", printk("Clock %s: setting VCO reg params: S=%d R=%d V=%d\n",
clk->name, vco.s, vco.r, vco.v); clk->name, vco.s, vco.r, vco.v);
......
...@@ -207,7 +207,7 @@ static int clcdfb_set_par(struct fb_info *info) ...@@ -207,7 +207,7 @@ static int clcdfb_set_par(struct fb_info *info)
clcdfb_set_start(fb); clcdfb_set_start(fb);
clk_set_rate(fb->clk, 1000000000 / regs.pixclock); clk_set_rate(fb->clk, (1000000000 / regs.pixclock) * 1000);
fb->clcd_cntl = regs.cntl; fb->clcd_cntl = regs.cntl;
......
...@@ -64,7 +64,7 @@ int clk_use(struct clk *clk); ...@@ -64,7 +64,7 @@ int clk_use(struct clk *clk);
void clk_unuse(struct clk *clk); void clk_unuse(struct clk *clk);
/** /**
* clk_get_rate - obtain the current clock rate for a clock source. * clk_get_rate - obtain the current clock rate (in Hz) for a clock source.
* This is only valid once the clock source has been enabled. * This is only valid once the clock source has been enabled.
* @clk: clock source * @clk: clock source
*/ */
...@@ -85,16 +85,16 @@ void clk_put(struct clk *clk); ...@@ -85,16 +85,16 @@ void clk_put(struct clk *clk);
/** /**
* clk_round_rate - adjust a rate to the exact rate a clock can provide * clk_round_rate - adjust a rate to the exact rate a clock can provide
* @clk: clock source * @clk: clock source
* @rate: desired clock rate in kHz * @rate: desired clock rate in Hz
* *
* Returns rounded clock rate, or negative errno. * Returns rounded clock rate in Hz, or negative errno.
*/ */
long clk_round_rate(struct clk *clk, unsigned long rate); long clk_round_rate(struct clk *clk, unsigned long rate);
/** /**
* clk_set_rate - set the clock rate for a clock source * clk_set_rate - set the clock rate for a clock source
* @clk: clock source * @clk: clock source
* @rate: desired clock rate in kHz * @rate: desired clock rate in Hz
* *
* Returns success (0) or negative errno. * Returns success (0) or negative errno.
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment