iio: adc: qcom-pm8xxx-xoadc: add support for reading channel labels
Implement the .read_label callback to allow userspace to identify ADC
channels via the "label" property in the device tree. The name field in
pm8xxx_chan_info is renamed to label to better reflect its purpose. If
no label is provided in the device tree, it defaults to the hardware
datasheet name.
The change has been tested on Sony Xperia SP (PM8921).
Stepan Ionichev [Sun, 10 May 2026 11:38:52 +0000 (16:38 +0500)]
iio: accel: adxl355: replace usleep_range() with fsleep()
The "at least 5ms" wait after software reset has no specific upper
bound. Use fsleep() with 5 * USEC_PER_MSEC to make the unit
explicit at the call site.
No functional change.
Signed-off-by: Stepan Ionichev <sozdayvek@gmail.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Stepan Ionichev [Mon, 11 May 2026 02:55:44 +0000 (07:55 +0500)]
iio: adc: ad7192: replace usleep_range() with fsleep()
The AD7192 datasheet (Rev. A, page 34, 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, 1000).
Signed-off-by: Stepan Ionichev <sozdayvek@gmail.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
iio: adc: ti-ads1298: Remove unnecessary CONFIG2 write during init
The driver was enabling the internal test signal (INT_TEST), double
amplitude (TEST_AMP), and fast frequency (TEST_FREQ_FAST) bits in
CONFIG2 during initialization. These bits activate an internal square
wave generator intended for device testing and calibration, not normal
ECG operation.
CONFIG2 defaults to having only the RESERVED bit set after reset, which
is the correct value for normal operation. Remove the write entirely
since it would just be writing the reset default value.
Suggested-by: Mike Looijmans <mike.looijmans@topic.nl> Signed-off-by: Md Shofiqul Islam <shofiqtest@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
iio: adc: ti-ads1298: Add parentheses around macro parameter
ADS1298_REG_CHnSET() is missing parentheses around the parameter 'n'.
Add them to follow kernel macro coding style and prevent potential
operator precedence issues if the argument is an expression.
Signed-off-by: Md Shofiqul Islam <shofiqtest@gmail.com> Reviewed-by: Stepan Ionichev <sozdayvek@gmail.com> Acked-by: Mike Looijmans <mike.looijmans@topic.nl> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
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>
Stepan Ionichev [Mon, 11 May 2026 05:44:41 +0000 (10:44 +0500)]
iio: frequency: adrf6780: replace usleep_range() with fsleep()
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>
Stepan Ionichev [Mon, 11 May 2026 05:30:43 +0000 (10:30 +0500)]
iio: adc: ad7793: replace usleep_range() with fsleep()
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>
Stepan Ionichev [Thu, 7 May 2026 15:28:00 +0000 (20:28 +0500)]
iio: chemical: scd30: reject (response=NULL, size>0) in scd30_i2c_command()
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>
iio: chemical: scd30: make command lookup table const
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.
Andy Shevchenko [Fri, 8 May 2026 06:08:35 +0000 (08:08 +0200)]
iio: magnetometer: yamaha-yas530: replace usleep_range() with fsleep()
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>
Andy Shevchenko [Fri, 8 May 2026 06:08:33 +0000 (08:08 +0200)]
iio: magnetometer: yamaha-yas530: Get rid of i2c_client_get_device_id()
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>
iio: adc: ingenic-adc: use guard()() and scoped_guard() to handle 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>
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>
iio: adc: ingenic-adc: rename ingenic_adc_enable_unlocked() function
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>
Andy Shevchenko [Tue, 5 May 2026 11:46:05 +0000 (13:46 +0200)]
iio: magnetometer: ak8975: avoid using temporary variable
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>
Joshua Crofts [Tue, 5 May 2026 11:46:02 +0000 (13:46 +0200)]
iio: magnetometer: ak8975: pass conversion timeouts as arguments
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>
Joshua Crofts [Tue, 5 May 2026 11:46:01 +0000 (13:46 +0200)]
iio: magnetometer: ak8975: fix wrong errno on return
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>
Joshua Crofts [Tue, 5 May 2026 11:46:00 +0000 (13:46 +0200)]
iio: magnetometer: ak8975: change 'u8*' to 'u8 *' in cast
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>
Kim Seer Paller [Tue, 5 May 2026 04:34:31 +0000 (12:34 +0800)]
iio: ABI: Add DAC 500ohm, 3.85kohm, and 16kohm powerdown modes
Add powerdown mode entries for DACs with 500 Ohm, 3.85 kOhm, and
16 kOhm resistor to ground output impedance states. These are used
by the AD3531/AD3531R 4-channel DAC.
Signed-off-by: Kim Seer Paller <kimseer.paller@analog.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Wang Zihan [Tue, 5 May 2026 09:22:43 +0000 (17:22 +0800)]
iio: adxl313: fix typos in documentation
Add missing space in "ADXL313is" and improve grammar for
"a single types of channels" to "multiple channels of a single type"
as suggested by Jonathan Cameron.
Wrap long line as suggested by Andy Shevchenko.
Signed-off-by: Wang Zihan <jiyu03@qq.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
iio: light: iqs621-als: prefer early error handling over if (!ret)
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>
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>
iio: adc: mcp3422: write bit operations using bitfield.h APIs
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>
iio: magnetometer: rm3100: Modernize locking and refactor control flow
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>
Joshua Crofts [Tue, 5 May 2026 07:31:27 +0000 (09:31 +0200)]
iio: light: si1133: prevent race condition on timeout
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.
Joshua Crofts [Tue, 5 May 2026 07:31:26 +0000 (09:31 +0200)]
iio: light: si1133: reset counter to prevent race condition
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.
Guilherme Dias [Mon, 4 May 2026 19:04:25 +0000 (16:04 -0300)]
iio: gyro: adxrs290: Use guard(mutex) in lieu of manual lock+unlock
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>
iio: Move MODULE_DEVICE_TABLE next to the table itself
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>
Miao Li [Mon, 4 May 2026 03:04:08 +0000 (11:04 +0800)]
iio: light: stk3310: Use sizeof() for regmap_bulk_read/write count parameter
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].
Miao Li [Mon, 4 May 2026 03:04:07 +0000 (11:04 +0800)]
iio: light: stk3310: Replace uint32_t with u32 and reorder members to 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>
Miao Li [Mon, 4 May 2026 03:04:06 +0000 (11:04 +0800)]
iio: light: stk3310: Deal with the ps interrupt issue in PM
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>
Angus Gardner [Mon, 4 May 2026 09:20:58 +0000 (19:20 +1000)]
staging: iio: ad9834: use dev_err_probe() in probe function
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().
Rafael G. Dias [Tue, 28 Apr 2026 16:13:39 +0000 (13:13 -0300)]
iio: light: stk3310: Update includes to match IWYU
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>
Rafael G. Dias [Tue, 28 Apr 2026 16:13:38 +0000 (13:13 -0300)]
iio: light: stk3310: Sort headers alphabetically
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>
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>
Andy Shevchenko [Mon, 27 Apr 2026 18:51:47 +0000 (20:51 +0200)]
iio: buffer: Move from int64_t to s64 for timestamp
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>
iio: adc: ad7625: fix type mismatch in clamp() macro
clamp() expects compatible operand types. The period calculation uses
nanosecond constants, while the local target variable was narrower than
the upper bound expression.
Make target unsigned long and use unsigned long bounds, including
NSEC_PER_USEC for the upper limit. This keeps the operands naturally
aligned without adding casts.
Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Giorgi Tchankvetadze <giorgitchankvetadze1997@gmail.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
iio: adc: ad4080: add support for AD4880 dual-channel ADC
Add support for the AD4880, a dual-channel 20-bit 40MSPS SAR ADC with
integrated fully differential amplifiers (FDA).
The AD4880 has two independent ADC channels, each with its own SPI
configuration interface. The driver uses spi_new_ancillary_device() to
create an additional SPI device for the second channel, allowing both
channels to share the same SPI bus with different chip selects.
Reviewed-by: David Lechner <dlechner@baylibre.com> Reviewed-by: Nuno SĆ” <nuno.sa@analog.com> Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Add support for the AD4880, a dual-channel 20-bit 40MSPS SAR ADC
with integrated fully differential amplifiers (FDA).
The AD4880 has two independent ADC channels, each with its own SPI
configuration interface. This requires:
- Two entries in reg property for primary and secondary channel
chip selects
- Two io-backends entries for the two data channels
Acked-by: Conor Dooley <conor.dooley@microchip.com> Reviewed-by: David Lechner <dlechner@baylibre.com> Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Add a new function to get an IIO backend by its index in the
io-backends device tree property. This is useful for multi-channel
devices that have multiple backends, where looking up by index is
more straightforward than using named backends.
Extract __devm_iio_backend_fwnode_get_by_index() from the existing
__devm_iio_backend_fwnode_get(), taking the index directly as a
parameter. The new public API devm_iio_backend_get_by_index() uses
the index to find the backend reference in the io-backends property,
avoiding the need for io-backend-names.
Reviewed-by: David Lechner <dlechner@baylibre.com> Reviewed-by: Nuno SĆ” <nuno.sa@analog.com> Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
dt-bindings: iio: gyroscope: add mount-matrix for bmg160
The mount-matrix property supplies a 3x3 matrix that is used
to transform the values from the gyroscope to get vector
values that are relative to the way the sensor has been mounted
on the device. When the property is not specified, the identity
matrix is used.
This change adds mount-matrix as an optional property to the
dt-bindings for the bmg160 gyroscope.
Signed-off-by: Vishwas Rajashekar <vishwas.dev@vrajashkr.com> Reviewed-by: Rob Herring (Arm) <robh@kernel.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Enable audio on the RZ/G3L SMARC EVK by linking SSI0 with the DA7212
audio CODEC. The SSI0 signals are multiplexed with SD2 and are selected
by switch SW_SD2_EN#. Add regulator nodes regulator-{1p8v,3p3v} to the
SoM DTSI for reuse by eMMC.
The RZ/G3L SMARC SoM has a Versa 5P35023B clock generator to generate
the following clocks:
- ref: Not connected,
- se1: AUDIO_MCK (11.2896 or 12.2880 MHz),
- se2: RZ_AUDIO_CLK_B (11.2896 MHz),
- se3: RZ_AUDIO_CLK_C (12.2880 MHz),
- diff{1,1B}: ET{0,1}_PHY_CLK (25 MHz),
- diff2{2,2B}: Not connected.
Enable the Vversa 5P35023B clock generator on the RZ/G3L SoM DTSI.
RZ/G3L SMARC EVK has 3 user buttons called USER_SW1, USER_SW2 and
USER_SW3. Instantiate the gpio-keys driver for these buttons by
removing place holders and replacing proper pins for the buttons.
USER_SW{1,2,3} are configured as wakeup-sources, so they can wake up the
system during s2idle.
Enable the xSPI0 and xSPI1 controllers on the RZ/T2H N2H EVK board.
Configure the xSPI0 controller interface to 1-bit (x1) mode, even though
the connected MX25LW51245 octal flash device supports octal mode. Add a
corresponding inline hardware comment detailing this restriction;
operating in octal mode causes the BootROM to fail loading the
first-stage bootloader following a Watchdog Timer (WDT) reset.
Configure the xSPI1 controller interface connected to the AT25SF128A
flash device for 4-bit (x4) mode to utilize all available data lines.
Sort the pinmux entries for both GMAC ctrl nodes in port order (A/B/C and
D/E/F respectively) and remove the extra blank line before the second
pinmux assignment.
Nguyen Tran [Fri, 22 May 2026 17:19:57 +0000 (19:19 +0200)]
arm64: dts: renesas: r8a779md: Add support for R-Car M3Le R8A779MD Geist
Add support for the Geist board based on the Renesas R-Car R8A779MD (M3Le)
SoC, a register-compatible variant of the R8A77965 (M3-N) with reduced set
of peripherals.
Biju Das [Wed, 20 May 2026 11:51:41 +0000 (12:51 +0100)]
arm64: dts: renesas: r9a07g054: Add max-frequency to SDHI nodes
Add the max-frequency property set to 133333333 Hz (133.33 MHz) to both
SDHI0 and SDHI1 MMC controller nodes in the RZ/V2L (r9a07g054) device
tree, increasing performance by ca. 33%.
Biju Das [Wed, 20 May 2026 11:51:40 +0000 (12:51 +0100)]
arm64: dts: renesas: r9a07g044: Add max-frequency to SDHI nodes
Add the max-frequency property set to 133333333 Hz (133.33 MHz) to both
SDHI0 and SDHI1 MMC controller nodes in the RZ/{G2L,G2LC} (r9a07g044)
device tree, increasing performance by ca. 33%.
Biju Das [Wed, 20 May 2026 11:51:39 +0000 (12:51 +0100)]
arm64: dts: renesas: r9a07g043: Add max-frequency to SDHI nodes
Add the max-frequency property set to 133333333 Hz (133.33 MHz) to both
SDHI0 and SDHI1 MMC controller nodes in the RZ/{G2UL,Five} (r9a07g043)
device tree, increasing performance by ca. 33%.
arm64: dts: renesas: r8a78000: Add MFIS, MFIS-SCP, and transport nodes
Describe the MFIS and MFIS SCP instances which are used for various
tasks including inter-processor communication. Remove the PRR node
because it is part of MFIS on R-Car X5H and should be handled using the
MFIS compatible. Also, describe the S-TCM transport area used for shared
memory mailboxing.
Marek Vasut [Sun, 17 May 2026 16:31:25 +0000 (18:31 +0200)]
arm64: dts: renesas: ironhide: Describe all reserved memory
Fully describe all available DRAM in the DT, and describe regions which
are not accessible because they are used by firmware in reserved-memory
nodes.
Replace the first memory bank memory@60600000 with memory@40000000 and a
518 MiB long reserved-memory no-map subnode. This memory region is used
by other cores in the system.
Reserve 32 kiB of memory at 0x8c100000 for parameters shared by IPL,
SCP, TFA BL31 and TEE.
Reserve 512 kiB of memory at 0x8c200000 for TFA BL31. The upcoming
upstream TFA 2.15 BL31 uses memory from 0x8c200000..0x8c242fff; rounding
up to 512 kiB is slight future-proofing.
Reserve 32 MiB of memory at 0x8c400000 for OPTEE-OS, which is the entire
OPTEE-OS TZ protected DRAM area.
Neither TFA BL31 nor OPTEE-OS modify the DT passed to Linux in any way
with any new reserved-memory {} nodes to reserve memory areas used by
the TFA BL31 or OPTEE-OS to prevent the next stage from using those
areas, which lets Linux use all of the available DRAM as it is described
in the DT that was passed in by U-Boot, including the areas that are
newly utilized by TFA BL31 or OPTEE-OS.
In case of high DRAM utilization, unless the memory used by TFA BL31 or
OPTEE-OS is properly reserved, Linux may use and corrupt the memory used
by TFA BL31 or OPTEE-OS, which would lead to the system becoming
unresponsive.
The HW user manual for the Renesas RZ/T2H and the RZ/N2H states that for
SDR104, SDR50, and HS200 to work properly the eMMC/SDHI interface pins
have to be configured as specified below:
- SDn_CLK pin - drive strength: Ultra High, slew rate: Fast,
- Other SDn_* pins: drive strength: High, slew rate: Fast,
Schmitt trigger: disabled (not applicable to SDn_RST pins).
HS DDR and DDR50 are currently not supported, and for every other bus
mode the eMMC/SDHI interface pins should be configured as specified
below:
- SDn_CLK pin - drive strength: High, slew rate: Fast,
- Other SDn_* pins: drive strength: Middle, slew rate: Fast,
Schmitt trigger: disabled (not applicable to SDn_RST pins).
The Renesas R-Car X5H (R8A78000) SoC contains Arm CoreLink GIC-720AE
Generic Interrupt Controller with Multi View capability. Firmware has
access to configuration View 0, Linux kernel has access to View 1.
The Arm CoreLink GIC-720AE Generic Interrupt Controller Technical
Reference Manual, currently latest r2p1 [1], chapter "5. Programmers
model for GIC-720AE", subchapter "5.4 Redistributor registers
for control and physical LPIs summary", part "5.4.3 GICR_TYPER,
Redistributor Type Register", "Table 5-50: GICR_TYPER bit descriptions"
on page 200, clarifies register "GICR_TYPER" bit 4 "Last" behavior
in Multi View setup as follows:
Last
Last Redistributor:
0 ... This Redistributor is not the last Redistributor on the chip.
1 ... This Redistributor is the last Redistributor on the chip.
When GICD_CFGID.VIEW == 1, for views 1, 2, or 3 this bit
always returns 1.
On this SoC, GICD_CFGID.VIEW is 1 and the Linux kernel has access to
View 1, therefore Linux kernel GICv3 driver will interpret register
"GICR_TYPER" bit 4 "Last" = 1 in the first Redistributor in continuous
Redistributor page as that first Redistributor being the one and only
Redistributor and will stop processing the continuous Redistributor
page further. This will prevent the other Redistributors from being
recognized by the system and used for other PEs.
Because the hardware indicates that the continuous Redistributor page
is not continuous for View 1, 2, or 3, describe every Redistributor
separately in the DT. This makes all Redistributors for all cores
accessible in Linux.
Add audio_clk1 and audio_clk2 fixed-clock nodes to the RZ/G3L (r9a08g046)
SoC DTSI. These clocks are external to the SoC and their frequencies are
board-dependent, so they are defined with clock-frequency = <0> as
placeholders that must be overridden in board-level DTS files.
Add i2c{0..3} device nodes to RZ/G3L ("R9A08G046") SoC DTSI.
As the place holders for i2c0 is removed, add the pincontrol
device nodes to make it functional on the board DTS.
We need to properly map camss WM index to our internal WM client
instance. Today we only support RDI interfaces with the RDI_WM
macro, introduce a __wm_to_client helper to support any interface.
Add PIX path support to the CSID-340 driver. The hardware exposes a
dedicated PIX interface in addition to the existing RDI paths, but
the driver only supported RDI stream configuration so far.
The PIX path is configured similarly to RDI but requires decode-format
to be specified.
The PIX pipeline can subsequently perform further processing,
including scaling, cropping, and statistics.
The CSID-340 block uses different register offsets for the PIX and RDI
interfaces, but the driver previously indexed these registers directly
with the camss port number. This happened to work for RDI because the
port index matches the RDI register layout, but this assumption breaks
with upcoming PIX interface support
Introduce an explicit port-to-interface mapping and use the mapped iface
index when programming CSID_CFG0 and CSID_CTRL. This replaces the
standalone __csid_ctrl_rdi() helper and simplifies the RDI stream setup
path.
Also correct the CSID_CFG0/CTRL base offsets and clean up the code in
preparation for full PIX path support.
Like RDI, PIX outputs Bayer frames but can also achieve some image
processing such as scaling, cropping and generating statitics (e.g.
histogram), it also offer more flexebility in term of image alignment
and stride. All of that can then later be leveraged to improve
software or hardware frames post-processing.
media: qcom: camss: csid-340: Switch to generic CSID_CFG/CTRL registers
The former RDI-specific register definitions (CSID_RDI_CFG0/CTRL) are
renamed to unified CSID_CFG0/CSID_CTRL variants, as their layout is
interface agnostic. This refactoring provides the foundation for
extending csid-340 with missing PIX interface/path support.