fixes for bc_cat
[sgx.git] / pvr / power.h
1 /**********************************************************************
2  *
3  * Copyright(c) 2008 Imagination Technologies Ltd. All rights reserved.
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms and conditions of the GNU General Public License,
7  * version 2, as published by the Free Software Foundation.
8  *
9  * This program is distributed in the hope it will be useful but, except
10  * as otherwise stated in writing, without any warranty; without even the
11  * implied warranty of merchantability or fitness for a particular purpose.
12  * See the GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License along with
15  * this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
17  *
18  * The full GNU General Public License is included in this distribution in
19  * the file called "COPYING".
20  *
21  * Contact Information:
22  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
23  * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
24  *
25  ******************************************************************************/
26
27 #ifndef POWER_H
28 #define POWER_H
29
30 struct PVRSRV_POWER_DEV {
31         enum PVRSRV_ERROR (*pfnPrePower)(void *, enum PVR_POWER_STATE,
32                                          enum PVR_POWER_STATE);
33         enum PVRSRV_ERROR (*pfnPostPower)(void *, enum PVR_POWER_STATE,
34                                           enum PVR_POWER_STATE);
35         enum PVRSRV_ERROR (*pfnPreClockSpeedChange)(void *, IMG_BOOL,
36                                                     enum PVR_POWER_STATE);
37         enum PVRSRV_ERROR (*pfnPostClockSpeedChange)(void *, IMG_BOOL,
38                                                      enum PVR_POWER_STATE);
39         void *hDevCookie;
40         u32 ui32DeviceIndex;
41         enum PVR_POWER_STATE eDefaultPowerState;
42         enum PVR_POWER_STATE eCurrentPowerState;
43         struct PVRSRV_POWER_DEV *psNext;
44
45 };
46
47 enum PVRSRV_INIT_SERVER_STATE {
48         PVRSRV_INIT_SERVER_Unspecified = -1,
49         PVRSRV_INIT_SERVER_RUNNING = 0,
50         PVRSRV_INIT_SERVER_RAN = 1,
51         PVRSRV_INIT_SERVER_SUCCESSFUL = 2,
52         PVRSRV_INIT_SERVER_NUM = 3,
53         PVRSRV_INIT_SERVER_FORCE_I32 = 0x7fffffff
54 };
55
56 IMG_BOOL PVRSRVGetInitServerState(enum PVRSRV_INIT_SERVER_STATE
57                 eInitServerState);
58
59 enum PVRSRV_ERROR PVRSRVSetInitServerState(enum PVRSRV_INIT_SERVER_STATE
60                 eInitServerState,
61                 IMG_BOOL bState);
62
63 enum PVRSRV_ERROR PVRSRVSetDevicePowerStateKM(u32 ui32DeviceIndex,
64                 enum PVR_POWER_STATE eNewPowerState);
65
66 enum PVRSRV_ERROR PVRSRVSystemPrePowerStateKM(
67                 enum PVR_POWER_STATE eNewPowerState);
68 enum PVRSRV_ERROR PVRSRVSystemPostPowerStateKM(
69                 enum PVR_POWER_STATE eNewPowerState);
70
71 enum PVRSRV_ERROR PVRSRVSetPowerStateKM(enum PVR_POWER_STATE ePVRState);
72
73 enum PVRSRV_ERROR PVRSRVRegisterPowerDevice(u32 ui32DeviceIndex,
74         enum PVRSRV_ERROR (*pfnPrePower)(void *, enum PVR_POWER_STATE,
75                                          enum PVR_POWER_STATE),
76         enum PVRSRV_ERROR (*pfnPostPower)(void *, enum PVR_POWER_STATE,
77                                           enum PVR_POWER_STATE),
78         enum PVRSRV_ERROR (*pfnPreClockSpeedChange)(void *, IMG_BOOL,
79                                                     enum PVR_POWER_STATE),
80         enum PVRSRV_ERROR (*pfnPostClockSpeedChange)(void *, IMG_BOOL,
81                                                      enum PVR_POWER_STATE),
82         void *hDevCookie, enum PVR_POWER_STATE eCurrentPowerState,
83         enum PVR_POWER_STATE eDefaultPowerState);
84
85 enum PVRSRV_ERROR PVRSRVRemovePowerDevice(u32 ui32DeviceIndex);
86
87 IMG_BOOL PVRSRVIsDevicePowered(u32 ui32DeviceIndex);
88
89 enum PVRSRV_ERROR PVRSRVDevicePreClockSpeedChange(u32 ui32DeviceIndex,
90                 IMG_BOOL bIdleDevice,
91                 void *pvInfo);
92
93 void PVRSRVDevicePostClockSpeedChange(u32 ui32DeviceIndex,
94                 IMG_BOOL bIdleDevice,
95                 void *pvInfo);
96
97 #endif