4 * DSP-BIOS Bridge driver support functions for TI OMAP processors.
6 * Copyright (C) 2005-2006 Texas Instruments, Inc.
8 * This package is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
12 * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
13 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
14 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
20 #include <dspbridge/dbdefs.h>
21 #include <dspbridge/mbx_sh.h>
23 /* valid sleep command codes that can be sent by GPP via mailbox: */
24 #define PWR_DEEPSLEEP MBX_PM_DSPIDLE
25 #define PWR_EMERGENCYDEEPSLEEP MBX_PM_EMERGENCYSLEEP
26 #define PWR_WAKEUP MBX_PM_DSPWAKEUP
30 * ======== pwr_sleep_dsp ========
31 * Signal the DSP to go to sleep.
34 * sleep_code: New sleep state for DSP. (Initially, valid codes
35 * are PWR_DEEPSLEEP or PWR_EMERGENCYDEEPSLEEP; both of
36 * these codes will simply put the DSP in deep sleep.)
38 * timeout: Maximum time (msec) that PWR should wait for
39 * confirmation that the DSP sleep state has been
40 * reached. If PWR should simply send the command to
41 * the DSP to go to sleep and then return (i.e.,
42 * asynchrounous sleep), the timeout should be
47 * 0: Success, but the DSP was already asleep.
48 * -EINVAL: The specified sleep_code is not supported.
49 * -ETIME: A timeout occured while waiting for DSP sleep
51 * -EPERM: General failure, unable to send sleep command to
54 extern int pwr_sleep_dsp(const u32 sleep_code, const u32 timeout);
57 * ======== pwr_wake_dsp ========
58 * Signal the DSP to wake from sleep.
61 * timeout: Maximum time (msec) that PWR should wait for
62 * confirmation that the DSP is awake. If PWR should
63 * simply send a command to the DSP to wake and then
64 * return (i.e., asynchrounous wake), timeout should
65 * be specified as zero.
69 * 0: Success, but the DSP was already awake.
70 * -ETIME: A timeout occured while waiting for wake
72 * -EPERM: General failure, unable to send wake command to
75 extern int pwr_wake_dsp(const u32 timeout);
78 * ======== pwr_pm_pre_scale ========
79 * Prescale notification to DSP.
82 * voltage_domain: The voltage domain for which notification is sent
83 * level: The level of voltage domain
87 * 0: Success, but the DSP was already awake.
88 * -ETIME: A timeout occured while waiting for wake
90 * -EPERM: General failure, unable to send wake command to
93 extern int pwr_pm_pre_scale(u16 voltage_domain, u32 level);
96 * ======== pwr_pm_post_scale ========
97 * PostScale notification to DSP.
100 * voltage_domain: The voltage domain for which notification is sent
101 * level: The level of voltage domain
105 * 0: Success, but the DSP was already awake.
106 * -ETIME: A timeout occured while waiting for wake
108 * -EPERM: General failure, unable to send wake command to
111 extern int pwr_pm_post_scale(u16 voltage_domain, u32 level);