Skip to content

Commit a96d3e2

Browse files
javiercarrascocruzjic23
authored andcommitted
iio: light: apds9306: fix max_scale_nano values
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: [email protected] Fixes: 620d1e6 ("iio: light: Add support for APDS9306 Light Sensor") Signed-off-by: Javier Carrasco <[email protected]> Tested-by: [email protected] Link: https://patch.msgid.link/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
1 parent 2014c95 commit a96d3e2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/iio/light/apds9306.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,11 @@ static const struct part_id_gts_multiplier apds9306_gts_mul[] = {
108108
{
109109
.part_id = 0xB1,
110110
.max_scale_int = 16,
111-
.max_scale_nano = 3264320,
111+
.max_scale_nano = 326432000,
112112
}, {
113113
.part_id = 0xB3,
114114
.max_scale_int = 14,
115-
.max_scale_nano = 9712000,
115+
.max_scale_nano = 97120000,
116116
},
117117
};
118118

0 commit comments

Comments
 (0)