aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/clocksource/timer-of.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/clocksource/timer-of.c')
-rw-r--r--drivers/clocksource/timer-of.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/drivers/clocksource/timer-of.c b/drivers/clocksource/timer-of.c
index ad5565404e25..c1045b9a787c 100644
--- a/drivers/clocksource/timer-of.c
+++ b/drivers/clocksource/timer-of.c
@@ -24,6 +24,12 @@
24 24
25#include "timer-of.h" 25#include "timer-of.h"
26 26
27/**
28 * timer_of_irq_exit - Release the interrupt
29 * @of_irq: an of_timer_irq structure pointer
30 *
31 * Free the irq resource
32 */
27static __init void timer_of_irq_exit(struct of_timer_irq *of_irq) 33static __init void timer_of_irq_exit(struct of_timer_irq *of_irq)
28{ 34{
29 struct timer_of *to = container_of(of_irq, struct timer_of, of_irq); 35 struct timer_of *to = container_of(of_irq, struct timer_of, of_irq);
@@ -34,6 +40,22 @@ static __init void timer_of_irq_exit(struct of_timer_irq *of_irq)
34 free_irq(of_irq->irq, clkevt); 40 free_irq(of_irq->irq, clkevt);
35} 41}
36 42
43/**
44 * timer_of_irq_init - Request the interrupt
45 * @np: a device tree node pointer
46 * @of_irq: an of_timer_irq structure pointer
47 *
48 * Get the interrupt number from the DT from its definition and
49 * request it. The interrupt is gotten by falling back the following way:
50 *
51 * - Get interrupt number by name
52 * - Get interrupt number by index
53 *
54 * When the interrupt is per CPU, 'request_percpu_irq()' is called,
55 * otherwise 'request_irq()' is used.
56 *
57 * Returns 0 on success, < 0 otherwise
58 */
37static __init int timer_of_irq_init(struct device_node *np, 59static __init int timer_of_irq_init(struct device_node *np,
38 struct of_timer_irq *of_irq) 60 struct of_timer_irq *of_irq)
39{ 61{
@@ -72,6 +94,12 @@ static __init int timer_of_irq_init(struct device_node *np,
72 return 0; 94 return 0;
73} 95}
74 96
97/**
98 * timer_of_clk_exit - Release the clock resources
99 * @of_clk: a of_timer_clk structure pointer
100 *
101 * Disables and releases the refcount on the clk
102 */
75static __init void timer_of_clk_exit(struct of_timer_clk *of_clk) 103static __init void timer_of_clk_exit(struct of_timer_clk *of_clk)
76{ 104{
77 of_clk->rate = 0; 105 of_clk->rate = 0;
@@ -79,6 +107,15 @@ static __init void timer_of_clk_exit(struct of_timer_clk *of_clk)
79 clk_put(of_clk->clk); 107 clk_put(of_clk->clk);
80} 108}
81 109
110/**
111 * timer_of_clk_init - Initialize the clock resources
112 * @np: a device tree node pointer
113 * @of_clk: a of_timer_clk structure pointer
114 *
115 * Get the clock by name or by index, enable it and get the rate
116 *
117 * Returns 0 on success, < 0 otherwise
118 */
82static __init int timer_of_clk_init(struct device_node *np, 119static __init int timer_of_clk_init(struct device_node *np,
83 struct of_timer_clk *of_clk) 120 struct of_timer_clk *of_clk)
84{ 121{