Tóth János
844ca960df
dt-bindings: trivial-devices: Document SEN0322
...
Add documentation for the DFRobot SEN0322 oxygen sensor.
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org >
Signed-off-by: Tóth János <gomba007@gmail.com >
Link: https://patch.msgid.link/20250506-iio-chemical-sen0322-v4-1-1465ac8dc190@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-05-21 14:22:32 +01:00
Jonathan Santos
034c71a287
iio: adc: ad7768-1: reorganize driver headers
...
Remove kernel.h since it adds a lot of unnecessary dependencies.
Add specific headers to ensure all functions and macros used in the driver
are directly declared.
Suggested-by: Andy Shevchenko <andy@kernel.org >
Signed-off-by: Jonathan Santos <Jonathan.Santos@analog.com >
Reviewed-by: Andy Shevchenko <andy@kernel.org >
Link: https://patch.msgid.link/1f7677d31a0165cb30d7eb3b4d613e1337937f9a.1746662899.git.Jonathan.Santos@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-05-21 14:22:32 +01:00
David Lechner
018f50909e
iio: bmp280: zero-init buffer
...
Zero-initialize the buffer used with iio_push_to_buffers_with_ts(). The
struct used for the buffer has holes in it, so we need to make sure that
the holes are zeroed out rather than containing uninitialized data from
the stack.
Reported-by: Dan Carpenter <dan.carpenter@linaro.org >
Closes: https://lore.kernel.org/linux-iio/aBoBR5D1UMjsSUfZ@stanley.mountain/
Fixes: 872c8014e0 ("iio: pressure: bmp280: drop sensor_data array")
Signed-off-by: David Lechner <dlechner@baylibre.com >
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Link: https://patch.msgid.link/20250506-iio-pressure-bmp280-zero-init-buffer-v1-1-0935c31558ac@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-05-21 14:22:02 +01:00
Ahelenia Ziemiańska
ed7a1e88ad
iio: ssp_sensors: optimalize -> optimize
...
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz >
Link: https://patch.msgid.link/5a64aa3034c6127d7587de9b7045a12892c01ee5.1746558529.git.nabijaczleweli@nabijaczleweli.xyz
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-05-21 14:21:34 +01:00
Chelsy Ratnawat
27737b8407
HID: sensor-hub: Fix typo and improve documentation
...
Includes the following corrections -
- Changed Measurment -> Measurement
- Changed clode -> close
- Gyro -> gyro
Signed-off-by: Chelsy Ratnawat <chelsyratnawat2001@gmail.com >
Reviewed-by: David Lechner <dlechner@baylibre.com >
Link: https://patch.msgid.link/20250507055745.4069933-1-chelsyratnawat2001@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-05-21 14:21:34 +01:00
Colin Ian King
6cdb4009c2
iio: admv1013: replace redundant ternary operator with just len
...
The variable ret is being assigned a return value and non-zero error
return paths are taken at all stages. At the end of the function ret
is always zero, so the ternary operator checking for zero ret is
redundant and can be replaced with just len instead.
Signed-off-by: Colin Ian King <colin.i.king@gmail.com >
Reviewed-by: David Lechner <dlechner@baylibre.com >
Link: https://patch.msgid.link/20250507134502.254736-1-colin.i.king@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-05-21 14:21:34 +01:00
Dan Carpenter
805bbd3ac9
iio: chemical: mhz19b: Fix error code in probe()
...
Return -ENOMEM if devm_iio_device_alloc() fails. Don't return success.
Fixes: 4572a70b36 ("iio: chemical: Add support for Winsen MHZ19B CO2 sensor")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org >
Reviewed-by: David Lechner <dlechner@baylibre.com >
Acked-by: Gyeyoung Baek <gye976@gmail.com >
Link: https://patch.msgid.link/aBtZFLFlr0slcYSi@stanley.mountain
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-05-21 14:21:08 +01:00
David Lechner
04c1290776
iio: adc: at91-sama5d2: use IIO_DECLARE_BUFFER_WITH_TS
...
Use IIO_DECLARE_BUFFER_WITH_TS() to declare the buffer that gets used
with iio_push_to_buffers_with_ts(). This makes the code a bit easier to
read and understand.
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Signed-off-by: David Lechner <dlechner@baylibre.com >
Link: https://patch.msgid.link/20250507-iio-introduce-iio_declare_buffer_with_ts-v6-7-4aee1b9f1b89@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-05-21 14:20:32 +01:00
David Lechner
edeb67fbbf
iio: accel: sca3300: use IIO_DECLARE_BUFFER_WITH_TS
...
Use IIO_DECLARE_BUFFER_WITH_TS() to declare the buffer that gets used
with iio_push_to_buffers_with_ts(). This makes the code a bit easier to
read and understand.
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Signed-off-by: David Lechner <dlechner@baylibre.com >
Link: https://patch.msgid.link/20250507-iio-introduce-iio_declare_buffer_with_ts-v6-6-4aee1b9f1b89@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-05-21 14:20:32 +01:00
David Lechner
6d06978f91
iio: adc: ad7380: use IIO_DECLARE_DMA_BUFFER_WITH_TS
...
Use IIO_DECLARE_DMA_BUFFER_WITH_TS() to declare the buffer that gets
used with iio_push_to_buffers_with_ts(). This makes the code a bit
easier to read and understand.
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Signed-off-by: David Lechner <dlechner@baylibre.com >
Link: https://patch.msgid.link/20250507-iio-introduce-iio_declare_buffer_with_ts-v6-5-4aee1b9f1b89@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-05-21 14:20:32 +01:00
David Lechner
76a67e394d
iio: adc: ad4695: rename AD4695_MAX_VIN_CHANNELS
...
Rename AD4695_MAX_CHANNELS to AD4695_MAX_VIN_CHANNELS. It has been a
point of confusion that this macro is only the voltage input channels
and not all channels.
Reviewed-by: Trevor Gamblin <tgamblin@baylibre.com >
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Signed-off-by: David Lechner <dlechner@baylibre.com >
Link: https://patch.msgid.link/20250507-iio-introduce-iio_declare_buffer_with_ts-v6-4-4aee1b9f1b89@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-05-21 14:20:31 +01:00
David Lechner
51924ff5ab
iio: adc: ad4695: use IIO_DECLARE_DMA_BUFFER_WITH_TS
...
Use IIO_DECLARE_DMA_BUFFER_WITH_TS() to declare the buffer that gets
used with iio_push_to_buffers_with_ts(). This makes the code a bit
easier to read and understand.
Reviewed-by: Trevor Gamblin <tgamblin@baylibre.com >
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Signed-off-by: David Lechner <dlechner@baylibre.com >
Link: https://patch.msgid.link/20250507-iio-introduce-iio_declare_buffer_with_ts-v6-3-4aee1b9f1b89@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-05-21 14:20:31 +01:00
David Lechner
63fc53526d
iio: introduce IIO_DECLARE_BUFFER_WITH_TS macros
...
Add new macros to help with the common case of declaring a buffer that
is safe to use with iio_push_to_buffers_with_ts(). This is not trivial
to do correctly because of the alignment requirements of the timestamp.
This will make it easier for both authors and reviewers.
To avoid double __align() attributes in cases where we also need DMA
alignment, add a 2nd variant IIO_DECLARE_DMA_BUFFER_WITH_TS().
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Signed-off-by: David Lechner <dlechner@baylibre.com >
Link: https://patch.msgid.link/20250507-iio-introduce-iio_declare_buffer_with_ts-v6-2-4aee1b9f1b89@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-05-21 14:20:31 +01:00
David Lechner
fa19c30325
iio: make IIO_DMA_MINALIGN minimum of 8 bytes
...
Add a condition to ensure that IIO_DMA_MINALIGN is at least 8 bytes.
On some 32-bit architectures, IIO_DMA_MINALIGN is 4. In many cases,
drivers are using this alignment for buffers that include a 64-bit
timestamp that is used with iio_push_to_buffers_with_ts(), which expects
the timestamp to be aligned to 8 bytes. To handle this, we can just make
IIO_DMA_MINALIGN at least 8 bytes.
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Signed-off-by: David Lechner <dlechner@baylibre.com >
Link: https://patch.msgid.link/20250507-iio-introduce-iio_declare_buffer_with_ts-v6-1-4aee1b9f1b89@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-05-21 14:20:31 +01:00
David Lechner
666eae6c6d
iio: pressure: zpa2326_spi: remove bits_per_word = 8
...
Remove setting bits_per_word = 8 from the zpa2326 driver. This is the
default value for SPI transfers, so it is not necessary to explicitly
set it.
Signed-off-by: David Lechner <dlechner@baylibre.com >
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Link: https://patch.msgid.link/20250505-iio-remove-bits_per_word-8-v1-14-341f85fcfe11@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-05-21 14:20:31 +01:00
David Lechner
5b6bfe1354
iio: pressure: ms5611_spi: remove bits_per_word = 8
...
Remove setting bits_per_word = 8 from the ms5611 driver. This is the
default value for SPI transfers, so it is not necessary to explicitly
set it.
Signed-off-by: David Lechner <dlechner@baylibre.com >
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Link: https://patch.msgid.link/20250505-iio-remove-bits_per_word-8-v1-13-341f85fcfe11@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-05-21 14:20:31 +01:00
David Lechner
10918e71ac
iio: pressure: bmp280-spi: remove bits_per_word = 8
...
Remove setting bits_per_word = 8 from the bmp280 driver. This is the
default value for SPI transfers, so it is not necessary to explicitly
set it.
Since no other SPI settings are changed, we can also remove the call to
spi_setup().
Signed-off-by: David Lechner <dlechner@baylibre.com >
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Link: https://patch.msgid.link/20250505-iio-remove-bits_per_word-8-v1-12-341f85fcfe11@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-05-21 14:20:31 +01:00
David Lechner
3108b5e0bc
iio: magnetometer: rm3100-spi: remove bits_per_word = 8
...
Remove setting bits_per_word = 8 from the rm3100 driver. This is the
default value for SPI transfers, so it is not necessary to explicitly
set it.
Signed-off-by: David Lechner <dlechner@baylibre.com >
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Link: https://patch.msgid.link/20250505-iio-remove-bits_per_word-8-v1-11-341f85fcfe11@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-05-21 14:20:31 +01:00
David Lechner
c48919febc
iio: magnetometer: hmc5843_spi: remove bits_per_word = 8
...
Remove setting bits_per_word = 8 from the hmc5843 driver. This is the
default value for SPI transfers, so it is not necessary to explicitly
set it.
Signed-off-by: David Lechner <dlechner@baylibre.com >
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Link: https://patch.msgid.link/20250505-iio-remove-bits_per_word-8-v1-10-341f85fcfe11@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-05-21 14:20:31 +01:00
David Lechner
6a1ebdb8a3
iio: imu: adis: remove bits_per_word = 8
...
Remove setting bits_per_word = 8 from the adis driver. This is the
default value for SPI transfers, so it is not necessary to explicitly
set it.
Signed-off-by: David Lechner <dlechner@baylibre.com >
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Link: https://patch.msgid.link/20250505-iio-remove-bits_per_word-8-v1-9-341f85fcfe11@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-05-21 14:20:31 +01:00
David Lechner
3de7492148
iio: gyro: adxrs450: remove bits_per_word = 8
...
Remove setting bits_per_word = 8 from the adxrs450 driver. This is the
default value for SPI transfers, so it is not necessary to explicitly
set it.
Signed-off-by: David Lechner <dlechner@baylibre.com >
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Link: https://patch.msgid.link/20250505-iio-remove-bits_per_word-8-v1-8-341f85fcfe11@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-05-21 14:20:31 +01:00
David Lechner
bfc50ab35a
iio: dac: ltc2688: remove bits_per_word = 8
...
Remove setting bits_per_word = 8 from the ltc2688 driver. This is the
default value for SPI transfers, so it is not necessary to explicitly
set it.
Signed-off-by: David Lechner <dlechner@baylibre.com >
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Link: https://patch.msgid.link/20250505-iio-remove-bits_per_word-8-v1-7-341f85fcfe11@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-05-21 14:20:31 +01:00
David Lechner
3cdd2953b3
iio: dac: ad5791: remove bits_per_word = 8
...
Remove setting bits_per_word = 8 from the ad5791 driver. This is the
default value for SPI transfers, so it is not necessary to explicitly
set it.
Signed-off-by: David Lechner <dlechner@baylibre.com >
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Link: https://patch.msgid.link/20250505-iio-remove-bits_per_word-8-v1-6-341f85fcfe11@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-05-21 14:20:30 +01:00
David Lechner
57e382e67c
iio: dac: ad5766: remove bits_per_word = 8
...
Remove setting bits_per_word = 8 from the ad5766 driver. This is the
default value for SPI transfers, so it is not necessary to explicitly
set it.
Signed-off-by: David Lechner <dlechner@baylibre.com >
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Link: https://patch.msgid.link/20250505-iio-remove-bits_per_word-8-v1-5-341f85fcfe11@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-05-21 14:20:30 +01:00
David Lechner
f92bb6b71b
iio: dac: ad5761: remove bits_per_word = 8
...
Remove setting bits_per_word = 8 from the ad5761 driver. This is the
default value for SPI transfers, so it is not necessary to explicitly
set it.
Signed-off-by: David Lechner <dlechner@baylibre.com >
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Link: https://patch.msgid.link/20250505-iio-remove-bits_per_word-8-v1-4-341f85fcfe11@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-05-21 14:20:30 +01:00
David Lechner
2fa33f8710
iio: chemical: bme680_spi: remove bits_per_word = 8
...
Remove setting bits_per_word = 8 from the bme680 driver. This is the
default value for SPI transfers, so it is not necessary to explicitly
set it.
Since no other SPI settings are changed, we can also remove the call to
spi_setup().
Signed-off-by: David Lechner <dlechner@baylibre.com >
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Link: https://patch.msgid.link/20250505-iio-remove-bits_per_word-8-v1-3-341f85fcfe11@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-05-21 14:20:30 +01:00
David Lechner
0115e17e9f
iio: adc: ti-tsc2046: remove bits_per_word = 8
...
Remove setting bits_per_word = 8 from the ti-tsc2046 driver. This is the
default value for SPI transfers, so it is not necessary to explicitly
set it.
Signed-off-by: David Lechner <dlechner@baylibre.com >
Reviewed-by: Oleksij Rempel <o.rempel@pengutronix.de >
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Link: https://patch.msgid.link/20250505-iio-remove-bits_per_word-8-v1-2-341f85fcfe11@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-05-21 14:20:30 +01:00
David Lechner
02b70dfe2f
iio: adc: ad4030: remove bits_per_word = 8
...
Remove setting bits_per_word = 8 from the ad4030 driver. This is the
default value for SPI transfers, so it is not necessary to explicitly
set it.
Signed-off-by: David Lechner <dlechner@baylibre.com >
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Link: https://patch.msgid.link/20250505-iio-remove-bits_per_word-8-v1-1-341f85fcfe11@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-05-21 14:20:30 +01:00
Arthur-Prince
3c5dfea39a
iio: adc: ti-ads1298: Kconfig: add kfifo dependency to fix module build
...
Add dependency to Kconfig’s ti-ads1298 because compiling it as a module
failed with an undefined kfifo symbol.
Fixes: 00ef7708fa ("iio: adc: ti-ads1298: Add driver")
Signed-off-by: Arthur-Prince <r2.arthur.prince@gmail.com >
Co-developed-by: Mariana Valério <mariana.valerio2@hotmail.com >
Signed-off-by: Mariana Valério <mariana.valerio2@hotmail.com >
Link: https://patch.msgid.link/20250430191131.120831-1-r2.arthur.prince@gmail.com
Cc: <Stable@vger.kernel.org >
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-05-21 14:20:30 +01:00
Matti Vaittinen
157517b5e8
iio: ti-adc128s052: Drop variable vref
...
According to Jonathan, variable reference voltages are very rare. It is
unlikely it is needed, and supporting it makes the code a bit more
complex.
Simplify the driver and drop the variable vref support.
Suggested-by: Jonathan Cameron <jic23@kernel.org >
Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com >
Reviewed-by: David Lechner <dlechner@baylibre.com >
Link: https://patch.msgid.link/59106e24332743a7f9eb0b13ad6a2f5595ab485a.1745823530.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-05-21 14:20:30 +01:00
Marcelo Schmitt
ce45446e52
iio: adc: ad4000: Avoid potential double data word read
...
Currently, SPI-Engine offload module always sends 32-bit data elements to
DMA engine. Appropriately, when set for SPI offloading, the IIO driver uses
32 storagebits for IIO ADC channel buffer elements. However, setting SPI
transfer length according to storagebits (32-bits in case of offload) can
lead to unnecessarily long transfers for ADCs that are 16-bit or less
precision. Adjust AD4000 single-shot read to run transfers of 2 bytes when
that is enough to get all ADC data bits.
Fixes: 59b51edf71 ("iio: adc: ad4000: Add support for SPI offload")
Suggested-by: David Lechner <dlechner@baylibre.com >
Signed-off-by: Marcelo Schmitt <marcelo.schmitt@analog.com >
Reviewed-by: David Lechner <dlechner@baylibre.com >
Link: https://patch.msgid.link/8f765cfd6e93fad4e755dd95d709b7bea2a388e2.1744718916.git.marcelo.schmitt@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-05-21 14:20:30 +01:00
Marcus Folkesson
f45a27b990
iio: adc: mcp3911: add reset management
...
Add support for optional HW reset.
If specified, a reset will be asserted during driver probe.
Co-developed-by: Lukas Rauber <lukas.rauber@janitza.de >
Signed-off-by: Lukas Rauber <lukas.rauber@janitza.de >
Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com >
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Link: https://patch.msgid.link/20250428-mcp3911-fixes-v2-3-406e39330c3d@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-05-21 14:20:30 +01:00
Marcus Folkesson
94264cc9ab
dt-bindings: iio: adc: mcp3911: add reset-gpios
...
The MCP391X family provides an active low reset signal that is still not
described in the bindings.
Add reset-gpios to the bindings and the example.
Co-developed-by: Lukas Rauber <lukas.rauber@janitza.de >
Signed-off-by: Lukas Rauber <lukas.rauber@janitza.de >
Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com >
Acked-by: Conor Dooley <conor.dooley@microchip.com >
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org >
Link: https://patch.msgid.link/20250428-mcp3911-fixes-v2-2-406e39330c3d@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-05-21 14:20:30 +01:00
Marcus Folkesson
f62c49d8f3
iio: adc: mcp3911: fix device dependent mappings for conversion result registers
...
The conversion result registers differs between devices. Make sure the
mapping is correct by using a device dependent .get_raw() callback function.
Fixes: 732ad34260 ("iio: adc: mcp3911: add support for the whole MCP39xx family")
Co-developed-by: Lukas Rauber <lukas.rauber@janitza.de >
Signed-off-by: Lukas Rauber <lukas.rauber@janitza.de >
Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com >
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Link: https://patch.msgid.link/20250428-mcp3911-fixes-v2-1-406e39330c3d@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-05-21 14:20:30 +01:00
David Lechner
15c82338b3
iio: adc: ad4695: use u16 for buffer elements
...
Change the type of the buffer elements to u16 since we currently only
support 16-bit word size. The code was originally written to also allow
for 32-bit word size when oversampling is enabled, but so far,
oversampling is only implemented when using SPI offload and therefore
doesn't use this buffer.
AD4695_MAX_CHANNEL_SIZE macro is dropped since it no longer adds any
value.
AD4695_MAX_CHANNELS + 2 is changed to AD4695_MAX_CHANNELS + 1 because
previously we were overallocating. AD4695_MAX_CHANNELS is the number of
of voltage channels and + 1 is for the temperature channel.
Signed-off-by: David Lechner <dlechner@baylibre.com >
Reviewed-by: Trevor Gamblin <tgamblin@baylibre.com >
Link: https://patch.msgid.link/20250428-iio-introduce-iio_declare_buffer_with_ts-v4-2-6f7f6126f1cb@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-05-21 14:20:29 +01:00
Kim Seer Paller
93583174a3
iio: dac: ad3530r: Add driver for AD3530R and AD3531R
...
The AD3530/AD3530R (8-channel) and AD3531/AD3531R (4-channel) are
low-power, 16-bit, buffered voltage output DACs with software-
programmable gain controls, providing full-scale output spans of 2.5V or
5V for reference voltages of 2.5V. These devices operate from a single
2.7V to 5.5V supply and are guaranteed monotonic by design. The "R"
variants include a 2.5V, 5ppm/°C internal reference, which is disabled
by default.
Support for monitoring internal die temperature, output voltages, and
current of a selected channel via the MUXOUT pin using an external ADC
is currently not implemented.
Reviewed-by: David Lechner <dlechner@baylibre.com >
Signed-off-by: Kim Seer Paller <kimseer.paller@analog.com >
Reviewed-by: Andy Shevchenko <andy@kernel.org >
Link: https://patch.msgid.link/20250429-togreg-v7-3-0af9c543b545@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-05-21 14:20:29 +01:00
Kim Seer Paller
6856e36171
dt-bindings: iio: dac: Add adi,ad3530r.yaml
...
Document the AD3530/AD3530R (8-channel) and AD3531/AD3531R (4-channel)
low-power, 16-bit, buffered voltage output DACs with software-
programmable gain controls. They provide full-scale output spans of 2.5V
or 5V for reference voltages of 2.5V. These devices operate on a single
2.7V to 5.5V supply and are guaranteed to be monotonic by design.
The "R" variants include a 2.5V, 5ppm/°C internal reference, which is
disabled by default.
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org >
Reviewed-by: David Lechner <dlechner@baylibre.com >
Signed-off-by: Kim Seer Paller <kimseer.paller@analog.com >
Link: https://patch.msgid.link/20250429-togreg-v7-2-0af9c543b545@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-05-21 14:20:29 +01:00
Kim Seer Paller
0cec113181
iio: ABI: add new DAC powerdown mode
...
Add a new powerdown mode for DACs with 7.7kohm and 32kohm resistor
to GND.
Reviewed-by: David Lechner <dlechner@baylibre.com >
Signed-off-by: Kim Seer Paller <kimseer.paller@analog.com >
Link: https://patch.msgid.link/20250429-togreg-v7-1-0af9c543b545@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-05-21 14:20:29 +01:00
Chelsy Ratnawat
7e00d74eac
HID: sensor-hub: Fix typo and improve documentation for sensor_hub_remove_callback()
...
Fixed a typo in "registered" and improved grammar for better readability
and consistency with kernel-doc standards. No functional changes.
Signed-off-by: Chelsy Ratnawat <chelsyratnawat2001@gmail.com >
Reviewed-by: David Lechner <dlechner@baylibre.com >
Link: https://patch.msgid.link/20250502003655.1943000-1-chelsyratnawat2001@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-05-21 14:20:29 +01:00
David Lechner
413e1d6a95
iio: adc: ad7606: explicit timestamp alignment
...
Use struct with aligned_s64 timestamp to make timestamp alignment
explicit. Technically, what we have works because for all known
architectures, IIO_DMA_MINALIGN is a multiple of __alignof__(s64).
But this way, we don't have to make people read the comments to know
why there are extra elements in each buffer.
Signed-off-by: David Lechner <dlechner@baylibre.com >
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Link: https://patch.msgid.link/20250428-iio-adc-ad7606-fix-buffer-alignment-v1-1-88dfc57e5df0@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-05-21 14:20:29 +01:00
Antoniu Miclaus
64794edd47
MAINTAINERS: add maintainers for ad4851 driver
...
Add the ad4851 entry in the MAINTAINERS file.
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com >
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Link: https://patch.msgid.link/20250502100016.26279-1-antoniu.miclaus@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-05-21 14:20:29 +01:00
David Lechner
017294e5a6
iio: adc: ad7606_spi: add offload scan mask check
...
Validate the scan mask when SPI offloading is being used.
Since this family of ADCs is simultaneous sampling, there isn't a way
to selectively disable channels when reading sample data. (Technically,
AD7616 has a sequencer so the driver could have some control, but that
is for another day).
For "regular" IIO triggered buffer reads, this isn't a problem and the
IIO core will demux the data and ignore data from disabled channels.
However, since SPI offloading is done completely in hardware, we don't
have a way to do the same. So before this patch, if less than all
channels were enabled, the data would be misplaced in the buffer.
By adding a check in update_scan_mode, we can fail to enable the buffer
instead of having bad data returned to userspace.
Fixes: e96d35faf3 ("iio: adc: ad7606: add SPI offload support")
Signed-off-by: David Lechner <dlechner@baylibre.com >
Reviewed-by: Andy Shevchenko <andy@kernel.org >
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Link: https://patch.msgid.link/20250502-iio-adc-ad7606_spi-fix-offload-scan-mask-check-v2-1-e70c6d71baa3@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-05-21 14:20:29 +01:00
AngeloGioacchino Del Regno
6eb974967a
dt-bindings: iio: adc: Add compatible for Dimensity 1200 MT6893
...
Add a compatible for the Dimensity 1200 (MT6893) SoC; The AUXADC
IP in this chip is fully compatible with the one found in MT8173.
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com >
Acked-by: Rob Herring (Arm) <robh@kernel.org >
Link: https://patch.msgid.link/20250416120235.147889-1-angelogioacchino.delregno@collabora.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-05-21 14:20:29 +01:00
Antoniu Miclaus
cdbc8b99ad
iio: dac: ad7293: add adc reference configuration
...
Add support for configurating the ADC reference (internal/external).
According to the datasheet, the external reference is enabled by
default.
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com >
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Link: https://patch.msgid.link/20250422085529.4407-2-antoniu.miclaus@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-05-21 14:20:29 +01:00
Antoniu Miclaus
55d0392fb1
dt-bindings: iio: dac: ad7293: add vrefin support
...
Add support for vrefin supply responsible for providing external
reference to the SAR ADC within the part.
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com >
Acked-by: Rob Herring (Arm) <robh@kernel.org >
Link: https://patch.msgid.link/20250422085529.4407-1-antoniu.miclaus@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-05-21 14:20:29 +01:00
Arthur Pilone
fc0b0e8226
iio: adc: ad7091r-base: Remove duplicate code on volatile reg check
...
Both ad7091r_writeable_reg() and ad7091r_volatile_reg() perform the
same test, checking whether a given 'reg' code is
AD7091R_REG_RESULT or AD7091R_REG_ALERT. As the volatile ad7091r
registers happen to be the only read-only ones, the volatile_reg()
function now returns the negated output of writeable_reg().
Co-developed-by: Bruno Stephan <bruno.stephan@usp.br >
Signed-off-by: Bruno Stephan <bruno.stephan@usp.br >
Co-developed-by: Andre de Lima <aschwarz@usp.br >
Signed-off-by: Andre de Lima <aschwarz@usp.br >
Signed-off-by: Arthur Pilone <art.pilone@gmail.com >
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com >
Link: https://patch.msgid.link/20250421145534.91146-1-arthurpilone@usp.br
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-05-21 14:20:29 +01:00
David Lechner
872c8014e0
iio: pressure: bmp280: drop sensor_data array
...
Drop the sensor_data array from struct bmp280_data and replace it using
local structs in each interrupt handler.
The sensor_data array in struct bmp280_data is not used to share data
between functions and isn't used for DMA, so there isn't really a need
to have it in the struct. Instead, we can use the struct pattern for
scan data in each interrupt handler. This has the advantage of allowing
us to see the actual layout of each scan buffer for each different type
of supported sensor. It also avoid juggling values between local
variables and the array which makes the code a bit simpler by avoiding
some extra assignments.
We can also drop the BME280_NUM_MAX_CHANNELS macro as it is no longer
used.
Suggested-by: Jonathan Cameron <jic23@kernel.org >
Link: https://lore.kernel.org/linux-iio/20250421135540.1a667221@jic23-huawei/
Signed-off-by: David Lechner <dlechner@baylibre.com >
Reviewed-by: Andy Shevchenko <andy@kernel.org >
Link: https://patch.msgid.link/20250422-iio-pressure-bmp280-rework-push-to-buffers-v1-1-ee722f29aeca@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-05-21 14:20:28 +01:00
Gyeyoung Baek
162129a27c
MAINTAINERS: Add WINSEN MHZ19B
...
Add undersigned as a maintainer for the WINSEN MHZ19B.
Signed-off-by: Gyeyoung Baek <gye976@gmail.com >
Link: https://patch.msgid.link/20250423194100.53934-5-gye976@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-05-21 14:20:28 +01:00
Gyeyoung Baek
4572a70b36
iio: chemical: Add support for Winsen MHZ19B CO2 sensor
...
Add support for Winsen MHZ19B CO2 sensor.
Datasheet: https://www.winsen-sensor.com/d/files/infrared-gas-sensor/mh-z19b-co2-ver1_0.pdf
Signed-off-by: Gyeyoung Baek <gye976@gmail.com >
Reviewed-by: Andy Shevchenko <andy@kernel.org >
Link: https://patch.msgid.link/20250423194100.53934-4-gye976@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-05-21 14:20:28 +01:00
Gyeyoung Baek
fd3730b2c7
dt-bindings: Add device tree support for Winsen MHZ19B CO2 sensor
...
Add device tree support for Winsen MHZ19B sensor.
Signed-off-by: Gyeyoung Baek <gye976@gmail.com >
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org >
Link: https://patch.msgid.link/20250423194100.53934-3-gye976@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2025-05-21 14:20:28 +01:00