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:
parent
fb4cb3a878
commit
27195895b1
4 changed files with 28 additions and 5 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue