summaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)Author
2026-05-31iio: adc: ti-ads1298: Fix incorrect timeout commentMd Shofiqul Islam
At the lowest supported data rate of 250Hz, one conversion period is 4ms, not 40ms. The 50ms timeout is deliberately conservative to allow for kernel scheduling latency, which can be significant under load or on slow machines. Fix the comment to state the correct conversion time, use "lowest sample rate" for clarity, and explain that the extra margin exists to absorb scheduling latency so that no one is tempted to shrink the timeout to match the conversion period. Also drop the redundant ret variable assignment by using the return value of wait_for_completion_timeout() directly in the if() condition. Signed-off-by: Md Shofiqul Islam <shofiqtest@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2026-05-31iio: frequency: adrf6780: replace usleep_range() with fsleep()Stepan Ionichev
The ADRF6780 datasheet (Rev. D, page 23, ADC section) says: "Wait approximately 200 us for the ADC to be ready." fsleep(200) expands to the same usleep_range(200, 250). Use the flexible sleep helper, which picks the right primitive for the given microsecond delay. Replace the generic "Recommended delay for the ADC to be ready" comment with the datasheet reference so the "why" of the wait is visible at the call site. No functional change. Signed-off-by: Stepan Ionichev <sozdayvek@gmail.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2026-05-31iio: adc: ad7793: replace usleep_range() with fsleep()Stepan Ionichev
The AD7792/AD7793 datasheet (Rev. B, page 25, RESET section) says: "When a reset is initiated, the user must allow a period of 500 us before accessing any of the on-chip registers." Use fsleep(500) instead of usleep_range(500, 2000). The 500 us minimum stays the same; fsleep() picks the upper slack itself (about +25% on a default config -- narrower than the original 2000 us). Add a code comment with the datasheet reference so the "why" of the wait is visible at the call site. Signed-off-by: Stepan Ionichev <sozdayvek@gmail.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2026-05-31iio: chemical: scd30: reject (response=NULL, size>0) in scd30_i2c_command()Stepan Ionichev
scd30_i2c_command() takes an opaque "response" buffer plus its size. At the start of the function the code already checks if response is NULL (via the rsp local), but the response-decoding loop after the i2c transfer always dereferences rsp without re-checking. With the current callers in scd30_core.c this is harmless, since write commands pass response=NULL together with size=0 (so the loop body is never entered). The (response=NULL, size>0) combination has no useful meaning: there is nowhere to put the bytes that come back from the chip. Treat it as an invalid argument and bail out at the top of the function with -EINVAL, instead of silently doing the i2c transfer and dereferencing a NULL pointer in the decode loop. smatch flagged the inconsistency: drivers/iio/chemical/scd30_i2c.c:104 scd30_i2c_command() error: we previously assumed rsp could be null (see line 77) No functional change for the existing callers, which only ever use (response=NULL, size=0) for writes and (response!=NULL, size>0) for reads. Signed-off-by: Stepan Ionichev <sozdayvek@gmail.com> Acked-by: Maxwell Doose <m32285159@gmail.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2026-05-31iio: chemical: scd30: make command lookup table constGiorgi Tchankvetadze
scd30_i2c_cmd_lookup_tbl contains fixed opcodes and is only read by scd30_i2c_command(). Make it const to document that it's immutable and allow it to be placed in read-only memory. Signed-off-by: Giorgi Tchankvetadze <giorgitchankvetadze1997@gmail.com> Reviewed-by: Stepan Ionichev <sozdayvek@gmail.com> Acked-by: Maxwell Doose <m32285159@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2026-05-31iio: magnetometer: yamaha-yas530: replace usleep_range() with fsleep()Andy Shevchenko
Replace usleep_range() with fsleep() to allow the kernel to select the most appropriate delay mechanism based on duration. Using USEC_PER_MSEC makes the unit conversion explicit. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2026-05-31iio: magnetometer: yamaha-yas530: Use devm_mutex_init() for mutex initializationAndy Shevchenko
Use devm_mutex_init() since it brings some benefits when CONFIG_DEBUG_MUTEXES is enabled. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2026-05-31iio: magnetometer: yamaha-yas530: Get rid of i2c_client_get_device_id()Andy Shevchenko
Instead of relying on the name from ID table, which might be ambiguous in some cases, use explicit product label in the driver data. With that being done, get rid of i2c_client_get_device_id() call. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2026-05-31iio: adc: ingenic-adc: use guard()() and scoped_guard() to handle ↵Felipe Ribeiro de Souza
synchronisation Replace mutex_lock() and mutex_unlock() calls with guard()() in functions ingenic_adc_set_adcmd(), ingenic_adc_set_config(), ingenic_adc_enable(), ingenic_adc_capture(), and with scoped_guard() in function ingenic_adc_read_chan_info_raw(). This removes the need to call the unlock function, as the lock is automatically released when the function return or the scope exits for any other case. Signed-off-by: Felipe Ribeiro de Souza <felipers@ime.usp.br> Co-developed-by: Lucas Ivars Cadima Ciziks <lucas@ciziks.com> Signed-off-by: Lucas Ivars Cadima Ciziks <lucas@ciziks.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2026-05-31iio: adc: ingenic-adc: refactor ingenic_adc_read_chan_info_raw()Felipe Ribeiro de Souza
Extract the sample logic from ingenic_adc_read_chan_info_raw() into a new helper function __ingenic_adc_read_chan() to improve code readability and modularity. The helper handles the mutex-protected section for sampling channels, while the main function manages mutex and clock enabling/disabling. Signed-off-by: Felipe Ribeiro de Souza <felipers@ime.usp.br> Co-developed-by: Lucas Ivars Cadima Ciziks <lucas@ciziks.com> Signed-off-by: Lucas Ivars Cadima Ciziks <lucas@ciziks.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2026-05-31iio: adc: ingenic-adc: rename ingenic_adc_enable_unlocked() functionFelipe Ribeiro de Souza
Rename ingenic_adc_enable_unlocked() to __ingenic_adc_enable() to better reflect that this helper must be called with the lock held. Signed-off-by: Felipe Ribeiro de Souza <felipers@ime.usp.br> Co-developed-by: Lucas Ivars Cadima Ciziks <lucas@ciziks.com> Signed-off-by: Lucas Ivars Cadima Ciziks <lucas@ciziks.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2026-05-31iio: magnetometer: ak8975: unify return code variable nameAndy Shevchenko
In one case 'rc' is used in the other 'err', the most use 'ret'. Make the latter use the former, id est 'ret'. While at it, drop unneeded ' < 0' checks. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2026-05-31iio: magnetometer: ak8975: reduce usage of magic lengths of the bufferAndy Shevchenko
Reduce usage of magic lengths of the supplied buffer by replacing them with the corresponding sizeof():s. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2026-05-31iio: magnetometer: ak8975: remove duplicate error messageAndy Shevchenko
The devm_request_irq() already prints an error message. Remove the duplicate. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2026-05-31iio: magnetometer: ak8975: drop duplicate NULL checkAndy Shevchenko
The gpiod_set_consumer_name() is NULL-aware, no need to perform the same check in the caller. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2026-05-31iio: magnetometer: ak8975: avoid using temporary variableAndy Shevchenko
Avoid using temporary variable in ak8975_read_axis(). With that being done, the clamp_t() call becomes idiomatic in the driver and can be factored out to a helper later on (and if needed). Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2026-05-31iio: magnetometer: ak8975: pass conversion timeouts as argumentsJoshua Crofts
Refactor wait_conversion_complete*_() helper function to accept poll and timeout values directly as parameters. This improves the readability of the code and does not rely on hardcoded macros. Besides that, fix the home grown and obviously wrong in some cases the jiffy-based timeout. Co-developed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2026-05-31iio: magnetometer: ak8975: fix wrong errno on returnJoshua Crofts
The driver currently returns -EINVAL on polling timeout instead of -ETIMEDOUT. Replace return code for -ETIMEDOUT and remove unnecessary error message as -ETIMEDOUT is a standard POSIX error. Also replace instances of -EINVAL in comments. Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2026-05-31iio: magnetometer: ak8975: change 'u8*' to 'u8 *' in castJoshua Crofts
Change 'u8*' cast to 'u8 *' as the former triggers a checkpatch error. Also fix the indentation of parameters in i2c_smbus_read_i2c_block_data_or_emulated() function. No functional change. Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Reviewed-by: Maxwell Doose <m32285159@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2026-05-31iio: magnetometer: ak8975: replace usleep_range() with fsleep()Joshua Crofts
Replace usleep_range() calls with fsleep(), passing the minimum value required by the sensor for hardware delays. fsleep() automatically selects the optimal sleep mechanism, simplifying driver code and time management. Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2026-05-31iio: magnetometer: ak8975: update headers per IWYU principleJoshua Crofts
Remove kernel.h proxy header and unused headers (slab.h, iio/sysfs.h, iio/trigger.h). Add missing headers to ensure atomicity (array_size.h, dev_printk.h, asm/byteorder.h, irqreturn.h, minmax.h, property.h, types.h, wait.h). Audited using the include-what-you-use tool. Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com> Reviewed-by: Maxwell Doose <m32285159@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2026-05-31iio: magnetometer: ak8975: sort headers alphabeticallyJoshua Crofts
Sort include headers alphabetically to improve coding style and readability. No functional change. Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com> Reviewed-by: Maxwell Doose <m32285159@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2026-05-31iio: magnetometer: ak8975: Add missed pm_runtime_put_autosuspend() callAndy Shevchenko
On the failure in the ak8975_read_axis() the PM runtime gets unbalanced. Balance it by calling pm_runtime_put_autosuspend() on error path as well. Fixes: cde4cb5dd422 ("iio: magn: ak8975: deploy runtime and system PM") Reported-by: Sashiko <sashiko-bot@kernel.org> Closes: https://sashiko.dev/#/patchset/20260505-magnetometer-fixes-v5-0-831b9b5550fc%40gmail.com Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2026-05-31iio: light: iqs621-als: prefer early error handling over if (!ret)Pedro Barletta Gennari
Handle errors as early as possible by replacing 'if (!ret)' with the more common form 'if (ret)'. This makes the code easier to read. Signed-off-by: Pedro Barletta Gennari <pedro.pbg@usp.br> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2026-05-31iio: light: iqs621-als: use lock guardsPedro Barletta Gennari
Use guard(mutex)() for handling mutex lock instead of manually locking and unlocking the mutex. This prevents forgotten locks due to early exits and removes the need of gotos. Signed-off-by: Pedro Barletta Gennari <pedro.pbg@usp.br> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2026-05-31iio: adc: mcp3422: write bit operations using bitfield.h APIsMarcelo Machado Lage
Replace manual bit manipulations with FIELD_GET(), FIELD_PREP() and FIELD_MODIFY() calls. The resulting code is more readable and maintainable, and 6 macros previously defined in the header are not needed anymore. Signed-off-by: Marcelo Machado Lage <marcelomlage@usp.br> Co-developed-by: Vinicius Lira <vinilira@usp.br> Signed-off-by: Vinicius Lira <vinilira@usp.br> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2026-05-31iio: adc: mcp3422: rewrite mask macros with help of bits.h APIsMarcelo Machado Lage
Rewrite MCP3422_CHANNEL_MASK, MCP3422_SRATE_MASK, MCP3422_PGA_MASK and MCP3422_CONT_SAMPLING using GENMASK() and BIT() macros from bits.h. The other macros MCP3422_SRATE_{240, 60, 15, 3} were not changed because they are also used as array indices. Signed-off-by: Marcelo Machado Lage <marcelomlage@usp.br> Co-developed-by: Vinicius Lira <vinilira@usp.br> Signed-off-by: Vinicius Lira <vinilira@usp.br> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2026-05-31iio: magnetometer: rm3100: Modernize locking and refactor control flowMaxwell Doose
Replace mutex_lock() and mutex_unlock() calls in rm3100-core.c with the more modern guard(mutex)() family. This will help modernize the driver and bring it up-to-date with modern available macros/functions. While replacing mutex_lock() and mutex_unlock(), the critical sections of rm3100_read_mag() and rm3100_get_samp_freq() have been extended to include negligible operations for cleaner logic. Add new helper-wrapper function rm3100_regmap_bulk_read_locked() to help keep rm3100_trigger_handler() switch-cases clean while maintaining mutex locking and avoiding re-entrancy risks from potential callbacks. While at it, remove redundant gotos where applicable, and use direct returns instead. In addition, remove regmap variable in rm3100_trigger_handler() as its references have been replaced with variable data. Suggested-by: Jonathan Cameron <jic23@kernel.org> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Maxwell Doose <m32285159@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2026-05-31iio: light: si1133: use guard(mutex)() macroJoshua Crofts
Remove mutex_lock()/mutex_unlock() and goto instances and add guard(mutex)() macro to modernize driver and improve mutex handling. Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2026-05-31iio: light: si1133: add local variable for timeoutJoshua Crofts
Add local variable for timeout to improve readability. No functional change. Suggested-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2026-05-31iio: light: si1133: group generic <linux/*> headersJoshua Crofts
Group generic <linux/*> include headers to improve code style. No functional change. Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2026-05-31iio: light: si1133: add missing include headersJoshua Crofts
Add missing include headers to prevent compilation relying on transient dependencies (array_size.h, bitops.h, completion.h, dev_printk.h, err.h, jiffies.h, math.h, mod_devicetable.h, mutex.h, types.h). Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2026-05-31iio: light: si1133: prefer complex macros enclosed in parenthesisJoshua Crofts
Enclose complex macros in parenthesis per checkpatch.pl error to improve code style. Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2026-05-31iio: light: si1133: remove unused macrosJoshua Crofts
Remove unused macros unrelated to hardware definition. No functional change. Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2026-05-31iio: light: si1133: prevent race condition on timeoutJoshua Crofts
Sashiko reported a bug where the si1133_command exits on timeout without halting the sensor or masking the interrupt. If the sensor completes the command later, any subsequent command to the sensor will cause the IRQ handler to complete immediately, returning stale data to the driver all while the command hasn't finished yet, shifting all potential reads in the future. Fix this by masking the IRQ if wait_for_completion_timeout() fails. When initiating a new command, do a dummy read of the IRQ_STATUS register and turn the IRQ back on. Fixes: e01e7eaf37d8 ("iio: light: introduce si1133") Reported-by: sashiko-bot <sashiko-bot@kernel.org> Closes: https://sashiko.dev/#/message/20260428-si1133-checkup-v2-5-70ad14bfefe2%40gmail.com Assisted-by: gemini:gemini-3.1-pro-preview Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2026-05-31iio: light: si1133: reset counter to prevent race conditionJoshua Crofts
Sashiko reported a potential race condition happening when the driver returns an errno after a timeout in the si1133_command() function. The premature exit causes the hardware and software counters to become out of sync by not updating data->rsp_seq, therefore the internal hardware counter keeps incrementing. Fix this by adding a call to si1133_cmd_reset_counter() before returning from timeout. Fixes: e01e7eaf37d8 ("iio: light: introduce si1133") Reported-by: sashiko-bot <sashiko-bot@kernel.org> Closes: https://sashiko.dev/#/message/20260428-si1133-checkup-v2-5-70ad14bfefe2%40gmail.com Assisted-by: gemini:gemini-3.1-pro-preview Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2026-05-31iio: gyro: adxrs290: Use guard(mutex) in lieu of manual lock+unlockGuilherme Dias
Use guard(mutex)() to automatically release the lock on scope exit, simplifying the error handling path and removing the need for explicit unlock and goto-based cleanup. Signed-off-by: Guilherme Dias <guilhermeabreu200105@usp.br> Co-developed-by: João Paulo Menezes Linaris <jplinaris@usp.br> Signed-off-by: João Paulo Menezes Linaris <jplinaris@usp.br> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Reviewed-by: Maxwell Doose <m32285159@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2026-05-31iio: Move MODULE_DEVICE_TABLE next to the table itselfKrzysztof Kozlowski
By convention MODULE_DEVICE_TABLE() immediately follows the ID table it exports, because this is easier to read and verify. It also makes more sense since #ifdef for ACPI or OF could hide both of them. Most of the drivers already have this correctly placed, so adjust the missing ones. No functional impact. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2026-05-31iio: light: stk3310: Use sizeof() for regmap_bulk_read/write count parameterMiao Li
Convert the hardcoded count parameter to sizeof(buf) for all regmap_bulk_write() and regmap_bulk_read() calls in this driver to improve code maintainability. For details, see [1]. Link: https://lore.kernel.org/all/20260428192213.7c5c80e5@jic23-huawei/ #[1] Signed-off-by: Miao Li <limiao@kylinos.cn> Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2026-05-31iio: light: stk3310: Replace uint32_t with u32 and reorder members to ↵Miao Li
eliminate padding Replace the uint32_t type members in struct stk3310_data with u32 to adhere to the unified kernel coding style, and reorder the member variables to eliminate memory padding holes. Suggested-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Miao Li <limiao@kylinos.cn> Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2026-05-31iio: light: stk3310: Deal with the ps interrupt issue in PMMiao Li
On the Inspur HS326 laptop(which integrated with HiSilicon M900 processor), if the STK3311-X chip's PS interrupt is configured in "Recommended interrupt mode", the interrupt cannot be triggered normally after waking from suspend or hibernation. In this case, neither disabling and re-enabling the interrupt nor resetting the PS threshold register can restore the interrupt to normal operation. If the interrupt is disabled in suspend() then reset the PS threshold register and enable the interrupt in resume(). This resolves the issue. Signed-off-by: Miao Li <limiao@kylinos.cn> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2026-05-31staging: iio: ad9834: fix chip name typo in commentsAngus Gardner
Two comments incorrectly refer to 'AD9843' instead of 'AD9834'. Fix the copy-paste typo. Signed-off-by: Angus Gardner <angusg778@gmail.com> Reviewed-by: Maxwell Doose <m32285159@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2026-05-31staging: iio: ad9834: use dev_err_probe() in probe functionAngus Gardner
Replace open-coded dev_err() + return sequences with dev_err_probe(), which is the preferred pattern for probe error paths as it handles deferred probing correctly and reduces boilerplate. Convert all three remaining instances in ad9834_probe(): - master clock enable failure - device init SPI sync failure The avdd regulator path already used dev_err_probe(). Signed-off-by: Angus Gardner <angusg778@gmail.com> Reviewed-by: Maxwell Doose <m32285159@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2026-05-31staging: iio: ad9834: simplify -ENOMEM return in probeAngus Gardner
devm_iio_device_alloc() failure returns -ENOMEM via a local variable unnecessarily. Return -ENOMEM directly instead. Signed-off-by: Angus Gardner <angusg778@gmail.com> Reviewed-by: Maxwell Doose <m32285159@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2026-05-31iio: light: stk3310: Update includes to match IWYURafael G. Dias
Clean up the included headers in stk3310.c according to the Include-What-You-Use (IWYU) tool. Remove the generic <linux/kernel.h> header and add explicit dependencies to improve compilation accuracy. Co-developed-by: Felipe Khoury Dayoub <felipedayoub@usp.br> Signed-off-by: Felipe Khoury Dayoub <felipedayoub@usp.br> Signed-off-by: Rafael G. Dias <rafael.guimaraes.dias@usp.br> Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2026-05-31iio: light: stk3310: Sort headers alphabeticallyRafael G. Dias
Sort the included headers alphabetically and group the <linux/iio/*> headers separately from the generic <linux/*> headers. Co-developed-by: Felipe Khoury Dayoub <felipedayoub@usp.br> Signed-off-by: Felipe Khoury Dayoub <felipedayoub@usp.br> Signed-off-by: Rafael G. Dias <rafael.guimaraes.dias@usp.br> Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2026-05-31iio: frequency: ad9832: simplify bitwise mathJoshua Crofts
Refactor the ad9832_calc_freqreg by removing the redundant u64 casts and 1L bitwise left shift and replacing the multiplication by a bit shift, as multiplying integers by a power of two is identical to a bitwise left shift. Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com> Reviewed-by: Nuno Sá <nuno.sa@analog.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2026-05-31iio: buffer: Move from int64_t to s64 for timestampAndy Shevchenko
iio_push_to_buffers_with_ts_unaligned() uses int64_t for timestamp. Move it from int64_t to s64 to make consistent with: - iio_push_to_buffers_with_ts() - all current users that supply s64 anyway This will reduce potential of wrong type being chosen when using this API. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2026-05-31iio: temperature: maxim_thermocouple: Fix indentation in of_match tableRahman Mahmutović
Replace leading spaces with tabs in the of_device_id table entries to comply with kernel coding style. Signed-off-by: Rahman Mahmutović <mahmutovicrahman5@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2026-05-31iio: dac: ad5706r: Add support for AD5706R DACAlexis Czezar Torreno
Add support for the Analog Devices AD5706R, a 4-channel 16-bit current output digital-to-analog converter with SPI interface. Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Alexis Czezar Torreno <alexisczezar.torreno@analog.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>