<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/iio/adc, branch v7.0.12</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v7.0.12</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v7.0.12'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2026-06-09T10:32:36+00:00</updated>
<entry>
<title>iio: adc: nxp-sar-adc: zero-initialize dma_slave_config</title>
<updated>2026-06-09T10:32:36+00:00</updated>
<author>
<name>Shuvam Pandey</name>
<email>shuvampandey1@gmail.com</email>
</author>
<published>2026-04-06T09:53:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f96cbc8834f35584c12c176ed3426d8a2b94f6c0'/>
<id>urn:sha1:f96cbc8834f35584c12c176ed3426d8a2b94f6c0</id>
<content type='text'>
commit 8ce176501f836634f9c0419c0820140f968e9dc5 upstream.

nxp_sar_adc_start_cyclic_dma() only fills the RX-side members of
dma_slave_config before passing it to dmaengine_slave_config().

Zero-initialize the structure so unused members do not contain stack
garbage. Some DMA engines consult optional dma_slave_config fields, so
leaving them uninitialized can cause DMA setup failures.

Fixes: 4434072a893e ("iio: adc: Add the NXP SAR ADC support for the s32g2/3 platforms")
Signed-off-by: Shuvam Pandey &lt;shuvampandey1@gmail.com&gt;
Reviewed-by: David Lechner &lt;dlechner@baylibre.com&gt;
Cc: &lt;Stable@vger.kernel.org&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>iio: adc: nxp-sar-adc: Avoid division by zero</title>
<updated>2026-06-09T10:32:36+00:00</updated>
<author>
<name>Andy Shevchenko</name>
<email>andriy.shevchenko@linux.intel.com</email>
</author>
<published>2026-04-16T09:01:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ad64b14c120d074dbeec8214b24785c618a41f30'/>
<id>urn:sha1:ad64b14c120d074dbeec8214b24785c618a41f30</id>
<content type='text'>
commit 7e5c0f97c66ad538b87c04a640573371fb434b4f upstream.

When Common Clock Framework is disabled, clk_get_rate() returns 0.
This is used as part of the divisor to perform nanosecond delays
with help of ndelay(). When the above condition occurs the compiler,
due to unspecified behaviour, is free to do what it wants to. Here
it saturates the value, which is logical from mathematics point of
view. However, the ndelay() implementation has set a reasonable
upper threshold and refuses to provide anything for such a long
delay. That's why code may not be linked under these circumstances.

To solve the issue, provide a wrapper that calls ndelay() when
the value is known not to be zero.

Fixes: 4434072a893e ("iio: adc: Add the NXP SAR ADC support for the s32g2/3 platforms")
Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Closes: https://lore.kernel.org/oe-kbuild-all/202603311958.ly6uROit-lkp@intel.com/
Signed-off-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Acked-by: Daniel Lezcano &lt;daniel.lezcano@oss.qualcomm.com&gt;
Cc: &lt;Stable@vger.kernel.org&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>iio: adc: nxp-sar-adc: fix division by zero in write_raw</title>
<updated>2026-06-09T10:32:36+00:00</updated>
<author>
<name>Antoniu Miclaus</name>
<email>antoniu.miclaus@analog.com</email>
</author>
<published>2026-04-01T15:29:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=cb6ea15e7d3c7518f806975a06b7d4c0a26402ea'/>
<id>urn:sha1:cb6ea15e7d3c7518f806975a06b7d4c0a26402ea</id>
<content type='text'>
commit a9aba21a539c668a66b58eeb08ad3909e5a54c2a upstream.

Add a validation check for the sampling frequency value before using it
as a divisor. A user writing zero or a negative value to the
sampling_frequency sysfs attribute triggers a division by zero in the
kernel.

Also prevent unsigned integer underflow when the computed cycle count is
smaller than NXP_SAR_ADC_CONV_TIME, which would wrap the u32 inpsamp to
a huge value.

Fixes: 4434072a893e ("iio: adc: Add the NXP SAR ADC support for the s32g2/3 platforms")
Signed-off-by: Antoniu Miclaus &lt;antoniu.miclaus@analog.com&gt;
Cc: &lt;Stable@vger.kernel.org&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>iio: adc: ad4695: Fix call ordering in offload buffer postenable</title>
<updated>2026-06-09T10:32:35+00:00</updated>
<author>
<name>Radu Sabau</name>
<email>radu.sabau@analog.com</email>
</author>
<published>2026-04-08T10:32:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b5510573ebcb2566131618c58c88a828dbf70e63'/>
<id>urn:sha1:b5510573ebcb2566131618c58c88a828dbf70e63</id>
<content type='text'>
commit 1a772719318c11e146f6fbe621fffd230a6f456a upstream.

ad4695_enter_advanced_sequencer_mode() was called after
spi_offload_trigger_enable(). That is wrong because
ad4695_enter_advanced_sequencer_mode() issues regular SPI transfers to
put the ADC into advanced sequencer mode, and not all SPI offload capable
controllers support regular SPI transfers while offloading is enabled.

Fix this by calling ad4695_enter_advanced_sequencer_mode() before
spi_offload_trigger_enable(), so the ADC is fully configured before the
first CNV pulse can occur. This is consistent with the same constraint
that already applies to the BUSY_GP_EN write above it.

Update the error unwind labels accordingly: add err_exit_conversion_mode
so that a failure of spi_offload_trigger_enable() correctly exits
conversion mode before clearing BUSY_GP_EN.

Fixes: f09f140e3ea8 ("iio: adc: ad4695: Add support for SPI offload")
Reviewed-by: Nuno Sá &lt;nuno.sa@analog.com&gt;
Reviewed-by: David Lechner &lt;dlechner@baylibre.com&gt;
Signed-off-by: Radu Sabau &lt;radu.sabau@analog.com&gt;
Cc: Stable@vger.kernel.org
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>iio: adc: viperboard: Fix error handling in vprbrd_iio_read_raw</title>
<updated>2026-06-09T10:32:35+00:00</updated>
<author>
<name>Salah Triki</name>
<email>salah.triki@gmail.com</email>
</author>
<published>2026-05-07T19:07:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=72434c1eece206fabfba58ec7c083015bd131e10'/>
<id>urn:sha1:72434c1eece206fabfba58ec7c083015bd131e10</id>
<content type='text'>
commit 422b5bbf333f75fb486855ad0eedc23cf21f3277 upstream.

The driver proceeds to the reception phase even if the preceding
transmission fails.

This uses a goto error label for an early bail out and ensures the mutex is
properly unlocked in case of failure.

Fixes: ffd8a6e7a778 ("iio: adc: Add viperboard adc driver")
Signed-off-by: Salah Triki &lt;salah.triki@gmail.com&gt;
Reviewed-by: Joshua Crofts &lt;joshua.crofts1@gmail.com&gt;
Reviewed-by: Maxwell Doose &lt;m32285159@gmail.com&gt;
Reviewed-by: Nuno Sá &lt;nuno.sa@analog.com&gt;
Cc: &lt;Stable@vger.kernel.org&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>iio: adc: mt6359: fix unchecked return value in mt6358_read_imp</title>
<updated>2026-06-09T10:32:35+00:00</updated>
<author>
<name>Salah Triki</name>
<email>salah.triki@gmail.com</email>
</author>
<published>2026-04-27T20:12:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a72f8e51d6ee66c255a8a93a4421b8a538d112a8'/>
<id>urn:sha1:a72f8e51d6ee66c255a8a93a4421b8a538d112a8</id>
<content type='text'>
commit f9bbd943c34a9ad60e593a4b99ce2394e4e2381b upstream.

In mt6358_read_imp(), the variable val_v is passed to regmap_read()
but the return value is not checked. If the read fails, val_v remains
uninitialized and its random stack content is subsequently reported
as a measurement result.

Initialize val_v to zero to ensure a predictable value is reported
in case of bus failure and to prevent potential stack data leakage.
This also satisfies static analyzers that might otherwise flag the
variable as used uninitialized.

Fixes: 3587914bf61d ("iio: adc: Add support for MediaTek MT6357/8/9 Auxiliary ADC")
Signed-off-by: Salah Triki &lt;salah.triki@gmail.com&gt;
Cc: &lt;Stable@vger.kernel.org&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>iio: adc: npcm: fix unbalanced clk_disable_unprepare()</title>
<updated>2026-06-09T10:32:35+00:00</updated>
<author>
<name>David Carlier</name>
<email>devnexen@gmail.com</email>
</author>
<published>2026-04-14T12:30:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3e419ace2ee2085079212319cb074edafc2a8152'/>
<id>urn:sha1:3e419ace2ee2085079212319cb074edafc2a8152</id>
<content type='text'>
commit 0d42e2c0bd6ceb89e44c6e065f9bdf9b1df3ef0c upstream.

The driver acquired the ADC clock with devm_clk_get() and read its
rate, but never called clk_prepare_enable(). The probe error path and
npcm_adc_remove() both called clk_disable_unprepare() unconditionally,
causing the clk framework's enable/prepare counts to underflow on
probe failure or module unbind.

The issue went unnoticed because NPCM BMC firmware leaves the ADC
clock enabled at boot, so the driver happened to work in practice.

Switch to devm_clk_get_enabled() so the clock is properly enabled
during probe and automatically released by the device-managed
cleanup, and drop the now-redundant clk_disable_unprepare() from
both the probe error path and remove().

While at it, drop the duplicate error message on devm_request_irq()
failure since the IRQ core already logs it.

Fixes: 9bf85fbc9d8f ("iio: adc: add NPCM ADC driver")
Signed-off-by: David Carlier &lt;devnexen@gmail.com&gt;
Reviewed-by: Andy Shevchenko &lt;andriy.shevchenko@intel.com&gt;
Cc: &lt;Stable@vger.kernel.org&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>iio: adc: xilinx-xadc: Fix sequencer mode in postdisable for dual mux</title>
<updated>2026-06-09T10:32:35+00:00</updated>
<author>
<name>Christofer Jonason</name>
<email>christofer.jonason@guidelinegeo.com</email>
</author>
<published>2026-03-04T09:07:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5518375b5fa7d49dc086c93dc93afe518bc27a8e'/>
<id>urn:sha1:5518375b5fa7d49dc086c93dc93afe518bc27a8e</id>
<content type='text'>
commit 852534744c2d35626a604f128ff0b8ec12805591 upstream.

xadc_postdisable() unconditionally sets the sequencer to continuous
mode. For dual external multiplexer configurations this is incorrect:
simultaneous sampling mode is required so that ADC-A samples through
the mux on VAUX[0-7] while ADC-B simultaneously samples through the
mux on VAUX[8-15]. In continuous mode only ADC-A is active, so
VAUX[8-15] channels return incorrect data.

Since postdisable is also called from xadc_probe() to set the initial
idle state, the wrong sequencer mode is active from the moment the
driver loads.

The preenable path already uses xadc_get_seq_mode() which returns
SIMULTANEOUS for dual mux. Fix postdisable to do the same.

Fixes: bdc8cda1d010 ("iio:adc: Add Xilinx XADC driver")
Cc: stable@vger.kernel.org
Signed-off-by: Christofer Jonason &lt;christofer.jonason@guidelinegeo.com&gt;
Reviewed-by: Andy Shevchenko &lt;andriy.shevchenko@intel.com&gt;
Reviewed-by: Nuno Sá &lt;nuno.sa@analog.com&gt;
Reviewed-by: Salih Erim &lt;salih.erim@amd.com&gt;
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>iio: adc: ad7768-1: remove switch to one-shot mode</title>
<updated>2026-05-07T04:13:55+00:00</updated>
<author>
<name>Jonathan Santos</name>
<email>Jonathan.Santos@analog.com</email>
</author>
<published>2026-02-23T11:59:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6dea777da386f8458d5c1dc4f67fe30f39a1c606'/>
<id>urn:sha1:6dea777da386f8458d5c1dc4f67fe30f39a1c606</id>
<content type='text'>
commit 81fdc3127d013a552465c3bf9829afbed5184406 upstream.

wideband low ripple FIR Filter is not available in one-shot mode. In
order to make direct reads work for all filter options, remove the
switch for one-shot mode and guarantee device is always in continuous
conversion mode.

Fixes: fb1d3b24ebf5 ("iio: adc: ad7768-1: add filter type and oversampling ratio attributes")
Signed-off-by: Jonathan Santos &lt;Jonathan.Santos@analog.com&gt;
Reviewed-by: David Lechner &lt;dlechner@baylibre.com&gt;
Cc: &lt;Stable@vger.kernel.org&gt;
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>iio: adc: ad7768-1: fix one-shot mode data acquisition</title>
<updated>2026-05-07T04:13:55+00:00</updated>
<author>
<name>Jonathan Santos</name>
<email>Jonathan.Santos@analog.com</email>
</author>
<published>2026-02-23T11:59:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a145891af64c09bba5c3298c7785311f82feaf18'/>
<id>urn:sha1:a145891af64c09bba5c3298c7785311f82feaf18</id>
<content type='text'>
commit 8be19e233744961db6069da9c9ab63eb085a0447 upstream.

According to the datasheet, one-shot mode requires a SYNC_IN pulse to
trigger a new sample conversion. In the current implementation, No sync
pulse was sent after switching to one-shot mode and reinit_completion()
was called before mode switching, creating a race condition where spurious
interrupts during mode change could trigger completion prematurely.

Fix by sending a sync pulse after configuring one-shot mode and
reinit_completion() to ensure it only waits for the actual conversion
completion.

Fixes: a5f8c7da3dbe ("iio: adc: Add AD7768-1 ADC basic support")
Signed-off-by: Jonathan Santos &lt;Jonathan.Santos@analog.com&gt;
Reviewed-by: David Lechner &lt;dlechner@baylibre.com&gt;
Cc: &lt;Stable@vger.kernel.org&gt;
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
