linux
linux copied to clipboard
Add support for AD4630 common mode data
PR Description
This PR updates ad4630 so it can provide ADC common-mode data. First, this PR brings multiple scan_type support from upstream into ADI Linux (https://lore.kernel.org/linux-iio/20240530-iio-add-support-for-multiple-scan-types-v3-0-cbc4acea2cfa@baylibre.com/). Then, ad4630 is extended to provide one scan_type to read ADC conversion, one scan_type to read common-mode voltage, and another scan_type to read both ADC conversion and common-mode voltage. This feature request was written in this JIRA task: https://jira.analog.com/browse/COSGTM-966.
After doing a self-review of the code, I don't really think this is a good solution for having the common-mode voltage. I think that common-mode voltage should be provided as a separate IIO channel, specially because common-mode LSB is VREF/256 (would need a separate scale attribute). Though, this is the less worse solution I could come up with so proposing it here for comments.
PR Type
- [ ] Bug fix (a change that fixes an issue)
- [x] New feature (a change that adds new functionality)
- [ ] Breaking change (a change that affects other repos or cause CIs to fail)
PR Checklist
- [x] I have conducted a self-review of my own code changes
- [x] I have tested the changes on the relevant hardware
- [ ] I have updated the documentation outside this repo accordingly (if there is the case)