/* @twsi: The MVTWSI register structure to use. @expected_start_status: The I2C status the controller is expected to assert after the address byte was sent. @addr: The address byte to be sent. @tick: The duration of a clock cycle at the current I2C speed.  */
static int i2c_begin(struct mvtwsi_registers *twsi, int expected_start_status, u8 addr, uint tick)
/* @twsi: The MVTWSI register structure to use. @expected_start_status: The I2C status the controller is expected to assert after the address byte was sent. @addr: The address byte to be sent. @tick: The duration of a clock cycle at the current I2C speed.  */
static int i2c_begin(struct mvtwsi_registers *twsi, int expected_start_status, u8 addr, uint tick)
{
	int status, expected_addr_status;
	if (addr & 1)
		expected_addr_status = MVTWSI_STATUS_ADDR_R_ACK;
	else
		expected_addr_status = MVTWSI_STATUS_ADDR_W_ACK;
	status = twsi_start(twsi, expected_start_status, tick);
	if (status == 0)
		status = twsi_send(twsi, addr, expected_addr_status, tick);
	return status;
}