Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 146690
b: refs/heads/master
c: 3014f47
h: refs/heads/master
v: v3
  • Loading branch information
Magnus Damm authored and Paul Mundt committed Apr 30, 2009
1 parent f41039f commit e2442f2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e6be3a25861429166f945499c7ee616875bc3db9
refs/heads/master: 3014f47460ecfb13d4169daae51f26a20bacfa17
12 changes: 7 additions & 5 deletions trunk/drivers/clocksource/sh_cmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,16 +158,18 @@ static int sh_cmt_enable(struct sh_cmt_priv *p, unsigned long *rate)
pr_err("sh_cmt: cannot enable clock \"%s\"\n", cfg->clk);
return ret;
}
*rate = clk_get_rate(p->clk) / 8;

/* make sure channel is disabled */
sh_cmt_start_stop_ch(p, 0);

/* configure channel, periodic mode and maximum timeout */
if (p->width == 16)
sh_cmt_write(p, CMCSR, 0);
else
if (p->width == 16) {
*rate = clk_get_rate(p->clk) / 512;
sh_cmt_write(p, CMCSR, 0x43);
} else {
*rate = clk_get_rate(p->clk) / 8;
sh_cmt_write(p, CMCSR, 0x01a4);
}

sh_cmt_write(p, CMCOR, 0xffffffff);
sh_cmt_write(p, CMCNT, 0);
Expand Down Expand Up @@ -615,7 +617,7 @@ static int sh_cmt_setup(struct sh_cmt_priv *p, struct platform_device *pdev)
if (resource_size(res) == 6) {
p->width = 16;
p->overflow_bit = 0x80;
p->clear_bits = ~0xc0;
p->clear_bits = ~0x80;
} else {
p->width = 32;
p->overflow_bit = 0x8000;
Expand Down

0 comments on commit e2442f2

Please sign in to comment.