patch "iio: light: al3010: fix incorrect scale for the highest gain range" added to char-misc-linus
Subsystems (2)
This is a note to let you know that I've just added the patch titled
iio: light: al3010: fix incorrect scale for the highest gain range
to my char-misc git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git
in the char-misc-linus branch.
The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)
The patch will hopefully also be merged in Linus's tree for the next -rc kernel release.
If you have any questions about this process, please let me know.
From aa411adc6ce40ad1a55ebc965f255a4cfc0005f8 Mon Sep 17 00:00:00 2001
From: Vidhu Sarwal <[email protected]>
Date: Sat, 4 Jul 2026 17:22:45 +0530
Subject: iio: light: al3010: fix incorrect scale for the highest gain range
al3010_scales[] encodes the highest gain range as {0, 1187200}. For IIO_VAL_INT_PLUS_MICRO, the fractional part must be less than 1000000, so the scale 1.1872 should instead be represented as { 1, 187200 }.
Since write_raw() compares the value from userspace against this table, writing the advertised 1.1872 scale never matches the malformed entry and returns -EINVAL. As a result, the highest gain range cannot be selected. Reading the scale in that state also reports the malformed value.
--- drivers/iio/light/al3010.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/light/al3010.c +1 -1
@@ -42,7 +42,7 @@ enum al3xxxx_range { };static const int al3010_scales[][2 ] = { - {0 ,1187200 }, {0 ,296800 }, {0 ,74200 }, {0 ,18600 } + {1 ,187200 }, {0 ,296800 }, {0 ,74200 }, {0 ,18600 }, };static const struct regmap_config al3010_regmap_config = {
Signature · 1 line
2.55.0