s32 fc8080_i2c_dataread(HANDLE handle, u16 addr, u8 *data, u32 length) { s32 res; mutex_lock(&lock); res = i2c_dataread(handle, (u8) CHIP_ADDR, addr, (u8 *) &data, length); mutex_unlock(&lock); return res; }
int fc8050_i2c_dataread(HANDLE hDevice, u16 addr, u8 *data, u16 length) { int res; u8 command = HPIC_READ | HPIC_BMODE | HPIC_ENDIAN; res = i2c_bulkwrite(hDevice, BBM_COMMAND_REG, &command, 1); res |= i2c_bulkwrite(hDevice, BBM_ADDRESS_REG, (u8 *)&addr, 2); res |= i2c_dataread(hDevice, BBM_DATA_REG, data, length); return res; }
int fc8150_i2c_dataread(HANDLE hDevice, u16 addr, u8 *data, u32 length) { int res; u8 command = HPIC_READ | HPIC_BMODE | HPIC_ENDIAN; OAL_OBTAIN_SEMAPHORE(); res = i2c_bulkwrite(hDevice, CHIP_ADDR, BBM_ADDRESS_REG , (u8 *)&addr, 2); res |= i2c_bulkwrite(hDevice, CHIP_ADDR, BBM_COMMAND_REG, &command, 1); res |= i2c_dataread(hDevice, CHIP_ADDR, BBM_DATA_REG, data, length); OAL_RELEASE_SEMAPHORE(); return res; }
int fc8150_i2c_dataread(HANDLE hDevice, u16 addr, u8 *data, u32 length) { int res; u8 command = HPIC_READ | HPIC_BMODE | HPIC_ENDIAN; mutex_lock(&fci_i2c_lock); res = i2c_bulkwrite(hDevice, CHIP_ADDR, BBM_ADDRESS_REG , (u8 *)&addr, 2); res |= i2c_bulkwrite(hDevice, CHIP_ADDR, BBM_COMMAND_REG, &command, 1); res |= i2c_dataread(hDevice, CHIP_ADDR, BBM_DATA_REG, data, length); mutex_unlock(&fci_i2c_lock); return res; }