0
|
1 |
// Copyright (c) 2003-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 |
//
|
|
15 |
|
|
16 |
#include <drivers/sdio/sdioinit.h>
|
|
17 |
#include <drivers/pbusmedia.h>
|
|
18 |
#include "utraceepbussdio.h"
|
|
19 |
|
|
20 |
EXPORT_C TInt TSDIOCardControllerInterface::RegisterMediaDevices(TInt aSocket)
|
|
21 |
/**
|
|
22 |
Registers the media devices for the specified socket.
|
|
23 |
By default, All MMC derivatives register at least an MMC driver,
|
|
24 |
and all SDIO compatable variants register a CSA driver.
|
|
25 |
@internalTechnology
|
|
26 |
*/
|
|
27 |
{
|
|
28 |
TRACE2(TTraceContext(EBorder), UTraceModuleEPBusSDIO::ESDIOTSDIOCardControllerInterfaceRegisterMediaDevice, reinterpret_cast<TUint32>(this), static_cast<TUint32>(aSocket)); // @SymTraceDataPublishedTvk
|
|
29 |
|
|
30 |
// Register the generic drivers first:
|
|
31 |
TInt err = TMMCardControllerInterface::RegisterMediaDevices(aSocket);
|
|
32 |
if(err == KErrNone)
|
|
33 |
{
|
|
34 |
// ...and now install a CSA media driver:
|
|
35 |
SMediaDeviceInfo mdi;
|
|
36 |
if (IsSDIOSocket(aSocket, mdi))
|
|
37 |
{
|
|
38 |
DPBusSocket* pS=TheSockets[aSocket];
|
|
39 |
if(pS == NULL)
|
|
40 |
err = KErrNoMemory;
|
|
41 |
else
|
|
42 |
{
|
|
43 |
DPBusPrimaryMedia* pMedia = new DPBusPrimaryMedia(pS);
|
|
44 |
if (pMedia == NULL)
|
|
45 |
err = KErrNoMemory;
|
|
46 |
else
|
|
47 |
err = LocDrv::RegisterMediaDevice(mdi.iDevice,
|
|
48 |
mdi.iDriveCount,
|
|
49 |
mdi.iDriveList,
|
|
50 |
pMedia,
|
|
51 |
mdi.
|
|
52 |
iNumMedia,
|
|
53 |
*mdi.iDeviceName);
|
|
54 |
}
|
|
55 |
}
|
|
56 |
}
|
|
57 |
|
|
58 |
TRACE2(TTraceContext(EBorder), UTraceModuleEPBusSDIO::ESDIOTSDIOCardControllerInterfaceRegisterMediaDeviceReturning, reinterpret_cast<TUint32>(this), err); // @SymTraceDataPublishedTvk
|
|
59 |
|
|
60 |
return(err);
|
|
61 |
}
|