/* Start a new transfer. This is called both by the idle state for the first transfer in a message, and by the wait state when the previous transfer in a message is complete.  */
static void mpc52xx_spi_start_transfer(struct mpc52xx_spi *ms)
/* Start a new transfer. This is called both by the idle state for the first transfer in a message, and by the wait state when the previous transfer in a message is complete.  */
static void mpc52xx_spi_start_transfer(struct mpc52xx_spi *ms)
{
	ms->rx_buf = ms->transfer->rx_buf;
	ms->tx_buf = ms->transfer->tx_buf;
	ms->len = ms->transfer->len;
	if (ms->cs_change)
		mpc52xx_spi_chipsel(ms, 1);
	ms->cs_change = ms->transfer->cs_change;
	ms->wcol_tx_timestamp = get_tbl();
	if (ms->tx_buf)
		out_8(ms->regs + SPI_DATA, *ms->tx_buf++);
	else
		out_8(ms->regs + SPI_DATA, 0);
}