Commit | Line | Data |
---|---|---|
6280238c ORL |
1 | /* |
2 | * pwr.h | |
3 | * | |
4 | * DSP-BIOS Bridge driver support functions for TI OMAP processors. | |
5 | * | |
6 | * Copyright (C) 2005-2006 Texas Instruments, Inc. | |
7 | * | |
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. | |
11 | * | |
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. | |
15 | */ | |
16 | ||
17 | #ifndef PWR_ | |
18 | #define PWR_ | |
19 | ||
20 | #include <dspbridge/dbdefs.h> | |
157bc26d AU |
21 | #include <dspbridge/mbx_sh.h> |
22 | ||
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 | |
27 | ||
6280238c ORL |
28 | |
29 | /* | |
30 | * ======== pwr_sleep_dsp ======== | |
31 | * Signal the DSP to go to sleep. | |
32 | * | |
33 | * Parameters: | |
0cd343a4 | 34 | * sleep_code: New sleep state for DSP. (Initially, valid codes |
6280238c ORL |
35 | * are PWR_DEEPSLEEP or PWR_EMERGENCYDEEPSLEEP; both of |
36 | * these codes will simply put the DSP in deep sleep.) | |
37 | * | |
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 | |
43 | * specified as zero. | |
44 | * | |
45 | * Returns: | |
46 | * 0: Success. | |
47 | * 0: Success, but the DSP was already asleep. | |
0cd343a4 | 48 | * -EINVAL: The specified sleep_code is not supported. |
25985edc | 49 | * -ETIME: A timeout occurred while waiting for DSP sleep |
6280238c ORL |
50 | * confirmation. |
51 | * -EPERM: General failure, unable to send sleep command to | |
52 | * the DSP. | |
53 | */ | |
9d7d0a52 | 54 | extern int pwr_sleep_dsp(const u32 sleep_code, const u32 timeout); |
6280238c ORL |
55 | |
56 | /* | |
57 | * ======== pwr_wake_dsp ======== | |
58 | * Signal the DSP to wake from sleep. | |
59 | * | |
60 | * Parameters: | |
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. | |
66 | * | |
67 | * Returns: | |
68 | * 0: Success. | |
69 | * 0: Success, but the DSP was already awake. | |
25985edc | 70 | * -ETIME: A timeout occurred while waiting for wake |
6280238c ORL |
71 | * confirmation. |
72 | * -EPERM: General failure, unable to send wake command to | |
73 | * the DSP. | |
74 | */ | |
9d7d0a52 | 75 | extern int pwr_wake_dsp(const u32 timeout); |
6280238c ORL |
76 | |
77 | /* | |
78 | * ======== pwr_pm_pre_scale ======== | |
79 | * Prescale notification to DSP. | |
80 | * | |
81 | * Parameters: | |
82 | * voltage_domain: The voltage domain for which notification is sent | |
83 | * level: The level of voltage domain | |
84 | * | |
85 | * Returns: | |
86 | * 0: Success. | |
87 | * 0: Success, but the DSP was already awake. | |
25985edc | 88 | * -ETIME: A timeout occurred while waiting for wake |
6280238c ORL |
89 | * confirmation. |
90 | * -EPERM: General failure, unable to send wake command to | |
91 | * the DSP. | |
92 | */ | |
9d7d0a52 | 93 | extern int pwr_pm_pre_scale(u16 voltage_domain, u32 level); |
6280238c ORL |
94 | |
95 | /* | |
96 | * ======== pwr_pm_post_scale ======== | |
97 | * PostScale notification to DSP. | |
98 | * | |
99 | * Parameters: | |
100 | * voltage_domain: The voltage domain for which notification is sent | |
101 | * level: The level of voltage domain | |
102 | * | |
103 | * Returns: | |
104 | * 0: Success. | |
105 | * 0: Success, but the DSP was already awake. | |
25985edc | 106 | * -ETIME: A timeout occurred while waiting for wake |
6280238c ORL |
107 | * confirmation. |
108 | * -EPERM: General failure, unable to send wake command to | |
109 | * the DSP. | |
110 | */ | |
9d7d0a52 | 111 | extern int pwr_pm_post_scale(u16 voltage_domain, u32 level); |
6280238c ORL |
112 | |
113 | #endif /* PWR_ */ |