upload tizen1.0 source
[kernel/linux-2.6.36.git] / drivers / staging / tidspbridge / include / dspbridge / pwr.h
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>
21 #include <dspbridge/pwr_sh.h>
22
23 /*
24  *  ======== pwr_sleep_dsp ========
25  *      Signal the DSP to go to sleep.
26  *
27  *  Parameters:
28  *      sleep_code:          New sleep state for DSP.  (Initially, valid codes
29  *                          are PWR_DEEPSLEEP or PWR_EMERGENCYDEEPSLEEP; both of
30  *                          these codes will simply put the DSP in deep sleep.)
31  *
32  *      timeout:            Maximum time (msec) that PWR should wait for
33  *                          confirmation that the DSP sleep state has been
34  *                          reached.  If PWR should simply send the command to
35  *                          the DSP to go to sleep and then return (i.e.,
36  *                          asynchrounous sleep), the timeout should be
37  *                          specified as zero.
38  *
39  *  Returns:
40  *      0:            Success.
41  *      0: Success, but the DSP was already asleep.
42  *      -EINVAL:    The specified sleep_code is not supported.
43  *      -ETIME:       A timeout occured while waiting for DSP sleep
44  *                          confirmation.
45  *      -EPERM:          General failure, unable to send sleep command to
46  *                          the DSP.
47  */
48 extern int pwr_sleep_dsp(const u32 sleep_code, const u32 timeout);
49
50 /*
51  *  ======== pwr_wake_dsp ========
52  *    Signal the DSP to wake from sleep.
53  *
54  *  Parameters:
55  *      timeout:            Maximum time (msec) that PWR should wait for
56  *                          confirmation that the DSP is awake.  If PWR should
57  *                          simply send a command to the DSP to wake and then
58  *                          return (i.e., asynchrounous wake), timeout should
59  *                          be specified as zero.
60  *
61  *  Returns:
62  *      0:            Success.
63  *      0:  Success, but the DSP was already awake.
64  *      -ETIME:       A timeout occured while waiting for wake
65  *                          confirmation.
66  *      -EPERM:          General failure, unable to send wake command to
67  *                          the DSP.
68  */
69 extern int pwr_wake_dsp(const u32 timeout);
70
71 /*
72  *  ======== pwr_pm_pre_scale ========
73  *    Prescale notification to DSP.
74  *
75  *  Parameters:
76  *      voltage_domain:   The voltage domain for which notification is sent
77  *    level:                    The level of voltage domain
78  *
79  *  Returns:
80  *      0:            Success.
81  *      0:  Success, but the DSP was already awake.
82  *      -ETIME:       A timeout occured while waiting for wake
83  *                          confirmation.
84  *      -EPERM:          General failure, unable to send wake command to
85  *                          the DSP.
86  */
87 extern int pwr_pm_pre_scale(u16 voltage_domain, u32 level);
88
89 /*
90  *  ======== pwr_pm_post_scale ========
91  *    PostScale notification to DSP.
92  *
93  *  Parameters:
94  *      voltage_domain:   The voltage domain for which notification is sent
95  *    level:                    The level of voltage domain
96  *
97  *  Returns:
98  *      0:            Success.
99  *      0:  Success, but the DSP was already awake.
100  *      -ETIME:       A timeout occured while waiting for wake
101  *                          confirmation.
102  *      -EPERM:          General failure, unable to send wake command to
103  *                          the DSP.
104  */
105 extern int pwr_pm_post_scale(u16 voltage_domain, u32 level);
106
107 #endif /* PWR_ */