1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/kernelhwsrv/kernel/eka/drivers/pbus/mmc/stackbody.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,59 @@
1.4 +/*
1.5 +* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* under the terms of the License "Eclipse Public License v1.0"
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description:
1.18 +*
1.19 +*/
1.20 +
1.21 +#include <drivers/mmc.h>
1.22 +#include "stackbody.h"
1.23 +
1.24 +DMMCStack::DBody::DBody(DMMCStack& aStack) :
1.25 + iStack(aStack),
1.26 + iCurrentSelectedBusWidth( (TUint32)EBusWidthInvalid )
1.27 + {
1.28 + }
1.29 +
1.30 +// Temporarily increase the idle timeout
1.31 +void DMMCStack::DBody::SetInactivityTimeout(TInt aInactivityTimeout)
1.32 + {
1.33 + iStack.iSocket->ResetInactivity(0);
1.34 +
1.35 + // save existing value - if not already saved (!)
1.36 + if (iInactivityLock++ == 0)
1.37 + {
1.38 + iInactivityTimeout = iStack.iSocket->iVcc->iInactivityTimeout;
1.39 + if (iStack.iSocket->iVccCore)
1.40 + iVccCoreSleepTimeout = iStack.iSocket->iVccCore->iInactivityTimeout;
1.41 + }
1.42 +
1.43 + // set the new inactivity timeout to the maximum of the existing value and the specified value
1.44 + TInt inactivityTimeout = Max(aInactivityTimeout, iInactivityTimeout);
1.45 + iStack.iSocket->iVcc->iInactivityTimeout = inactivityTimeout;
1.46 + if (iStack.iSocket->iVccCore)
1.47 + // Sleep timeout should always be less than Vcc Inactivity timer
1.48 + iStack.iSocket->iVccCore->iInactivityTimeout = inactivityTimeout;
1.49 + }
1.50 +
1.51 +void DMMCStack::DBody::RestoreInactivityTimeout()
1.52 + {
1.53 + iStack.iSocket->ResetInactivity(0);
1.54 +
1.55 + if (--iInactivityLock == 0)
1.56 + {
1.57 + iStack.iSocket->iVcc->iInactivityTimeout = iInactivityTimeout;
1.58 + if (iStack.iSocket->iVccCore)
1.59 + iStack.iSocket->iVccCore->iInactivityTimeout = iVccCoreSleepTimeout;
1.60 + }
1.61 + }
1.62 +