diff options
Diffstat (limited to 'arch/arm/mach-davinci/clock.c')
-rw-r--r-- | arch/arm/mach-davinci/clock.c | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/arch/arm/mach-davinci/clock.c b/arch/arm/mach-davinci/clock.c index 34668ead53c7..d458558ee84a 100644 --- a/arch/arm/mach-davinci/clock.c +++ b/arch/arm/mach-davinci/clock.c | |||
@@ -52,6 +52,40 @@ static void __clk_disable(struct clk *clk) | |||
52 | __clk_disable(clk->parent); | 52 | __clk_disable(clk->parent); |
53 | } | 53 | } |
54 | 54 | ||
55 | int davinci_clk_reset(struct clk *clk, bool reset) | ||
56 | { | ||
57 | unsigned long flags; | ||
58 | |||
59 | if (clk == NULL || IS_ERR(clk)) | ||
60 | return -EINVAL; | ||
61 | |||
62 | spin_lock_irqsave(&clockfw_lock, flags); | ||
63 | if (clk->flags & CLK_PSC) | ||
64 | davinci_psc_reset(clk->gpsc, clk->lpsc, reset); | ||
65 | spin_unlock_irqrestore(&clockfw_lock, flags); | ||
66 | |||
67 | return 0; | ||
68 | } | ||
69 | EXPORT_SYMBOL(davinci_clk_reset); | ||
70 | |||
71 | int davinci_clk_reset_assert(struct clk *clk) | ||
72 | { | ||
73 | if (clk == NULL || IS_ERR(clk) || !clk->reset) | ||
74 | return -EINVAL; | ||
75 | |||
76 | return clk->reset(clk, true); | ||
77 | } | ||
78 | EXPORT_SYMBOL(davinci_clk_reset_assert); | ||
79 | |||
80 | int davinci_clk_reset_deassert(struct clk *clk) | ||
81 | { | ||
82 | if (clk == NULL || IS_ERR(clk) || !clk->reset) | ||
83 | return -EINVAL; | ||
84 | |||
85 | return clk->reset(clk, false); | ||
86 | } | ||
87 | EXPORT_SYMBOL(davinci_clk_reset_deassert); | ||
88 | |||
55 | int clk_enable(struct clk *clk) | 89 | int clk_enable(struct clk *clk) |
56 | { | 90 | { |
57 | unsigned long flags; | 91 | unsigned long flags; |
@@ -535,7 +569,7 @@ int davinci_set_refclk_rate(unsigned long rate) | |||
535 | } | 569 | } |
536 | 570 | ||
537 | int __init davinci_clk_init(struct clk_lookup *clocks) | 571 | int __init davinci_clk_init(struct clk_lookup *clocks) |
538 | { | 572 | { |
539 | struct clk_lookup *c; | 573 | struct clk_lookup *c; |
540 | struct clk *clk; | 574 | struct clk *clk; |
541 | size_t num_clocks = 0; | 575 | size_t num_clocks = 0; |
@@ -576,6 +610,9 @@ int __init davinci_clk_init(struct clk_lookup *clocks) | |||
576 | if (clk->lpsc) | 610 | if (clk->lpsc) |
577 | clk->flags |= CLK_PSC; | 611 | clk->flags |= CLK_PSC; |
578 | 612 | ||
613 | if (clk->flags & PSC_LRST) | ||
614 | clk->reset = davinci_clk_reset; | ||
615 | |||
579 | clk_register(clk); | 616 | clk_register(clk); |
580 | num_clocks++; | 617 | num_clocks++; |
581 | 618 | ||