1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/kernelhwsrv/kernel/eka/include/drivers/mmccd_ifc.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,229 @@
1.4 +// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of the License "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +// e32\include\drivers\mmccd_ifc.h
1.18 +// Factory class for creating platform-specific MMC Drivers
1.19 +//
1.20 +//
1.21 +
1.22 +/**
1.23 + @file
1.24 + @publishedPartner
1.25 + @released
1.26 +*/
1.27 +
1.28 +#ifndef __MMCCD_IFC_H__
1.29 +#define __MMCCD_IFC_H__
1.30 +
1.31 +#include <drivers/mmc.h>
1.32 +#include <drivers/locmedia.h>
1.33 +
1.34 +
1.35 +
1.36 +
1.37 +/**
1.38 +The factory class for creating platform specific MultiMediaCard objects.
1.39 +
1.40 +The class defines the interface that must be implemented by a derived class.
1.41 +*/
1.42 +class TMMCardControllerInterface
1.43 + {
1.44 +public:
1.45 + IMPORT_C TInt Create();
1.46 +
1.47 +
1.48 + /**
1.49 + Creates a platform specific socket object.
1.50 +
1.51 + The function is called from TMMCardControllerInterface::Create(), and
1.52 + an implementation must be provided by the platform specific layer in
1.53 + the Variant DLL.
1.54 +
1.55 + @param aSocketNum The socket number.
1.56 + @param aPasswordStore A pointer to the password store.
1.57 +
1.58 + @return A pointer to the new socket object.
1.59 +
1.60 + @see Create()
1.61 + */
1.62 + virtual DMMCSocket* NewSocket(TInt aSocketNum, TMMCPasswordStore* aPasswordStore)=0;
1.63 +
1.64 +
1.65 + /**
1.66 + Creates a platform specific stack object.
1.67 +
1.68 + The function is called from TMMCardControllerInterface::Create(), and
1.69 + an implementation must be provided by the platform specific layer in
1.70 + the Variant DLL.
1.71 +
1.72 + @param aSocketNum The socket number.
1.73 + @param aSocket A pointer to the socket object.
1.74 +
1.75 + @return A pointer to the new stack object.
1.76 +
1.77 + @see Create()
1.78 + */
1.79 + virtual DMMCStack* NewStack(TInt aSocketNum, DMMCSocket* aSocket)=0;
1.80 +
1.81 +
1.82 + /**
1.83 + Creates a platform specific media change object.
1.84 +
1.85 + The function is called from TMMCardControllerInterface::Create(), and
1.86 + an implementation must be provided by the platform specific layer in
1.87 + the Variant DLL.
1.88 +
1.89 + @param aMcId The media change number.
1.90 +
1.91 + @return A pointer to the new media change object.
1.92 +
1.93 + @see Create()
1.94 + @see MediaChangeID()
1.95 + */
1.96 + virtual DMMCMediaChange* NewMediaChange(TInt aMcId)=0;
1.97 +
1.98 +
1.99 + /**
1.100 + Creates a platform specific power supply unit object.
1.101 +
1.102 + The function is called from TMMCardControllerInterface::Create(), and
1.103 + an implementation must be provided by the platform specific layer in
1.104 + the Variant DLL.
1.105 +
1.106 + @param aVccNum The power supply unit number
1.107 + @param aMcId The associated media change number.
1.108 +
1.109 + @return A pointer to the new power supply unit object.
1.110 +
1.111 + @see Create()
1.112 + @see MediaChangeID()
1.113 + @see VccID()
1.114 + */
1.115 + virtual DMMCPsu* NewVcc(TInt aVccNum, TInt aMcId)=0;
1.116 +
1.117 + /**
1.118 + Creates a platform specific VccCore power supply unit object.
1.119 +
1.120 + The function is called from TMMCardControllerInterface::Create(), and
1.121 + an implementation can be provided by the platform specific layer in
1.122 + the Variant DLL.
1.123 +
1.124 + @param aVccQNum The power supply unit number (must match paired Vcc unit number).
1.125 + @param aMcId The associated media change number.
1.126 +
1.127 + @return A pointer to the new power supply unit object.
1.128 +
1.129 + @see Create()
1.130 + @see MediaChangeID()
1.131 + @see VccID()
1.132 + */
1.133 + virtual inline DMMCPsu* NewVccCore(TInt aVccCoreNum, TInt aMcId);
1.134 +
1.135 +
1.136 + /**
1.137 + Performs platform specific initialisation.
1.138 +
1.139 + The function is called from TMMCardControllerInterface::Create(), and
1.140 + an implementation must be provided by the platform specific layer in
1.141 + the Variant DLL.
1.142 +
1.143 + @return KErrNone to indicate that initialisation has completed
1.144 + successfully, otherwise one of the other system-wide error codes
1.145 + to indicate initialisation failure.
1.146 +
1.147 + @see Create()
1.148 + */
1.149 + virtual TInt Init()=0;
1.150 +
1.151 +
1.152 + /**
1.153 + Indicates whether the peripheral bus socket, as identified by the specified
1.154 + peripheral bus socket number, is designated as a MultiMediaCard socket on
1.155 + this platform.
1.156 +
1.157 + If the socket is designated as a MultiMediaCard socket, then the function
1.158 + must also provide the media information for that socket.
1.159 +
1.160 + The function is called from TMMCardControllerInterface::Create(), and
1.161 + an implementation must be provided by the platform specific layer in
1.162 + the Variant DLL.
1.163 +
1.164 + @param aSocket The peripheral bus socket number.
1.165 + @param aMediaDeviceInfo The media information for that socket, if
1.166 + the socket is designated as a MultiMediaCard
1.167 + socket.
1.168 +
1.169 + @return True, if the socket is designated as a MultiMediaCard socket;
1.170 + false, otherwise.
1.171 +
1.172 + @see Create()
1.173 + */
1.174 + virtual TBool IsMMCSocket(TInt aSocket,SMediaDeviceInfo& aMediaDeviceInfo)=0;
1.175 +
1.176 +
1.177 + /**
1.178 + Reports which media change object is to be associated with the specified
1.179 + peripheral bus socket number.
1.180 +
1.181 + The function is called from TMMCardControllerInterface::Create(), and
1.182 + an implementation must be provided by the platform specific layer in
1.183 + the Variant DLL.
1.184 +
1.185 + @param aSocket The socket number
1.186 +
1.187 + @return The media change number.
1.188 +
1.189 + @see Create()
1.190 + @see NewMediaChange()
1.191 + */
1.192 + virtual TInt MediaChangeID(TInt aSocket)=0;
1.193 +
1.194 +
1.195 + /**
1.196 + Reports which power supply unit (PSU) object is to be associated with
1.197 + the specified peripheral bus socket number.
1.198 +
1.199 + The function is called from TMMCardControllerInterface::Create(), and
1.200 + an implementation must be provided by the platform specific layer in
1.201 + the Variant DLL.
1.202 +
1.203 + @param aSocket The socket number.
1.204 +
1.205 + @return The power supply unit number.
1.206 +
1.207 + @see Create()
1.208 + @see NewVcc()
1.209 + */
1.210 + virtual TInt VccID(TInt aSocket)=0;
1.211 +
1.212 +protected:
1.213 +
1.214 +
1.215 + /**
1.216 + * Performs registration of the media devices on the current socket
1.217 + * @internalComponent
1.218 + */
1.219 + IMPORT_C virtual TInt RegisterMediaDevices(TInt aSocket);
1.220 + };
1.221 +
1.222 +
1.223 +DMMCPsu* TMMCardControllerInterface::NewVccCore(TInt /*aVccCoreNum*/, TInt /*aMcId*/)
1.224 +/**
1.225 + * Default implementation.
1.226 + * Only eMMC v4.3+ media supports a seperate supply for VccCore.
1.227 + */
1.228 + {return NULL;};
1.229 +
1.230 +#endif
1.231 +
1.232 +