os/kernelhwsrv/kernel/eka/drivers/pbus/pccard/epoc/pccd_vcc.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 1995-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\drivers\pbus\pccard\epoc\pccd_vcc.cpp
    15 // 
    16 //
    17 
    18 #include <pccd_vcc.h>
    19 
    20 DPlatPcCardVcc::DPlatPcCardVcc(TInt aPsuNum, TInt aMediaChangeNum)
    21 //
    22 // Constructor.
    23 //
    24 	:	DPcCardVcc(aPsuNum,aMediaChangeNum)
    25 	{}
    26 
    27 DPlatPcCardVcc::~DPlatPcCardVcc()
    28 //
    29 // Destructor
    30 //
    31 	{}
    32 
    33 void DPlatPcCardVcc::PsuInfo(TPBusPsuInfo &anInfo)
    34 //
    35 // Return machine info relating to the Pc Card Vcc supply
    36 //
    37 	{
    38 
    39 	ThePccdCntrlInterface->VccInfo(iPsuNum,anInfo);
    40     }
    41 
    42 void DPlatPcCardVcc::DoSetState(TPBusPsuState aState)
    43 //
    44 // Turn on/off the PSU.
    45 //
    46 	{
    47 
    48     switch (aState)
    49         {
    50     case EPsuOff:
    51         ThePccdCntrlInterface->VccOff(iPsuNum);
    52 		__KTRACE_OPT(KPBUS2,Kern::Printf("PlatPsu-Off"));
    53         break;
    54     case EPsuOnFull:
    55         ThePccdCntrlInterface->VccOnFull(iPsuNum,iVoltageSetting);
    56 		__KTRACE_OPT(KPBUS2,Kern::Printf("PlatPsu-On"));
    57         break;
    58     case EPsuOnCurLimit:
    59         ThePccdCntrlInterface->VccOnCurrentLimit(iPsuNum,iVoltageSetting);
    60 		__KTRACE_OPT(KPBUS2,Kern::Printf("PlatPsu-OnL"));
    61         break;
    62         }
    63 	}
    64 
    65 void DPlatPcCardVcc::DoCheckVoltage()
    66 //
    67 // Check the voltage level of the PSU is as expected. Returns either KErrNone, KErrGeneral 
    68 // to indicate the pass/fail state or KErrNotReady if the voltage check isn't complete.
    69 //
    70 	{
    71 
    72 	TInt err=KErrGeneral;
    73 	if (iVoltCheckMethod==EPsuChkComparator)
    74 		err=ThePccdCntrlInterface->VccVoltCheck(iPsuNum);
    75 	ReceiveVoltageCheckResult(err);
    76 	}
    77