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

2020-12-02 Thread Stephen Boyd
Quoting Jonathan Cameron (2020-11-21 07:02:45) > On Sat, 21 Nov 2020 14:58:49 + > Jonathan Cameron wrote: > > > On Fri, 20 Nov 2020 10:29:44 -0800 > > Stephen Boyd wrote: > > > diff --git a/drivers/iio/proximity/sx9310.c > > > b/drivers/iio/proximity/sx9310.c > > > index

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

2020-11-21 Thread Jonathan Cameron
On Sat, 21 Nov 2020 14:58:49 + Jonathan Cameron wrote: > On Fri, 20 Nov 2020 10:29:44 -0800 > 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

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

2020-11-21 Thread Jonathan Cameron
On Fri, 20 Nov 2020 10:29:44 -0800 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 by

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

2020-11-20 Thread Doug Anderson
Hi, On Fri, Nov 20, 2020 at 10:29 AM 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

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

2020-11-20 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