linux
linux copied to clipboard
drivers: iio: adc: Add support for ad4630
This PR is based on #1894
Changelog -> V2:
- Use claim_direct_mode for buffer locking
- Add scale support
- Use power monitor ops instead of iio attribute for sleep mode
Changelog -> V3:
- Add missing iio_device_release_direct_mode()
Changelog:
- Claim iio device only inside helper functions
- Remove unused pm runtime functions
v5:
- rebase on top of the master branch
v5:
- fix Checkpatch complaint (Please use a blank line after struct iio_enum ad4630_avg_frame_len_enum).
There was a major refactor on the driver that fixed some issues and also brings the driver to a state more "upstreamable". Just some highlights:
- Removes common mode voltage channels. It was working in previous version since it relies on out of tree IIO code. One can still get the raw data from the buffered samples to get the common mode voltage;
- Used proper IIO channel attributes for additional channel gain and offset;
- Fixed channel gain calculation;
- Get rid of string devicetree properties;
- Use regmap;
- Properly support regulators;
- Fixed spi word size for interleaved lane and 4 lanes;
- Support test_pattern as an additional channel. Only done like this because of the host clock mode where the device itself controls the spi word length (and IIO scan element properties are constant).
v2:
- fixed bindings check.
v3:
- imply the new driver.
v4:
- Take into account the test_pattern channel is not a real device channel that cannot be taken into account when calculating spi word length for the interleaved lane mode.
v5:
- Fix arm64 warnings about overflows...