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: lpadc: fix ADC command chaining #60111

Merged
merged 1 commit into from
Jul 12, 2023

Conversation

tyalie
Copy link
Contributor

@tyalie tyalie commented Jul 6, 2023

When reading multiple ADC channel in parallel, an ADC command chain will be build. This is similar to a linked list, as every command references the next command.

Before this patch every ADC command after the first, would always reference this initial command. So that during execution only two commands (the last and first) would be executed which resulted in readout of only two analog values. As Zephyr expected more to come in, the read_adc function would block endlessly.

The patch fixes the behaviour and allows a correct chain to build up, fixing the regression that has been introduced by
e587047

When reading multiple ADC channel in parallel, an ADC command chain will be
build. This is similar to a linked list, as every command references the
next command.

Before this patch every ADC command after the first, would always reference
this initial command. So that during execution only two commands (the last
and first) would be executed which resulted in readout of only two analog
values. As Zephyr expected more to come in, the `read_adc` function would
block endlessly.

The patch fixes the behaviour and allows a correct chain to build up.

Signed-off-by: Elisabeth Friedrich <auxsys@flowerpot.me>
Copy link
Collaborator

@danieldegrasse danieldegrasse left a comment

Choose a reason for hiding this comment

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

Thanks for the fix, was able to reproduce this issue. I opened #60276 which should hopefully catch regressions like this in the future.

@danieldegrasse danieldegrasse added the backport v3.4-branch Backport to the v3.4-branch label Jul 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: ADC Analog-to-Digital Converter (ADC) backport v3.4-branch Backport to the v3.4-branch platform: NXP NXP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants