Matti Vaittinen
7af2ea72d6
iio: adc: ti-adc128s052: Simplify using be16_to_cpu()
...
The register data is 12-bit big-endian data. Use be16_to_cpu() to do
the conversion, and simple bitwise AND for masking to make it more
obvious.
Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com >
Link: https://patch.msgid.link/8202060d90221beb9b8cf467606641349ad47fe9.1744022065.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-04-22 19:10:03 +01:00
Matti Vaittinen
085831cfce
dt-bindings: ROHM BD79104 ADC
...
The ROHM BD79104 is a 12-bit, 8-channel ADC with two power supply pins,
connected to SPI. It's worth noting the IC requires SPI MODE 3, (CPHA =
1, CPOL = 1).
I used an evaluation board "BD79104FV-EVK-001" from ROHM. With this
board I had problems to have things working correctly with higher SPI
clock frequencies. I didn't do thorough testing for maximum frequency
though. First attempt was 40M, then 20M and finally 4M. With 20M it
seemed as if the read values were shifted by 1 bit. With 4M it worked
fine.
The component data-sheet is not exact what comes to the maximum SPI
frequency. It says SPI frequency is 20M - "unless othervice specified".
Additionally, it says that maximum sampling rate is 1Mhz, and since
reading a sample requires writing the channel (16 bits) and reading
data (16 bits) - we get some upper limit from this.
>From the "frequency is 20M, unless othervice specified" I picked the
maximum frequency 20M - and did assumption that my problems with 20M
weren't related to the BD79104 - but to the evaluation board
"BD79104FV-EVK-001".
Add bindings for the ROHM BD79104 ADC.
Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com >
Reviewed-by: Conor Dooley <conor.dooley@microchip.com >
Link: https://patch.msgid.link/2a4c65ee35cb79c6b29dbc59cfd9bc7d615a08ac.1744022065.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-04-22 19:10:02 +01:00
Bartosz Golaszewski
c3c8492cec
iio: addac: ad74115: use new GPIO line value setter callbacks
...
struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Link: https://patch.msgid.link/20250409-gpiochip-set-rv-iio-v2-7-4b36428f39cb@linaro.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-04-22 19:10:02 +01:00
Bartosz Golaszewski
b8b3ea6429
iio: addac: ad74413r: use new GPIO line value setter callbacks
...
struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Link: https://patch.msgid.link/20250409-gpiochip-set-rv-iio-v2-6-4b36428f39cb@linaro.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-04-22 19:10:02 +01:00
Bartosz Golaszewski
3bb36fe058
iio: adc: ad4130: use new GPIO line value setter callbacks
...
struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Link: https://patch.msgid.link/20250409-gpiochip-set-rv-iio-v2-5-4b36428f39cb@linaro.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-04-22 19:10:02 +01:00
Bartosz Golaszewski
6c6881af01
iio: adc: ti-ads7950: use new GPIO line value setter callbacks
...
struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Link: https://patch.msgid.link/20250409-gpiochip-set-rv-iio-v2-4-4b36428f39cb@linaro.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-04-22 19:10:02 +01:00
Bartosz Golaszewski
8a2d2326f5
iio: dac: ad5592r: use new GPIO line value setter callbacks
...
struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Link: https://patch.msgid.link/20250409-gpiochip-set-rv-iio-v2-3-4b36428f39cb@linaro.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-04-22 19:10:02 +01:00
Bartosz Golaszewski
135e101f4d
iio: dac: ad5592r: use lock guards
...
Use lock guards from linux/cleanup.h to simplify the code and remove
some labels.
Note that we need to initialize some variables even though it's not
technically required as scoped_guards() are implemented as for loops.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Link: https://patch.msgid.link/20250409-gpiochip-set-rv-iio-v2-2-4b36428f39cb@linaro.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-04-22 19:10:02 +01:00
Bartosz Golaszewski
0f8d8b3548
iio: dac: ad5592r: destroy mutexes in detach paths
...
The locks used here are initialized but never released which causes
resource leaks with mutex debugging enabled. Add missing calls to
mutex_destroy() or use devres if applicable.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Link: https://patch.msgid.link/20250409-gpiochip-set-rv-iio-v2-1-4b36428f39cb@linaro.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-04-22 19:10:02 +01:00
Matti Vaittinen
a34b88b48a
iio: bd79124: Use set_rv and set_multiple_rv
...
The new GPIO callbacks 'set_rv' and 'set_multiple_rv' allow returning a
success code to indicate failures when setting GPIO status. Use them to
allow callers to know when things go south.
Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com >
Link: https://patch.msgid.link/Z_N_J52IZ2IaWawl@mva-rohm
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-04-22 19:10:02 +01:00
Jonathan Cameron
2a44c3ed80
MAINTAINERS: IIO: Update reviewers for the subsystem
...
Lars-Peter has not been active in IIO reviewing for some time. Without
David, Nuno and Andy, along with many others who review IIO patches, I
would not be able to keep up with the rate of change and would have
become a bottleneck to development.
Hence update the MAINTAINERS entry to more accurately reflect reality.
This is not intended to give the 3 of them any more work or to oblige
them to review any particular series, so if there are any series waiting
a long time continue to poke me via the list.
Acked-by: Andy Shevchenko <andy@kernel.org >
Acked-by: Lars-Peter Clausen <lars@metafoo.de >
Acked-by: David Lechner <dlechner@baylibre.com >
Link: https://patch.msgid.link/20250406153120.2129133-1-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-04-22 19:10:02 +01:00
Angelo Dureghello
e96d35faf3
iio: adc: ad7606: add SPI offload support
...
Add SPI offload support for this family.
Signed-off-by: Angelo Dureghello <adureghello@baylibre.com >
Reviewed-by: David Lechner <dlechner@baylibre.com >
Link: https://patch.msgid.link/20250403-wip-bl-spi-offload-ad7606-v1-3-1b00cb638b12@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-04-22 19:10:02 +01:00
Angelo Dureghello
89e1f95a61
doc: iio: ad7606: describe offload support
...
Add a section to the ad7606 documentation describing how to use the
driver with SPI offloading.
Signed-off-by: Angelo Dureghello <adureghello@baylibre.com >
Reviewed-by: David Lechner <dlechner@baylibre.com >
Link: https://patch.msgid.link/20250403-wip-bl-spi-offload-ad7606-v1-2-1b00cb638b12@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-04-22 19:10:02 +01:00
Angelo Dureghello
81fe5529e8
dt-bindings: iio: adc: adi,ad7606: add SPI offload properties
...
Add #trigger-source-cells property to allow the BUSY output to be
used as a SPI offload trigger source to indicate when a sample is ready
to be read.
Macros are added to adi,ad7606.h for the cell values to help with
readability since they are arbitrary values.
Signed-off-by: Angelo Dureghello <adureghello@baylibre.com >
Reviewed-by: Rob Herring (Arm) <robh@kernel.org >
Reviewed-by: David Lechner <dlechner@baylibre.com >
Link: https://patch.msgid.link/20250403-wip-bl-spi-offload-ad7606-v1-1-1b00cb638b12@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-04-22 19:10:01 +01:00
David Lechner
81a481f625
Documentation: iio: ad7380: add AD7389-4
...
Document support for AD7389-4 and it's quirks.
Signed-off-by: David Lechner <dlechner@baylibre.com >
Link: https://patch.msgid.link/20250401-iio-ad7380-add-ad7389-4-v1-5-23d2568aa24f@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-04-22 19:10:01 +01:00
David Lechner
98a0026748
iio: adc: ad7380: add ad7389-4
...
Add chip info for AD7389-4 to the ad7380 driver.
This is essentially the same as ad7380-4 except that it is internal-
reference-only instead of external-reference-only.
Signed-off-by: David Lechner <dlechner@baylibre.com >
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Link: https://patch.msgid.link/20250401-iio-ad7380-add-ad7389-4-v1-4-23d2568aa24f@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-04-22 19:10:01 +01:00
David Lechner
d63a749bf7
iio: adc: ad7380: move internal reference voltage to chip_info
...
Move the internal reference voltage value to the chip_info structure.
Before this change, only ADAQ chips could be internal_ref_only and only
non-ADAQ chips could be external_ref_only. Now, this restriction is
removed.
Signed-off-by: David Lechner <dlechner@baylibre.com >
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Link: https://patch.msgid.link/20250401-iio-ad7380-add-ad7389-4-v1-3-23d2568aa24f@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-04-22 19:10:01 +01:00
David Lechner
abb97cc0ff
iio: adc: ad7380: rename internal_ref_only
...
Rename adaq_internal_ref_only to internal_ref_only_adaq. There are non-
ADAQ chips in the family that are also internal reference only, so the
adaq_ prefix is misleading.
Signed-off-by: David Lechner <dlechner@baylibre.com >
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Link: https://patch.msgid.link/20250401-iio-ad7380-add-ad7389-4-v1-2-23d2568aa24f@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-04-22 19:10:01 +01:00
David Lechner
ebe0b2a86a
dt-bindings: iio: adc: ad7380: add AD7389-4
...
Add compatible and quirks for AD7389-4. This is essentially the same as
AD7380-4 but instead of having no internal reference, it has no external
reference voltage supply.
Signed-off-by: David Lechner <dlechner@baylibre.com >
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org >
Link: https://patch.msgid.link/20250401-iio-ad7380-add-ad7389-4-v1-1-23d2568aa24f@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-04-22 19:10:01 +01:00
Jonathan Cameron
5d1dff5b45
iio: Adjust internals of handling of direct mode claiming to suit new API.
...
Now there are no remaining callers of iio_device_claim_direct_mode()
and iio_device_release_direct_mode() rename those functions to ensure
they are not used in new drivers. Also make them now return booleans
in line with the sparse friendly static inline wrappers.
Reviewed-by: David Lechner <dlechner@baylibre.com >
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com >
Link: https://patch.msgid.link/20250331121317.1694135-38-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-04-22 19:10:01 +01:00
Jonathan Cameron
692760702f
staging: iio: ad5933: 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: David Lechner <dlechner@baylibre.com >
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com >
Link: https://patch.msgid.link/20250331121317.1694135-37-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-04-22 19:10:01 +01:00
Jonathan Cameron
e2729d5e04
iio: temp: maxim_thermocouple: Drop unused mutex.h include.
...
There are no mutex related calls in this driver.
Reviewed-by: David Lechner <dlechner@baylibre.com >
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com >
Link: https://patch.msgid.link/20250331121317.1694135-36-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-04-22 19:10:01 +01:00
Jonathan Cameron
3332487099
iio: temp: maxim_thermocouple: 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.
Tidy up a few direct returns whilst here.
Reviewed-by: David Lechner <dlechner@baylibre.com >
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com >
Link: https://patch.msgid.link/20250331121317.1694135-35-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-04-22 19:10:01 +01:00
Jonathan Cameron
0ed4424478
iio: proximity: sx9500: 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: David Lechner <dlechner@baylibre.com >
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com >
Link: https://patch.msgid.link/20250331121317.1694135-34-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-04-22 19:10:01 +01:00
Jonathan Cameron
3e3f57659b
iio: proximity: pulsed-light: 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: David Lechner <dlechner@baylibre.com >
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com >
Link: https://patch.msgid.link/20250331121317.1694135-33-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-04-22 19:10:01 +01:00
Jonathan Cameron
9dc7ed3bfe
iio: proximity: hx9023s: 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: Yasin Lee <yasin.lee.x@gmail.com >
Reviewed-by: David Lechner <dlechner@baylibre.com >
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com >
Link: https://patch.msgid.link/20250331121317.1694135-32-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-04-22 19:10:01 +01:00
Jonathan Cameron
66024cb953
iio: pressure: zpa2326: 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: David Lechner <dlechner@baylibre.com >
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com >
Link: https://patch.msgid.link/20250331121317.1694135-31-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-04-22 19:10:00 +01:00
Jonathan Cameron
71a998e791
iio: pressure: rohm-bm1390: 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: Matti Vaittinen <mazziesaccount@gmail.com >
Reviewed-by: David Lechner <dlechner@baylibre.com >
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com >
Link: https://patch.msgid.link/20250331121317.1694135-30-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-04-22 19:10:00 +01:00
Jonathan Cameron
1bfa7698bc
iio: pressure: ms5611: 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: David Lechner <dlechner@baylibre.com >
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com >
Link: https://patch.msgid.link/20250331121317.1694135-29-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-04-22 19:10:00 +01:00
Jonathan Cameron
d2de91b3ed
iio: pressure: mpl3115: 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: David Lechner <dlechner@baylibre.com >
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com >
Link: https://patch.msgid.link/20250331121317.1694135-28-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-04-22 19:10:00 +01:00
Jonathan Cameron
770ee1a2c5
iio: pressure: mpl3115: factor out core of IIO_INFO_RAW read to simplify code flow
...
Apply guard(mutex) to remove the need for manual release of the lock.
Factor out the code that occurs under the direct claim.
These two changes allow for direct returns simplifying code flow.
Reviewed-by: David Lechner <dlechner@baylibre.com >
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com >
Link: https://patch.msgid.link/20250331121317.1694135-27-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-04-22 19:10:00 +01:00
Jonathan Cameron
b2a3a51000
iio: pressure: icp10100: 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.
Acked-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com >
Reviewed-by: David Lechner <dlechner@baylibre.com >
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com >
Link: https://patch.msgid.link/20250331121317.1694135-26-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-04-22 19:10:00 +01:00
Jonathan Cameron
74fc7aacda
iio: pressure: dlhl60d: 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: David Lechner <dlechner@baylibre.com >
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com >
Link: https://patch.msgid.link/20250331121317.1694135-25-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-04-22 19:10:00 +01:00
Jonathan Cameron
e0a4d6a93e
iio: magnetometer: rm3100: 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: David Lechner <dlechner@baylibre.com >
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com >
Link: https://patch.msgid.link/20250331121317.1694135-24-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-04-22 19:10:00 +01:00
Jonathan Cameron
587895606e
iio: magnetometer: mag3110: 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: David Lechner <dlechner@baylibre.com >
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com >
Link: https://patch.msgid.link/20250331121317.1694135-23-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-04-22 19:10:00 +01:00
Jonathan Cameron
b5228482eb
iio: magnetometer: mag3110: Factor out core of read/write_raw() and use guard() to simplify code flow.
...
The combination of guard(mutex) and factoring out sections of code
that occur with the device held in direct mode simplifies code flow.
Reviewed-by: David Lechner <dlechner@baylibre.com >
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com >
Link: https://patch.msgid.link/20250331121317.1694135-22-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-04-22 19:10:00 +01:00
Jonathan Cameron
0daeba3eda
iio: imu: st_lsm6dsx: 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.
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org >
Reviewed-by: David Lechner <dlechner@baylibre.com >
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com >
Link: https://patch.msgid.link/20250331121317.1694135-21-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-04-22 19:10:00 +01:00
Jonathan Cameron
a332a90eac
iio: imu: st_lsm6dsx: Switch to sparse friendly claim/release_direct()
...
This driver caused a false positive with __cond_lock() style solution
but is fine with the simple boolean return approach now used.
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org >
Reviewed-by: David Lechner <dlechner@baylibre.com >
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com >
Link: https://patch.msgid.link/20250331121317.1694135-20-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-04-22 19:10:00 +01:00
Jonathan Cameron
ee56bbcaad
iio: imu: st_lsm6dsx: Factor out parts of st_lsm6dsx_shub_write_raw() to allow direct returns
...
By factoring out all the code that occurs with direct mode claimed
to a helper function, that helper function can directly return simplifying
code flow.
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org >
Reviewed-by: David Lechner <dlechner@baylibre.com >
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com >
Link: https://patch.msgid.link/20250331121317.1694135-19-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-04-22 19:09:59 +01:00
Jonathan Cameron
59d3109aab
iio: imu: smi240: 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: Shen Jianping <Jianping.Shen@de.bosch.com >
Reviewed-by: David Lechner <dlechner@baylibre.com >
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com >
Link: https://patch.msgid.link/20250331121317.1694135-18-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-04-22 19:09:59 +01:00
Jonathan Cameron
4455bc5c30
iio: imu: inv_mpu6050: 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.
Acked-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com >
Reviewed-by: David Lechner <dlechner@baylibre.com >
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com >
Link: https://patch.msgid.link/20250331121317.1694135-17-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-04-22 19:09:59 +01:00
Jonathan Cameron
cbff19a382
iio: imu: inv_icm42600: 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.
Acked-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com >
Reviewed-by: David Lechner <dlechner@baylibre.com >
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com >
Link: https://patch.msgid.link/20250331121317.1694135-16-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-04-22 19:09:59 +01:00
Jonathan Cameron
ca75b9fb28
iio: humidity: hts211: 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.
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org >
Reviewed-by: David Lechner <dlechner@baylibre.com >
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com >
Link: https://patch.msgid.link/20250331121317.1694135-15-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-04-22 19:09:59 +01:00
Jonathan Cameron
db532a4114
iio: humidity: hts211: Factor out everything under direct mode claim into helper functions.
...
Pulling out the functionality of read_raw() and write_raw() callbacks
so that only the mode claim is done in the initial call allows for
direct returns and simpler error handling in the new __hts211_write_raw()
/ __hts211_read_raw() functions.
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org >
Reviewed-by: David Lechner <dlechner@baylibre.com >
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com >
Link: https://patch.msgid.link/20250331121317.1694135-14-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-04-22 19:09:59 +01:00
Jonathan Cameron
35a34861ce
iio: humidity: hdc2010: 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.
Acked-by: Eugene Zaikonnikov <ez@norphonic.com >
Reviewed-by: David Lechner <dlechner@baylibre.com >
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com >
Link: https://patch.msgid.link/20250331121317.1694135-13-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-04-22 19:09:59 +01:00
Jonathan Cameron
0d51e888e0
iio: humidity: hdc100x: 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: David Lechner <dlechner@baylibre.com >
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com >
Link: https://patch.msgid.link/20250331121317.1694135-12-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-04-22 19:09:59 +01:00
Jonathan Cameron
d9e6b59e5b
iio: humidity: hdc100x: Use guard(mutex) to simplify code flow
...
By using autoreleasing on the lock a number of paths can use
direct returns allow earlier exit from functions.
Reviewed-by: David Lechner <dlechner@baylibre.com >
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com >
Link: https://patch.msgid.link/20250331121317.1694135-11-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-04-22 19:09:59 +01:00
Jonathan Cameron
6c9dc1e8f2
iio: health: max30102: 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 particular case is about ensuring
the mode does not change rather than ensuring we are in direct mode.
A follow up may cleanup the buffer mode claim.
Reviewed-by: David Lechner <dlechner@baylibre.com >
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com >
Link: https://patch.msgid.link/20250331121317.1694135-10-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-04-22 19:09:59 +01:00
Jonathan Cameron
fcc065fdf5
iio: gyro: adxrs290: 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: Nishant Malpani <nish.malpani25@gmail.com >
Reviewed-by: David Lechner <dlechner@baylibre.com >
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com >
Link: https://patch.msgid.link/20250331121317.1694135-9-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-04-22 19:09:59 +01:00
Jonathan Cameron
f664ab98b2
iio: common: st_sensors: 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: David Lechner <dlechner@baylibre.com >
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com >
Link: https://patch.msgid.link/20250331121317.1694135-8-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-04-22 19:09:59 +01:00