]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
iio: light: apds9306: fix max_scale_nano values
authorJavier Carrasco <javier.carrasco.cruz@gmail.com>
Sun, 12 Jan 2025 00:08:11 +0000 (01:08 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Mar 2025 12:02:17 +0000 (13:02 +0100)
commit3d4f335c268d0ceac29f40c75693a9dac2f6f608
tree3a621b6a643f86ecbf053f7dbcbd50561c11bed7
parentaffe7249f9c17bb922415ea94e0bed68d3a3bbc1
iio: light: apds9306: fix max_scale_nano values

commit a96d3e2beca0e51c8444d0a3b6b3ec484c4c5a8f upstream.

The two provided max_scale_nano values must be multiplied by 100 and 10
respectively to achieve nano units. According to the comments:

Max scale for apds0306 is 16.326432 → the fractional part is 0.326432,
which is 326432000 in NANO. The current value is 3264320.

Max scale for apds0306-065 is 14.09721 → the fractional part is 0.09712,
which is 97120000 in NANO. The current value is 9712000.

Update max_scale_nano initialization to use the right NANO fractional
parts.

Cc: stable@vger.kernel.org
Fixes: 620d1e6c7a3f ("iio: light: Add support for APDS9306 Light Sensor")
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Tested-by: subhajit.ghosh@tweaklogic.com
Link: https://patch.msgid.link/20250112-apds9306_nano_vals-v1-1-82fb145d0b16@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/light/apds9306.c