/*----------------------------------------------------------------------------*/ BOOL kalDevWriteWithSdioCmd52 ( IN P_GLUE_INFO_T prGlueInfo, IN UINT_32 u4Addr, IN UINT_8 ucData ) { UINT_32 u4RegValue; BOOLEAN bRet; GLUE_SPIN_LOCK_DECLARATION(); ASSERT(prGlueInfo); /* 0. acquire spinlock */ GLUE_ACQUIRE_SPIN_LOCK(prGlueInfo, SPIN_LOCK_EHPI_BUS); /* 1. there is no single byte access support for eHPI, use 4-bytes write-after-read approach instead */ if(kalDevRegRead_impl(prGlueInfo, u4Addr, &u4RegValue) == TRUE) { u4RegValue &= 0x00; u4RegValue |= ucData; bRet = kalDevRegWrite_impl(prGlueInfo, u4Addr, u4RegValue); } else { bRet = FALSE; } /* 2. release spin lock */ GLUE_RELEASE_SPIN_LOCK(prGlueInfo, SPIN_LOCK_EHPI_BUS); return bRet; }
/*----------------------------------------------------------------------------*/ BOOL kalDevRegRead(IN P_GLUE_INFO_T prGlueInfo, IN UINT_32 u4Register, OUT PUINT_32 pu4Value) { GLUE_SPIN_LOCK_DECLARATION(); ASSERT(prGlueInfo); ASSERT(pu4Value); /* 0. acquire spinlock */ GLUE_ACQUIRE_SPIN_LOCK(prGlueInfo, SPIN_LOCK_EHPI_BUS); /* 1. I/O stuff */ kalDevRegRead_impl(prGlueInfo, u4Register, pu4Value); /* 2. release spin lock */ GLUE_RELEASE_SPIN_LOCK(prGlueInfo, SPIN_LOCK_EHPI_BUS); return TRUE; }