-
Notifications
You must be signed in to change notification settings - Fork 901
Fix ADAQ4216 data capture #2861
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
Draft
machschmitt
wants to merge
16
commits into
main
Choose a base branch
from
adaq4216-data-capture-fix
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c9ac8fd
to
dd952d3
Compare
Change log v1 -> v2
No functional change. |
Can you also fix the ci caught warnings? e.g., |
dd952d3
to
b27cc6d
Compare
Change log v2 -> v3
|
cc8e0e0
to
65d4fa4
Compare
Switch from old/temporary SPI-Engine compatible to upstream consolidated SPI-Engine compatible string. Signed-off-by: Marcelo Schmitt <[email protected]>
The ad4630 driver was updated and is now using the SPI offload trigger infrastructure which relies on a pwm-trigger being declared in device tree. Update ADAQ4216 device tree to work with the recent SPI offload trigger abstraction and infrastructure. Signed-off-by: Marcelo Schmitt <[email protected]>
… node The clock properties are no longer used after the update to use trigger-sources. Drop leftover clock properties in ADC node. Signed-off-by: Marcelo Schmitt <[email protected]>
Increase the number of pwm-cells to 3, following recent changes made to zynq-zed-adv7511-ad4630-24.dts. Signed-off-by: Marcelo Schmitt <[email protected]>
Move properties around and rename PWM phandle (axi_pwm_gen -> adc_trigger) to make ADAQ4216 dts similar to AD4630-24 as they should be. No functional change. Signed-off-by: Marcelo Schmitt <[email protected]>
Remove unneeded num-cs property from SPI-Engine device node. Signed-off-by: Marcelo Schmitt <[email protected]>
…ord size Set ADAQ channel storage bit to 32 since that was chosen to be the DMA word size. While at it, align channel macro arguments to comply with Linux code style and avoid checkpatch warnings. Signed-off-by: Marcelo Schmitt <[email protected]>
With SPI-Engine offload module, PWMs, and trigger-sources, the sampling frequency can be set from a wide range of values that cannot be displayed as a list of available items. Remove the sampling frequency available attribute so the user is not constrained when specifying the desired sampling frequency. Signed-off-by: Marcelo Schmitt <[email protected]>
ADAQ4216 doesn't use BIT(2) of OUT_DATA_MD field in mode register. Signed-off-by: Marcelo Schmitt <[email protected]>
This is a hack to discard ADAQ4216 second channel data. The ad4630_fmc HDL project was designed for ADCs with two channels and always streams two data channels to DMA (even when the ADC has only one physical channel). Though, if the ADC has only one physical channel, the data that would come from the second ADC channel comes in as noise and has to be discarded. Because of that, only half of data collected by DMA blocks shall be passed to IIO buffers when using single-channel ADCs such as ADAQ4216. Because only half of the data pushed to DMA is used, the filtered dmaengine buffer variant allocates blocks that are two times the usual size so the IIO buffer can still be filled with the data from one DMA block. Otherwise, a data glitch occurs right in the middle of the IIO buffer. Add a separate dmaengine buffer variant for filtering data from ADAQ4216 and similar single-channel ADCs supported by the ad4630.c driver. Signed-off-by: Marcelo Schmitt <[email protected]>
Use the new filtered DMA buffer variant to avoid pushing noise to IIO buffers when single-channel ADCs are used. Signed-off-by: Marcelo Schmitt <[email protected]>
Previously, due to return 0 after goto jump, '*val = temp;' could execute with temp uninitialized if regmap_read() failed in ad4630_get_avg_frame_len(). Prevent that by returning the actual error code if regmap_read() fails in ad4630_get_avg_frame_len(). Suggested-by: Jorge Marques <[email protected]> Fixes: 5bc31c5 ("iio: adc: ad4630: Use oversampling iio attribute for average mode") Signed-off-by: Marcelo Schmitt <[email protected]>
The average mode value is never negative so there is no need to check if it is lower than zero. This fixes a 'comparison of unsigned expression in '< 0' is always false' build warn. Signed-off-by: Marcelo Schmitt <[email protected]>
The PGA gain value is stored in an unsigned variable so it's value can never be a negative number. Thus, drop the lower bound check for PGA gain values as that is not needed. This fixes a 'comparison of unsigned expression in '< 0' is always false' build warn. Signed-off-by: Marcelo Schmitt <[email protected]>
The calibration scale value is stored in an unsigned variable so it's value can never be a negative number. Thus, drop the lower bound check for the calibration scale values as that is not needed. This fixes a 'comparison of unsigned expression in '< 0' is always false' build warn. Signed-off-by: Marcelo Schmitt <[email protected]>
The ADC input range value is never negative and so there is no need to use shift_right() to calculate the scale. Make direct use of right shift operator for scale calculation. This fixes 'comparison of unsigned expression in ‘< 0’ is always false' build warn. Signed-off-by: Marcelo Schmitt <[email protected]>
65d4fa4
to
f71869b
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes ADAQ4216 data capture
end_cycle_offset_ns
field tostruct spi_offload_trigger_periodic
.PR Type
PR Checklist