summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2025-05-21iio: chemical: Add support for Winsen MHZ19B CO2 sensorGyeyoung Baek
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-21dt-bindings: Add device tree support for Winsen MHZ19B CO2 sensorGyeyoung Baek
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-21dt-bindings: Add Winsen to the vendor prefixesGyeyoung Baek
Add Winsen to the vendor prefixes. Signed-off-by: Gyeyoung Baek <gye976@gmail.com> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://patch.msgid.link/20250423194100.53934-2-gye976@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-05-21iio: accel: kxcjk-1013: Deduplicate setup interrupt functionsGustavo Vaz
The contents of kxcjk1013_setup_any_motion_interrupt and kxcj1013_setup_new_data_interrupt are very similar. Deduplicate these functions by introducing a generic function named kxcjk1013_setup_interrupt that has an additional flag indicating if it's a new data interrupt. Signed-off-by: Gustavo Vaz <gustavo.vaz@usp.br> Co-developed-by: Francisco Henriques <franciscolealhenriques@usp.br> Signed-off-by: Francisco Henriques <franciscolealhenriques@usp.br> Link: https://patch.msgid.link/20250423204631.16460-1-gustavo.vaz@usp.br Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-05-21iio: cros_ec_sensors: Flush when changing the FIFO timeoutGwendal Grignou
|hwfifo_timeout| is used by the EC firmware only when new samples are available. When the timeout changes, espcially when the new timeout is shorter than the current one, send the samples waiting in the FIFO to the host. Inline the call to transmit |hwfifo_timeout| value to the firmware. Now flush when a sensor is suspended (ODR set to 0) as well. Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Link: https://patch.msgid.link/20250423220506.2061021-1-gwendal@chromium.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-05-21iio: light: zopt2201: Remove code duplication in scale write functionsBeatriz Viana Costa
Consolidate duplicated logic from zopt2201_write_scale_als_by_idx() and zopt2201_write_scale_uvb_by_idx() into a new generic helper function zopt2201_write_scale_by_idx(). This function takes an additional parameter: a pointer to a zopt2201_scale array. To support this, the previously anonymous and duplicated struct used in the scale arrays was promoted to a named struct: zopt2201_scale. This change also corrects an incorrect array access that existed in zopt2201_write_scale_uvb_by_idx(). Signed-off-by: Beatriz Viana Costa <beatrizvianacosta16@gmail.com> Co-developed-by: Gabriela Victor <gabevictor333@gmail.com> Signed-off-by: Gabriela Victor <gabevictor333@gmail.com> Link: https://patch.msgid.link/20250424002144.23260-1-beatrizvianacosta16@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-05-21iio: adc: PAC1934: fix typo in documentation linkMarius Cristea
Fix a typo,(PAC1934 -> PAC193X), into the link from an application note related to the ACPI device definition. Fixes: 0fb528c8255b ("iio: adc: adding support for PAC193x") Reported-by: Matteo Martelli <matteomartelli3@gmail.com> Closes: https://patch.msgid.link/172794015844.2520.11909797050797595912@njaxe.localdomain Signed-off-by: Marius Cristea <marius.cristea@microchip.com> Reviewed-by: David Lechner <dlechner@baylibre.com> Link: https://patch.msgid.link/20250424-pac1934-doc_link-v1-1-9832445cb270@microchip.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-05-21iio: adc: stm32: add oversampling supportOlivier Moysan
Add oversampling support for STM32H7, STM32MP15 & STM32MP13. STM32F4 ADC has no oversampling feature. The current support of the oversampling feature aims at increasing the data SNR, without changing the data resolution. As the oversampling by itself increases data resolution, a right shift is applied to keep the initial resolution. Only the oversampling ratio corresponding to a power of two are supported here, to get a direct link between right shift and oversampling ratio. (2^n ratio <=> n right shift) The oversampling ratio is shared by all channels, whatever channel type. (e.g. single ended or differential). Oversampling can be configured using IIO ABI: - oversampling_ratio_available - oversampling_ratio Co-developed-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com> Signed-off-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com> Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com> Reviewed-by: David Lechner <dlechner@baylibre.com> Reviewed-by: Andy Shevchenko <andy@kernel.org> Link: https://patch.msgid.link/20250424151604.626758-1-olivier.moysan@foss.st.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-05-21staging: iio: ad5933: Correct settling cycles encoding per datasheetGabriel Shahrouzi
The AD5933 datasheet (Table 13) lists the maximum cycles to be 0x7FC (2044). Clamp the user input to the maximum effective value of 0x7FC cycles. Fixes: f94aa354d676 ("iio: impedance-analyzer: New driver for AD5933/4 Impedance Converter, Network Analyzer") Cc: stable@vger.kernel.org Signed-off-by: Gabriel Shahrouzi <gshahrouzi@gmail.com> Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com> Link: https://patch.msgid.link/20250420013009.847851-1-gshahrouzi@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-05-21iio: orientation: hid-sensor-rotation: remove unnecessary alignmentDavid Lechner
Remove __aligned(16) in the scan data struct in the hid-sensor-rotation driver. There is nothing in the code that requires this alignment. Signed-off-by: David Lechner <dlechner@baylibre.com> Reviewed-by: Andy Shevchenko <andy@kernel.org> Link: https://patch.msgid.link/20250418-iio-orientation-hid-sensor-rotation-remove-alignment-v1-1-6da68eae7ecf@baylibre.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-05-21iio: adc: hx711: use struct with aligned_s64 timestampDavid Lechner
Use a struct with aligned s64_timestamp instead of a padded array for the buffer used for iio_push_to_buffers_with_ts(). This makes it easier to see the correctness of the size and alignment of the buffer. Signed-off-by: David Lechner <dlechner@baylibre.com> Link: https://patch.msgid.link/20250418-iio-prefer-aligned_s64-timestamp-v1-3-4c6080710516@baylibre.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-05-21iio: accel: adxl345: set the tap suppress bit permanentlyLothar Rubusch
Set the suppress bit feature to the double tap detection, whenever double tap is enabled. This impedes the suppress bit dangling in any state, and thus varying in sensitivity for double tap detection. Any tap event is defined by a rising signal edge above threshold, i.e. duration time starts counting; and the falling edge under threshold within duration time, i.e. then the tap event is issued. This means duration is used individually for each tap event. For double tap detection after a single tap, a latency time needs to be specified. Usually tap events, i.e. spikes above and returning below threshold will be ignored within latency. After latency, the window time starts counting for a second tap detection which has to happen within a duration time. If the suppress bit is not set, spikes within latency time are ignored. Setting the suppress bit will invalidate the double tap function. The sensor will thus be able to save the window time for double tap detection, and follow a more strict definition of what signal qualifies for a double tap. In a summary having the suppress bit set, fewer signal spikes will be considered as double taps. This is an optional add on to double tap, thus a separate patch. Signed-off-by: Lothar Rubusch <l.rubusch@gmail.com> Link: https://patch.msgid.link/20250414184245.100280-5-l.rubusch@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-05-21iio: accel: adxl345: add double tap featureLothar Rubusch
Add the double tap feature of the sensor. The interrupt handler needs to catch and forward the event to the IIO channel. The single tap implementation now is extended to deal with double tap as well. Doubletap introduces window and latency times, both in us. Since both times are scaled, the 8-bit register value is stored in hardware, where the scaled value in [us] is stored as member variable. Signed-off-by: Lothar Rubusch <l.rubusch@gmail.com> Link: https://patch.msgid.link/20250414184245.100280-4-l.rubusch@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-05-21iio: accel: adxl345: add single tap featureLothar Rubusch
Add the single tap feature with a threshold in 62.5mg/LSB points and a scaled duration in us. Keep singletap threshold in regmap cache but the scaled value of duration in us as member variable. Both use IIO channels for individual enable of the x/y/z axis. Initializes threshold and duration with reasonable content. When an interrupt is caught it will be pushed to the according IIO channel. Signed-off-by: Lothar Rubusch <l.rubusch@gmail.com> Link: https://patch.msgid.link/20250414184245.100280-3-l.rubusch@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-05-21iio: accel: adxl345: introduce adxl345_push_event functionLothar Rubusch
Move the fifo handling into a separate function. This is a preparation for a generic handling of the interrupt status register results. The function is supposed to handle particular sensor events, and later to forward them to the iio channel. This is needed to read out the interrupt status register. The function shall return occurring errors, if any, or 0 in case of handled events or read fifo content. Thus migrate fifo read-out and push fifo content to iio channels into this function to be built up with additional event handling. Signed-off-by: Lothar Rubusch <l.rubusch@gmail.com> Link: https://patch.msgid.link/20250414184245.100280-2-l.rubusch@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-05-21iio: dac: ad5592r: Delete stray unlock in ad5592r_write_raw()Dan Carpenter
This code was converted to use guard locks but one of the unlocks was accidentally overlooked. Delete it. Fixes: 135e101f4dd6 ("iio: dac: ad5592r: use lock guards") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Andy Shevchenko <andy@kernel.org> Reviewed-by: Nuno Sá <nuno.sa@analog.com> Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Link: https://patch.msgid.link/Z_-P7bsD3KL5K25R@stanley.mountain Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-05-21iio: frequency: ad9832: Remove unused parameter from data documentationGabriel Shahrouzi
This is a leftover from the patch: commit 566564e80b0e ("staging: iio: ad9832: use clock framework for clock reference"). The AD9832 driver uses the Common Clock Framework (CCF) to obtain the master clock (MCLK) frequency rather than relying on a frequency value passed from platform data. Signed-off-by: Gabriel Shahrouzi <gshahrouzi@gmail.com> Link: https://patch.msgid.link/20250417173333.607844-1-gshahrouzi@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-05-21iio: frequency: ad9832: Use FIELD_PREP macro to set bit fieldsSiddharth Menon
Use bitfield and bitmask macros to clearly specify AD9832 SPI command fields to make register write code more readable. Suggested-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com> Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com> Signed-off-by: Siddharth Menon <simeddon@gmail.com> Link: https://patch.msgid.link/20250416140259.13431-1-simeddon@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-05-21iio: addac: ad74413r: use aligned_s64 for timestampDavid Lechner
Follow the pattern of other drivers and use aligned_s64 for the timestamp. Technically there was no issue here since AD74413R_FRAME_SIZE * AD74413R_CHANNEL_MAX == 16 and IIO_DMA_MINALIGN is always a multiple of 8. But best to conform in case someone copies this to new code and then tweaks something. Also move the unaligned.h header while touching this since it was the only one not in alphabetical order. Signed-off-by: David Lechner <dlechner@baylibre.com> Reviewed-by: Nuno Sá <nuno.sa@analog.com> Link: https://patch.msgid.link/20250417-iio-more-timestamp-alignment-v1-3-eafac1e22318@baylibre.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-05-21iio: adc: mt6360-adc: use aligned_s64 for timestampDavid Lechner
Follow the pattern of other drivers and use aligned_s64 for the timestamp. This will ensure that the timestamp is correctly aligned on all architectures. It also ensures that the struct itself it also 8-byte aligned so we can drop the explicit __aligned(8) attribute. Signed-off-by: David Lechner <dlechner@baylibre.com> Reviewed-by: Nuno Sá <nuno.sa@analog.com> Link: https://patch.msgid.link/20250417-iio-more-timestamp-alignment-v1-2-eafac1e22318@baylibre.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-05-21iio: magnetometer: Use iio_push_to_buffers_with_ts() to provide length for ↵Jonathan Cameron
runtime checks. This new function allows us to perform debug checks in the helper to ensure that the overrun does not occur. Use it in all the simple cases where either a static buffer or a structure is used in the drivers. Reviewed-by: David Lechner <dlechner@baylibre.com> Link: https://patch.msgid.link/20250413103443.2420727-21-jic23@kernel.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-05-21iio: pressure: Use iio_push_to_buffers_with_ts() to provide length for ↵Jonathan Cameron
runtime checks. This new function allows us to perform debug checks in the helper to ensure that the overrun does not occur. Use it in all the simple cases where either a static buffer or a structure is used in the drivers. Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com> # ROHM BM1390 Reviewed-by: David Lechner <dlechner@baylibre.com> Link: https://patch.msgid.link/20250413103443.2420727-20-jic23@kernel.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-05-21iio: pressure: zpa2326: Use aligned_s64 for the timestampJonathan Cameron
On x86_32 s64 fields are only 32-bit aligned. Hence force the alignment of the field and padding in the structure by using aligned_s64 instead. Reviewed-by: David Lechner <dlechner@baylibre.com> Link: https://patch.msgid.link/20250413103443.2420727-19-jic23@kernel.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-05-21iio: proximity: Use iio_push_to_buffers_with_ts() to provide length for ↵Jonathan Cameron
runtime checks. This new function allows us to perform debug checks in the helper to ensure that the overrun does not occur. Use it in all the simple cases where either a static buffer or a structure is used in the drivers. Reviewed-by: David Lechner <dlechner@baylibre.com> Link: https://patch.msgid.link/20250413103443.2420727-18-jic23@kernel.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-05-21iio: proximity: irsd200: Use a struct for scan and iio_push_to_buffers_with_ts()Jonathan Cameron
The driver previously used an array of two s64, then type cast the pointer to write an s16 to the start. The code is made more readable using a structure. At the same time switch to the new iio_push_to_buffers_with_ts() helper to enable runtime checking of the size of the source buffer. Note that this approach uses a structure with holes, so use memset() to ensure those do not contain old kernel data as this data is passed to userspace. Reviewed-by: David Lechner <dlechner@baylibre.com> Link: https://patch.msgid.link/20250413103443.2420727-17-jic23@kernel.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-05-21iio: resolver: Use iio_push_to_buffers_with_ts() to provide length for ↵Jonathan Cameron
runtime checks. This new function allows us to perform debug checks in the helper to ensure that the overrun does not occur. Use it in all the simple cases where either a static buffer or a structure is used in the drivers. Reviewed-by: David Lechner <dlechner@baylibre.com> Link: https://patch.msgid.link/20250413103443.2420727-16-jic23@kernel.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-05-21iio: temperature: Use iio_push_to_buffers_with_ts() to provide length for ↵Jonathan Cameron
runtime checks. This new function allows us to perform debug checks in the helper to ensure that the overrun does not occur. Use it in all the simple cases where either a static buffer or a structure is used in the drivers. Reviewed-by: David Lechner <dlechner@baylibre.com> Link: https://patch.msgid.link/20250413103443.2420727-15-jic23@kernel.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-05-21iio: chemical: Use iio_push_to_buffers_with_ts() to provide length for ↵Jonathan Cameron
runtime checks. This new function allows us to perform debug checks in the helper to ensure that the overrun does not occur. Use it in all the simple cases where either a static buffer or a structure is used in the drivers. Reviewed-by: David Lechner <dlechner@baylibre.com> Link: https://patch.msgid.link/20250413103443.2420727-13-jic23@kernel.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-05-21iio: accel: hid: Use iio_push_to_buffers_with_ts() to provide length for ↵Jonathan Cameron
runtime checks. This new function allows us to perform debug checks in the helper to ensure that the overrun does not occur. For this case, the length being provided is already passed into the caller function so reuse that. Reviewed-by: David Lechner <dlechner@baylibre.com> Link: https://patch.msgid.link/20250413103443.2420727-12-jic23@kernel.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-05-21iio: accel: Use iio_push_to_buffers_with_ts() to provide length for runtime ↵Jonathan Cameron
checks. This new function allows us to perform debug checks in the helper to ensure that the overrun does not occur. Use it in all the simple cases where either a static buffer or a structure is used in the drivers. Reviewed-by: David Lechner <dlechner@baylibre.com> Link: https://patch.msgid.link/20250413103443.2420727-11-jic23@kernel.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-05-21iio: adc: Use iio_push_to_buffers_with_ts() to provide length for runtime ↵Jonathan Cameron
checks. This new function allows us to perform debug checks in the helper to ensure that the overrun does not occur. Use it in all the simple cases where either a static buffer or a structure is used in the drivers. Reviewed-by: David Lechner <dlechner@baylibre.com> Link: https://patch.msgid.link/20250413103443.2420727-10-jic23@kernel.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-05-21iio: adc: ti-ads131e08: Use new iio_push_to_buffers_with_ts() to provide ↵Jonathan Cameron
length sanity check. By providing the size of the buffer used, runtime checks can be performed to ensure not overrun. Also change the pushed data pointer to be that of the structure that also contains the timestamp. Not an actual bug but semantically incorrect to push the channel data when we want the storage with the timestamp as well. Reviewed-by: David Lechner <dlechner@baylibre.com> Link: https://patch.msgid.link/20250413103443.2420727-9-jic23@kernel.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-05-21iio: dummy: Switch to iio_push_to_buffers_with_ts() and provide size of storageJonathan Cameron
Provide the storage size so that the helper can sanity check that it is large enough for the configured channels. Reviewed-by: Nuno Sá <nuno.sa@analog.com> Reviewed-by: David Lechner <dlechner@baylibre.com> Link: https://patch.msgid.link/20250413103443.2420727-8-jic23@kernel.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-05-21iio: dummy: Use a fixed structure to build up scan to push to buffers.Jonathan Cameron
It has long been discouraged for drivers to make use of iio_dev->scan_bytes directly as that is an implementation detail of the core. As such our example driver should definitely not be doing so. In order to illustrate the more complex case, where a DMA safe buffer is needed, continue to kzalloc() the storage (but with a structure definition to provide an explicit data layout). Also add comments on when a DMA safe buffer is necessary and the two common ways of obtaining one. Whilst we have a mixture of signed and unsigned channels, the unsigned channels have ranges that can be stored in a signed value - hence use signed storage for all channels, simplifying the structure definition. Reviewed-by: David Lechner <dlechner@baylibre.com> Link: https://patch.msgid.link/20250413103443.2420727-7-jic23@kernel.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-05-21iio: introduced iio_push_to_buffers_with_ts() that takes a data_total_len ↵Jonathan Cameron
argument. Check that data_total_len argument against iio_dev->scan_bytes. The size needs to be at least as big as the scan. It can be larger, which is typical if only part of fixed sized storage is used due to a subset of channels being enabled. Reviewed-by: Nuno Sá <nuno.sa@analog.com> Reviewed-by: David Lechner <dlechner@baylibre.com> Link: https://patch.msgid.link/20250413103443.2420727-6-jic23@kernel.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-05-21docs: iio: ad3552r: fix malformed tableAngelo Dureghello
Fix malformed table. Fixes: ede84c455659 ("docs: iio: add documentation for ad3552r driver") Signed-off-by: Angelo Dureghello <adureghello@baylibre.com> Reviewed-by: Nuno Sá <nuno.sa@analog.com> Link: https://patch.msgid.link/20250415-wip-bl-ad3552r-fix-doc-table-v1-1-717ffd320c9d@baylibre.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-04-22iio: normalize array sentinel styleDavid Lechner
Use `\t(\{ ?\},|\{\}|\{\s*/\*.*\*/\s*\},?)$` regex to find and replace the array sentinel in all IIO drivers to the same style. For some time, we've been trying to consistently use `{ }` (no trailing comma, no comment, one space between braces) for array sentinels in the IIO subsystem. Still nearly 50% of existing code uses a different style. To save reviewers from having to request this trivial change as frequently, let's normalize the style in all existing IIO drivers. At least when code is copy/pasted to new drivers, the style will be consistent. Signed-off-by: David Lechner <dlechner@baylibre.com> Reviewed-by: Andy Shevchenko <andy@kernel.org> Link: https://patch.msgid.link/20250411-iio-sentinel-normalization-v1-1-d293de3e3d93@baylibre.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-04-22iio: adc: ad7768-1: Move buffer allocation to a separate functionSergiu Cuciurean
This change moves the buffer allocation and related trigger allocation in a separate function, making space for adding another type of iio buffer if needed. Reviewed-by: Marcelo Schmitt <marcelo.schmitt@analog.com> Reviewed-by: David Lechner <dlechner@baylibre.com> Signed-off-by: Sergiu Cuciurean <sergiu.cuciurean@analog.com> Signed-off-by: Jonathan Santos <Jonathan.Santos@analog.com> Link: https://patch.msgid.link/11c1777b406875ce1a7216dc4b094ff99af8da7f.1744325346.git.Jonathan.Santos@analog.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-04-22iio: adc: ad7768-1: Add reset gpioSergiu Cuciurean
Implement asynchronous hardware reset GPIO. Reviewed-by: David Lechner <dlechner@baylibre.com> Reviewed-by: Marcelo Schmitt <marcelo.schmitt@analog.com> Signed-off-by: Sergiu Cuciurean <sergiu.cuciurean@analog.com> Co-developed-by: Jonathan Santos <Jonathan.Santos@analog.com> Signed-off-by: Jonathan Santos <Jonathan.Santos@analog.com> Link: https://patch.msgid.link/25a413babeddf29583f1c26abf4234dfd606a595.1744325346.git.Jonathan.Santos@analog.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-04-22iio: adc: ad7768-1: convert driver to use regmapJonathan Santos
Convert the AD7768-1 driver to use the regmap API for register access. This change simplifies and standardizes register interactions, reducing code duplication and improving maintainability. Create two regmap configurations, one for 8-bit register values and other for 24-bit register values. Since we are using regmap now, define the remaining registers from 0x32 to 0x34. Reviewed-by: David Lechner <dlechner@baylibre.com> Signed-off-by: Jonathan Santos <Jonathan.Santos@analog.com> Link: https://patch.msgid.link/aec9e5452c1ac16d5379a80dfce97c00d85614a2.1744325346.git.Jonathan.Santos@analog.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-04-22iio: adc: ad_sigma_delta: Fix use of uninitialized status_posPurva Yeshi
Fix Smatch-detected issue: drivers/iio/adc/ad_sigma_delta.c:604 ad_sd_trigger_handler() error: uninitialized symbol 'status_pos'. The variable `status_pos` was only initialized in specific switch cases (1, 2, 3, 4), which could leave it uninitialized if `reg_size` had an unexpected value. Fix by adding a default case to the switch block to catch unexpected values of `reg_size`. Use `dev_err_ratelimited()` for error logging and `goto irq_handled` instead of returning early. Signed-off-by: Purva Yeshi <purvayeshi550@gmail.com> Link: https://patch.msgid.link/20250410170408.8585-1-purvayeshi550@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-04-22iio: dac: ad3552r-hs: add support for internal rampAngelo Dureghello
The ad3552r can be feeded from the HDL controller by an internally generated 16bit ramp, useful for debug pourposes. Add debugfs a file to enable or disable it. Signed-off-by: Angelo Dureghello <adureghello@baylibre.com> Link: https://patch.msgid.link/20250409-wip-bl-ad3552r-fixes-v5-5-fb429c3a6515@baylibre.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-04-22iio: dac: adi-axi-dac: add data source getAngelo Dureghello
Add data source getter. Reviewed-by: Nuno Sá <nuno.sa@analog.com> Signed-off-by: Angelo Dureghello <adureghello@baylibre.com> Link: https://patch.msgid.link/20250409-wip-bl-ad3552r-fixes-v5-4-fb429c3a6515@baylibre.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-04-22iio: backend: add support for data source getAngelo Dureghello
Add backend support for getting the data source used. The ad3552r HDL implements an internal ramp generator, so adding the getter to allow data source get/set by debugfs. Reviewed-by: Nuno Sá <nuno.sa@analog.com> Signed-off-by: Angelo Dureghello <adureghello@baylibre.com> Link: https://patch.msgid.link/20250409-wip-bl-ad3552r-fixes-v5-3-fb429c3a6515@baylibre.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-04-22docs: iio: add documentation for ad3552r driverAngelo Dureghello
Add documentation for ad3552r driver, needed to describe the high-speed driver debugfs attributes and shows how the user may use them. Signed-off-by: Angelo Dureghello <adureghello@baylibre.com> Link: https://patch.msgid.link/20250409-wip-bl-ad3552r-fixes-v5-2-fb429c3a6515@baylibre.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-04-22iio: dac: adi-axi-dac: add cntrl chan checkAngelo Dureghello
Add validity check on CNTRL_X channels (valid as 0 to 15). Reviewed-by: Nuno Sá <nuno.sa@analog.com> Signed-off-by: Angelo Dureghello <adureghello@baylibre.com> Link: https://patch.msgid.link/20250409-wip-bl-ad3552r-fixes-v5-1-fb429c3a6515@baylibre.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-04-22iio: imu: inv_icm42600: switch to use generic name irq getJean-Baptiste Maneyrol
Use generic fwnode_irq_get_byname() for getting interrupt pin using interrupt name. Only INT1 is supported by the driver currently. If not found fallback to first defined interrupt to keep compatibility. Signed-off-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com> Link: https://patch.msgid.link/20250410-iio-imu-inv-icm42600-rework-interrupt-using-names-v4-2-19e4e2f8f7eb@tdk.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-04-22dt-bindings: iio: imu: icm42600: add interrupt naming supportJean-Baptiste Maneyrol
Add interrupt-names field for specifying interrupt pin configured. Chips are supporting up to 2 interrupt pins with configurable interrupt sources. Change interrupt to support 1 or 2 entries. Signed-off-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com> Acked-by: Conor Dooley <conor.dooley@microchip.com> Link: https://patch.msgid.link/20250410-iio-imu-inv-icm42600-rework-interrupt-using-names-v4-1-19e4e2f8f7eb@tdk.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-04-22MAINTAINERS: A driver for TI/ROHM ADCsMatti Vaittinen
Add undersigned as a maintainer for the ti-adc128s052.c which supports a few TI's ADCs and the ROHM Semiconductor BD79704 ADC. Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com> Link: https://patch.msgid.link/b303bf42b84e7ab143ff6a4a810f7d788e210b86.1744022065.git.mazziesaccount@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-04-22iio: adc: ti-adc128s052: Support ROHM BD79104Matti Vaittinen
The ROHM BD79104 ADC has identical SPI communication logic as the ti-adc128s052. Eg, SPI transfer should be 16 clk cycles, conversion is started when the CS is pulled low, and channel selection is done by writing the channel ID after two zero bits. Data is contained in big-endian format in the last 12 bits. The BD79104 has two input voltage pins. Data sheet uses terms "vdd" and "iovdd". The "vdd" is used also as an analog reference voltage. Hence the driver expects finding these from the device-tree, instead of having the "vref" only as TI's driver. NOTE: The TI's data sheet[1] does show that the TI's IC does actually have two voltage inputs as well. Pins are called Va (analog reference) and Vd (digital supply pin) - but I keep the existing driver behaviour for the TI's IC "as is", because I have no HW to test changes, and because I have no real need to touch it. NOTE II: The BD79104 requires SPI MODE 3. NOTE III: I used evaluation board "BD79104FV-EVK-001" made by ROHM. With this board I had to drop the SPI speed below the 20M which is mentioned in the data-sheet [2]. This, however, may be a limitation of the EVK board, not the component itself. Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com> Datasheet: https://www.ti.com/lit/ds/symlink/adc128s052.pdf # [1] Datasheet: https://fscdn.rohm.com/en/products/databook/datasheet/ic/data_converter/dac/bd79104fv-la-e.pdf # [2] Link: https://patch.msgid.link/36ffa72cbdf8dbbdf1e612040db82ebcdf73fa24.1744022065.git.mazziesaccount@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>