navienginebsp/ne1_tb/specific/resmanpsl.cpp
changeset 0 5de814552237
child 4 5937e08d5244
equal deleted inserted replaced
-1:000000000000 0:5de814552237
       
     1 /*
       
     2 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  
       
    15 * ne1_tb\specific\resmanpsl.cpp
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 #include "resmanpsl.h"
       
    22 
       
    23 static DNE1_TBPowerResourceController TheController;
       
    24 /** Entry point of resource controller */
       
    25 DECLARE_RESOURCE_MANAGER_EXTENSION(TheController)
       
    26 	{
       
    27 	__KTRACE_OPT(KBOOT, Kern::Printf("CreateController called"));
       
    28     new(&TheController) DNE1_TBPowerResourceController;
       
    29     return;
       
    30 	}
       
    31 
       
    32 /** Constructor */
       
    33 DNE1_TBPowerResourceController::DNE1_TBPowerResourceController() : DPowerResourceController()
       
    34 	{
       
    35 	__KTRACE_OPT(KRESMANAGER, Kern::Printf("DNE1_TBPowerResourceController Called\n"));
       
    36 	}
       
    37 
       
    38 /** This function is called by PIL during its creation phase.
       
    39 	It creates a DFC queue and then invokes setDfcQ function of PIL to set the queue.
       
    40 	It also initialises the pools with appropriate size.
       
    41 	*/
       
    42 TInt DNE1_TBPowerResourceController::DoInitController()
       
    43 	{
       
    44 	TInt r = KErrNone;
       
    45 	__KTRACE_OPT(KRESMANAGER, Kern::Printf(">DNE1_TBPowerResourceController::DoInitController()"));
       
    46 	//Create a DFC queue
       
    47 	r = Kern::DfcQCreate(iDfcQ, KDfcQThreadPriority, &KResmanName);
       
    48 	if(r != KErrNone)
       
    49 		{
       
    50 		Kern::Printf("DFC Queue creation failed");
       
    51 		return r;
       
    52 		}
       
    53 
       
    54 #ifdef CPU_AFFINITY_ANY
       
    55 	NKern::ThreadSetCpuAffinity((NThread*)(iDfcQ->iThread), KCpuAffinityAny);
       
    56 #endif
       
    57 
       
    58 	//Call the resource controller to set the DFCQ
       
    59 	SetDfcQ(iDfcQ);
       
    60 	//Init pools
       
    61 	r = InitPools(KERNEL_CLIENTS, USER_CLIENTS, CLIENT_LEVELS, REQUESTS);
       
    62 	return r;
       
    63 	}
       
    64 
       
    65 /** This function is called by PIL to register the static resources. 
       
    66     It creates an array to hold the static resource and also creates the resources and updates 
       
    67 	in the array. 
       
    68 	*/
       
    69 TInt DNE1_TBPowerResourceController::DoRegisterStaticResources(DStaticPowerResource**& aStaticResourceArray, 
       
    70 																                 TUint16& aStaticResourceCount)
       
    71 	{
       
    72 	__KTRACE_OPT(KRESMANAGER, Kern::Printf("DNE1_TBPowerResourceController::DoRegisterStaticResources"));
       
    73 	/** Create the static resource array */
       
    74 	aStaticResourceArray = (DStaticPowerResource**)new(DStaticPowerResource*[EMaxResourceCount]);
       
    75 	if(!aStaticResourceArray)
       
    76 		return KErrNoMemory;
       
    77 
       
    78 	DStaticPowerResource* pR = NULL;
       
    79 
       
    80 	/** Create I2S0 MCLK resource and add to the static resource array */
       
    81 	REGISTER_RESOURCE(DNE1_TBI2S0MclkResource, aStaticResourceArray, aStaticResourceCount);
       
    82 
       
    83 	/** Create I2S1 MCLK resource and add to the static resource array */
       
    84 	REGISTER_RESOURCE(DNE1_TBI2S1MclkResource, aStaticResourceArray, aStaticResourceCount);
       
    85 	
       
    86 	/** Create I2S2 MCLK resource and add to the static resource array */
       
    87 	REGISTER_RESOURCE(DNE1_TBI2S2MclkResource, aStaticResourceArray, aStaticResourceCount);
       
    88 
       
    89 	/** Create I2S3 MCLK resource and add to the static resource array */
       
    90 	REGISTER_RESOURCE(DNE1_TBI2S3MclkResource, aStaticResourceArray, aStaticResourceCount);
       
    91 
       
    92 	/** Create I2S0 SCLK resource and add to the static resource array */
       
    93 	REGISTER_RESOURCE(DNE1_TBI2S0SclkResource, aStaticResourceArray, aStaticResourceCount);
       
    94 
       
    95 	/** Create I2S1 SCLK resource and add to the static resource array */
       
    96 	REGISTER_RESOURCE(DNE1_TBI2S1SclkResource, aStaticResourceArray, aStaticResourceCount);
       
    97 
       
    98 	/** Create I2S2 SCLK resource and add to the static resource array */
       
    99 	REGISTER_RESOURCE(DNE1_TBI2S2SclkResource, aStaticResourceArray, aStaticResourceCount);
       
   100 
       
   101 	/** Create I2S3 SCLK resource and add to the static resource array */
       
   102 	REGISTER_RESOURCE(DNE1_TBI2S3SclkResource, aStaticResourceArray, aStaticResourceCount);
       
   103 
       
   104 	/** Create CSI0 clock resource and add to the static resource array */
       
   105 	REGISTER_RESOURCE(DNE1_TBCSI0ClockResource, aStaticResourceArray, aStaticResourceCount);
       
   106 
       
   107 	/** Create CSI1 clock resource and add to the static resource array */
       
   108 	REGISTER_RESOURCE(DNE1_TBCSI1ClockResource, aStaticResourceArray, aStaticResourceCount);
       
   109 
       
   110 	/** Create Display DCLK resource and add to the static resource array */
       
   111 	REGISTER_RESOURCE(DNE1_TBDisplayDclkResource, aStaticResourceArray, aStaticResourceCount);
       
   112 
       
   113 	/** Create LCD resource and add to the static resource array */
       
   114 	REGISTER_RESOURCE(DNE1_TBLcdResource, aStaticResourceArray, aStaticResourceCount);
       
   115 
       
   116 	/** Create Board Power resource and add to the static resource array */
       
   117 	REGISTER_RESOURCE(DNE1_TBBoardPowerResource, aStaticResourceArray, aStaticResourceCount);
       
   118 
       
   119 	/** Create PCI clock mask enable resource and add to the static resource array */
       
   120 	REGISTER_RESOURCE(DNE1_TBPCIClockResource, aStaticResourceArray, aStaticResourceCount);
       
   121 
       
   122 	return KErrNone;
       
   123 	}
       
   124 
       
   125