Commit 908b75e8 authored by Tero Kristo's avatar Tero Kristo Committed by Kevin Hilman

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: default avatarTero Kristo <t-kristo@ti.com>
Signed-off-by: default avatarKevin Hilman <khilman@ti.com>
parent 9a1729cb
...@@ -39,6 +39,36 @@ static struct omap_device_pm_latency *pm_lats; ...@@ -39,6 +39,36 @@ static struct omap_device_pm_latency *pm_lats;
*/ */
int (*omap_pm_suspend)(void); int (*omap_pm_suspend)(void);
/**
* struct omap2_oscillator - Describe the board main oscillator latencies
* @startup_time: oscillator startup latency
* @shutdown_time: oscillator shutdown latency
*/
struct omap2_oscillator {
u32 startup_time;
u32 shutdown_time;
};
static struct omap2_oscillator oscillator = {
.startup_time = ULONG_MAX,
.shutdown_time = ULONG_MAX,
};
void omap_pm_setup_oscillator(u32 tstart, u32 tshut)
{
oscillator.startup_time = tstart;
oscillator.shutdown_time = tshut;
}
void omap_pm_get_oscillator(u32 *tstart, u32 *tshut)
{
if (!tstart || !tshut)
return;
*tstart = oscillator.startup_time;
*tshut = oscillator.shutdown_time;
}
static int __init _init_omap_device(char *name) static int __init _init_omap_device(char *name)
{ {
struct omap_hwmod *oh; struct omap_hwmod *oh;
......
...@@ -129,4 +129,12 @@ static inline int omap4_twl_init(void) ...@@ -129,4 +129,12 @@ static inline int omap4_twl_init(void)
} }
#endif #endif
#ifdef CONFIG_PM
extern void omap_pm_setup_oscillator(u32 tstart, u32 tshut);
extern void omap_pm_get_oscillator(u32 *tstart, u32 *tshut);
#else
static inline void omap_pm_setup_oscillator(u32 tstart, u32 tshut) { }
static inline void omap_pm_get_oscillator(u32 *tstart, u32 *tshut) { }
#endif
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment