<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/iio/adc/max1363.c, branch master</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=master</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2025-06-09T06:45:19Z</updated>
<entry>
<title>iio: adc: max1363: Reorder mode_list[] entries</title>
<updated>2025-06-09T06:45:19Z</updated>
<author>
<name>Fabio Estevam</name>
</author>
<published>2025-05-16T17:39:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8d8d7c1dbc46aa07a76acab7336a42ddd900be10'/>
<id>urn:sha1:8d8d7c1dbc46aa07a76acab7336a42ddd900be10</id>
<content type='text'>
The IIO core issues warnings when a scan mask is a subset of a previous
entry in the available_scan_masks array.

On a board using a MAX11601, the following warning is observed:

max1363 1-0064: available_scan_mask 7 subset of 6. Never used

This occurs because the entries in the max11607_mode_list[] array are not
ordered correctly. To fix this, reorder the entries so that no scan mask is
a subset of an earlier one.

While at it, reorder the mode_list[] arrays for other supported chips as
well, to prevent similar warnings on different variants.

Note fixes tag dropped as these were introduced over many commits a long
time back and the side effect until recently was a reduction in sampling
rate due to reading too many channels when only a few were desired.
Now we have a sanity check that reports this error but that is not
where the issue was introduced.

Cc: stable@vger.kernel.org
Signed-off-by: Fabio Estevam &lt;festevam@denx.de&gt;
Acked-by: Matti Vaittinen &lt;mazziesaccount@gmail.com&gt;
Link: https://patch.msgid.link/20250516173900.677821-2-festevam@gmail.com
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>iio: adc: max1363: Fix MAX1363_4X_CHANS/MAX1363_8X_CHANS[]</title>
<updated>2025-06-09T06:45:19Z</updated>
<author>
<name>Fabio Estevam</name>
</author>
<published>2025-05-16T17:38:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6d21f2c2dd843bceefd9455f2919f6bb526797f0'/>
<id>urn:sha1:6d21f2c2dd843bceefd9455f2919f6bb526797f0</id>
<content type='text'>
Since commit 2718f15403fb ("iio: sanity check available_scan_masks array"),
booting a board populated with a MAX11601 results in a flood of warnings:

max1363 1-0064: available_scan_mask 8 subset of 0. Never used
max1363 1-0064: available_scan_mask 9 subset of 0. Never used
max1363 1-0064: available_scan_mask 10 subset of 0. Never used
max1363 1-0064: available_scan_mask 11 subset of 0. Never used
max1363 1-0064: available_scan_mask 12 subset of 0. Never used
max1363 1-0064: available_scan_mask 13 subset of 0. Never used
...

These warnings are caused by incorrect offsets used for differential
channels in the MAX1363_4X_CHANS() and MAX1363_8X_CHANS() macros.

The max1363_mode_table[] defines the differential channel mappings as
follows:

MAX1363_MODE_DIFF_SINGLE(0, 1, 1 &lt;&lt; 12),
MAX1363_MODE_DIFF_SINGLE(2, 3, 1 &lt;&lt; 13),
MAX1363_MODE_DIFF_SINGLE(4, 5, 1 &lt;&lt; 14),
MAX1363_MODE_DIFF_SINGLE(6, 7, 1 &lt;&lt; 15),
MAX1363_MODE_DIFF_SINGLE(8, 9, 1 &lt;&lt; 16),
MAX1363_MODE_DIFF_SINGLE(10, 11, 1 &lt;&lt; 17),
MAX1363_MODE_DIFF_SINGLE(1, 0, 1 &lt;&lt; 18),
MAX1363_MODE_DIFF_SINGLE(3, 2, 1 &lt;&lt; 19),
MAX1363_MODE_DIFF_SINGLE(5, 4, 1 &lt;&lt; 20),
MAX1363_MODE_DIFF_SINGLE(7, 6, 1 &lt;&lt; 21),
MAX1363_MODE_DIFF_SINGLE(9, 8, 1 &lt;&lt; 22),
MAX1363_MODE_DIFF_SINGLE(11, 10, 1 &lt;&lt; 23),

Update the macros to follow this same pattern, ensuring that the scan masks
are valid and preventing the warnings.

Cc: stable@vger.kernel.org
Suggested-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
Signed-off-by: Fabio Estevam &lt;festevam@denx.de&gt;
Acked-by: Matti Vaittinen &lt;mazziesaccount@gmail.com&gt;
Link: https://patch.msgid.link/20250516173900.677821-1-festevam@gmail.com
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>iio: adc: Use iio_push_to_buffers_with_ts() to provide length for runtime checks.</title>
<updated>2025-05-21T13:20:26Z</updated>
<author>
<name>Jonathan Cameron</name>
</author>
<published>2025-04-13T10:34:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c65d3f3f938600345146df9f5cac7681c9f1b15e'/>
<id>urn:sha1:c65d3f3f938600345146df9f5cac7681c9f1b15e</id>
<content type='text'>
This new function allows us to perform debug checks in the helper to ensure
that the overrun does not occur.  Use it in all the simple cases where
either a static buffer or a structure is used in the drivers.

Reviewed-by: David Lechner &lt;dlechner@baylibre.com&gt;
Link: https://patch.msgid.link/20250413103443.2420727-10-jic23@kernel.org
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>iio: normalize array sentinel style</title>
<updated>2025-04-22T18:10:04Z</updated>
<author>
<name>David Lechner</name>
</author>
<published>2025-04-11T20:49:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=70788d26ae1c482dba843efcc0cf166c2ba36a38'/>
<id>urn:sha1:70788d26ae1c482dba843efcc0cf166c2ba36a38</id>
<content type='text'>
Use `\t(\{ ?\},|\{\}|\{\s*/\*.*\*/\s*\},?)$` regex to find and replace
the array sentinel in all IIO drivers to the same style.

For some time, we've been trying to consistently use `{ }` (no trailing
comma, no comment, one space between braces) for array sentinels in the
IIO subsystem. Still nearly 50% of existing code uses a different style.
To save reviewers from having to request this trivial change as
frequently, let's normalize the style in all existing IIO drivers.
At least when code is copy/pasted to new drivers, the style will be
consistent.

Signed-off-by: David Lechner &lt;dlechner@baylibre.com&gt;
Reviewed-by: Andy Shevchenko &lt;andy@kernel.org&gt;
Link: https://patch.msgid.link/20250411-iio-sentinel-normalization-v1-1-d293de3e3d93@baylibre.com
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>iio: adc: max1363: Stop using iio_device_claim_direct_scoped()</title>
<updated>2025-02-17T13:02:06Z</updated>
<author>
<name>Jonathan Cameron</name>
</author>
<published>2025-02-09T18:06:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5fd89f430d9e97b06ca242a59ca69819f3e6a85d'/>
<id>urn:sha1:5fd89f430d9e97b06ca242a59ca69819f3e6a85d</id>
<content type='text'>
This complex cleanup.h use case of conditional guards has proved
to be more trouble that it is worth in terms of false positive compiler
warnings and hard to read code.

Move directly to the new claim/release_direct() that allow sparse
to check for unbalanced context.

Reviewed-by: David Lechner &lt;dlechner@baylibre.com&gt;
Reviewed-by: Nuno Sa &lt;nuno.sa@analog.com&gt;
Link: https://patch.msgid.link/20250209180624.701140-17-jic23@kernel.org
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>iio: adc: max1363: Use a small fixed size buffer to replace dynamic allocation</title>
<updated>2024-12-28T14:28:13Z</updated>
<author>
<name>Vasileios Amoiridis</name>
</author>
<published>2024-12-14T19:14:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=45e3146d75424392e1cbc057e2b560785de82806'/>
<id>urn:sha1:45e3146d75424392e1cbc057e2b560785de82806</id>
<content type='text'>
Drop the recurrent allocation of the data buffer from the trigger
handler and put it in the iio_priv(). This way, the maximum amount of
channels is always allocated in favor of simpler code and drop
of usage of the internal private variable "scan_timestamp" of the
struct iio_dev.

Signed-off-by: Vasileios Amoiridis &lt;vassilisamir@gmail.com&gt;
Link: https://patch.msgid.link/20241214191421.94172-3-vassilisamir@gmail.com
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>iio: fix write_event_config signature</title>
<updated>2024-11-03T20:33:44Z</updated>
<author>
<name>Julien Stephan</name>
</author>
<published>2024-10-31T15:27:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b4b42f28a0df6b9d31f0003f7dea3bddf272eaa4'/>
<id>urn:sha1:b4b42f28a0df6b9d31f0003f7dea3bddf272eaa4</id>
<content type='text'>
write_event_config callback use an int for state, but it is actually a
boolean. iio_ev_state_store is actually using kstrtobool to check user
input, then gives the converted boolean value to write_event_config.

Fix signature and update all iio drivers to use the new signature.

This patch has been partially written using coccinelle with the
following script:

$ cat iio-bool.cocci
// Options: --all-includes

virtual patch

@c1@
identifier iioinfo;
identifier wecfunc;
@@
 static const struct iio_info iioinfo = {
        ...,
        .write_event_config =
(
 wecfunc
|
 &amp;wecfunc
),
        ...,
 };

@@
identifier c1.wecfunc;
identifier indio_dev, chan, type, dir, state;
@@
 int wecfunc(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, enum iio_event_direction dir,
-int
+bool
 state) {
  ...
 }

make coccicheck MODE=patch COCCI=iio-bool.cocci M=drivers/iio

Unfortunately, this script didn't match all files:
* all write_event_config callbacks using iio_device_claim_direct_scoped
  were not detected and not patched.
* all files that do not assign and declare the write_event_config
  callback in the same file.

iio.h was also manually updated.

The patch was build tested using allmodconfig config.

cc: Julia Lawall &lt;julia.lawall@inria.fr&gt;
Signed-off-by: Julien Stephan &lt;jstephan@baylibre.com&gt;
Link: https://patch.msgid.link/20241031-iio-fix-write-event-config-signature-v2-7-2bcacbb517a2@baylibre.com
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>Merge tag 'v6.12-rc2' into test2</title>
<updated>2024-10-12T10:43:29Z</updated>
<author>
<name>Jonathan Cameron</name>
</author>
<published>2024-10-12T10:22:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=220c71dafaa28cbb75fd785670cf68a758347026'/>
<id>urn:sha1:220c71dafaa28cbb75fd785670cf68a758347026</id>
<content type='text'>
Linux 6.12-rc2

Resolved movement of asm/unaligned.h to linux/unaligned.h
</content>
</entry>
<entry>
<title>iio: adc: max1363: Convert to get_unaligned_be16</title>
<updated>2024-10-05T11:09:13Z</updated>
<author>
<name>Abhash Jha</name>
</author>
<published>2024-09-20T18:14:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c2c4826cfa466dac828c84335bab821766f25efa'/>
<id>urn:sha1:c2c4826cfa466dac828c84335bab821766f25efa</id>
<content type='text'>
Converted manual shifting and or to use `get_unaligned_be16` api
instead.

Signed-off-by: Abhash Jha &lt;abhashkumarjha123@gmail.com&gt;
Link: https://patch.msgid.link/20240920181437.20194-1-abhashkumarjha123@gmail.com
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>iio: adc: max1363: simplify with cleanup.h</title>
<updated>2024-07-29T19:31:11Z</updated>
<author>
<name>Krzysztof Kozlowski</name>
</author>
<published>2024-07-05T10:40:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=adcba9cd610912aa5f0befbae5125c63dda36e00'/>
<id>urn:sha1:adcba9cd610912aa5f0befbae5125c63dda36e00</id>
<content type='text'>
Allocate the memory with scoped/cleanup.h to reduce error handling and
make the code a bit simpler.

Signed-off-by: Krzysztof Kozlowski &lt;krzysztof.kozlowski@linaro.org&gt;
Reviewed-by: Nuno Sa &lt;nuno.sa@analog.com&gt;
Link: https://patch.msgid.link/20240705-cleanup-h-iio-v1-4-77114c7e84c5@linaro.org
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
</feed>
