From 73fcd52e49db49449613035a3bce8b04d9890f72 Mon Sep 17 00:00:00 2001 From: daniel_Tomas Date: Fri, 3 Dec 2010 14:16:11 +0100 Subject: Fix to increase the stability of the Init/Deint action Change-Id: I89e08ab079a6c0a83cd5a128ecfee2026411af15 --- Linux_x86/phDal4Nfc.c | 13 +++++++++++-- Linux_x86/phDal4Nfc_i2c.c | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) (limited to 'Linux_x86') diff --git a/Linux_x86/phDal4Nfc.c b/Linux_x86/phDal4Nfc.c index 97217f9..4cc2470 100644 --- a/Linux_x86/phDal4Nfc.c +++ b/Linux_x86/phDal4Nfc.c @@ -289,6 +289,9 @@ NFCSTATUS phDal4Nfc_ConfigRelease( void *pHwRef) DAL_PRINT("phDal4Nfc_ConfigRelease "); + /* Shutdown NFC Chip */ + phDal4Nfc_Reset(0); + if (gDalContext.hw_valid == TRUE) { /* Kill the read and write threads */ @@ -475,8 +478,14 @@ PURPOSE: Cancel the Read wait function. NFCSTATUS phDal4Nfc_ReadWaitCancel( void *pContext, void *pHwRef) { - /* not used */ - DAL_PRINT("phDal4Nfc_ReadWaitCancel"); + DAL_PRINT("phDal4Nfc_ReadWaitCancel"); + + /* unlock read semaphore */ + sem_post(&nfc_read_sem); + + /* Stop the reader thread */ + gReadWriteContext.nReadThreadAlive = 0; + return 0; } diff --git a/Linux_x86/phDal4Nfc_i2c.c b/Linux_x86/phDal4Nfc_i2c.c index 4f18ffc..667c1a0 100644 --- a/Linux_x86/phDal4Nfc_i2c.c +++ b/Linux_x86/phDal4Nfc_i2c.c @@ -252,7 +252,7 @@ int phDal4Nfc_i2c_reset(long level) */ if (level == 0) { LOGW("sleeping a little longer..."); - usleep(10000); + usleep(50000); } else { usleep(10000); } -- cgit v1.1