<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/iio/adc, branch linux-6.4.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.4.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.4.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2023-08-16T16:32:21Z</updated>
<entry>
<title>iio: adc: ina2xx: avoid NULL pointer dereference on OF device match</title>
<updated>2023-08-16T16:32:21Z</updated>
<author>
<name>Alvin Šipraga</name>
</author>
<published>2023-06-19T14:12:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=13f3ce53b65aa8b44cad7039d31e62c9ffd6c5d1'/>
<id>urn:sha1:13f3ce53b65aa8b44cad7039d31e62c9ffd6c5d1</id>
<content type='text'>
commit a41e19cc0d6b6a445a4133170b90271e4a2553dc upstream.

The affected lines were resulting in a NULL pointer dereference on our
platform because the device tree contained the following list of
compatible strings:

    power-sensor@40 {
        compatible = "ti,ina232", "ti,ina231";
        ...
    };

Since the driver doesn't declare a compatible string "ti,ina232", the OF
matching succeeds on "ti,ina231". But the I2C device ID info is
populated via the first compatible string, cf. modalias population in
of_i2c_get_board_info(). Since there is no "ina232" entry in the legacy
I2C device ID table either, the struct i2c_device_id *id pointer in the
probe function is NULL.

Fix this by using the already populated type variable instead, which
points to the proper driver data. Since the name is also wanted, add a
generic one to the ina2xx_config table.

Signed-off-by: Alvin Šipraga &lt;alsi@bang-olufsen.dk&gt;
Fixes: c43a102e67db ("iio: ina2xx: add support for TI INA2xx Power Monitors")
Link: https://lore.kernel.org/r/20230619141239.2257392-1-alvin@pqrs.dk
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: meson: fix core clock enable/disable moment</title>
<updated>2023-08-16T16:32:21Z</updated>
<author>
<name>George Stark</name>
</author>
<published>2023-07-21T10:23:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a3751305397d2636aaf82d44f3881eb0fcf4b987'/>
<id>urn:sha1:a3751305397d2636aaf82d44f3881eb0fcf4b987</id>
<content type='text'>
commit 09738ccbc4148c62d6c8c4644ff4a099d57f49ad upstream.

Enable core clock at probe stage and disable it at remove stage.
Core clock is responsible for turning on/off the entire SoC module so
it should be on before the first module register is touched and be off
at very last moment.

Fixes: 3adbf3427330 ("iio: adc: add a driver for the SAR ADC found in Amlogic Meson SoCs")
Signed-off-by: George Stark &lt;gnstark@sberdevices.ru&gt;
Link: https://lore.kernel.org/r/20230721102413.255726-2-gnstark@sberdevices.ru
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: Fix ac excitation feature</title>
<updated>2023-08-16T16:32:21Z</updated>
<author>
<name>Alisa Roman</name>
</author>
<published>2023-06-14T15:52:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9656c2baeb541953d01f5ca59a1b8f7dbd1a3d9d'/>
<id>urn:sha1:9656c2baeb541953d01f5ca59a1b8f7dbd1a3d9d</id>
<content type='text'>
commit 6bc471b6c3aeaa7b95d1b86a1bb8d91a3c341fa5 upstream.

AC excitation enable feature exposed to user on AD7192, allowing a bit
which should be 0 to be set. This feature is specific only to AD7195. AC
excitation attribute moved accordingly.

In the AD7195 documentation, the AC excitation enable bit is on position
22 in the Configuration register. ACX macro changed to match correct
register and bit.

Note that the fix tag is for the commit that moved the driver out of
staging.

Fixes: b581f748cce0 ("staging: iio: adc: ad7192: move out of staging")
Signed-off-by: Alisa Roman &lt;alisa.roman@analog.com&gt;
Cc: stable@vger.kernel.org
Reviewed-by: Nuno Sa &lt;nuno.sa@analog.com&gt;
Link: https://lore.kernel.org/r/20230614155242.160296-1-alisa.roman@analog.com
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>meson saradc: fix clock divider mask length</title>
<updated>2023-07-23T11:54:07Z</updated>
<author>
<name>George Stark</name>
</author>
<published>2023-06-06T16:53:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=11394a9eb18d10a87d667466e25ee9501a93cf4f'/>
<id>urn:sha1:11394a9eb18d10a87d667466e25ee9501a93cf4f</id>
<content type='text'>
commit c57fa0037024c92c2ca34243e79e857da5d2c0a9 upstream.

According to the datasheets of supported meson SoCs length of ADC_CLK_DIV
field is 6-bit. Although all supported SoCs have the register
with that field documented later SoCs use external clock rather than
ADC internal clock so this patch affects only meson8 family (S8* SoCs).

Fixes: 3adbf3427330 ("iio: adc: add a driver for the SAR ADC found in Amlogic Meson SoCs")
Signed-off-by: George Stark &lt;GNStark@sberdevices.ru&gt;
Reviewed-by: Andy Shevchenko &lt;andy.shevchenko@gmail.com&gt;
Reviewed-by: Martin Blumenstingl &lt;martin.blumenstingl@googlemail.com&gt;
Link: https://lore.kernel.org/r/20230606165357.42417-1-gnstark@sberdevices.ru
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: Fix internal/external clock selection</title>
<updated>2023-07-19T14:35:06Z</updated>
<author>
<name>Fabrizio Lamarque</name>
</author>
<published>2023-05-30T07:53:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=90d8789805d4e30368b32be1a575dfd3e7d46602'/>
<id>urn:sha1:90d8789805d4e30368b32be1a575dfd3e7d46602</id>
<content type='text'>
commit f7d9e21dd274b97dc0a8dbc136a2ea8506063a96 upstream.

Fix wrong selection of internal clock when mclk is defined.

Resolve a logical inversion introduced in c9ec2cb328e3.

Fixes: c9ec2cb328e3 ("iio: adc: ad7192: use devm_clk_get_optional() for mclk")
Signed-off-by: Fabrizio Lamarque &lt;fl.scratchpad@gmail.com&gt;
Reviewed-by: Nuno Sa &lt;nuno.sa@analog.com&gt;
Cc: &lt;Stable@vger.kernel.org&gt;
Link: https://lore.kernel.org/r/20230530075311.400686-3-fl.scratchpad@gmail.com
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: Fix null ad7192_state pointer access</title>
<updated>2023-07-19T14:35:06Z</updated>
<author>
<name>Fabrizio Lamarque</name>
</author>
<published>2023-05-30T07:53:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=30e469ad6a5b00eca28880084a45e80e35e60a24'/>
<id>urn:sha1:30e469ad6a5b00eca28880084a45e80e35e60a24</id>
<content type='text'>
commit 9e58e3a6f8e1c483c86a04903b7b7aa0923e4426 upstream.

Pointer to indio_dev structure is obtained via spi_get_drvdata() at
the beginning of function ad7192_setup(), but the spi-&gt;dev-&gt;driver_data
member is not initialized, hence a NULL pointer is returned.

Fix by changing ad7192_setup() signature to take pointer to struct
iio_dev, and get ad7192_state pointer via st = iio_priv(indio_dev);

Fixes: bd5dcdeb3fd0 ("iio: adc: ad7192: convert to device-managed functions")
Signed-off-by: Fabrizio Lamarque &lt;fl.scratchpad@gmail.com&gt;
Reviewed-by: Nuno Sa &lt;nuno.sa@analog.com&gt;
Cc: &lt;Stable@vger.kernel.org&gt;
Link: https://lore.kernel.org/r/20230530075311.400686-2-fl.scratchpad@gmail.com
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-05-20T15:34:52Z</updated>
<author>
<name>Masahiro Honda</name>
</author>
<published>2023-05-18T11:08:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=626d312028bec44209d0ecd5beaa9b1aa8945f7d'/>
<id>urn:sha1:626d312028bec44209d0ecd5beaa9b1aa8945f7d</id>
<content type='text'>
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;
</content>
</entry>
<entry>
<title>iio: adc: stm32-adc: skip adc-channels setup if none is present</title>
<updated>2023-05-13T16:54:57Z</updated>
<author>
<name>Sean Nyekjaer</name>
</author>
<published>2023-05-03T16:20:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3e27ef0ced49f8ae7883c25fadf76a2086e99025'/>
<id>urn:sha1:3e27ef0ced49f8ae7883c25fadf76a2086e99025</id>
<content type='text'>
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;
</content>
</entry>
<entry>
<title>iio: adc: stm32-adc: skip adc-diff-channels setup if none is present</title>
<updated>2023-05-13T16:54:57Z</updated>
<author>
<name>Sean Nyekjaer</name>
</author>
<published>2023-05-03T16:20:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9c0d6ccd7d6bbd275e390b55a3390b4274291d95'/>
<id>urn:sha1:9c0d6ccd7d6bbd275e390b55a3390b4274291d95</id>
<content type='text'>
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;
</content>
</entry>
<entry>
<title>iio: adc: ad7192: Change "shorted" channels to differential</title>
<updated>2023-05-13T16:54:57Z</updated>
<author>
<name>Paul Cercueil</name>
</author>
<published>2023-03-30T10:21:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e55245d115bb9054cb72cdd5dda5660f4484873a'/>
<id>urn:sha1:e55245d115bb9054cb72cdd5dda5660f4484873a</id>
<content type='text'>
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;
</content>
</entry>
</feed>
