spi: cadence: Configure SPI clock in the prepare_message() callback
authorLars-Peter Clausen <lars@metafoo.de>
Thu, 10 Jul 2014 09:26:29 +0000 (11:26 +0200)
committerMark Brown <broonie@linaro.org>
Fri, 11 Jul 2014 13:39:26 +0000 (14:39 +0100)
commitb48b9488e3180b173f37782a348b76ea6bff2c48
treeb0a8678fc9c49f0fed451dc47f77276f8c6e8a59
parenta39e65e9cc935b84f35d080e934c3fdd9ff86654
spi: cadence: Configure SPI clock in the prepare_message() callback

Currently the cadence SPI driver does the SPI clock configuration (setup CPOL
and CPHA) in the prepare_transfer_hardware() callback. The
prepare_transfer_hardware() callback is only called though when the controller
transitions from a idle state to a non-idle state. Such a transitions happens
when the message queue goes from empty to non-empty. If multiple messages from
different SPI slaves with different clock settings are in the message queue the
clock settings will not be properly updated when switching from one slave device
to another. Instead do the updating of the clock configuration in the
prepare_message() callback which will be called for each individual message.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/spi/spi-cadence.c