Skip to content

Commit ca73e64

Browse files
[nrf fromtree] drivers: spi: nrfx_spim_common: Limit freq by max_freq of controller
When configuring the nRF SPIM, the frequency needs to be limited by the max frequency of the SPIM, which is specified in the devicetree. Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no> (cherry picked from commit b2085e6) (cherry picked from commit e589b5a)
1 parent c56bb60 commit ca73e64

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/spi/spi_nrfx_spim_common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ int spi_nrfx_spim_common_configure(const struct device *dev, const struct spi_co
561561

562562
spim_cfg.ss_pin = NRF_SPIM_PIN_NOT_CONNECTED;
563563
spim_cfg.orc = dev_config->orc;
564-
spim_cfg.frequency = resolve_freq(spi_cfg->frequency);
564+
spim_cfg.frequency = MIN(resolve_freq(spi_cfg->frequency), dev_config->max_freq);
565565
spim_cfg.mode = mode_from_op(spi_cfg->operation);
566566
spim_cfg.bit_order = bit_order_from_op(spi_cfg->operation);
567567
#if NRF_SPIM_HAS_DCX

0 commit comments

Comments
 (0)