|
1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of the License "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // e32\include\drivers\resourceman.h |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @file |
|
20 @publishedPartner |
|
21 @released 9.5 |
|
22 */ |
|
23 #ifndef __RESOURCEMAN_H__ |
|
24 #define __RESOURCEMAN_H__ |
|
25 |
|
26 #ifdef PRM_ENABLE_EXTENDED_VERSION |
|
27 #include <drivers/resource_extend.h> |
|
28 #else |
|
29 #include <drivers/resource.h> |
|
30 #endif |
|
31 |
|
32 static const TUint KResManControlIoGetVersion=0x0; |
|
33 static const TUint KResManControlIoRegisterDynamicResource=0x1; |
|
34 static const TUint KResManControlIoDeregisterDynamicResource=0x2; |
|
35 static const TUint KResManControlIoRegisterDependency=0x3; |
|
36 static const TUint KResManControlIoDeregisterDependency=0x4; |
|
37 static const TUint KResManControlIoGetNumDependents=0x5; |
|
38 static const TUint KResManControlIoGetDependentsId=0x6; |
|
39 |
|
40 //Resource controller versions |
|
41 static const TUint KResControllerBasicVersion=0x0; |
|
42 static const TUint KResControllerExtendedVersion=0x01; |
|
43 |
|
44 /** |
|
45 Resource Manager API class |
|
46 API's are exported from this class to kernel side components |
|
47 */ |
|
48 NONSHARABLE_CLASS (PowerResourceManager) |
|
49 { |
|
50 public: |
|
51 IMPORT_C static TInt RegisterClient(TUint& aClientId, const TDesC8& aName, TOwnerType aType=EOwnerProcess); |
|
52 IMPORT_C static TInt DeRegisterClient(TUint aClientId); |
|
53 IMPORT_C static TInt GetClientName(TUint aClientId, TUint aTargetClientId, TDes8& aName); |
|
54 IMPORT_C static TInt GetClientId(TUint aClientId, TDesC8& aClientName, TUint& aTargetClientId); |
|
55 IMPORT_C static TInt GetResourceId(TUint aClientId, TDesC8& aResourceName, TUint& aResourceId); |
|
56 IMPORT_C static TInt GetResourceInfo(TUint aClientId, TUint aResourceId, TAny* aInfo); |
|
57 IMPORT_C static TInt GetNumResourcesInUseByClient(TUint aClientId, TUint aTargetClientId, TUint& aNumResources); |
|
58 IMPORT_C static TInt GetInfoOnResourcesInUseByClient(TUint aClientId, TUint aTargetClientId, TUint& aNumResources, TAny* aInfo); |
|
59 IMPORT_C static TInt GetNumClientsUsingResource(TUint aClientId, TUint aResourceId, TUint& aNumClients); |
|
60 IMPORT_C static TInt GetInfoOnClientsUsingResource(TUint aClientId, TUint aResourceId, TUint& aNumClients, TAny* aInfo); |
|
61 IMPORT_C static TInt AllocReserve(TUint aClientId, TUint8 aNumCl, TUint8 aNumRm); |
|
62 IMPORT_C static TInt ChangeResourceState(TUint aClientId, TUint aResourceId, TInt aNewState, TPowerResourceCb* aCb=NULL); |
|
63 IMPORT_C static TInt GetResourceState(TUint aClientId, TUint aResourceId, TBool aCached, TInt& aState, TInt& aLevelOwnerId); |
|
64 IMPORT_C static TInt GetResourceState(TUint aClientId, TUint aResourceId, TBool aCached, TPowerResourceCb& aCb); |
|
65 IMPORT_C static TInt CancelAsyncRequestCallBack(TUint aClientId, TUint aResourceId, TPowerResourceCb& aCb); |
|
66 IMPORT_C static TInt RequestNotification(TUint aClientId, TUint aResourceId, DPowerResourceNotification& aN); |
|
67 IMPORT_C static TInt RequestNotification(TUint aClientId, TUint aResourceId, DPowerResourceNotification& aN, TInt aThreshold, TBool aDirection); |
|
68 IMPORT_C static TInt CancelNotification(TUint aClientId, TUint aResourceId, DPowerResourceNotification& aN); |
|
69 IMPORT_C static TInt DeRegisterClientLevelFromResource(TUint aClientId, TUint aResourceId); |
|
70 IMPORT_C static TInt ControlIO(TUint aClientId, TUint aFunction, TAny* aParam1, TAny* aParam2, TAny* aParam3 = NULL); |
|
71 inline static TInt GetResourceControllerVersion(TUint aClientId, TUint& aVersion); |
|
72 #ifdef PRM_ENABLE_EXTENDED_VERSION |
|
73 inline static TInt RegisterDynamicResource(TUint aClientId, DDynamicPowerResource* aResource, TUint& aResourceId); |
|
74 inline static TInt DeRegisterDynamicResource(TUint aClientId, TUint aResourceId, TInt* aState); |
|
75 inline static TInt RegisterResourceDependency(TUint aClientId, SResourceDependencyInfo* aResDependecyInfo1, SResourceDependencyInfo* aResDependencyInfo2); |
|
76 inline static TInt DeRegisterResourceDependency(TUint aClientId, TUint aResourceId1, TUint aResourceId2); |
|
77 inline static TInt GetNumDependentsForResource(TUint aClientId, TUint aResourceId, TUint& aNumDepResource); |
|
78 inline static TInt GetDependentsIdForResource(TUint aClientId, TUint aResourceId, TAny* aResIdArray, TUint& aNumDepResources); |
|
79 #endif |
|
80 }; |
|
81 |
|
82 #include <drivers/resourceman.inl> |
|
83 |
|
84 #endif //__RESOURCEMAN_H__ |