Skip to content

Commit

Permalink
drivers: mspi: add checking device frequency
Browse files Browse the repository at this point in the history
Add checking if desired transmission frequency is possible to
set.

Signed-off-by: Magdalena Pastula <[email protected]>
  • Loading branch information
magp-nordic committed Feb 26, 2025
1 parent 09cc0f1 commit 315cef8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/mspi/mspi_nrfe.c
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,12 @@ static int api_dev_config(const struct device *dev, const struct mspi_dev_id *de
drv_cfg->mspicfg.max_freq);
return -EINVAL;
}

if (cfg->freq < drv_cfg->mspicfg.max_freq / UINT16_MAX) {
LOG_ERR("Invalid frequency: %u. MIN: %u", cfg->freq,
drv_cfg->mspicfg.max_freq / UINT16_MAX);
return -EINVAL;
}
}

if (param_mask & MSPI_DEVICE_CONFIG_IO_MODE) {
Expand Down

0 comments on commit 315cef8

Please sign in to comment.