drivers/spi: Do not reconfigure at every transaction

If the configuration is already installed, there will no need to
reconfigure the controller all over again.

This was missing for mcux_dspi, mcux_lspi, sam and sam0.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This commit is contained in:
Tomasz Bursztyka 2018-11-12 15:54:02 +01:00 committed by Maureen Helm
commit 27195895b1
4 changed files with 28 additions and 5 deletions

View file

@ -128,6 +128,11 @@ static int spi_mcux_configure(struct device *dev,
u32_t clock_freq;
u32_t word_size;
if (spi_context_configured(&data->ctx, spi_cfg)) {
/* This configuration is already in use */
return 0;
}
DSPI_MasterGetDefaultConfig(&master_config);
if (spi_cfg->slave > FSL_FEATURE_DSPI_CHIP_SELECT_COUNT) {