Alisa-Dariana Roman
9525c66de3
docs: iio: add AD7191
...
Add documentation for AD7191 driver.
Signed-off-by: Alisa-Dariana Roman <alisa.roman@analog.com >
Reviewed-by: David Lechner<dlechner@baylibre.com >
Link: https://patch.msgid.link/20250228141327.262488-4-alisa.roman@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-03-11 19:09:05 +00:00
Alisa-Dariana Roman
2e3ae10c35
iio: adc: ad7191: add AD7191
...
AD7191 is a pin-programmable, ultra-low noise 24-bit sigma-delta ADC
designed for precision bridge sensor measurements. It features two
differential analog input channels, selectable output rates,
programmable gain, internal temperature sensor and simultaneous
50Hz/60Hz rejection.
Signed-off-by: Alisa-Dariana Roman <alisa.roman@analog.com >
Reviewed-by: David Lechner<dlechner@baylibre.com >
Link: https://patch.msgid.link/20250228141327.262488-3-alisa.roman@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-03-11 19:08:56 +00:00
Alisa-Dariana Roman
f52b5daf39
dt-bindings: iio: adc: add AD7191
...
AD7191 is a pin-programmable, ultra-low noise 24-bit sigma-delta ADC
designed for precision bridge sensor measurements. It features two
differential analog input channels, selectable output rates,
programmable gain, internal temperature sensor and simultaneous
50Hz/60Hz rejection.
Signed-off-by: Alisa-Dariana Roman <alisa.roman@analog.com >
Reviewed-by: Rob Herring (Arm) <robh@kernel.org >
Reviewed-by: David Lechner<dlechner@baylibre.com >
Link: https://patch.msgid.link/20250228141327.262488-2-alisa.roman@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-03-11 19:08:49 +00:00
Jonathan Cameron
21ce1ce043
staging: iio: accel: adis16240: Drop driver for this impact sensor
...
Whilst an interesting part, no one has done significant work on this
driver since 2019. The recent changes are all as a result of adis library
improvements having to incorporate this device.
https://www.analog.com/en/products/adis16240.html now lists this part
as obsolete so the chances of anyone working on it are likely to be greatly
reduced.
So drop it. We can always bring it back if anyone does have interest in
this device and is willing to invest the time to make it suitable for a
staging graduation. How to handle the hardware triggered short bursts
of capture has never been resolved and is a somewhat challenging ABI design
problem.
Cc: Nuno Sa <nuno.sa@analog.com >
Cc: Rodrigo Carvalho <rodrigorsdc@gmail.com >
Link: https://patch.msgid.link/20250222152021.1039675-1-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-03-05 14:52:58 +00:00
Uwe Kleine-König
08808b3ef3
iio: adc: ad7192: Grab direct mode for calibration
...
While a calibration is running, better don't make the device do anything
else.
To enforce that, grab direct mode during calibration.
Fixes: 42776c14c6 ("staging: iio: adc: ad7192: Add system calibration support")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com >
Link: https://patch.msgid.link/8aade802afca6a89641e24c1ae1d4b8d82cff58d.1740655250.git.u.kleine-koenig@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-03-05 12:38:46 +00:00
Uwe Kleine-König
7021d97fb8
iio: adc: ad7173: Grab direct mode for calibration
...
While a calibration is running, better don't make the device do anything
else.
To enforce that, grab direct mode during calibration.
Fixes: 031bdc8aee ("iio: adc: ad7173: add calibration support")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com >
Link: https://patch.msgid.link/8319fa2dc881c9899d60db4eba7fe8e984716617.1740655250.git.u.kleine-koenig@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-03-05 12:38:46 +00:00
Julien Stephan
aac287ec80
docs: iio: ad7380: add adaq4381-4
...
adaq4381-4 is the 14 bits version of adaq4380-1 chip. Add it to the
documentation.
Signed-off-by: Julien Stephan <jstephan@baylibre.com >
Reviewed-by: David Lechner <dlechner@baylibre.com >
Link: https://patch.msgid.link/20250226-ad7380-add-adaq4381-4-support-v1-3-f350ab872d37@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-03-04 15:05:50 +00:00
Julien Stephan
7131fcdba9
dt-bindings: iio: adc: ad7380: add adaq4381-4 compatible parts
...
adaq4381-4 is the 14 bits version of adaq4380-1 chip. Add support for
it.
Signed-off-by: Julien Stephan <jstephan@baylibre.com >
Acked-by: Rob Herring (Arm) <robh@kernel.org >
Reviewed-by: David Lechner <dlechner@baylibre.com >
Link: https://patch.msgid.link/20250226-ad7380-add-adaq4381-4-support-v1-2-f350ab872d37@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-03-04 15:05:50 +00:00
Julien Stephan
f66d625c4d
iio: adc: ad7380: add adaq4381-4 support
...
adaq4381-4 is the 14 bits version of adaq4380-1 chip. Add support for
it.
Signed-off-by: Julien Stephan <jstephan@baylibre.com >
Reviewed-by: David Lechner <dlechner@baylibre.com >
Link: https://patch.msgid.link/20250226-ad7380-add-adaq4381-4-support-v1-1-f350ab872d37@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-03-04 15:05:50 +00:00
Simon Xue
1e30116da0
iio: adc: rockchip_saradc: add rk3562
...
rk3562 is using v2 saradc with 8 channels.
Signed-off-by: Simon Xue <xxm@rock-chips.com >
Signed-off-by: Kever Yang <kever.yang@rock-chips.com >
Link: https://patch.msgid.link/20250227110343.2342017-2-kever.yang@rock-chips.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-03-04 15:03:03 +00:00
Kever Yang
94e4fc4004
dt-bindings: iio: adc: Add rockchip,rk3562-saradc string
...
Add rockchip,rk3562-saradc compatible string.
The saradc on rk3562 is v2 controller, with 10bit width which is different
with rk3588.
Signed-off-by: Kever Yang <kever.yang@rock-chips.com >
Acked-by: Rob Herring (Arm) <robh@kernel.org >
Link: https://patch.msgid.link/20250227110343.2342017-1-kever.yang@rock-chips.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-03-04 14:59:47 +00:00
Dan Carpenter
15a007e7ae
iio: adc: ad4030: fix error pointer dereference in probe()
...
The intention here was obviously to return an error if devm_regmap_init()
fails, but the return statement was accidentally left out. This leads to
an error pointer dereference when we call:
ret = ad4030_detect_chip_info(st);
Add the return statement.
Fixes: ec25cf6f1e ("iio: adc: ad4030: add support for ad4632-16 and ad4632-24")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org >
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Link: https://patch.msgid.link/cc67cee7-9c65-46d2-aae3-f860fc3cc461@stanley.mountain
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-03-04 14:52:42 +00:00
Colin Ian King
5017dcb8fc
iio: light: Fix spelling mistake "regist" -> "register"
...
There are spelling mistakes in dev_err messages. Fix them.
Signed-off-by: Colin Ian King <colin.i.king@gmail.com >
Link: https://patch.msgid.link/20250228090228.679535-1-colin.i.king@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-03-04 14:50:52 +00:00
Folker Schwesinger
fcd104f0ed
iio: buffer-dma: Fix docstrings
...
Fix a typo in the docstring of iio_dma_buffer_read() and fix what looks
like a copy-and-paste error in the iio_dma_buffer_write() docstring.
Signed-off-by: Folker Schwesinger <dev@folker-schwesinger.de >
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Link: https://patch.msgid.link/D83IPSTKYWNB.1PUBV1530XI86@folker-schwesinger.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-03-04 14:49:31 +00:00
Jonas Karlman
8a9aa0bbd6
iio: adc: rockchip_saradc: Add support for RK3528
...
The Successive Approximation ADC (SARADC) in RK3528 uses the v2
controller and support:
- 10-bit resolution
- Up to 1MS/s sampling rate
- 4 single-ended input channels
- Current consumption: 0.5mA @ 1MS/s
Add support for the 4 channels of 10-bit resolution supported by SARADC
in RK3528.
Signed-off-by: Jonas Karlman <jonas@kwiboo.se >
Reviewed-by: Heiko Stuebner <heiko@sntech.de >
Link: https://patch.msgid.link/20250227184058.2964204-3-jonas@kwiboo.se
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-03-04 14:45:33 +00:00
Jonas Karlman
d15fc646cc
dt-bindings: iio: adc: Add rockchip,rk3528-saradc variant
...
The Successive Approximation ADC (SARADC) in RK3528 uses the v2
controller and support:
- 10-bit resolution
- Up to 1MS/s sampling rate
- 4 single-ended input channels
- Current consumption: 0.5mA @ 1MS/s
Add a rockchip,rk3562-saradc compatible string for the 4 channels of
10-bit resolution supported by SARADC in RK3528.
Signed-off-by: Jonas Karlman <jonas@kwiboo.se >
Acked-by: Conor Dooley <conor.dooley@microchip.com >
Reviewed-by: Heiko Stuebner <heiko@sntech.de >
Link: https://patch.msgid.link/20250227184058.2964204-2-jonas@kwiboo.se
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-03-04 14:45:32 +00:00
David Lechner
7867a0d1dd
MAINTAINERS: remove adi,ad7606.yaml from SEPS525
...
Remove Documentation/devicetree/bindings/iio/adc/adi,ad7606.yaml from
STAGING - SEPS525 LCD CONTROLLER DRIVERS. This was likley a copy/paste
mistake. There is no bindings file for SEPS525 since it is only in
staging.
The removed file matches Documentation/devicetree/bindings/iio/*/adi,*
under ANALOG DEVICES INC IIO DRIVERS already so wasn't just misplaced.
Signed-off-by: David Lechner <dlechner@baylibre.com >
Link: https://patch.msgid.link/20250303-maintainers-remove-adi-ad7606-yaml-from-seps525-lcd-controller-v1-1-a4e4f1b824ab@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-03-04 14:28:11 +00:00
sunliming
443238858a
iio: imu: adis: fix uninitialized symbol warning
...
Fix below kernel warning:
smatch warnings:
drivers/iio/imu/adis.c:319 __adis_check_status() error: uninitialized symbol 'status_16'.
Reported-by: kernel test robot <lkp@intel.com >
Reported-by: Dan Carpenter <error27@gmail.com >
Signed-off-by: sunliming <sunliming@kylinos.cn >
Link: https://patch.msgid.link/20250304060518.1834910-1-sunliming@linux.dev
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-03-04 14:13:56 +00:00
Dan Carpenter
eb2f9ab1f5
iio: adc: ad4851: Fix signedness bug in ad4851_calibrate()
...
The "c" variable is used to store error codes from ad4851_find_opt()
so it has to be signed for the error handling to work. Change it
to type int.
Fixes: 6250803fe2 ("iio: adc: ad4851: add ad485x driver")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org >
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Link: https://patch.msgid.link/f5e260e9-d7a8-4dae-b7ea-f1bbb1760e60@stanley.mountain
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-03-04 13:17:51 +00:00
Lothar Rubusch
62c6b4f1c7
iio: accel: adxl345: reorganize irq handler
...
Reorganize the IRQ handler. Move the overrun handling to the bottom.
Overrun leads to reset the interrupt register. This also happens at
evaluation of a particular interrupt event. First evaluate an event
if possible, then fall back to overrun handling. Additionally simplify
fetching the interrupt status function.
Both is in preparation to build interrupt handling up for the handling
of different detected events, implemented in follow up patches.
Signed-off-by: Lothar Rubusch <l.rubusch@gmail.com >
Link: https://patch.msgid.link/20250220104234.40958-4-l.rubusch@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-03-04 13:17:51 +00:00
Lothar Rubusch
a69b0bd304
iio: accel: adxl345: add debug register access
...
Add the possibility to verify the content of the configuration
registers of the sensor in preparation for upcomming feature
implementations.
Signed-off-by: Lothar Rubusch <l.rubusch@gmail.com >
Link: https://patch.msgid.link/20250220104234.40958-3-l.rubusch@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-03-04 13:17:51 +00:00
Lothar Rubusch
60a7903301
iio: accel: adxl345: reorganize measurement enable
...
Move the measurement enable function up in order to have it generically
available.
This is a preparation for upcomming patches. Particular features need
to have measuring off while changing settings, and turned on again
afterwards.
Signed-off-by: Lothar Rubusch <l.rubusch@gmail.com >
Link: https://patch.msgid.link/20250220104234.40958-2-l.rubusch@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-03-04 13:17:51 +00:00
Gustavo Silva
a1854d55f5
iio: imu: bmi270: add support for data ready interrupt trigger
...
The BMI270 sensor provides two interrupt pins that can be used for
different interrupt sources, including a data ready signal. Add support
for configuring one the pins as a trigger source.
The interrupt pin can be configured with various options: active high or
low, push-pull or open-drain, and latched or non-latched.
Acked-by: Alex Lanzano <lanzano.alex@gmail.com >
Signed-off-by: Gustavo Silva <gustavograzs@gmail.com >
Link: https://patch.msgid.link/20250228-bmi270-irq-v2-3-3f97a4e8f551@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-03-04 13:17:51 +00:00
Gustavo Silva
16c94de2aa
iio: imu: bmi270: rename variable bmi270_device to data
...
Rename all instances of 'struct bmi270_data' to 'data', to ensure
consistency across the driver.
Also rename bmi270_data::data to bmi270_data::buffer to avoid naming
conflicts.
Acked-by: Alex Lanzano <lanzano.alex@gmail.com >
Signed-off-by: Gustavo Silva <gustavograzs@gmail.com >
Link: https://patch.msgid.link/20250228-bmi270-irq-v2-2-3f97a4e8f551@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-03-04 13:17:51 +00:00
Marcelo Schmitt
9b4b9791dd
Documentation: iio: Add ADC documentation
...
ADC inputs can be classified into a few different types according to how
they measure the input signal, how restrained the signal is, and number of
input pins. Even though datasheets tend to provide many details about their
inputs and measurement procedures, it may not always be clear how to model
those inputs into IIO channels.
For example, some differential ADCs can have their inputs configured into
pseudo-differential channels. In that configuration, only one input
connects to the signal of interest as opposed to using two inputs of a
differential input configuration. Datasheets sometimes also refer to
pseudo-differential inputs as single-ended inputs even though they have
distinct physical configuration and measurement procedure.
Document consolidated ADC input types and how they are usually described
and supported in device tree and IIO, respectively.
Signed-off-by: Marcelo Schmitt <marcelo.schmitt@analog.com >
Reviewed-by: David Lechner <dlechner@baylibre.com >
Link: https://patch.msgid.link/e6ac2a595f06ba2d5ff0eb86e5895479c9dd797f.1739998491.git.marcelo.schmitt@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-03-04 13:17:51 +00:00
Matti Vaittinen
8c53df1499
iio: adc: Include cleanup.h when using guard()
...
Directly include the cleanup.h for the guard() instead of relying it to
be included via other files.
Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com >
Link: https://patch.msgid.link/5b352ce7241e5904a317dd26950c7cd4daa59fc0.1740748394.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-03-04 13:17:51 +00:00
Gustavo Silva
4e0bd62e80
iio: imu: bmi270: move private struct declaration to source file
...
The device's private data struct is currently declared in the header
file, but it does not need to be exposed there. Move it to the driver's
core source file to avoid unnecessary #include directives or forward
declarations in the header.
Signed-off-by: Gustavo Silva <gustavograzs@gmail.com >
Acked-by: Alex Lanzano <lanzano.alex@gmail.com >
Link: https://patch.msgid.link/20250219-bmi270-irq-v1-1-145d02bbca3b@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-03-04 13:17:51 +00:00
Angelo Dureghello
25331775b5
iio: dac: adi-axi-dac: add io_mode check
...
Add safe check to the high bound of the enum values,
Signed-off-by: Angelo Dureghello <adureghello@baylibre.com >
Link: https://patch.msgid.link/20250219-wip-bl-axi-dac-add-enum-check-v1-1-8de9db0b3b1b@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-03-04 13:17:51 +00:00
Jun Yan
583350c1d4
iio: gyro: bmg160_i2c: add BMI088 to of_match_table
...
BMI088 is missing from the of_match_table. Let's complete it.
Signed-off-by: Jun Yan <jerrysteve1101@gmail.com >
Link: https://patch.msgid.link/20250220165001.273325-3-jerrysteve1101@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-03-04 13:17:51 +00:00
Lothar Rubusch
b543d881e8
docs: iio: fix wrong driver name in documentation
...
The ADXL380/382 documentation uses in one place a wrong driver name.
Adds no functional change.
Signed-off-by: Lothar Rubusch <l.rubusch@gmail.com >
Link: https://patch.msgid.link/20250221194658.41358-1-l.rubusch@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-03-04 13:17:51 +00:00
David Lechner
38f898e0b5
iio: adc: ad4695: simplify getting oversampling_ratio
...
We already have a local variable that holds a pointer to
st->channels_cfg[chan->scan_index]. Use that to simplify the code.
Signed-off-by: David Lechner <dlechner@baylibre.com >
Reviewed-by: Trevor Gamblin <tgamblin@baylibre.com >
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Link: https://patch.msgid.link/20250218-iio-adc-ad4695-fix-out-of-bounds-array-access-v1-2-57fef8c7a3fd@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-03-04 13:17:50 +00:00
David Lechner
cafeb8a997
iio: adc: ad4695: fix out of bounds array access
...
Fix some out of bounds array access of st->channels_cfg in the ad4695
driver. This array only has elements for voltage channels, but it was
also being accessed for the temperature channel in a few cases causing
reading past the end of the array.
In some cases, this was harmless because the value was read but not
used. However, the in_temp_sampling_frequency attribute shares code
with the in_voltageY_sampling_frequency attributes and was trying to
read the oversampling ratio from the st->channels_cfg array. This
resulted in a garbage value being used in the calculation and the
resulting in_temp_sampling_frequency value was incorrect.
To fix, make sure we always check that we are dealing with a voltage
channel before accessing the st->channels_cfg array and use an
oversampling ratio of 1 for the temperature channel (multiplicative
identity value) since that channel doesn't support oversampling.
Fixes: 67d63185db ("iio: adc: ad4695: add offload-based oversampling support")
Signed-off-by: David Lechner <dlechner@baylibre.com >
Reviewed-by: Trevor Gamblin <tgamblin@baylibre.com >
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Link: https://patch.msgid.link/20250218-iio-adc-ad4695-fix-out-of-bounds-array-access-v1-1-57fef8c7a3fd@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-03-04 13:17:50 +00:00
Nuno Sá
d477cda71a
iio: adc: adi-axi-adc: replace of.h with mod_devicetable.h
...
Don't use of.h in order to include mod_devicetable.h. Use it directly as
there no direct dependency on OF.
Signed-off-by: Nuno Sá <nuno.sa@analog.com >
Reviewed-by: David Lechner <dlechner@baylibre.com >
Link: https://patch.msgid.link/20250218-dev-axi-adc-fix-headers-v1-1-5ddc79221d8c@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-03-04 13:17:50 +00:00
Nuno Sá
6d5dd486c7
iio: core: make use of simple_write_to_buffer()
...
Instead of open coding (kind of) simple_write_to_buffer(), use it.
While at it, use ascii representation to terminate the string as that is
the more common way of doing it.
Signed-off-by: Nuno Sá <nuno.sa@analog.com >
Reviewed-by: David Lechner <dlechner@baylibre.com >
Link: https://patch.msgid.link/20250218-dev-iio-misc-v1-2-bf72b20a1eb8@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-03-04 13:17:50 +00:00
Nuno Sá
035b498921
iio: backend: make sure to NULL terminate stack buffer
...
Make sure to NULL terminate the buffer in
iio_backend_debugfs_write_reg() before passing it to sscanf(). It is a
stack variable so we should not assume it will 0 initialized.
Fixes: cdf01e0809 ("iio: backend: add debugFs interface")
Signed-off-by: Nuno Sá <nuno.sa@analog.com >
Reviewed-by: David Lechner <dlechner@baylibre.com >
Link: https://patch.msgid.link/20250218-dev-iio-misc-v1-1-bf72b20a1eb8@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-03-04 13:17:50 +00:00
Jonathan Cameron
1a21a9842e
iio: adc: Switch to sparse friendly iio_device_claim/release_direct()
...
Single patch for all the relatively simple cases.
These new functions allow sparse to find failures to release
direct mode reducing chances of bugs over the claim_direct_mode()
functions that are deprecated.
Cc: Olivier Moysan <olivier.moysan@foss.st.com >
Cc: Phil Reid <preid@electromag.com.au >
Reviewed-by: Mike Looijmans <mike.looijmans@topic.nl >
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Link: https://patch.msgid.link/20250217141630.897334-30-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-03-04 13:17:50 +00:00
Jonathan Cameron
0152834768
iio: adc: max11410: Switch to sparse friendly iio_device_claim/release_direct()
...
These new functions allow sparse to find failures to release
direct mode reducing chances of bugs over the claim_direct_mode()
functions that are deprecated.
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Link: https://patch.msgid.link/20250217141630.897334-27-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-03-04 13:17:50 +00:00
Jonathan Cameron
386c1d6e41
iio: adc: max11410: Factor out writing of sampling frequency to simplify errro paths.
...
Introduce __max11410_write_samp_freq() helper and use guard() to avoid
need for manual unlock of the mutex. This allows direct returns and
simplifies the resulting error handling.
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Link: https://patch.msgid.link/20250217141630.897334-26-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-03-04 13:17:50 +00:00
Jonathan Cameron
71dfa35f7b
iio: adc: max1027: Switch to sparse friendly iio_device_claim/release_direct()
...
These new functions allow sparse to find failures to release
direct mode reducing chances of bugs over the claim_direct_mode()
functions that are deprecated.
Cc: Miquel Raynal <miquel.raynal@bootlin.com >
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com >
Link: https://patch.msgid.link/20250217141630.897334-25-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-03-04 13:17:50 +00:00
Jonathan Cameron
2ce5314c68
iio: adc: max1027: Move claim of direct mode up one level and use guard()
...
Move iio_device_claim_direct_mode() into the read_raw() callback
and use guard() to release a mutex. This enables simpler error
handling via direct returns.
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com >
Link: https://patch.msgid.link/20250217141630.897334-24-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-03-04 13:17:50 +00:00
Jonathan Cameron
173386d036
iio: adc: at91-sama5d2: Switch to sparse friendly iio_device_claim/release_direct()
...
These new functions allow sparse to find failures to release
direct mode reducing chances of bugs over the claim_direct_mode()
functions that are deprecated.
Reviewed-by: Claudiu Beznea <claudiu.beznea@tuxon.dev >
Link: https://patch.msgid.link/20250217141630.897334-23-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-03-04 13:17:50 +00:00
Jonathan Cameron
b3179f59c1
iio: adc: at91-sama5d2: Move claim of direct mode up a level and use guard()
...
Move iio_device_claim_direct_mode() up one layer in the call stack,
and use guard() for scope based unlocking to simplify error handling
by allowing direct returns.
Reviewed-by: Claudiu Beznea <claudiu.beznea@tuxon.dev >
Link: https://patch.msgid.link/20250217141630.897334-22-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-03-04 13:17:50 +00:00
Jonathan Cameron
6eedf172d9
iio: adc: ad_sigma_delta: Switch to sparse friendly iio_device_claim/release_direct()
...
These new functions allow sparse to find failures to release
direct mode reducing chances of bugs over the claim_direct_mode()
functions that are deprecated.
This is a complex function with a lot more than the release of direct
mode to unwind on error. As such no attempt made to factor out
the inner code.
Cc: Uwe Kleine-König <u.kleine-koenig@baylibre.com >
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Link: https://patch.msgid.link/20250217141630.897334-21-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-03-04 13:17:49 +00:00
Jonathan Cameron
bbd841f9d0
iio: adc: ad799x: Switch to sparse friendly iio_device_claim/release_direct()
...
These new functions allow sparse to find failures to release
direct mode reducing chances of bugs over the claim_direct_mode()
functions that are deprecated.
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Link: https://patch.msgid.link/20250217141630.897334-20-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-03-04 13:17:49 +00:00
Jonathan Cameron
4d47f64ca8
iio: adc: ad7793: Switch to sparse friendly iio_device_claim/release_direct()
...
These new functions allow sparse to find failures to release
direct mode reducing chances of bugs over the claim_direct_mode()
functions that are deprecated.
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Link: https://patch.msgid.link/20250217141630.897334-19-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-03-04 13:17:49 +00:00
Jonathan Cameron
f1a4a2e6b8
iio: adc: ad7793: Factor out core of ad7793_write_raw() to simplify error handling
...
Factor out everything under the direct mode claim allowing direct returns
in error paths. Switch sense of matching in the loop and use a continue
to reduce code indent and improve readability.
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Link: https://patch.msgid.link/20250217141630.897334-18-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-03-04 13:17:49 +00:00
Jonathan Cameron
85e840ced7
iio: adc: ad7791: Switch to sparse friendly iio_device_claim/release_direct()
...
These new functions allow sparse to find failures to release
direct mode reducing chances of bugs over the claim_direct_mode()
functions that are deprecated
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Link: https://patch.msgid.link/20250217141630.897334-17-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-03-04 13:17:49 +00:00
Jonathan Cameron
c05cbf02df
iio: adc: ad7791: Factor out core of ad7791_write_raw() to simplify error handling
...
Factor out everything under the direct mode claim allowing direct returns
in error paths.
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Link: https://patch.msgid.link/20250217141630.897334-16-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-03-04 13:17:49 +00:00
Jonathan Cameron
15bed4f0cb
iio: adc: ad7606: Switch to sparse friendly iio_device_claim/release_direct()
...
These new functions allow sparse to find failures to release
direct mode reducing chances of bugs over the claim_direct_mode()
functions that are deprecated.
This driver got partly converted during removal of the _scoped form.
However some more cases got added in parallel.
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Link: https://patch.msgid.link/20250217141630.897334-15-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-03-04 13:17:49 +00:00
Jonathan Cameron
e76750f50a
iio: adc: ad7768-1: Switch to sparse friendly iio_device_claim/release_direct()
...
These new functions allow sparse to find failures to release
direct mode reducing chances of bugs over the claim_direct_mode()
functions that are deprecated.
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Link: https://patch.msgid.link/20250217141630.897334-14-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-03-04 13:17:49 +00:00