Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 350726
b: refs/heads/master
c: 7248001
h: refs/heads/master
v: v3
  • Loading branch information
Tony Prisk authored and Mike Turquette committed Jan 16, 2013
1 parent bc3850b commit efe5f8e
Show file tree
Hide file tree
Showing 2 changed files with 9 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: 35a5db55ab96eadb07b3d5f7258558c680ebc2f0
refs/heads/master: 72480014b86c8b51fb51c5c6a0525876055c37c7
8 changes: 8 additions & 0 deletions trunk/drivers/clk/clk-vt8500.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ static long vt8500_dclk_round_rate(struct clk_hw *hw, unsigned long rate,
struct clk_device *cdev = to_clk_device(hw);
u32 divisor = *prate / rate;

/* If prate / rate would be decimal, incr the divisor */
if (rate * divisor < *prate)
divisor++;

/*
* If this is a request for SDMMC we have to adjust the divisor
* when >31 to use the fixed predivisor
Expand All @@ -141,6 +145,10 @@ static int vt8500_dclk_set_rate(struct clk_hw *hw, unsigned long rate,
u32 divisor = parent_rate / rate;
unsigned long flags = 0;

/* If prate / rate would be decimal, incr the divisor */
if (rate * divisor < *prate)
divisor++;

if (divisor == cdev->div_mask + 1)
divisor = 0;

Expand Down

0 comments on commit efe5f8e

Please sign in to comment.