Re: [PATCH] iio: sx9310: Fix semtech,avg-pos-strength setting when > 16

2020-11-20 Thread Doug Anderson
Hi, On Thu, Nov 19, 2020 at 11:38 PM Stephen Boyd wrote: > > This DT property can be 0, 16, and then 64, but not 32. The math here > doesn't recognize this slight bump in the power of 2 numbers and > translates a DT property of 64 into the register value '3' when it > really should be '2'. Fix it

Re: [PATCH] iio: sx9310: Fix semtech,avg-pos-strength setting when > 16

2020-11-20 Thread Stephen Boyd
Quoting Doug Anderson (2020-11-20 10:16:28) > > Checking the math for the documented possible values of pos. What we want: > > 0 => 0 > 16 => 1 > 64 => 2 > 128 => 3 > 256 => 4 > 512 => 5 > 1024 => 6 > 4294967295 => 7 > > So looks OK. Do we care about anything other than the documented > number

[PATCH] iio: sx9310: Fix semtech,avg-pos-strength setting when > 16

2020-11-19 Thread Stephen Boyd
This DT property can be 0, 16, and then 64, but not 32. The math here doesn't recognize this slight bump in the power of 2 numbers and translates a DT property of 64 into the register value '3' when it really should be '2'. Fix it by subtracting one more if the number being translated is larger tha