/* RETURN: MV_BAD_PARAM if parameters to function invalid, MV_OK otherwise. NOTE: This function does not modify the Operation_mode field of control register.  */
int mv_xor_ctrl_set(u32 chan, u32 xor_ctrl)
/* RETURN: MV_BAD_PARAM if parameters to function invalid, MV_OK otherwise. NOTE: This function does not modify the Operation_mode field of control register.  */
int mv_xor_ctrl_set(u32 chan, u32 xor_ctrl)
{
	u32 old_value;
	old_value = reg_read(XOR_CONFIG_REG(XOR_UNIT(chan), XOR_CHAN(chan))) &
		XEXCR_OPERATION_MODE_MASK;
	xor_ctrl &= ~XEXCR_OPERATION_MODE_MASK;
	xor_ctrl |= old_value;
	reg_write(XOR_CONFIG_REG(XOR_UNIT(chan), XOR_CHAN(chan)), xor_ctrl);
	return MV_OK;
}