Ian Abbott [Fri, 30 Jan 2026 16:48:08 +0000 (16:48 +0000)]
comedi: pcmuio: Add sanity checks for I/O base address
The "pcmmio" driver uses an admin-supplied configuration option
(`it->options[0]`) to configure the I/O port base address of a
PCM-UIO48A or PCM-UIO96A board. It will probably work with the later
PCM-UIO48C and PCM-UIO96C boards. It currently allows any base address
to be configured but the hardware only supports base addresses
(configured by on-board jumpers) in the range 0 to 0xFFF0 on 16-byte
boundaries (for PCM-UIO48C) or 0 to 0xFFE0 on 32-byte boundaries (for
PCM-UIO96C). (The PCM-UIO48A supports base addresses up to 0xFF0 and
the PCI-UIO96A supports base addresses up to 0x7E0.)
Add a sanity check to ensure the device is not configured at an
unsupported base address (allowing for the extended range of the "C"
models).
Ian Abbott [Fri, 30 Jan 2026 16:48:07 +0000 (16:48 +0000)]
comedi: pcmmio: Add sanity checks for I/O base address
The "pcmmio" driver uses an admin-supplied configuration option
(`it->options[0]`) to configure the I/O port base address of a PCM-MIO
board. It currently allows any base address to be configured but the
hardware only supports base addresses (configured by on-board jumpers)
in the range 0 to 0xFFE0 on 32-byte boundaries.
Add a sanity check to ensure the device is not configured at an
unsupported base address.
Ian Abbott [Fri, 30 Jan 2026 16:48:06 +0000 (16:48 +0000)]
comedi: pcmda12: Add sanity checks for I/O base address
The "pcmda12" driver uses an admin-supplied configuration option
(`it->options[0]`) to configure the I/O port base address of a
PCM-D/A-12 or PCM-A/D-16 board. It currently allows any base address to
be configured. I cannot find a full manual, but the short datasheet
says it uses 15 consecutive I/O addresses on "any even sixteen port
boundary", so assume it supports base addresses (configured by on-board
jumpers) in the range 0 to 0x3E0 on 32-byte boundaries.
Add a sanity check to ensure the device is not configured at an
unsupported base address.
Ian Abbott [Fri, 30 Jan 2026 16:48:05 +0000 (16:48 +0000)]
comedi: pcmad: Add sanity checks for I/O base address
The "pcmad" driver uses an admin-supplied configuration option
(`it->options[0]`) to configure the I/O port base address of a
PCM-A/D-12 or PCM-A/D-16 board. It currently allows any base address to
be configured but the hardware only supports base addresses (configured
by on-board jumpers) in the range 0 to 0x3FC on 4-byte boundaries.
Add a sanity check to ensure the device is not configured at an
unsupported base address.
Ian Abbott [Fri, 30 Jan 2026 16:48:04 +0000 (16:48 +0000)]
comedi: pcm3724: Add sanity checks for I/O base address
The "pcm3724" driver uses an admin-supplied configuration option
(`it->options[0]`) to configure the I/O port base address of a PCM-3724
board. It currently allows any base address to be configured but the
hardware only supports base addresses (configured by on-board DIP
switches) in the range 0 to 0x3F0 on 16-byte boundaries.
Add a sanity check to ensure the device is not configured at an
unsupported base address.
Ian Abbott [Fri, 30 Jan 2026 16:48:03 +0000 (16:48 +0000)]
comedi: pcl818: Add sanity checks for I/O base address
The "pcl818" driver uses an admin-supplied configuration option
(`it->options[0]`) to configure the I/O port base address of a board in
the PCL-818 series. It currently allows any base address to be
configured but the hardware devices only support base addresses
(configured by on-board DIP switches) from 0 to 0x3F0 on 16-byte
boundaries. If the board has a FIFO and jumper JP6 is in the "Enabled"
(default) position, then the base address needs to be on a 32-byte
boundary and the length of the I/O port region will be 32 (to allow
access to the FIFO registers) instead of 16. The state of jumper JP6 is
unknown, so if the board has a FIFO device and is being configured on an
odd 16-byte boundary, assume that jumper JP6 is in the "Disabled"
position (to disallow access to the FIFO registers).
Add a sanity check to ensure the device is not configured at an
unsupported base address.
If the board has a FIFO and is configured on an odd 16-byte boundary,
log a reminder that JP6 needs to be in the "Disabled" position for
correct operation. If the board has a FIFO and is configured on an even
16-byte boundary and the configuration option has been set to use the
FIFO (`it->options[2] == -1`), log a reminder that JP6 needs to be in
the "Enabled" position.
Ian Abbott [Fri, 30 Jan 2026 16:48:02 +0000 (16:48 +0000)]
comedi: pcl816: Add sanity checks for I/O base address
The "pcl816" driver uses an admin-supplied configuration option
(`it->options[0]`) to configure the I/O port base address of a PCL-816
or PCL-814B ISA board. It currently allows any base address to be
configured but the hardware devices only support base addresses
(configured by on-board DIP switches) from 0 to 0x3F0 on 16-byte
boundaries.
Add a sanity check to ensure the device is not configured at an
unsupported base address.
Ian Abbott [Fri, 30 Jan 2026 16:48:01 +0000 (16:48 +0000)]
comedi: pcl812: Add sanity checks for I/O base address
The "pcl812" driver uses an admin-supplied configuration option
(`it->options[0]`) to configure the I/O port base address of various
analog/digital I/O ISA boards from Advantech, ADLINK, and ICP DAS. It
currently allows any base address to be configured but the hardware
devices only support base addresses (configured by on-board DIP
switches) from 0 or 0x200 (depending on the model) to 0x3F0 on 16-byte
boundaries.
Store the minimum supported I/O base addresses in the static board
information array elements and add a sanity check to ensure the device
is not configured at an unsupported base address.
Ian Abbott [Fri, 30 Jan 2026 16:48:00 +0000 (16:48 +0000)]
comedi: pcl730: Add sanity checks for I/O base address
The "pcl730" driver uses an admin-supplied configuration option
(`it->options[0]`) to configure the I/O port base address of various
relay output and digital input ISA board from Advantech, ADLINK, ICP
DAS, and Diamond Systems. It currently allows any base address to be
configured but the hardware devices have restrictions on the base
addresses (configured by on-board DIP switches or jumpers), including
the alignment, which can be larger than the board's I/O register address
span. The Diamond Systems IR104-PBF board is particularly restricted to
4 different base addresses with different sized gaps between the
possible addresses.
Store the minimum supported I/O base addresses and alignment in the
static board information array elements and add a sanity check to ensure
the device is not configured at an unsupported base address. For the
IR104-PBF board, add a special check that the base address is one of the
4 supported base addresses for that board.
Ian Abbott [Fri, 30 Jan 2026 16:47:59 +0000 (16:47 +0000)]
comedi: pcl726: Add sanity checks for I/O base address
The "pcl726" driver uses an admin-supplied configuration option
(`it->options[0]`) to configure the I/O port base address of various
analog output ISA boards from Advantech (PCL-726/727/728) and ADLINK
(ACL-6126/6128). (Most of them also have digital I/O.) It currently
allows any base address to be configured but the hardware only supports
base addresses (configured by on-board DIP switches) from 0 or 0x200 up
to nearly 0x3FF, depending on the model.
Store the minimum and maximum supported I/O address ranges in the static
board information array elements (the required alignment is already
stored in the `io_len` member), and add a sanity check to ensure the
device is not configured at an unsupported base address.
Ian Abbott [Fri, 30 Jan 2026 16:47:58 +0000 (16:47 +0000)]
comedi: pcl724: Add sanity checks for I/O base address
The "pcl724" driver uses an admin-supplied configuration option
(`it->options[0]`) to configure the I/O port base address of various
8255 chip-based digital I/O ISA boards from Advantech, ADLINK,
WinSystems, and Diamond Systems. It currently allows any base address
to be configured but the hardware only supports base addresses
(configured by on-board DIP switches or jumpers) in various ranges, and
on various alignment boundaries, depending on the model.
Store the minimum and maximum supported I/O address ranges in the static
board information array elements (the required alignment is already
stored in the `io_range` member), and add a sanity check to ensure the
device is not configured at an unsupported base address.
Ian Abbott [Fri, 30 Jan 2026 16:47:57 +0000 (16:47 +0000)]
comedi: pcl711: Add sanity checks for I/O base address
The "pcl711" driver uses an admin-supplied configuration option
(`it->options[0]`) to configure the I/O port base address of an
Advantech PCL-711 series board or an Adlink ACL-8112 series board. It
currently allows any base address to be configured but the hardware only
supports base addresses (configured by on-board DIP switches) in the
range 0 to 0x3F0 (for PCL-711) or 0x200 to 0x3F0 (for ACL-8112) on
16-byte boundaries.
Store the minimum supported I/O base address in the static board
information array elements, and add a sanity check to ensure the device
is not configured at an unsupported base address.
Ian Abbott [Fri, 30 Jan 2026 16:47:56 +0000 (16:47 +0000)]
comedi: ni_labpc: Add sanity checks for I/O base address
The "ni_labpc" driver uses an admin-supplied configuration option
(`it->options[0]`) to configure the I/O port base address of a
Lab-PC-1200 series or Lab-PC+ board. It currently allows any base
address to be configured but the hardware only supports base addresses
(configured by a configuration utility and stored in nonvolatile memory)
in the range 0 to 0x3E0 on 32-byte boundaries.
Add a sanity check to ensure the device is not configured at an
unsupported base address.
Ian Abbott [Fri, 30 Jan 2026 16:47:55 +0000 (16:47 +0000)]
comedi: ni_atmio16d: Add sanity checks for I/O base address
The "ni_atmio16d" driver uses an admin-supplied configuration option
(`it->options[0]`) to configure the I/O port base address of an
AT-MIO-16 o AT-MIO-16D board. It currently allows any base address to
be configured but the hardware only supports base addresses (configured
by on-board DIP switches) in the range 0 to 0x3E0 on 32-byte boundaries.
Add a sanity check to ensure the device is not configured at an
unsupported base address.
Ian Abbott [Fri, 30 Jan 2026 16:47:54 +0000 (16:47 +0000)]
comedi: ni_atmio: Add sanity checks for I/O base address
The "ni_atmio" driver uses an admin-supplied configuration option
(`it->options[0]`) to configure the I/O port base address of an AT E
Series board. Or, if the option value is zero, it can search ISA PNP
devices to look for a compatible board. If the base address is
configured manually, it currently allows any base address to be
configured but the hardware only supports base addresses (configured by
a configuration utility and stored in nonvolatile memory) in the range
0x20 to 0xFFE0 on 32-byte boundaries.
Add a sanity check to ensure the device is not configured at an
unsupported base address.
Ian Abbott [Fri, 30 Jan 2026 16:47:53 +0000 (16:47 +0000)]
comedi: ni_at_ao: Add sanity checks for I/O base address
The "ni_at_ao" driver uses an admin-supplied configuration option
(`it->options[0]`) to configure the I/O port base address of an AT-AO-6
or AT-AO-10 board. It currently allows any base address to be
configured but the hardware only supports base addresses (configured by
on-board jumpers) in the range 0 to 0x3E0 on 32-byte boundaries.
Add a sanity check to ensure the device is not configured at an
unsupported base address.
Ian Abbott [Fri, 30 Jan 2026 16:47:52 +0000 (16:47 +0000)]
comedi: ni_at_a2150: Add sanity checks for I/O base address
The "ni_at_a2150" driver uses an admin-supplied configuration option
(`it->options[0]`) to configure the I/O port base address of an AT-A2150
series board. It currently allows any base address to be configured but
the hardware only supports base addresses (configured by on-board
jumpers) in the range 0 to 0x3E0 on 32-byte boundaries.
Add a sanity check to ensure the device is not configured at an
unsupported base address.
Ian Abbott [Fri, 30 Jan 2026 16:47:51 +0000 (16:47 +0000)]
comedi: multiq3: Add sanity checks for I/O base address
The "multiq3" driver uses an admin-supplied configuration option
(`it->options[0]`) to configure the I/O port base address of a Multiq-3
board. It currently allows any base address to be configured but the
hardware only supports base addresses (configured by on-board jumpers)
in the range 0 to 0x3F0 on 16-byte boundaries.
Add a sanity check to ensure the device is not configured at an
unsupported base address.
Ian Abbott [Fri, 30 Jan 2026 16:47:50 +0000 (16:47 +0000)]
comedi: mpc624: Add sanity checks for I/O base address
The "mpc624" driver uses an admin-supplied configuration option
(`it->options[0]`) to configure the I/O port base address of a MPC624
board. It currently allows any base address to be configured but the
hardware only supports base addresses (configured by on-board jumpers)
in the range 0 to 0x3F0 on 16-byte boundaries.
Add a sanity check to ensure the device is not configured at an
unsupported base address.
Ian Abbott [Fri, 30 Jan 2026 16:47:49 +0000 (16:47 +0000)]
comedi: fl512: Add sanity checks for I/O base address
The "fl512" driver uses an admin-supplied configuration option
(`it->options[0]`) to configure the I/O port base address of an FL512
board. It currently allows any base address to be configured and uses a
16-byte register region.
I cannot find any information about this board, but assume it needs to
be aligned to a 16-byte boundary. I have no idea about the allowed
range, so allow anything in a 32-bit range and add a "FIXME" comment
(although most ancient ISA cards only support 10-bit address decoding).
Add a sanity check to ensure the device is not configured at an
unsupported base address.
Ian Abbott [Fri, 30 Jan 2026 16:47:48 +0000 (16:47 +0000)]
comedi: dt2817: Add sanity checks for I/O base address
The "dt2817" driver uses an admin-supplied configuration option
(`it->options[0]`) to configure the I/O port base address of a DT2817
board. It currently allows any base address to be configured but the
hardware only supports base addresses (configured by on-board jumpers)
in the range 0x200 to 0x3f8 on 8-byte boundaries.
Add a sanity check to ensure the device is not configured at an
unsupported base address.
Ian Abbott [Fri, 30 Jan 2026 16:47:47 +0000 (16:47 +0000)]
comedi: dt2815: Add sanity checks for I/O base address
The "dt2815" driver uses an admin-supplied configuration option
(`it->options[0]`) to configure the I/O port base address of a DT2815
board. It currently allows any base address to be configured but the
hardware only supports base addresses (configured by an on-board DIP
switch) in the range 0x200 to 0x3fe on 2-byte boundaries.
Add a sanity check to ensure the device is not configured at an
unsupported base address.
Ian Abbott [Fri, 30 Jan 2026 16:47:46 +0000 (16:47 +0000)]
comedi: dt2814: Add sanity checks for I/O base address
The "dt2814" driver uses an admin-supplied configuration option
(`it->options[0]`) to configure the I/O port base address of a DT2814
board. It currently allows any base address to be configured but the
hardware only supports base addresses (configured by an on-board DIP
switch) in the range 0x200 to 0x3fe on 2-byte boundaries.
Add a sanity check to ensure the device is not configured at an
unsupported base address.
Ian Abbott [Fri, 30 Jan 2026 16:47:45 +0000 (16:47 +0000)]
comedi: dt2811: Add sanity checks for I/O base address
The "dt2811" driver uses an admin-supplied configuration option
(`it->options[0]`) to configure the I/O port base address of a supported
board in the DT2811 family. It currently allows any base address to be
configured but the hardware only supports base addresses (configured by
on-board jumpers) in the range 0x200 to 0x3f8 on 8-byte boundaries.
Add a sanity check to ensure the device is not configured at an
unsupported base address.
Ian Abbott [Fri, 30 Jan 2026 16:47:44 +0000 (16:47 +0000)]
comedi: dt2801: Add sanity checks for I/O base address
The "dt2801" driver uses an admin-supplied configuration option
(`it->options[0]`) to configure the I/O port base address of a supported
board in the DT2801 family. It currently allows any base address to be
configured but the hardware only supports base addresses (configured by
an on-board DIP switch) in the range 0x200 to 0x3fe on 2-byte
boundaries.
Add a sanity check to ensure the device is not configured at an
unsupported base address.
Ian Abbott [Fri, 30 Jan 2026 16:47:43 +0000 (16:47 +0000)]
comedi: dmm32at: Add sanity check for I/O base address
The "dmm32at" driver uses an admin-supplied configuration option
(`it->options[0]`) to configure the I/O port base address of a
Diamond-MM-32-AT board. It currently allows any base address to be
configured but the hardware only supports 8 possible base addresses
(selected by 3 on-board jumpers). These are 0x100, 0x140, 0x180, 0x200,
0x280, 0x300, 0x340, and 0x380.
Add a sanity check to ensure the device is not configured at an
unsupported base address.
Ian Abbott [Fri, 30 Jan 2026 16:47:42 +0000 (16:47 +0000)]
comedi: das800: Add sanity checks for I/O base address
The "das800" driver uses an admin-supplied configuration option
(`it->options[0]`) to configure the I/O port base address of a supported
board in the DAS800 family. It currently allows any base address to be
configured but the hardware only supports base addresses (configured by
an on-board DIP switch) in the range 0 to 0x3f8 on 8-byte boundaries.
Add a sanity check to ensure the device is not configured at an
unsupported base address.
Ian Abbott [Fri, 30 Jan 2026 16:47:41 +0000 (16:47 +0000)]
comedi: das6402: Add sanity checks for I/O base address
The "das6402" driver uses an admin-supplied configuration option
(`it->options[0]`) to configure the I/O port base address of a supported
board in the DAS6402 family. It currently allows any base address to be
configured but the hardware only supports base addresses (configured by
an on-board DIP switch) in the range 0 to 0x3f0 on 16-byte boundaries.
Add a sanity check to ensure the device is not configured at an
unsupported base address.
Ian Abbott [Fri, 30 Jan 2026 16:47:40 +0000 (16:47 +0000)]
comedi: das1800: Add sanity checks for I/O base address
The "das1800" driver uses an admin-supplied configuration option
(`it->options[0]`) to configure the I/O port base address of a board
compatible with the DAS1800 series. It currently allows any base
address to be configured but the hardware only supports base addresses
(configured by an on-board DIP switch) in the range 0 to 0x3f0 on
16-byte boundaries. Some boards have an additional span of up to 0x10
registers at offset 0x400 from the main 0x10 byte region.
Add a sanity check to ensure the device is not configured at an
unsupported base address. If the main base address is correctly aligned
and within range, then the additional region at offset 0x400 from the
configured base address will naturally be within range and correctly
aligned.
Ian Abbott [Fri, 30 Jan 2026 16:47:39 +0000 (16:47 +0000)]
comedi: das16m1: Add sanity checks for I/O base address
The "das16m1" driver uses an admin-supplied configuration option
(`it->options[0]`) to configure the I/O port base address of a DAS16/M1
board. It currently allows any base address to be configured but the
hardware only supports base addresses (configured by an on-board DIP
switch) in the range 0 to 0x3f0 on 16-byte boundaries. It has an
additional span of 0x8 registers at offset 0x400 from the main 0x10 byte
region.
Add a sanity check to ensure the device is not configured at an
unsupported base address. If the main base address is correctly aligned
and within range, then the additional region at offset 0x400 from the
configured base address will naturally be within range and correctly
aligned.
Ian Abbott [Fri, 30 Jan 2026 16:47:38 +0000 (16:47 +0000)]
comedi: das16: Add sanity checks for I/O base address
The "das16" driver uses an admin-supplied configuration option
(`it->options[0]`) to configure the I/O port base address of a various
DAS16 compatible boards. It currently allows any base address to be
configured but the hardware only supports base addresses (configured by
an on-board DIP switch) in the range 0 to 0x3f0 on 16- or 32-byte
boundaries. Some of the boards have an 8255 chip at offset 0x10 and
require the board to be configured on a 32-byte boundary unless some
on-board jumpers are set to limit the board to decoding only the first
0x10 registers, disabling access to the 8255. Some other boards place
the 8255 chip (and some other registers) at offset 0x400 from the base
address, decoding 0x10 registers at the base address and 0x8 registers
at the base address plus 0x400.
Add a sanity check to ensure the device is not configured at an
unsupported base address. If the device has the 8255 chip at offset
0x10, and is being configured with the base address at an odd 16-byte
boundary, limit the size of the region to 0x10 and disable the 8255
subdevice.
Ian Abbott [Fri, 30 Jan 2026 16:47:37 +0000 (16:47 +0000)]
comedi: das08_isa: Add sanity checks for I/O base address
The "das08_isa" driver uses an admin-supplied configuration option
(`it->options[0]`) to configure the I/O port base address of a supported
board in the DAS08 family. It currently allows any base address to be
configured but the hardware only supports base addresses (configured by
an on-board DIP switch) in the range 0 to 0x3f0 on 16-byte boundaries.
(Technically, the DIP switches allow 8-byte boundaries, but I do not
think that is advisable given that the boards decode an 16-byte address
range.)
Add a sanity check to ensure the device is not configured at an
unsupported base address.
Ian Abbott [Fri, 30 Jan 2026 16:47:36 +0000 (16:47 +0000)]
comedi: dac02: Add sanity checks for I/O base address
The "dac02" driver uses an admin-supplied configuration option
(`it->options[0]`) to configure the I/O port base address of a supported
DAC-02 board. It currently allows any base address to be configured but
the hardware only supports base addresses (configured by an on-board DIP
switch) in the range 0x200 to 0x3f8 on 8-byte boundaries.
Add a sanity check to ensure the device is not configured at an
unsupported base address.
Ian Abbott [Fri, 30 Jan 2026 16:47:35 +0000 (16:47 +0000)]
comedi: comedi_parport: Add sanity checks for I/O base address
The "comedi_parport" driver treats a standard printer parallel port as a
COMEDI digital I/O device, driving the port's I/O registers directly.
It uses an admin-supplied configuration option (`it->options[0]`) to
configure the I/O port base address of the device. Currently, the
driver allows any I/O base address to be specified as long as the I/O
region can be reserved, and it converts the specified `int` option value
holding the base address to `unsigned long`.
It doesn't make sense to allow base addresses that are not aligned to
4-byte boundaries (for SPP printer ports, although printer ports with
EPP/ECP support actually need to be aligned on 8-byte boundaries), so
add a check for 4-byte alignment.
Convert the option value that specifies the base address from `int` to
`unsigned int` instead of `unsigned long` so it ends up the same on
32-bit and 64-bit systems.
Ian Abbott [Fri, 30 Jan 2026 16:47:34 +0000 (16:47 +0000)]
comedi: c6xdigio: Add sanity checks for I/O base address
The "c6xdigio" driver uses an admin-supplied configuration option
(`it->options[0]`) to configure the I/O port base address of a supported
C6x_DIGIO DSP device connected to a PC printer parallel port (driving
the port's I/O registers directly). Currently, the driver allows any
I/O base address to be specified as long as the I/O region can be
reserved, and it converts the specified `int` option value holding the
base address to `unsigned long`.
It doesn't make sense to allow base addresses that are not aligned to
4-byte boundaries (for SPP printer ports, although printer ports with
EPP/ECP support actually need to be aligned on 8-byte boundaries), so
add a check for 4-byte alignment.
Convert the option value that specifies the base address from `int` to
`unsigned int` instead of `unsigned long` so it ends up the same on
32-bit and 64-bit systems.
Ian Abbott [Fri, 30 Jan 2026 16:47:33 +0000 (16:47 +0000)]
comedi: amplc_pc263: Add sanity checks for I/O base address
The "amplc_pc263" driver uses an admin-supplied configuration option
(`it->options[0]`) to configure the I/O port base address of a supported
PC263 board. It currently allows any base address to be configured but
the hardware only supports base addresses (set by on-board DIP switches)
in the range 0 to 0x7FE on 2-byte boundaries.
Add a sanity check to ensure the device is not configured at an
unsupported base address.
Ian Abbott [Fri, 30 Jan 2026 16:47:32 +0000 (16:47 +0000)]
comedi: amplc_pc236: Add sanity checks for I/O base address
The "amplc_pc236" driver uses an admin-supplied configuration option
(`it->options[0]`) to configure the I/O port base address of a supported
PC36AT board. It currently allows any base address to be configured but
the hardware only supports base addresses (set by on-board DIP switches)
in the range 0 to 0xFFC on 4-byte boundaries.
Add a sanity check to ensure the device is not configured at an
unsupported base address.
Ian Abbott [Fri, 30 Jan 2026 16:47:31 +0000 (16:47 +0000)]
comedi: amplc_dio200: Add sanity checks for I/O base address
The "amplc_dio200" driver uses an admin-supplied configuration option
(`it->options[0]`) to configure the I/O port base address of a supported
board (PC212E, PC214E, PC215E, PC218E, or PC272E). It currently allows
any base address to be configured but the hardware only supports base
addresses (set by on-board DIP switches) in the range 0 to 0xFE0 on
32-byte boundaries. (Technically, the DIP switches allow 16-byte
boundaries, but I do not think that is advisable given that the boards
decode a 32-byte address range.)
Add a sanity check to ensure the device is not configured at an
unsupported base address.
Ian Abbott [Fri, 30 Jan 2026 16:47:30 +0000 (16:47 +0000)]
comedi: aio_iiro_16: Add sanity checks for I/O base address
The "aio_iiro_16" driver uses an admin-supplied configuration option
(`it->options[0]`) to configure the I/O port base address of a supported
board (IIRO-16). It currently allows any base address to be configured
but the hardware only supports base addresses (set by on-board jumpers)
in the range 0x100 to 0x3F8 on 8-byte boundaries.
Add a sanity check to ensure the device is not configured at an
unsupported base address.
Ian Abbott [Fri, 30 Jan 2026 16:47:29 +0000 (16:47 +0000)]
comedi: aio_aio12_8: Add sanity checks for I/O base address
The "aio_aio12_8" driver uses an admin-supplied configuration option
(`it->options[0]`) to configure the I/O port base address of a supported
board (AIO12-8, AI12-8, or AO12-4). It currently allows any base
address to be configured but the hardware only supports base addresses
(set by on-board jumpers) in the range 0x100 to 0x3C0 on 32-byte
boundaries.
Add a sanity check to ensure the device is not configured at an
unsupported base address.
Ian Abbott [Fri, 30 Jan 2026 16:47:28 +0000 (16:47 +0000)]
comedi: adq12b: Add sanity checks for I/O base address
The "adq12b" driver uses an admin-supplied configuration option
(`it->options[0]`) to configure the I/O port base address of the ADQ12-B
board. It currently allows any base address to be configured but the
hardware only supports the following base addresses (set by an on-board
jumper): 0x300, 0x320, 0x340, 0x360, 0x380, 0x3A0.
Add a sanity check to ensure the device is not configured at an
unsupported base address.
Ian Abbott [Fri, 30 Jan 2026 16:47:27 +0000 (16:47 +0000)]
comedi: 8255: Add some I/O base address sanity checks
The "8255" driver allows a COMEDI device to be constructed from one or
more 8255 chips, each at an I/O port base address specified by the
admin-supplied configuration options (`it->options[]`). Currently, the
driver allows any I/O base addresses to be specified as long as the I/O
regions can be reserved, and it converts the specified `int` option
values holding the base address to `unsigned long`.
It doesn't make sense to allow base addresses that are not aligned to
4-byte boundaries because the hardware register addresses would not be
decoded properly, so add a check for valid alignment.
Convert the option values that specify the base addresses from `int` to
`unsigned int` instead of `unsigned long` so they end up the same on
32-bit and 64-bit systems.
Ian Abbott [Fri, 30 Jan 2026 16:47:26 +0000 (16:47 +0000)]
comedi: add comedi_check_request_region()
There is an existing comedi_request_region(dev, start, len) function
used by COMEDI drivers for legacy devices to request an I/O port region
starting at a specified base address (which must be non-zero) and with a
specified length. It uses request_region(). On success, it sets
dev->iobase and dev->iolen and returns 0. There is a alternative
function __comedi_request_region(dev, start, len) which does the same
thing without setting dev->iobase and dev->iolen.
Most hardware devices have restrictions on the allowed I/O port base
address and alignment, so add new functions
comedi_check_request_region(dev, start, len, minstart, maxend, minalign)
and __comedi_check_request_region(dev, start, len, minstart, maxend,
minalign) to perform these additional checks. Turn the original
functions into static inline wrapper functions that call the new
functions.
Mohamad Alsadhan [Tue, 17 Mar 2026 14:49:47 +0000 (17:49 +0300)]
rust_binder: add `command`/`return` tracepoints
Add Rust Binder `command` and `return` tracepoint declarations and
wire them in where BC commands are parsed and BR return codes are
emitted to userspace.
Mohamad Alsadhan [Tue, 17 Mar 2026 14:49:46 +0000 (17:49 +0300)]
rust_binder: add fd translation tracepoints
Add Rust Binder tracepoint declarations for both `transaction_fd_send`
and `transaction_fd_recv`. Also, wire in the corresponding trace calls
where fd objects are serialised/deserialised.
Add Rust Binder `transaction_received` tracepoint decalaration and
wire in the corresponding trace call when a transaction work item is
accepted for execution.
Alice Ryhl [Tue, 24 Mar 2026 20:02:38 +0000 (20:02 +0000)]
rust_binder: check current before closing fds
This list gets populated once the transaction is delivered to the target
process, at which point it's not touched again except in BC_FREE_BUFFER
and process exit, so if the list has been populated then this code
should not run in the context of the wrong userspace process.
However, why tempt fate? The function itself can run in the context of
both the sender and receiver, and if someone can engineer a scenario
where it runs in the sender and this list is non-empty (or future Rust
Binder changes make such a scenario possible), then that'd be a problem
because we'd be closing random unrelated fds in the wrong process.
Note that on process exit, the == comparison may actually fail because
it's called from a kthread. The fd closing code is a no-op on kthreads,
so there is no actual behavior different though.
Alice Ryhl [Tue, 24 Mar 2026 20:02:36 +0000 (20:02 +0000)]
rust: task: implement == operator for Task
It's useful to compare if two tasks are the same task or not. Rust
Binder wants this to check if a certain task is equal to the group
leader of current.
Alice Ryhl [Tue, 24 Mar 2026 20:02:35 +0000 (20:02 +0000)]
rust: sync: implement == operator for ARef
Rust Binder wants to perform a comparison between ARef<Task> and &Task,
so define the == operator for ARef<_> when compared with another ARef<_>
or just a reference. The operator is implemented in terms of the same
operator applied to the inner type.
Note that PartialEq<U> cannot be implemented because it would overlap
with the impl for ARef<U>.
Alice Ryhl [Fri, 6 Mar 2026 11:28:46 +0000 (11:28 +0000)]
rust_binder: introduce TransactionInfo
Rust Binder exposes information about transactions that are sent in
various ways: printing to the kernel log, tracepoints, files in
binderfs, and the upcoming netlink support. Currently all these
mechanisms use disparate ways of obtaining the same information, so
let's introduce a single Info struct that collects all the required
information in a single place, so that all of these different mechanisms
can operate in a more uniform way.
For now, the new info struct is only used to replace a few things:
* The BinderTransactionDataSg struct that is passed as an argument to
several methods is removed as the information is moved into the new
info struct and passed down that way.
* The oneway spam detection fields on Transaction and Allocation can be
removed, as the information can be returned to the caller via the
mutable info struct instead.
But several other uses of the info struct are planned in follow-up
patches.
Merge tag 'iio-for-7.1a' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/jic23/iio into char-misc-next
Jonathan writes:
IIO: New devices support, features and cleanup for 7.1
Includes merge of v7.0-rc4 to pull in a fix and a merge of
ib-iio-thermal-qcom-pmic5 immutable branch (provided from the IIO tree so
thermal could also pick this up and add thermal specific remainder
of the series on top.
New device support
------------------
adi,ad4030
- Add support for ADA4316 and ADAQ4224 ADCs with PGAs.
adi,ad4080
- Add support for AD4082, AD4085 and AD4088 ADCs.
adi,ad8366
- Add ADRF5702 and ADRF5703 digital step attenuators.
adi,adxl372
- Add support for the ADXL371 accelerometer after refactors to allow multiple
device variants to be supported by the driver. In particular a silicon
issue means the hardware FIFO doesn't work on the ADXL371
bosch,bma255/bmg160
- Add support for BMX055 gyroscope and magnetometer (effectively separate
devices from point of view of interface).
lltc,ltc2309
- Add support for LTC2305 2 channel 12-bit ADC.
lltc,ltc2532
- Add support for 4 variants of the LTC2654 quad DAC.
maxim,ds4424
- Add IDs for DS4402 and DS4404 parts. Initially patch is ID only but additional
features also added that are device dependent.
qcom,spmi-adc-gen3
- New driver supporting this generation of Qualcomm's SoC ADC.
st,vl53l1
- New driver for this Time Of Flight (TOF) sensor.
ti,ina2xx
- Support the INA236 digital power monitor.
vishay,vcnl4000
- Add support for CM36686 ambient light and proximity sensor.
- Add support for CM36672P proximity sensors.
ID only additions.
amlogic,meson-adc
- Support the Meson S4.
Features
--------
iio-backend framework
- Add capability discovery so front end drivers can know what features are
available from the backend and adjust how they operate.
adi,ad4030
- Add SPI offload support requiring a non trivial PWM setup.
adi,ad7380
- Add support for multiple SPI lanes to improve throughput.
adi,ad7768-1
- Support SPI offload and always use continuous mode, enabling more
filter options.
adi,ad8366
- Device tree bindings and support.
aspeed,adc
- Handle battery channel.
maxim,ds4424
- Add external resistor controlled scale and per-variant limits.
- Handle per variant range limits.
- Move it to regmap.
motorola,cpcap-adc
- Support for the ADC found on the Motorola Mot board. Effectively some board
specific configuration handled in the driver.
vishay,vcnl4000
- Support explicit power supply regulators.
tyhx,hx9023s
- Allow device tree specification of firmware file name.
Cleanup and minor fixes
-----------------------
treewide
- Remove a bunch of unused structure elements.
- Replaces standard fixed width integers with kernel types.
- Replace some other error values that were returned on allocation failure
with -ENOMEM
iio-core
- Replace a few custom devm implementations for devm_add_action_or_reset()
iio-trigger
- Use put_device() to cleanup on error.
iio-backend
- Use __free(fwmode_handle) to simplify some code.
hw-consumer
- Use separate allocation for scan mask bitmap to simplify code.
acpi-als
- Switch from ACPI driver to platform driver.
adi,ad4030
- Use BIT() to replace values that are always a power of 2 to slightly
improve readability.
adi,ad4062
- Add a missing check for error form iio_get_current_scan_type()
adi,ad5933
- Use div64_ul() rather than do_div() as remainder was not used.
adi,ad7191
- Documentation fixes related to clocks
adi,ad7816
- Use sysfs_emit()
adi,ad8366
- General driver modernization
adi,adf4350
- Change a TOOD to NOTE in a comment to avoid anyone from walking into
a tricky to improve corner case.
adi,admv1013
- Avoid a null pointer dereference if device_property_read_string() fails.
adi,admv4420
- Return error code rather than -1..
adi,adxl345
- Add separate scaling for events from that of raw channels.
amlogic,meson-adc
- Don't bother keeping nvmem cell access around when only used in probe.
atmel,at91-sama5d
- Don't bother keeping nvmem cell access around when only used in probe.
bosch,bmc150
- Use sysfs_emit() in a few places.
honeywell,hsc030pa
- Improve handling of return values from i2c_transfer.
liteon,ltr501
- Return error values rather than -1 replaced by -EINVAL at higher
levels of the callstack.
maxim,ds4424
- A bunch of general minor improvements prior to adding new features.
maxim,max11410
- Make some const string arrays static.
maxim,max5522
- Use devm_regulator_get_enable_read_voltage() at probe to cache the
voltage rather than keeping the regulator around to access and query
later.
vishay,vcnl4000
- Various code improvements.
sharp,gp2ap020a00f
- General driver modernization.
silabs,si7210
- Use devm_regulator_get_enable_read_voltage() at probe to cache the
voltage rather than keeping the regulator around to access and query
later.
st,lsm6dsx
- Add SMOCF00 ACPI ID seen on products by SHIFT.
st,st_sensors
- Fix up various kernel-doc issues.
- Avoid kmalloc of a single use buffer and instead reused existing
buffer_data.
taos,tsl2772
- Fix some kernel-doc warnings due to missing :
ti,ads7950
- Use iio_push_to_buffers_with_ts_unaligned() as first few elements of
array are not the data that is pushed.
- Move from array of chip_info structures to individual named ones. This
is part of slowly replacing use of a code pattern that we don't want
replicated in new drivers.
vti,sca3000
- General driver modernization included use of devm and guard().
Various other more minor stuff not called out explicitly.
Includes things like typo fixes, use of dev_err_probe() and local
variables to avoid repeated dereferencing of the same member as well as
increasing use of guard() to simplify release of locks.
Another slow improvement to code quality is both standardizing on
header order and ensure all appropriate headers are included.
* tag 'iio-for-7.1a' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (217 commits)
Docs: iio: ad7191 Correct clock configuration
iio: amplifiers: ad8366: add support for adrf5702/3
dt-bindings: iio: amplifiers: ad8366: add adrf5702/3 support
iio: adc: meson-saradc: add support for Meson S4
dt-bindings: iio: adc: amlogic,meson-saradc: add S4 compatible
iio: imu: st_lsm6dsx: Add ACPI ID for SHIFT13mi gyroscope
iio: proximity: add driver for ST VL53L1X ToF sensor
dt-bindings: iio: proximity: add ST VL53L1X ToF sensor
iio: adc: max11410: make vref register name arrays static const
iio: accel: bmc150-accel-core: use sysfs_emit() in show functions
iio: frequency: adf4350: replace TODO with NOTE in adf4350_set_freq()
iio: adc: ltc2309: add support for ltc2305
iio: adc: ltc2309: explicitly assign hex values to channel enums
dt-bindings: adc: ltc2497: add support for ltc2305
iio: accel: adxl380: fix typo in PART_ID register macro
iio: dac: ds4424: add Rfs-based scale and per-variant limits
dt-bindings: iio: dac: maxim,ds4424: add maxim,rfs-ohms property
iio: dac: ds4424: convert to regmap
iio: dac: ds4424: support per-variant output range limits
iio: dac: ds4424: add DS4402/DS4404 device IDs
...
Ammar Mustafa [Fri, 27 Feb 2026 19:08:33 +0000 (14:08 -0500)]
Docs: iio: ad7191 Correct clock configuration
Correct the ad7191 documentation to match the datasheet:
- Fix inverted CLKSEL pin logic: device uses external clock when pin is
inactive, and internal CMOS/crystal when high.
- Correct CMOS-compatible clock pin from MCLK2 to MCLK1.
Signed-off-by: Ammar Mustafa <ammarmustafa34@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Rodrigo Alencar [Thu, 26 Mar 2026 18:32:16 +0000 (18:32 +0000)]
dt-bindings: iio: amplifiers: ad8366: add adrf5702/3 support
Add compatible entries for ADRF5702 and ADRF5703 Digital Attenuators.
ADRF5702 is an 8-bit DSA with a step of 0.125 dB and ADRF5703 is a 7-bit
DSA with a step 0.25 dB. Then, each device ends up with its own gain
range, hence no fallback compatibles are used.
Nick Xie [Wed, 25 Mar 2026 07:06:16 +0000 (15:06 +0800)]
iio: adc: meson-saradc: add support for Meson S4
Add support for the SARADC found on the Amlogic Meson S4 SoC.
According to the documentation and current testing, it is fully
compatible with the G12A parameter set, so we reuse
`meson_sar_adc_g12a_data` for this new compatible string.
Although the device tree fallback mechanism could handle the match,
a dedicated entry is added to ensure the userspace ABI correctly
reports the specific part name ("meson-s4-saradc"). This allows
userspace to accurately identify the exact device and maintains
consistency across different firmware types where automatic fallback
parsing might be problematic.
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Nick Xie <nick@khadas.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Add the compatible string for the SARADC (Successive Approximation
Register ADC) IP block found in the Amlogic Meson S4 SoC.
There are no known differences between the SARADC on S4 and the one
on G12A. Therefore, it uses "amlogic,meson-g12a-saradc" as a proper
specific fallback.
Also add a comment indicating that "amlogic,meson-saradc" must not be
used for new devices. It's a made up compatible string that does not
correspond to a specific hardware generation and is not used to match
any driver. For old devices we keep it as it's part of the ABI.
Signed-off-by: Nick Xie <nick@khadas.com> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Milan Misic [Tue, 24 Mar 2026 19:36:26 +0000 (20:36 +0100)]
iio: imu: st_lsm6dsx: Add ACPI ID for SHIFT13mi gyroscope
The SHIFT13mi or SHIFTbook tablet device by the German manufacturer
SHIFT contains an STM LSM6DSO IMU declared in the DSDT with the
hardware ID SMOCF00. Add this ID to the ACPI match table so that the
driver binds correctly to this device.
Signed-off-by: Milan Misic <twoexem@gmail.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Siratul Islam [Wed, 25 Mar 2026 20:19:42 +0000 (02:19 +0600)]
iio: proximity: add driver for ST VL53L1X ToF sensor
Add support for the STMicroelectronics VL53L1X Time-of-Flight
ranging sensor with I2C interface.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Siratul Islam <email@sirat.me> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Siratul Islam [Wed, 25 Mar 2026 20:19:41 +0000 (02:19 +0600)]
dt-bindings: iio: proximity: add ST VL53L1X ToF sensor
Add device tree binding documentation for the STMicroelectronics
VL53L1X Time-of-Flight ranging sensor connected via I2C.
vdd-supply is not made globally required to maintain backwards
compatibility with existing st,vl53l0x devicetrees that do not specify it.
Signed-off-by: Siratul Islam <email@sirat.me> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
iio: adc: max11410: make vref register name arrays static const
The vrefp_regs and vrefn_regs arrays are constant lookup tables and
are not modified.
Make them static const so they are not reinitialized on each probe
call and are placed in read-only memory. Mark the pointer array as
const as well to prevent unintended modification.
Signed-off-by: Giorgi Tchankvetadze <giorgitchankvetadze1997@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Gabriel Rondon [Mon, 23 Mar 2026 21:56:19 +0000 (21:56 +0000)]
iio: accel: bmc150-accel-core: use sysfs_emit() in show functions
Replace sprintf() with sysfs_emit() in sysfs attribute show
callbacks. sysfs_emit() is the preferred API as it is aware of the
sysfs buffer page size limit.
Signed-off-by: Gabriel Rondon <grondon@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Neel Bullywon [Mon, 23 Mar 2026 23:33:16 +0000 (19:33 -0400)]
iio: frequency: adf4350: replace TODO with NOTE in adf4350_set_freq()
Replace the TODO comment in adf4350_set_freq() with a NOTE explaining
that a constant-time approach using fls_long() was attempted but deemed
more complex without meaningful benefit for initialization code.
Signed-off-by: Neel Bullywon <neelb2403@gmail.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Kyle Hsieh [Wed, 25 Mar 2026 02:24:22 +0000 (10:24 +0800)]
iio: adc: ltc2309: add support for ltc2305
Add support for the LTC2305 ADC to the LTC2309 driver. The LTC2305 is
a 2-channel, 12-bit SAR ADC that is register-compatible with the
LTC2309 but has a different channel selection mapping and count.
To support multiple chips in this family, introduce ltc2309_chip_info
struct to store chip-specific channel specifications and names.
The probe function now uses i2c_get_match_data() to retrieve the
correct configuration for the detected device.
Specific channel addresses for LTC2305 (CH0, CH1, and differential
pairs) are added based on the datasheet.
Signed-off-by: Kyle Hsieh <kylehsieh1995@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Kyle Hsieh [Wed, 25 Mar 2026 02:24:21 +0000 (10:24 +0800)]
iio: adc: ltc2309: explicitly assign hex values to channel enums
The current ltc2309_channels enum relies on implicit sequential
assignment. While this works for the 8-channel LTC2309, it is
not intuitive and makes it difficult to support other chips in
the same family that might have different bit mappings.
Explicitly assign hex values to the enum members based on the
channel selection bits defined in the datasheet. This improves
code readability and provides a consistent pattern for future
chip support.
Signed-off-by: Kyle Hsieh <kylehsieh1995@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Kyle Hsieh [Wed, 25 Mar 2026 02:24:20 +0000 (10:24 +0800)]
dt-bindings: adc: ltc2497: add support for ltc2305
Add documentation for the 2-channel LTC2305 ADC in the
existing ltc2497 binding.
This enables automatic device tree matching for LTC2305
while using the LTC2309 driver (drivers/iio/adc/ltc2309.c),
since both ADCs share the same I2C interface and 12-bit SAR architecture.
The main difference is the number of channels (LTC2305: 2, LTC2309: 8).
Reviewed-by: Rob Herring (Arm) <robh@kernel.org> Signed-off-by: Kyle Hsieh <kylehsieh1995@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Oleksij Rempel [Tue, 10 Feb 2026 13:51:10 +0000 (14:51 +0100)]
iio: dac: ds4424: add Rfs-based scale and per-variant limits
Parse optional maxim,rfs-ohms values to derive the per-channel output
current scale (mA per step) for the IIO current ABI.
Behavior changes:
- If maxim,rfs-ohms is present, IIO_CHAN_INFO_SCALE becomes available
and reports mA/step derived from Rfs.
- If maxim,rfs-ohms is missing, SCALE is not exposed to keep older DTs
working without requiring updates.
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
The Maxim DS4422/DS4424 and DS4402/DS4404 current DACs determine their
full-scale output current via external resistors (Rfs) connected to the
FSx pins. Without knowing these values, the full-scale range of the
hardware is undefined.
Add the 'maxim,rfs-ohms' property to describe these physical components.
This property is required to provide a complete description of the
hardware configuration.
Oleksij Rempel [Tue, 10 Feb 2026 13:51:07 +0000 (14:51 +0100)]
iio: dac: ds4424: support per-variant output range limits
The DS4402/DS4404 variants operate with a 5-bit resolution (31 steps),
whereas the DS4422/DS4424 support 7-bit (127 steps).
Previously, the driver enforced a hardcoded 7-bit mask (DS4424_DAC_MASK)
for all variants. This allowed users to write values exceeding the 5-bit
range to DS4402/DS4404 devices, resulting in silent truncation or
undefined behavior.
Add a `result_mask` field to the chip_info structure to define the valid
data range for each variant. Use this mask to:
1. Correctly mask register values in read_raw().
2. Return -EINVAL in write_raw() if the input value exceeds the
variant's capabilities.
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Oleksij Rempel [Tue, 10 Feb 2026 13:51:04 +0000 (14:51 +0100)]
iio: dac: ds4424: use fsleep() instead of usleep_range()
The DS4422/DS4424 and DS4402/DS4404 datasheets do not specify a minimum
delay between power-up (POR) and the availability of the I2C interface.
The driver previously used `usleep_range(1000, 1200)` to enforce a ~1ms
delay. Replace this with `fsleep(1000)` to allow the kernel to select
the most efficient sleep mechanism while retaining the existing
conservative delay to ensure device readiness.
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Oleksij Rempel [Tue, 10 Feb 2026 13:51:03 +0000 (14:51 +0100)]
iio: dac: ds4424: use device match data for chip info
Refactor the driver to use device match data instead of checking ID enums
in a switch statement.
Define a `ds4424_chip_info` structure to hold variant-specific attributes
(currently just the channel count) and attach it directly to the I2C and
OF device ID tables.
This simplifies the probe function and makes it easier to add support for
new variants like DS4402/DS4404.
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Oleksij Rempel [Tue, 10 Feb 2026 13:51:02 +0000 (14:51 +0100)]
iio: dac: ds4424: rename iio_info struct to avoid ambiguity
Rename the static `ds4424_info` structure to `ds4424_iio_info`.
The previous name was generic and could be confused with chip-specific
data structures (like the upcoming `ds4424_chip_info`). The new name
explicitly indicates that this structure holds the IIO framework
callbacks.
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Oleksij Rempel [Tue, 10 Feb 2026 13:50:59 +0000 (14:50 +0100)]
iio: dac: ds4424: refactor raw access to use bitwise operations
Refactor the raw access logic to use standard GENMASK() and BIT()
macros. Use abs() for magnitude calculation to simplify the logic and
make the data flow clearer.
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Randy Dunlap [Thu, 12 Mar 2026 05:13:45 +0000 (22:13 -0700)]
iio: st_sensors: correct kernel-doc issues
Use the proper kernel-doc format and struct member names to avoid
kernel-doc warnings:
Warning: include/linux/iio/common/st_sensors.h:184 struct member 'int1'
not described in 'st_sensor_data_ready_irq'
Warning: ../include/linux/iio/common/st_sensors.h:184 struct member 'int2'
not described in 'st_sensor_data_ready_irq'
Warning: ../include/linux/iio/common/st_sensors.h:184 struct member
'stat_drdy' not described in 'st_sensor_data_ready_irq'
Warning: ../include/linux/iio/common/st_sensors.h:184 struct member 'ig1'
not described in 'st_sensor_data_ready_irq'
Warning: ../include/linux/iio/common/st_sensors.h:219 struct member
'num_ch' not described in 'st_sensor_settings'
Warning: ../include/linux/iio/common/st_sensors.h:263 struct member
'num_data_channels' not described in 'st_sensor_data'
Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
David Lechner [Sat, 14 Mar 2026 21:12:24 +0000 (16:12 -0500)]
iio: adc: ti-ads7950: use iio_push_to_buffers_with_ts_unaligned()
Use iio_push_to_buffers_with_ts_unaligned() to avoid unaligned access
when writing the timestamp in the rx_buf.
The previous implementation would have been fine on architectures that
support 4-byte alignment of 64-bit integers but could cause issues on
architectures that require 8-byte alignment.
Fixes: 902c4b2446d4 ("iio: adc: New driver for TI ADS7950 chips") Signed-off-by: David Lechner <dlechner@baylibre.com> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Sanjay Chitroda [Sun, 15 Mar 2026 12:16:25 +0000 (17:46 +0530)]
iio: st_sensors: drop temporary kmalloc buffer and reuse buffer_data
Replace the per-call kmalloc() scratch buffer with the existing
buffer_data[] field present in struct st_sensor_data. The existing buffer
is DMA-aligned and sufficiently sized for all channel widths, so using it
avoids unnecessary dynamic memory allocation on each read.
This simplifies the code, removes redundant allocation and cleanup.
No functional change intended.
Signed-off-by: Sanjay Chitroda <sanjayembeddedse@gmail.com> Reviewed-by: David Lechner <dlechner@baylibre.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Chuang Zhu [Sun, 15 Mar 2026 18:23:04 +0000 (02:23 +0800)]
iio: adc: ina2xx: add INA236 support
The calibration divisor is not directly specified in the datasheet, but can be calculated:
I = Current_LSB * Current
Current = ShuntVoltage * CAL / calibration_divisor
CAL = 0.00512 / (Current_LSB * Rshunt)
ShuntVoltage = Vshunt / ShuntVoltage_LSB
=> I = (0.00512 / (calibration_divisor*ShuntVoltage_LSB)) * (Vshunt / Rshunt)
David Lechner [Sun, 15 Mar 2026 19:21:51 +0000 (14:21 -0500)]
iio: light: as73211: remove duplicate zero init of scan.chan[3]
Remove setting scan.chan[3] to zero. Since commit 433b99e92294 ("iio:
light: as73211: Ensure buffer holes are zeroed"), the entire scan struct
is zeroed before being filled with data, so this is redundant.
Signed-off-by: David Lechner <dlechner@baylibre.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Shi Hao [Mon, 16 Mar 2026 09:00:18 +0000 (14:30 +0530)]
iio: test: fix typo from neeeds to needs in comment
Fix incorrect spelling from neeeds to needs.
Signed-off-by: Shi Hao <i.shihao.999@gmail.com> Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>