mbox series

[0/5] iio: light: vcnl4000: make some settings configurable

Message ID 20200205101655.11728-1-tomas@novotny.cz (mailing list archive)
Headers show
Series iio: light: vcnl4000: make some settings configurable | expand

Message

Tomas Novotny Feb. 5, 2020, 10:16 a.m. UTC
Hi,

series adds enable, integration time, duty ratio and multi pulse
settings for vcnl4040 and vcnl4200. Only enable is also for ambient
light sensor, the rest is for proximity sensor.

The second patch allows you to switch sensors on or off. This is
required for the rest of patches, as the settings should be changed on
disabled sensor.

The duty ratio (the fourth patch) is available as extended channel enum.
I've chosen this approach as it is more straightforward from the
sensor's perspective. It will be a bit tricky, but it can be
exported as sampling frequency attribute. The sampling frequency depends
on the integration time and 20% of part to part tolerance needs to be
added. In this case, only the available frequencies for currently
selected integration time should be listed in the available attribute?
Please note that the sampling frequency -> duty ratio mapping is
ambiguous. There are more frequencies which map to different integration
and duty ratio pairs.

The whole series is tested on vcnl4020 and vcnl4200.

The series is based on fixes-togreg (e19ac9d9a978) and two patches
already posted to iio mailing lists (series 'iio: light: vcnl4000:
update sampling rates' [1]).

[1] https://lore.kernel.org/linux-iio/20200108155852.32702-1-tomas@novotny.cz/

Tomas Novotny (5):
  iio: light: vcnl4000: convert to regmap
  iio: light: vcnl4000: add enable attributes for vcnl4040/4200
  iio: light: vcnl4000: add proximity integration time for vcnl4040/4200
  iio: light: vcnl4000: add control of duty ratio
  iio: light: vcnl4000: add control of multi pulse

 Documentation/ABI/testing/sysfs-bus-iio-vcnl4000 |  39 ++
 drivers/iio/light/Kconfig                        |   1 +
 drivers/iio/light/vcnl4000.c                     | 545 +++++++++++++++++++++--
 3 files changed, 549 insertions(+), 36 deletions(-)
 create mode 100644 Documentation/ABI/testing/sysfs-bus-iio-vcnl4000