staging: iio: tsl2x7x: split out als and prox persistence settings
authorBrian Masney <masneyb@onstation.org>
Wed, 21 Mar 2018 10:29:08 +0000 (06:29 -0400)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 24 Mar 2018 13:40:20 +0000 (13:40 +0000)
commit490941db5535dd470beec13aacb5bae748943c06
tree51da0131258179f27e593602846a34802c839cb7
parent8bf09ec4dc31a114b60249448076fdb53712be58
staging: iio: tsl2x7x: split out als and prox persistence settings

The struct tsl2x7x_settings contained a persistence member that
contained both the ALS and proximity persistence fields. This patch
splits this out into two separate fields so that the bitmasks in
several parts of the code are no longer necessary.

The default persistence settings are also changed by this patch from:

- Proximity: 0 (Every proximity cycle generates an interrupt)
- ALS: 255 (60 consecutive values out of range)

to something a little more reasonable based on my testing:

- Proximity: 1 (1 proximity value out of range)
- ALS: 1 (1 value outside of threshold range)

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/staging/iio/light/tsl2x7x.c
drivers/staging/iio/light/tsl2x7x.h