diff options
author | Tero Kristo <t-kristo@ti.com> | 2012-09-25 12:33:39 -0400 |
---|---|---|
committer | Kevin Hilman <khilman@ti.com> | 2012-11-05 18:12:40 -0500 |
commit | 908b75e850c4a6130b680ea7e59b00f80d4cd2d2 (patch) | |
tree | 8b9480fc931af48286bb8a5fdd1a6cd4c9d54b7b /arch/arm/mach-omap2/pm.c | |
parent | 9a1729cbaaf1a9d1fd27f80cd488ef182fe033a0 (diff) |
ARM: OMAP: add support for oscillator setup
This contains startup and shutdown times for the oscillator. By default
use ULONG_MAX. Oscillator setup is used for calculating and setting up
latencies for sleep modes that disable oscillator.
Based on a patch from Nishanth Menon <nm@ti.com>.
Signed-off-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2/pm.c')
-rw-r--r-- | arch/arm/mach-omap2/pm.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c index ea61c32957bd..109a02e02d72 100644 --- a/arch/arm/mach-omap2/pm.c +++ b/arch/arm/mach-omap2/pm.c | |||
@@ -39,6 +39,36 @@ static struct omap_device_pm_latency *pm_lats; | |||
39 | */ | 39 | */ |
40 | int (*omap_pm_suspend)(void); | 40 | int (*omap_pm_suspend)(void); |
41 | 41 | ||
42 | /** | ||
43 | * struct omap2_oscillator - Describe the board main oscillator latencies | ||
44 | * @startup_time: oscillator startup latency | ||
45 | * @shutdown_time: oscillator shutdown latency | ||
46 | */ | ||
47 | struct omap2_oscillator { | ||
48 | u32 startup_time; | ||
49 | u32 shutdown_time; | ||
50 | }; | ||
51 | |||
52 | static struct omap2_oscillator oscillator = { | ||
53 | .startup_time = ULONG_MAX, | ||
54 | .shutdown_time = ULONG_MAX, | ||
55 | }; | ||
56 | |||
57 | void omap_pm_setup_oscillator(u32 tstart, u32 tshut) | ||
58 | { | ||
59 | oscillator.startup_time = tstart; | ||
60 | oscillator.shutdown_time = tshut; | ||
61 | } | ||
62 | |||
63 | void omap_pm_get_oscillator(u32 *tstart, u32 *tshut) | ||
64 | { | ||
65 | if (!tstart || !tshut) | ||
66 | return; | ||
67 | |||
68 | *tstart = oscillator.startup_time; | ||
69 | *tshut = oscillator.shutdown_time; | ||
70 | } | ||
71 | |||
42 | static int __init _init_omap_device(char *name) | 72 | static int __init _init_omap_device(char *name) |
43 | { | 73 | { |
44 | struct omap_hwmod *oh; | 74 | struct omap_hwmod *oh; |