/* Tune USB Tx/Rx Equalization */
int ps8740_tune_usb_eq(int i2c_addr, uint8_t tx, uint8_t rx)
{
	int ret = 0;

	ret |= ps8740_write(i2c_addr, PS8740_REG_USB_EQ_TX, tx);
	ret |= ps8740_write(i2c_addr, PS8740_REG_USB_EQ_RX, rx);

	return ret;
}
/* Writes control register to set switch mode */
static int ps8740_set_mux(int i2c_addr, mux_state_t mux_state)
{
	uint8_t reg = 0;

	if (mux_state & MUX_USB_ENABLED)
		reg |= PS8740_MODE_USB_ENABLED;
	if (mux_state & MUX_DP_ENABLED)
		reg |= PS8740_MODE_DP_ENABLED;
	if (mux_state & MUX_POLARITY_INVERTED)
		reg |= PS8740_MODE_POLARITY_INVERTED;

	return ps8740_write(i2c_addr, PS8740_REG_MODE, reg);
}
static int ps8740_reset(int i2c_addr)
{
	return ps8740_write(i2c_addr, PS8740_REG_MODE, PS8740_MODE_POWER_DOWN);
}