88 } |
88 } |
89 |
89 |
90 class DIicClientChan : public DBase |
90 class DIicClientChan : public DBase |
91 { |
91 { |
92 public: |
92 public: |
93 DIicClientChan(DIicBusChannel* aChan, TInt8 aChanNum, TUint8 aChanType):iChan(aChan),iChanNumber(aChanNum),iChanType(aChanType){}; |
93 DIicClientChan(DIicBusChannel* aChan, TInt8 aChanNum, TUint8 aChanType):iChanNumber(aChanNum),iChanType(aChanType),iChan(aChan){}; |
94 ~DIicClientChan(); |
94 ~DIicClientChan(); |
95 TInt GetChanNum()const {return iChanNumber;}; |
95 TInt GetChanNum()const {return iChanNumber;}; |
96 TUint8 GetChanType()const {return iChanType;}; |
96 TUint8 GetChanType()const {return iChanType;}; |
97 DIicBusChannel* GetChannelPtr(){return iChan;}; |
97 DIicBusChannel* GetChannelPtr(){return iChan;}; |
98 inline DIicClientChan& operator=(DIicClientChan& aChan) {iChanNumber=aChan.iChanNumber; iChanType=aChan.iChanType; iChan=aChan.iChan; return *this;}; |
98 inline DIicClientChan& operator=(DIicClientChan& aChan) {iChanNumber=aChan.iChanNumber; iChanType=aChan.iChanType; iChan=aChan.iChan; return *this;}; |
497 |
497 |
498 DDeviceIicClient::DDeviceIicClient() |
498 DDeviceIicClient::DDeviceIicClient() |
499 // Constructor |
499 // Constructor |
500 { |
500 { |
501 CLIENT_PRINT(("> DDeviceIicClient::DDeviceIicClient()")); |
501 CLIENT_PRINT(("> DDeviceIicClient::DDeviceIicClient()")); |
502 __KTRACE_OPT(KRESMANAGER, Kern::Printf("> DDeviceIicClient::DDeviceIicClient()")); |
502 __KTRACE_OPT(KIIC, Kern::Printf("> DDeviceIicClient::DDeviceIicClient()")); |
503 iParseMask=0; // No info, no PDD, no Units |
503 iParseMask=0; // No info, no PDD, no Units |
504 iUnitsMask=0; |
504 iUnitsMask=0; |
505 iVersion=TVersion(KIicClientMajorVersionNumber, |
505 iVersion=TVersion(KIicClientMajorVersionNumber, |
506 KIicClientMinorVersionNumber, |
506 KIicClientMinorVersionNumber, |
507 KIicClientBuildVersionNumber); |
507 KIicClientBuildVersionNumber); |
527 #endif /*STANDALONE_CHANNEL*/ |
527 #endif /*STANDALONE_CHANNEL*/ |
528 |
528 |
529 DDeviceIicClient::~DDeviceIicClient() |
529 DDeviceIicClient::~DDeviceIicClient() |
530 { |
530 { |
531 CLIENT_PRINT(("> DDeviceIicClient::~DDeviceIicClient()")); |
531 CLIENT_PRINT(("> DDeviceIicClient::~DDeviceIicClient()")); |
532 __KTRACE_OPT(KRESMANAGER, Kern::Printf("> DDeviceIicClient::~DDeviceIicClient()")); |
532 __KTRACE_OPT(KIIC, Kern::Printf("> DDeviceIicClient::~DDeviceIicClient()")); |
533 #ifdef STANDALONE_CHANNEL |
533 #ifdef STANDALONE_CHANNEL |
534 //For Standalone Channel, the client is responsible for channel destroy |
534 //For Standalone Channel, the client is responsible for channel destroy |
535 ChannelArray.ResetAndDestroy(); |
535 ChannelArray.ResetAndDestroy(); |
536 #endif |
536 #endif |
537 } |
537 } |
538 |
538 |
539 TInt DDeviceIicClient::Install() |
539 TInt DDeviceIicClient::Install() |
540 // Install the device driver. |
540 // Install the device driver. |
541 { |
541 { |
542 CLIENT_PRINT(("> DDeviceIicClient::Install()")); |
542 CLIENT_PRINT(("> DDeviceIicClient::Install()")); |
543 __KTRACE_OPT(KRESMANAGER, Kern::Printf("> DDeviceIicClient::Install()")); |
543 __KTRACE_OPT(KIIC, Kern::Printf("> DDeviceIicClient::Install()")); |
544 return(SetName(&KLddRootName)); |
544 return(SetName(&KLddRootName)); |
545 } |
545 } |
546 |
546 |
547 // Auxiliary functions for ordering entries in the array of TTransStatusPair pointers |
547 // Auxiliary functions for ordering entries in the array of TTransStatusPair pointers |
548 // The first is to enable searching by Transaction (used by the callback) |
548 // The first is to enable searching by Transaction (used by the callback) |
761 //If in STANDALONE_CHANNEL mode, the client creates a list of channels |
761 //If in STANDALONE_CHANNEL mode, the client creates a list of channels |
762 #ifdef STANDALONE_CHANNEL |
762 #ifdef STANDALONE_CHANNEL |
763 DIicClientChan* aClientChan; |
763 DIicClientChan* aClientChan; |
764 TInt r = KErrNone; |
764 TInt r = KErrNone; |
765 DIicBusChannel *chan = NULL, *chanM = NULL, *chanS = NULL; |
765 DIicBusChannel *chan = NULL, *chanM = NULL, *chanS = NULL; |
766 TInt i; |
766 TUint i; |
767 for(i=0; i<NUM_CHANNELS_SPI; i++) |
767 for(i=0; i<NUM_CHANNELS_SPI; i++) |
768 { |
768 { |
769 CLIENT_PRINT(("\n")); |
769 CLIENT_PRINT(("\n")); |
770 #if defined(MASTER_MODE) |
770 #if defined(MASTER_MODE) |
771 if(CHANNEL_TYPE_SPI(i) == (DIicBusChannel::EMaster)) |
771 if(CHANNEL_TYPE_SPI(i) == (DIicBusChannel::EMaster)) |
1017 |
1017 |
1018 DChannelIicClient::~DChannelIicClient() |
1018 DChannelIicClient::~DChannelIicClient() |
1019 // Destructor |
1019 // Destructor |
1020 { |
1020 { |
1021 CLIENT_PRINT(("> DChannelIicClient::~DChannelIicClient()")); |
1021 CLIENT_PRINT(("> DChannelIicClient::~DChannelIicClient()")); |
1022 __KTRACE_OPT(KRESMANAGER, Kern::Printf("> DChannelIicClient::~DChannelIicClient()")); |
1022 __KTRACE_OPT(KIIC, Kern::Printf("> DChannelIicClient::~DChannelIicClient()")); |
1023 delete iNotif; |
1023 delete iNotif; |
1024 iArrayMutex->Close(NULL); |
1024 iArrayMutex->Close(NULL); |
1025 iChanArrWrtSem->Close(NULL); |
1025 iChanArrWrtSem->Close(NULL); |
1026 iDfcQue->Destroy(); |
1026 iDfcQue->Destroy(); |
1027 // decrement the DThread's reference count |
1027 // decrement the DThread's reference count |