kernel/eka/drivers/pbus/mmc/sdcard/sdcard3c/sdcard.cpp
branchRCL_3
changeset 19 4a8fed1c0ef6
parent 14 5d2844f35677
child 22 2f92ad2dc5db
--- a/kernel/eka/drivers/pbus/mmc/sdcard/sdcard3c/sdcard.cpp	Tue Feb 02 01:24:03 2010 +0200
+++ b/kernel/eka/drivers/pbus/mmc/sdcard/sdcard3c/sdcard.cpp	Sat Feb 20 00:10:51 2010 +0200
@@ -16,7 +16,7 @@
 #include <drivers/sdcard.h>
 #include "OstTraceDefinitions.h"
 #ifdef OST_TRACE_COMPILER_IN_USE
-#include "locmedia_ost.h"
+#include "../../../../include/drivers/locmedia_ost.h"
 #ifdef __VC32__
 #pragma warning(disable: 4127) // disabling warning "conditional expression is constant"
 #endif
@@ -594,8 +594,16 @@
 
 	SMF_BEGIN
 
-		OstTrace0( TRACE_INTERNALS, DSDSTACK_INITIALISEMEMORYCARDSM1, "EStBegin" );
-		iCxCardType = ESDCardTypeUnknown;
+	OstTrace0( TRACE_INTERNALS, DSDSTACK_INITIALISEMEMORYCARDSM1, "EStBegin" );
+
+	iCxCardType = CardType(MMCSocket()->iSocketNumber, iCxCardCount);
+        
+        if (iCxCardType==ESDCardTypeIsMMC)
+            {
+            // Skip the SD Protocol Seq.
+            SMF_INVOKES(GoIdleSMST, EStCheckVoltage);
+            }
+                
 		s.iCardP = NULL;	// This stops ExecCommandSM() from setting old RCA when sending CMD55
 
 		// Send CMD0 to initialise memory
@@ -1623,7 +1631,22 @@
 	return new DSDSession(aCallBack);
 	}
 
+EXPORT_C DSDStack::TSDCardType DSDStack::CardType(TInt /*aSocket*/, TInt /*aCardNumber*/)
+/**
+ * This method allows a preset card type to be specified for a given slot/socket.
+ * The SD protocol stack attempts to identify card types (SD or MMC) through protocol responses; 
+ * For embedded media (eMMC or eSD) this is unnecessary as the media type is already known and cannot change. 
+ * Licensee may override this function to specify the preset card type.
+ * @param aSocket Socket to be queried for card type.
+ * @param aCardNumber Card number attached to Socket to be queried for card type.
+ * @return Preset card type
+ */
+    {
+    // Default implmentation.
+    return DSDStack::ESDCardTypeUnknown;
+    }
+
+
 EXPORT_C void DSDStack::Dummy1() {}
 EXPORT_C void DSDStack::Dummy2() {}
 EXPORT_C void DSDStack::Dummy3() {}
-EXPORT_C void DSDStack::Dummy4() {}