]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commit
staging: iio: tsl2x7x: split out als and prox interrupt settings
authorBrian Masney <masneyb@onstation.org>
Wed, 21 Mar 2018 10:29:06 +0000 (06:29 -0400)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 24 Mar 2018 13:36:29 +0000 (13:36 +0000)
commit4123e69af20f483980ddd2e8e34b5129a30a0d3f
treeea4269503cfd23f813aa93453ed0ec9fc383ff0c
parentbce075d0ec4b6155cf4f52a7e56aa2dd3b668679
staging: iio: tsl2x7x: split out als and prox interrupt settings

The struct tsl2x7x_settings contained an interrupts_en member that was
a bitmask for which interrupts are enabled. This required having
bitmasks in several parts of the code. This patch splits this field
out into two booleans to remove most of the bitmasks in the code.

This patch also fixes a bug where if an interrupt pin was configured,
but proximity interrupts were disabled, then the proximity value could
not be polled.

This patch also removes an unnecessary second call to writing the
control register in tsl2x7x_chip_on().

Driver tested using a TSL2772 hooked up to a Raspberry Pi 2.

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