Example #1
0
s32 fc8080_i2c_longread(HANDLE handle, u16 addr, u32 *data)
{
	s32 res;

	mutex_lock(&lock);
	res = i2c_bulkread(handle, (u8) CHIP_ADDR, addr, (u8 *) data, 4);
	mutex_unlock(&lock);

	return res;
}
Example #2
0
s32 fc8080_i2c_byteread(HANDLE handle, u16 addr, u8 *data)
{
	s32 res;

	mutex_lock(&lock);
	res = i2c_bulkread(handle, (u8) CHIP_ADDR, addr, data, 1);
	mutex_unlock(&lock);

	return res;
}
int fc8050_i2c_bulkread(HANDLE hDevice, u16 addr, u8 *data, u16 length)
{
	int res;
	u8 command = HPIC_READ | HPIC_AINC | 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_bulkread(hDevice, BBM_DATA_REG, data, length);

	return res;
}
int fc8050_i2c_longread(HANDLE hDevice, fci_u16 addr, fci_u32 *data)
{
	int res;
	fci_u8 command = HPIC_READ | HPIC_AINC | HPIC_BMODE | HPIC_ENDIAN;

	res  = i2c_bulkwrite(hDevice, BBM_COMMAND_REG, &command, 1);
	res |= i2c_bulkwrite(hDevice, BBM_ADDRESS_REG, (fci_u8*)&addr, 2);
	res |= i2c_bulkread(hDevice, BBM_DATA_REG, (fci_u8*)data, 4);

	return res;
}
int fc8050_i2c_wordread(HANDLE hDevice, fci_u16 addr, fci_u16 *data)
{
	int res;
	fci_u8 command = HPIC_READ | HPIC_AINC | HPIC_BMODE | HPIC_ENDIAN;
	
	if(BBM_SCI_DATA <= addr && BBM_SCI_SYNCRX >= addr)
		command = HPIC_READ | HPIC_WMODE | HPIC_ENDIAN;

	res  = i2c_bulkwrite(hDevice, BBM_COMMAND_REG, &command, 1);
	res |= i2c_bulkwrite(hDevice, BBM_ADDRESS_REG, (fci_u8*)&addr, 2);
	res |= i2c_bulkread(hDevice, BBM_DATA_REG, (fci_u8*)data, 2);

	return res;
}
Example #6
0
int fc8150_i2c_byteread(HANDLE hDevice, u16 addr, u8 *data)
{
	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_bulkread(hDevice, CHIP_ADDR, BBM_DATA_REG, data, 1);
	OAL_RELEASE_SEMAPHORE();

	return res;
}
int fc8150_i2c_longread(HANDLE hDevice, u16 addr, u32 *data)
{
	int res;
	u8 command = HPIC_READ | HPIC_AINC | 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_bulkread(hDevice, CHIP_ADDR, BBM_DATA_REG, (u8 *)data, 4);
	mutex_unlock(&fci_i2c_lock);

	return res;
}
Example #8
0
int fc8150_bypass_read(HANDLE hDevice, u8 chip, u8 addr, u8 *data, u16 length)
{
	int res;
	u8 bypass_addr = 0x03;
	u8 bypass_data = 1;
	u8 bypass_len  = 1;

	OAL_OBTAIN_SEMAPHORE();
	res = i2c_bulkwrite(hDevice, CHIP_ADDR, bypass_addr
		, &bypass_data, bypass_len);
	res |= i2c_bulkread(hDevice, chip, addr, data, length);
	OAL_RELEASE_SEMAPHORE();

	return res;
}
int fc8150_bypass_read(HANDLE hDevice, u8 chip, u8 addr, u8 *data, u16 length)
{
	int res;
	u8 bypass_addr = 0x03;
	u8 bypass_data = 1;
	u8 bypass_len  = 1;

	mutex_lock(&fci_i2c_lock);
	res = i2c_bulkwrite(hDevice, CHIP_ADDR, bypass_addr
		, &bypass_data, bypass_len);
	res |= i2c_bulkread(hDevice, chip, addr, data, length);
	mutex_unlock(&fci_i2c_lock);

	return res;
}
static int i2c_dataread(HANDLE hDevice, fci_u16 addr, fci_u8* data, fci_u16 length)
{
	return i2c_bulkread(hDevice, addr, data, length);
}
Example #11
0
static int i2c_dataread(HANDLE hDevice, u8 chip, u8 addr, u8 *data, u32 length)
{
	return i2c_bulkread(hDevice, chip, addr, data, length);
}
Example #12
0
static s32 i2c_dataread(HANDLE handle, u8 chip, u16 addr, u8 *data, u16 length)
{
	return i2c_bulkread(handle, chip, addr, data, length);
}