<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/git/stable/linux.git/drivers/iio/adc, branch linux-6.3.y</title>
<subtitle>Linux kernel stable tree</subtitle>
<id>https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/atom?h=linux-6.3.y</id>
<link rel='self' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/atom?h=linux-6.3.y'/>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/'/>
<updated>2023-06-09T08:48:14+00:00</updated>
<entry>
<title>iio: adc: stm32-adc: skip adc-diff-channels setup if none is present</title>
<updated>2023-06-09T08:48:14+00:00</updated>
<author>
<name>Sean Nyekjaer</name>
<email>sean@geanix.com</email>
</author>
<published>2023-05-03T16:20:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=bd844f8b87670cf8b709830f605863ced5578979'/>
<id>urn:sha1:bd844f8b87670cf8b709830f605863ced5578979</id>
<content type='text'>
commit 9c0d6ccd7d6bbd275e390b55a3390b4274291d95 upstream.

If no adc differential channels are defined driver will fail with EINVAL:
stm32-adc: probe of 48003000.adc:adc@0 failed with error -22

Fix this by skipping the initialization if no channels are defined.

This applies only to the legacy way of initializing adc channels.

Fixes: d7705f35448a ("iio: adc: stm32-adc: convert to device properties")
Signed-off-by: Sean Nyekjaer &lt;sean@geanix.com&gt;
Link: https://lore.kernel.org/r/20230503162029.3654093-1-sean@geanix.com
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: ad7192: Change "shorted" channels to differential</title>
<updated>2023-06-09T08:48:14+00:00</updated>
<author>
<name>Paul Cercueil</name>
<email>paul@crapouillou.net</email>
</author>
<published>2023-03-30T10:21:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=b91145204a9aa55a5c1d30b36ebb75d003b45393'/>
<id>urn:sha1:b91145204a9aa55a5c1d30b36ebb75d003b45393</id>
<content type='text'>
commit e55245d115bb9054cb72cdd5dda5660f4484873a upstream.

The AD7192 provides a specific channel configuration where both negative
and positive inputs are connected to AIN2. This was represented in the
ad7192 driver as a IIO channel with .channel = 2 and .extended_name set
to "shorted".

The problem with this approach, is that the driver provided two IIO
channels with the identifier .channel = 2; one "shorted" and the other
not. This goes against the IIO ABI, as a channel identifier should be
unique.

Address this issue by changing "shorted" channels to being differential
instead, with channel 2 vs. itself, as we're actually measuring AIN2 vs.
itself.

Note that the fix tag is for the commit that moved the driver out of
staging. The bug existed before that, but backporting would become very
complex further down and unlikely to happen.

Fixes: b581f748cce0 ("staging: iio: adc: ad7192: move out of staging")
Signed-off-by: Paul Cercueil &lt;paul@crapouillou.net&gt;
Co-developed-by: Alisa Roman &lt;alisa.roman@analog.com&gt;
Signed-off-by: Alisa Roman &lt;alisa.roman@analog.com&gt;
Reviewed-by: Nuno Sa &lt;nuno.sa@analog.com&gt;
Link: https://lore.kernel.org/r/20230330102100.17590-1-paul@crapouillou.net
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: ad_sigma_delta: Fix IRQ issue by setting IRQ_DISABLE_UNLAZY flag</title>
<updated>2023-06-09T08:48:14+00:00</updated>
<author>
<name>Masahiro Honda</name>
<email>honda@mechatrax.com</email>
</author>
<published>2023-05-18T11:08:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=4c13d06d16f0baf5c7888024a30ecda22658e994'/>
<id>urn:sha1:4c13d06d16f0baf5c7888024a30ecda22658e994</id>
<content type='text'>
commit 626d312028bec44209d0ecd5beaa9b1aa8945f7d upstream.

The Sigma-Delta ADCs supported by this driver can use SDO as an interrupt
line to indicate the completion of a conversion. However, some devices
cannot properly detect the completion of a conversion by an interrupt.
This is for the reason mentioned in the following commit.

commit e9849777d0e2 ("genirq: Add flag to force mask in
                      disable_irq[_nosync]()")

A read operation is performed by an extra interrupt before the completion
of a conversion. At this time, the value read from the ADC data register
is the same as the previous conversion result. This patch fixes the issue
by setting IRQ_DISABLE_UNLAZY flag.

Fixes: 0c6ef985a1fd ("iio: adc: ad7791: fix IRQ flags")
Fixes: 1a913270e57a ("iio: adc: ad7793: Fix IRQ flag")
Fixes: e081102f3077 ("iio: adc: ad7780: Fix IRQ flag")
Fixes: 89a86da5cb8e ("iio: adc: ad7192: Add IRQ flag")
Fixes: 79ef91493f54 ("iio: adc: ad7124: Set IRQ type to falling")
Signed-off-by: Masahiro Honda &lt;honda@mechatrax.com&gt;
Link: https://lore.kernel.org/r/20230518110816.248-1-honda@mechatrax.com
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: stm32-adc: skip adc-channels setup if none is present</title>
<updated>2023-06-09T08:48:14+00:00</updated>
<author>
<name>Sean Nyekjaer</name>
<email>sean@geanix.com</email>
</author>
<published>2023-05-03T16:20:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=c6a3fcf98553ac6d59b7c089fdaccb3a68d30449'/>
<id>urn:sha1:c6a3fcf98553ac6d59b7c089fdaccb3a68d30449</id>
<content type='text'>
commit 3e27ef0ced49f8ae7883c25fadf76a2086e99025 upstream.

If only adc differential channels are defined driver will fail with
stm32-adc: probe of 48003000.adc:adc@0 failed with error -22

Fix this by skipping the initialization if no channels are defined.

This applies only to the legacy way of initializing adc channels.

Fixes: d7705f35448a ("iio: adc: stm32-adc: convert to device properties")
Signed-off-by: Sean Nyekjaer &lt;sean@geanix.com&gt;
Reviewed-by: Olivier Moysan &lt;olivier.moysan@foss.st.com&gt;
Link: https://lore.kernel.org/r/20230503162029.3654093-2-sean@geanix.com
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: mt6370: Fix ibus and ibat scaling value of some specific vendor ID chips</title>
<updated>2023-06-09T08:48:13+00:00</updated>
<author>
<name>ChiaEn Wu</name>
<email>chiaen_wu@richtek.com</email>
</author>
<published>2023-04-10T10:34:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=d99168a26329470249013246c1f2d893887e3f22'/>
<id>urn:sha1:d99168a26329470249013246c1f2d893887e3f22</id>
<content type='text'>
commit 00ffdd6fa90298522d45ca0c348b23485584dcdc upstream.

The scale value of ibus and ibat on the datasheet is incorrect due to the
customer report after the experimentation with some specific vendor ID
chips.

Fixes: c1404d1b659f ("iio: adc: mt6370: Add MediaTek MT6370 support")
Signed-off-by: ChiaEn Wu &lt;chiaen_wu@richtek.com&gt;
Reviewed-by: Alexandre Mergnat &lt;amergnat@baylibre.com&gt;
Link: https://lore.kernel.org/r/1681122862-1994-1-git-send-email-chiaen_wu@richtek.com
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: ad4130: Make sure clock provider gets removed</title>
<updated>2023-06-09T08:48:13+00:00</updated>
<author>
<name>Lars-Peter Clausen</name>
<email>lars@metafoo.de</email>
</author>
<published>2023-04-14T15:07:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=029e23f9750de90a162207f5fecbb9f5582e7504'/>
<id>urn:sha1:029e23f9750de90a162207f5fecbb9f5582e7504</id>
<content type='text'>
commit 28f73ded19d403697f87473c9b85a27eb8ed9cf2 upstream.

The ad4130 driver registers a clock provider, but never removes it. This
leaves a stale clock provider behind that references freed clocks when the
device is unbound.

Register a managed action to remove the clock provider when the device is
removed.

Fixes: 62094060cf3a ("iio: adc: ad4130: add AD4130 driver")
Signed-off-by: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
Link: https://lore.kernel.org/r/20230414150702.518441-1-lars@metafoo.de
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: mxs-lradc: fix the order of two cleanup operations</title>
<updated>2023-06-09T08:48:12+00:00</updated>
<author>
<name>Jiakai Luo</name>
<email>jkluo@hust.edu.cn</email>
</author>
<published>2023-04-22T13:34:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=10385ddf6667fe433ecc52809e078d98bce606f7'/>
<id>urn:sha1:10385ddf6667fe433ecc52809e078d98bce606f7</id>
<content type='text'>
commit 27b2ed5b6d53cd62fc61c3f259ae52f5cac23b66 upstream.

Smatch reports:
drivers/iio/adc/mxs-lradc-adc.c:766 mxs_lradc_adc_probe() warn:
missing unwind goto?

the order of three init operation:
1.mxs_lradc_adc_trigger_init
2.iio_triggered_buffer_setup
3.mxs_lradc_adc_hw_init

thus, the order of three cleanup operation should be:
1.mxs_lradc_adc_hw_stop
2.iio_triggered_buffer_cleanup
3.mxs_lradc_adc_trigger_remove

we exchange the order of two cleanup operations,
introducing the following differences:
1.if mxs_lradc_adc_trigger_init fails, returns directly;
2.if trigger_init succeeds but iio_triggered_buffer_setup fails,
goto err_trig and remove the trigger.

In addition, we also reorder the unwind that goes on in the
remove() callback to match the new ordering.

Fixes: 6dd112b9f85e ("iio: adc: mxs-lradc: Add support for ADC driver")
Signed-off-by: Jiakai Luo &lt;jkluo@hust.edu.cn&gt;
Reviewed-by: Dongliang Mu &lt;dzm91@hust.edu.cn&gt;
Link: https://lore.kernel.org/r/20230422133407.72908-1-jkluo@hust.edu.cn
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: imx93: fix a signedness bug in imx93_adc_read_raw()</title>
<updated>2023-06-09T08:48:10+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>error27@gmail.com</email>
</author>
<published>2023-02-14T15:47:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=635383e95ee21260a4ca0a83d1637146ec73faf4'/>
<id>urn:sha1:635383e95ee21260a4ca0a83d1637146ec73faf4</id>
<content type='text'>
[ Upstream commit 20f291b88ecf23f674ee2ed980a4d93b7f16a06f ]

The problem is these lines:

	ret = vref_uv = regulator_get_voltage(adc-&gt;vref);
	if (ret &lt; 0)

The "ret" variable is type long and "vref_uv" is u32 so that means
the condition can never be true on a 64bit system.  A negative error
code from regulator_get_voltage() would be cast to a high positive
u32 value and then remain a high positive value when cast to a long.

The "ret" variable only ever stores ints so it should be declared as
an int.  We can delete the "vref_uv" variable and use "ret" directly.

Fixes: 7d02296ac8b8 ("iio: adc: add imx93 adc support")
Signed-off-by: Dan Carpenter &lt;error27@gmail.com&gt;
Reviewed-by: Haibo Chen &lt;haibo.chen@nxp.com&gt;
Link: https://lore.kernel.org/r/Y+utEvjfjQRQo2QB@kili
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>iio: adc: at91-sama5d2_adc: fix an error code in at91_adc_allocate_trigger()</title>
<updated>2023-04-01T14:50:11+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>error27@gmail.com</email>
</author>
<published>2023-03-29T04:35:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=73a428b37b9b538f8f8fe61caa45e7f243bab87c'/>
<id>urn:sha1:73a428b37b9b538f8f8fe61caa45e7f243bab87c</id>
<content type='text'>
The at91_adc_allocate_trigger() function is supposed to return error
pointers.  Returning a NULL will cause an Oops.

Fixes: 5e1a1da0f8c9 ("iio: adc: at91-sama5d2_adc: add hw trigger and buffer support")
Signed-off-by: Dan Carpenter &lt;error27@gmail.com&gt;
Link: https://lore.kernel.org/r/5d728f9d-31d1-410d-a0b3-df6a63a2c8ba@kili.mountain
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>Merge tag 'iio-fixes-for-6.3a' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into char-misc-linus</title>
<updated>2023-03-28T11:30:55+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2023-03-28T11:30:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=4bffd2c7a3fc165fc70bc69211b8e6436f41a5c3'/>
<id>urn:sha1:4bffd2c7a3fc165fc70bc69211b8e6436f41a5c3</id>
<content type='text'>
Jonathan writes:

1st set of IIO fixes for 6.3

Usual mixed bag:

- core - output buffers
  Fix return of bytes written when only some succeed.
  Fix O_NONBLOCK handling to not block.

- adi,ad7791
  Fix IRQ type.  Not confirmed to have any impact but good to correct it anyway

- adi,adis16400
  Missing CONFIG_CRC32

- capella,cm32181
  Unregister 2nd I2C client if one is used.

- cio-dac
  Fix bitdepth for range check on write.

- linear,ltc2497
  Fix a wrong shift of the LSB introduced when switching to be24 handling.

- maxim,max11410
  Fix handling of return code in read_poll_timeout()

- qcom,spmi-adc
  Fix an accidental change of channel name to include the reg value from OF.

- ti,palmas
  Fix a null dereference on remove due to wrong function used to get the
  drvdata.

- ti,ads7950
  Mark GPIO as can sleep.

* tag 'iio-fixes-for-6.3a' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio:
  iio: adc: ti-ads7950: Set `can_sleep` flag for GPIO chip
  iio: adc: palmas_gpadc: fix NULL dereference on rmmod
  iio: adc: max11410: fix read_poll_timeout() usage
  iio: dac: cio-dac: Fix max DAC write value check for 12-bit
  iio: light: cm32181: Unregister second I2C client if present
  iio: accel: kionix-kx022a: Get the timestamp from the driver's private data in the trigger_handler
  iio: adc: ad7791: fix IRQ flags
  iio: buffer: make sure O_NONBLOCK is respected
  iio: buffer: correctly return bytes written in output buffers
  iio: light: vcnl4000: Fix WARN_ON on uninitialized lock
  iio: adis16480: select CONFIG_CRC32
  drivers: iio: adc: ltc2497: fix LSB shift
  iio: adc: qcom-spmi-adc5: Fix the channel name
</content>
</entry>
</feed>
