mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-07 14:32:23 +00:00
spi: spi-bfin5xx: Calculate transfer speed unconditionally
SPI core validates the transfer speed and defaults to spi->max_speed_hz in case the transfer speed is not set so code here won't use the chip->baud value (which is derived from spi->max_speed_hz). Please note driver uses chip->baud at the beginning of message transmission by calling the bfin_spi_restore_state() but then programs per transfer speed in bfin_spi_pump_transfers(). I'm not familiar with the HW so I don't know would it be possible to remove chip->baud completely by either using constant value in bfin_spi_restore_state() or by removing the baud register write there. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
6ff33f3902
commit
95a8fde23e
@ -661,11 +661,7 @@ static void bfin_spi_pump_transfers(unsigned long data)
|
||||
message->state = RUNNING_STATE;
|
||||
dma_config = 0;
|
||||
|
||||
/* Speed setup (surely valid because already checked) */
|
||||
if (transfer->speed_hz)
|
||||
bfin_write(&drv_data->regs->baud, hz_to_spi_baud(transfer->speed_hz));
|
||||
else
|
||||
bfin_write(&drv_data->regs->baud, chip->baud);
|
||||
bfin_write(&drv_data->regs->baud, hz_to_spi_baud(transfer->speed_hz));
|
||||
|
||||
bfin_write(&drv_data->regs->stat, BIT_STAT_CLR);
|
||||
bfin_spi_cs_active(drv_data, chip);
|
||||
|
Loading…
Reference in New Issue
Block a user