iio: dac: Add AD5413 support#2786
iio: dac: Add AD5413 support#2786BruceTsaoADI wants to merge 8 commits intoanalogdevicesinc:mirror_ci/jic23/iio/testingfrom
Conversation
gastmaier
left a comment
There was a problem hiding this comment.
Added the warnings that caused the ci to exit with an error but were not logged
ba5d87d to
1401608
Compare
|
Hi, sorry for the pr failure, I updated the checkout strategy to retry by deepening the fetch until the rebase succeeds. please see CI output, checkpatch is failing for example |
|
Hi @dlech, @mhennerich, @nunojsa, All feedback so far has been addressed in the latest commits. Could you kindly take a look and let me know if anything else is required for approval? Thanks! |
15694b1 to
8174327
Compare
b76d403 to
d859997
Compare
|
Thanks for the detailed review and for pointing this out again. I went through the comments and addressed them in the updated series. After rebasing onto that branch, the PR now only contains the two upstream-relevant patches:
All checks are passing now. |
4674362 to
78b10cd
Compare
|
@BruceTsaoADI please properly rebase your patches on top of the target branch. |
6114e4f to
e196cfc
Compare
Replace mutex_lock() and mutex_unlock() calls in rm3100-core.c with the more modern guard(mutex)() family. This will help modernize the driver and bring it up-to-date with modern available macros/functions. While replacing mutex_lock() and mutex_unlock(), the critical sections of rm3100_read_mag() and rm3100_get_samp_freq() have been extended to include negligible operations for cleaner logic. Add new helper-wrapper function rm3100_guarded_regmap_bulk_read() to help keep rm3100_trigger_handler() switch-cases clean while maintaining mutex locking and avoiding re-entrancy risks from potential callbacks. While at it, remove redundant gotos where applicable, and use direct returns instead. In addition, remove regmap variable in rm3100_trigger_handler() as its references have been replaced with variable data. Suggested-by: Jonathan Cameron <jic23@kernel.org> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Maxwell Doose <m32285159@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Rewrite MCP3422_CHANNEL_MASK, MCP3422_SRATE_MASK, MCP3422_PGA_MASK
and MCP3422_CONT_SAMPLING using GENMASK() and BIT() macros from
bits.h.
The other macros MCP3422_SRATE_{240, 60, 15, 3} were not changed
because they are also used as array indices.
Signed-off-by: Marcelo Machado Lage <marcelomlage@usp.br>
Co-developed-by: Vinicius Lira <vinilira@usp.br>
Signed-off-by: Vinicius Lira <vinilira@usp.br>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Replace manual bit manipulations with FIELD_GET(), FIELD_PREP() and FIELD_MODIFY() calls. The resulting code is more readable and maintainable, and 6 macros previously defined in the header are not needed anymore. Signed-off-by: Marcelo Machado Lage <marcelomlage@usp.br> Co-developed-by: Vinicius Lira <vinilira@usp.br> Signed-off-by: Vinicius Lira <vinilira@usp.br> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Use guard(mutex)() for handling mutex lock instead of manually locking and unlocking the mutex. This prevents forgotten locks due to early exits and removes the need of gotos. Signed-off-by: Pedro Barletta Gennari <pedro.pbg@usp.br> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Handle errors as early as possible by replacing 'if (!ret)' with the more common form 'if (ret)'. This makes the code easier to read. Signed-off-by: Pedro Barletta Gennari <pedro.pbg@usp.br> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
e196cfc to
fdad854
Compare
Document the devicetree bindings for the Analog Devices AD5413, a single-channel precision DAC controlled via SPI. The device supports voltage or current output modes and programmable slew-rate control. Signed-off-by: Bruce Tsao <bruce.tsao@analog.com>
Signed-off-by: Bruce Tsao <bruce.tsao@analog.com>
d859997 to
f41ce13
Compare
Thanks @nunojsa . I fetched the latest mirror_ci/jic23/iio/testing target branch and rebased the two AD5413 patches on top of fdad854. The PR branch has been force-pushed again. CI is now passing and there are no conflicts with the base branch. |
4783e10 to
ae283b1
Compare
Summary
This PR adds initial support for the Analog Devices AD5413, a 14-bit single-channel DAC capable of voltage and current output.
Key changes
ad5413.cunderdrivers/iio/dac/adi,ad5413.yamlunderDocumentation/devicetree/bindings/iio/dac/Datasheet:
https://www.analog.com/media/en/technical-documentation/data-sheets/ad5413.pdf
PR Description
necessary to understand them. List any dependencies required for this change.
any space), or simply check them after publishing the PR.
description and try to push all related PRs simultaneously.
PR Type
PR Checklist