navienginebsp/ne1_tb/specific/resmanpsl.cpp
author Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
Fri, 08 Oct 2010 14:36:55 +0100
changeset 4 5937e08d5244
parent 0 5de814552237
permissions -rw-r--r--
Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
     1
/*
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
     2
* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
     3
* All rights reserved.
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
     8
*
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
     9
* Initial Contributors:
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    11
*
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    12
* Contributors:
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    13
*
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    14
* Description:  
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    15
* ne1_tb\specific\resmanpsl.cpp
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    16
*
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    17
*/
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    18
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    19
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    20
#include "resmanpsl.h"
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    21
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    22
static DNE1_TBPowerResourceController TheController;
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    23
/** Entry point of resource controller */
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    24
DECLARE_RESOURCE_MANAGER_EXTENSION(TheController)
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    25
	{
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    26
	__KTRACE_OPT(KBOOT, Kern::Printf("CreateController called"));
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    27
    new(&TheController) DNE1_TBPowerResourceController;
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    28
    return;
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    29
	}
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    30
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    31
/** Constructor */
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    32
DNE1_TBPowerResourceController::DNE1_TBPowerResourceController() : DPowerResourceController()
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    33
	{
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    34
	__KTRACE_OPT(KRESMANAGER, Kern::Printf("DNE1_TBPowerResourceController Called\n"));
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    35
	}
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    36
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    37
/** This function is called by PIL during its creation phase.
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    38
	It creates a DFC queue and then invokes setDfcQ function of PIL to set the queue.
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    39
	It also initialises the pools with appropriate size.
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    40
	*/
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    41
TInt DNE1_TBPowerResourceController::DoInitController()
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    42
	{
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    43
	TInt r = KErrNone;
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    44
	__KTRACE_OPT(KRESMANAGER, Kern::Printf(">DNE1_TBPowerResourceController::DoInitController()"));
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    45
	//Create a DFC queue
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    46
	r = Kern::DfcQCreate(iDfcQ, KDfcQThreadPriority, &KResmanName);
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    47
	if(r != KErrNone)
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    48
		{
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    49
		Kern::Printf("DFC Queue creation failed");
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    50
		return r;
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    51
		}
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    52
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    53
#ifdef CPU_AFFINITY_ANY
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    54
	NKern::ThreadSetCpuAffinity((NThread*)(iDfcQ->iThread), KCpuAffinityAny);
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    55
#endif
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    56
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    57
	//Call the resource controller to set the DFCQ
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    58
	SetDfcQ(iDfcQ);
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    59
	//Init pools
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    60
	r = InitPools(KERNEL_CLIENTS, USER_CLIENTS, CLIENT_LEVELS, REQUESTS);
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    61
	return r;
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    62
	}
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    63
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    64
/** This function is called by PIL to register the static resources. 
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    65
    It creates an array to hold the static resource and also creates the resources and updates 
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    66
	in the array. 
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    67
	*/
4
5937e08d5244 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
parents: 0
diff changeset
    68
//C TSAI: this is to fit new virtual function prototype which uses RPointerArray
5937e08d5244 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
parents: 0
diff changeset
    69
TInt DNE1_TBPowerResourceController::DoRegisterStaticResources(RPointerArray<DStaticPowerResource>& aStaticResourceArray)
5937e08d5244 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
parents: 0
diff changeset
    70
	{
5937e08d5244 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
parents: 0
diff changeset
    71
	__KTRACE_OPT(KRESMANAGER, Kern::Printf("DNE1_TBPowerResourceController::DoRegisterStaticResources [SF4 new virtual function prototype]"));
5937e08d5244 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
parents: 0
diff changeset
    72
5937e08d5244 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
parents: 0
diff changeset
    73
/** Macro definition to register resource */
5937e08d5244 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
parents: 0
diff changeset
    74
#define REGISTER_RESOURCE_RPOINTERARRAY(resource, resourceArray)						\
5937e08d5244 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
parents: 0
diff changeset
    75
	{																					\
5937e08d5244 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
parents: 0
diff changeset
    76
	pR = new resource();																\
5937e08d5244 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
parents: 0
diff changeset
    77
	if(!pR)																				\
5937e08d5244 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
parents: 0
diff changeset
    78
		{																				\
5937e08d5244 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
parents: 0
diff changeset
    79
		TUint resourceCount = (TUint) resourceArray.Count();							\
5937e08d5244 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
parents: 0
diff changeset
    80
		for(TUint count = 0; count < resourceCount; count++)							\
5937e08d5244 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
parents: 0
diff changeset
    81
			{																			\
5937e08d5244 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
parents: 0
diff changeset
    82
			delete resourceArray[count];												\
5937e08d5244 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
parents: 0
diff changeset
    83
			}																			\
5937e08d5244 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
parents: 0
diff changeset
    84
		resourceArray.Reset();															\
5937e08d5244 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
parents: 0
diff changeset
    85
		return KErrNoMemory;															\
5937e08d5244 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
parents: 0
diff changeset
    86
		}																				\
5937e08d5244 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
parents: 0
diff changeset
    87
	resourceArray.Append(pR);												\
5937e08d5244 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
parents: 0
diff changeset
    88
	}
5937e08d5244 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
parents: 0
diff changeset
    89
5937e08d5244 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
parents: 0
diff changeset
    90
	DStaticPowerResource* pR = NULL;
5937e08d5244 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
parents: 0
diff changeset
    91
5937e08d5244 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
parents: 0
diff changeset
    92
	//Note: RPointerArray itself only deal with pointers and doesn't delete objects when Close() or Reset()
5937e08d5244 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
parents: 0
diff changeset
    93
5937e08d5244 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
parents: 0
diff changeset
    94
	/** Create I2S0 MCLK resource and add to the static resource array */
5937e08d5244 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
parents: 0
diff changeset
    95
	REGISTER_RESOURCE_RPOINTERARRAY(DNE1_TBI2S0MclkResource, aStaticResourceArray);
5937e08d5244 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
parents: 0
diff changeset
    96
	/** Create I2S1 MCLK resource and add to the static resource array */
5937e08d5244 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
parents: 0
diff changeset
    97
	REGISTER_RESOURCE_RPOINTERARRAY(DNE1_TBI2S1MclkResource, aStaticResourceArray);
5937e08d5244 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
parents: 0
diff changeset
    98
	/** Create I2S2 MCLK resource and add to the static resource array */
5937e08d5244 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
parents: 0
diff changeset
    99
	REGISTER_RESOURCE_RPOINTERARRAY(DNE1_TBI2S2MclkResource, aStaticResourceArray);
5937e08d5244 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
parents: 0
diff changeset
   100
	/** Create I2S3 MCLK resource and add to the static resource array */
5937e08d5244 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
parents: 0
diff changeset
   101
	REGISTER_RESOURCE_RPOINTERARRAY(DNE1_TBI2S3MclkResource, aStaticResourceArray);
5937e08d5244 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
parents: 0
diff changeset
   102
	/** Create I2S0 SCLK resource and add to the static resource array */
5937e08d5244 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
parents: 0
diff changeset
   103
	REGISTER_RESOURCE_RPOINTERARRAY(DNE1_TBI2S0SclkResource, aStaticResourceArray);
5937e08d5244 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
parents: 0
diff changeset
   104
	/** Create I2S1 SCLK resource and add to the static resource array */
5937e08d5244 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
parents: 0
diff changeset
   105
	REGISTER_RESOURCE_RPOINTERARRAY(DNE1_TBI2S1SclkResource, aStaticResourceArray);
5937e08d5244 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
parents: 0
diff changeset
   106
	/** Create I2S2 SCLK resource and add to the static resource array */
5937e08d5244 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
parents: 0
diff changeset
   107
	REGISTER_RESOURCE_RPOINTERARRAY(DNE1_TBI2S2SclkResource, aStaticResourceArray);
5937e08d5244 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
parents: 0
diff changeset
   108
	/** Create I2S3 SCLK resource and add to the static resource array */
5937e08d5244 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
parents: 0
diff changeset
   109
	REGISTER_RESOURCE_RPOINTERARRAY(DNE1_TBI2S3SclkResource, aStaticResourceArray);
5937e08d5244 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
parents: 0
diff changeset
   110
	/** Create CSI0 clock resource and add to the static resource array */
5937e08d5244 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
parents: 0
diff changeset
   111
	REGISTER_RESOURCE_RPOINTERARRAY(DNE1_TBCSI0ClockResource, aStaticResourceArray);
5937e08d5244 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
parents: 0
diff changeset
   112
	/** Create CSI1 clock resource and add to the static resource array */
5937e08d5244 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
parents: 0
diff changeset
   113
	REGISTER_RESOURCE_RPOINTERARRAY(DNE1_TBCSI1ClockResource, aStaticResourceArray);
5937e08d5244 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
parents: 0
diff changeset
   114
	/** Create Display DCLK resource and add to the static resource array */
5937e08d5244 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
parents: 0
diff changeset
   115
	REGISTER_RESOURCE_RPOINTERARRAY(DNE1_TBDisplayDclkResource, aStaticResourceArray);
5937e08d5244 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
parents: 0
diff changeset
   116
	/** Create LCD resource and add to the static resource array */
5937e08d5244 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
parents: 0
diff changeset
   117
	REGISTER_RESOURCE_RPOINTERARRAY(DNE1_TBLcdResource, aStaticResourceArray);
5937e08d5244 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
parents: 0
diff changeset
   118
	/** Create Board Power resource and add to the static resource array */
5937e08d5244 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
parents: 0
diff changeset
   119
	REGISTER_RESOURCE_RPOINTERARRAY(DNE1_TBBoardPowerResource, aStaticResourceArray);
5937e08d5244 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
parents: 0
diff changeset
   120
	/** Create PCI clock mask enable resource and add to the static resource array */
5937e08d5244 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
parents: 0
diff changeset
   121
	REGISTER_RESOURCE_RPOINTERARRAY(DNE1_TBPCIClockResource, aStaticResourceArray);
5937e08d5244 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
parents: 0
diff changeset
   122
5937e08d5244 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
parents: 0
diff changeset
   123
	return KErrNone;
5937e08d5244 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
parents: 0
diff changeset
   124
	}
5937e08d5244 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
parents: 0
diff changeset
   125
5937e08d5244 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
parents: 0
diff changeset
   126
#if 0	//C TSAI: This is older function implementation (older virtual function prototype)
0
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
   127
TInt DNE1_TBPowerResourceController::DoRegisterStaticResources(DStaticPowerResource**& aStaticResourceArray, 
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
   128
																                 TUint16& aStaticResourceCount)
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
   129
	{
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
   130
	__KTRACE_OPT(KRESMANAGER, Kern::Printf("DNE1_TBPowerResourceController::DoRegisterStaticResources"));
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
   131
	/** Create the static resource array */
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
   132
	aStaticResourceArray = (DStaticPowerResource**)new(DStaticPowerResource*[EMaxResourceCount]);
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
   133
	if(!aStaticResourceArray)
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
   134
		return KErrNoMemory;
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
   135
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
   136
	DStaticPowerResource* pR = NULL;
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
   137
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
   138
	/** Create I2S0 MCLK resource and add to the static resource array */
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
   139
	REGISTER_RESOURCE(DNE1_TBI2S0MclkResource, aStaticResourceArray, aStaticResourceCount);
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
   140
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
   141
	/** Create I2S1 MCLK resource and add to the static resource array */
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
   142
	REGISTER_RESOURCE(DNE1_TBI2S1MclkResource, aStaticResourceArray, aStaticResourceCount);
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
   143
	
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
   144
	/** Create I2S2 MCLK resource and add to the static resource array */
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
   145
	REGISTER_RESOURCE(DNE1_TBI2S2MclkResource, aStaticResourceArray, aStaticResourceCount);
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
   146
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
   147
	/** Create I2S3 MCLK resource and add to the static resource array */
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
   148
	REGISTER_RESOURCE(DNE1_TBI2S3MclkResource, aStaticResourceArray, aStaticResourceCount);
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
   149
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
   150
	/** Create I2S0 SCLK resource and add to the static resource array */
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
   151
	REGISTER_RESOURCE(DNE1_TBI2S0SclkResource, aStaticResourceArray, aStaticResourceCount);
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
   152
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
   153
	/** Create I2S1 SCLK resource and add to the static resource array */
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
   154
	REGISTER_RESOURCE(DNE1_TBI2S1SclkResource, aStaticResourceArray, aStaticResourceCount);
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
   155
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
   156
	/** Create I2S2 SCLK resource and add to the static resource array */
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
   157
	REGISTER_RESOURCE(DNE1_TBI2S2SclkResource, aStaticResourceArray, aStaticResourceCount);
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
   158
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
   159
	/** Create I2S3 SCLK resource and add to the static resource array */
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
   160
	REGISTER_RESOURCE(DNE1_TBI2S3SclkResource, aStaticResourceArray, aStaticResourceCount);
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
   161
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
   162
	/** Create CSI0 clock resource and add to the static resource array */
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
   163
	REGISTER_RESOURCE(DNE1_TBCSI0ClockResource, aStaticResourceArray, aStaticResourceCount);
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
   164
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
   165
	/** Create CSI1 clock resource and add to the static resource array */
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
   166
	REGISTER_RESOURCE(DNE1_TBCSI1ClockResource, aStaticResourceArray, aStaticResourceCount);
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
   167
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
   168
	/** Create Display DCLK resource and add to the static resource array */
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
   169
	REGISTER_RESOURCE(DNE1_TBDisplayDclkResource, aStaticResourceArray, aStaticResourceCount);
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
   170
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
   171
	/** Create LCD resource and add to the static resource array */
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
   172
	REGISTER_RESOURCE(DNE1_TBLcdResource, aStaticResourceArray, aStaticResourceCount);
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
   173
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
   174
	/** Create Board Power resource and add to the static resource array */
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
   175
	REGISTER_RESOURCE(DNE1_TBBoardPowerResource, aStaticResourceArray, aStaticResourceCount);
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
   176
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
   177
	/** Create PCI clock mask enable resource and add to the static resource array */
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
   178
	REGISTER_RESOURCE(DNE1_TBPCIClockResource, aStaticResourceArray, aStaticResourceCount);
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
   179
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
   180
	return KErrNone;
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
   181
	}
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
   182
4
5937e08d5244 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
parents: 0
diff changeset
   183
#endif
0
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
   184
4
5937e08d5244 Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
parents: 0
diff changeset
   185