Skip to content

Commit 8d8d7c1

Browse files
Fabio Estevamjic23
authored andcommitted
iio: adc: max1363: Reorder mode_list[] entries
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 <festevam@denx.de> Acked-by: Matti Vaittinen <mazziesaccount@gmail.com> Link: https://patch.msgid.link/20250516173900.677821-2-festevam@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
1 parent 6d21f2c commit 8d8d7c1

1 file changed

Lines changed: 9 additions & 10 deletions

File tree

drivers/iio/adc/max1363.c

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -532,23 +532,23 @@ static const struct iio_chan_spec max1363_channels[] =
532532
/* Applies to max1236, max1237 */
533533
static const enum max1363_modes max1236_mode_list[] = {
534534
_s0, _s1, _s2, _s3,
535-
s0to1, s0to2, s0to3,
535+
s0to1, s0to2, s2to3, s0to3,
536536
d0m1, d2m3, d1m0, d3m2,
537537
d0m1to2m3, d1m0to3m2,
538-
s2to3,
539538
};
540539

541540
/* Applies to max1238, max1239 */
542541
static const enum max1363_modes max1238_mode_list[] = {
543542
_s0, _s1, _s2, _s3, _s4, _s5, _s6, _s7, _s8, _s9, _s10, _s11,
544543
s0to1, s0to2, s0to3, s0to4, s0to5, s0to6,
544+
s6to7, s6to8, s6to9, s6to10, s6to11,
545545
s0to7, s0to8, s0to9, s0to10, s0to11,
546546
d0m1, d2m3, d4m5, d6m7, d8m9, d10m11,
547547
d1m0, d3m2, d5m4, d7m6, d9m8, d11m10,
548-
d0m1to2m3, d0m1to4m5, d0m1to6m7, d0m1to8m9, d0m1to10m11,
549-
d1m0to3m2, d1m0to5m4, d1m0to7m6, d1m0to9m8, d1m0to11m10,
550-
s6to7, s6to8, s6to9, s6to10, s6to11,
551-
d6m7to8m9, d6m7to10m11, d7m6to9m8, d7m6to11m10,
548+
d0m1to2m3, d0m1to4m5, d0m1to6m7, d6m7to8m9,
549+
d0m1to8m9, d6m7to10m11, d0m1to10m11, d1m0to3m2,
550+
d1m0to5m4, d1m0to7m6, d7m6to9m8, d1m0to9m8,
551+
d7m6to11m10, d1m0to11m10,
552552
};
553553

554554
#define MAX1363_12X_CHANS(bits) { \
@@ -584,16 +584,15 @@ static const struct iio_chan_spec max1238_channels[] = MAX1363_12X_CHANS(12);
584584

585585
static const enum max1363_modes max11607_mode_list[] = {
586586
_s0, _s1, _s2, _s3,
587-
s0to1, s0to2, s0to3,
588-
s2to3,
587+
s0to1, s0to2, s2to3,
588+
s0to3,
589589
d0m1, d2m3, d1m0, d3m2,
590590
d0m1to2m3, d1m0to3m2,
591591
};
592592

593593
static const enum max1363_modes max11608_mode_list[] = {
594594
_s0, _s1, _s2, _s3, _s4, _s5, _s6, _s7,
595-
s0to1, s0to2, s0to3, s0to4, s0to5, s0to6, s0to7,
596-
s6to7,
595+
s0to1, s0to2, s0to3, s0to4, s0to5, s0to6, s6to7, s0to7,
597596
d0m1, d2m3, d4m5, d6m7,
598597
d1m0, d3m2, d5m4, d7m6,
599598
d0m1to2m3, d0m1to4m5, d0m1to6m7,

0 commit comments

Comments
 (0)