Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drivers:platform:stm32: Update SPI desc frequency with configured frequency #2392

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

NagaHimanshu
Copy link
Contributor

Update SPI descriptor clock frequency value with configured value instead of retaining init params value.

Pull Request Description

Please replace this with a detailed description and motivation of the changes.
You can tick the checkboxes below with an 'x' between square brackets or just check them after publishing the PR.
If this PR contains a breaking change, list dependent PRs and try to push all related PRs at the same time.

PR Type

  • Bug fix (change that fixes an issue)
  • New feature (change that adds new functionality)
  • Breaking change (has dependencies in other repos or will cause CI to fail)

PR Checklist

  • I have followed the Coding style guidelines
  • I have performed a self-review of the changes
  • I have commented my code, at least hard-to-understand parts
  • I have build all projects affected by the changes in this PR
  • I have tested in hardware affected projects, at the relevant boards
  • I have signed off all commits from this PR
  • I have updated the documentation (wiki pages, ReadMe etc), if applies

…quency

Update SPI descriptor clock frequency value with configured value instead of retaining init params value.

Signed-off-by: Naga Himanshu Indraganti <[email protected]>
@@ -58,31 +58,41 @@ static int stm32_spi_config(struct no_os_spi_desc *desc)
switch (div) {
case 0 ... 2:
prescaler = SPI_BAUDRATEPRESCALER_2;
desc->max_speed_hz = sdesc->input_clock / 2;
Copy link
Contributor

@buha buha Dec 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmmm, to be honest i think here it'd be better to keep both, max_speed_hz is the requested maximum speed and there could be an actual_speed_hz with the computed one

i don't think the proposed change is good as it is, either we drop it or we implement both if you really want this info in the desc but this would imply that we populate actual_speed_hz on all platforms

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants