1
0
Fork 0
Commit Graph

7 Commits (redonkable)

Author SHA1 Message Date
Thomas Gleixner 36edc93958 treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 330
Based on 1 normalized pattern(s):

  this file is subject to the terms and conditions of version 2 of the
  gnu general public license see the file copying in the main
  directory of this archive for more details

extracted by the scancode license scanner the SPDX license identifier

  GPL-2.0-only

has been chosen to replace the boilerplate/reference in 55 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Allison Randal <allison@lohutok.net>
Reviewed-by: Alexios Zavras <alexios.zavras@intel.com>
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190530000436.108941081@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-05 17:37:06 +02:00
Stefan Brüns 3525d7cfb7 iio: light: vl6180: Correct ALS scale for non-default gain/integration time
The reported scale was only correct for the default settings of 100 ms
integration time and gain 1.

This aligns the reported scale with the behaviour of any other IIO driver
and the documented ABI, but may require userspace changes if someone uses
non-default settings.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-10-09 20:50:21 +01:00
Stefan Brüns e794bf6751 iio: light: vl6180: Cleanup als_gain lookup, avoid register readback
Instead of manually iterating the array of allowed gain values, use
find_closest. Storing the current gain setting avoids accessing the
hardware on each query.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-10-09 20:50:15 +01:00
Stefan Brüns df698c0402 iio: light: vl6180: Avoid readback of integration time register
Instead of reading the value from the register on each query, store the
set value.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-10-09 20:50:10 +01:00
Stefan Brüns 1e2ed3d0d2 iio: light: vl6180: Move range check to integration time setter, cleanup
This improves code uniformity (range checks for als_gain are also done
in the setter). Also unmangle rounding and calculation of register value.

The calculated integration time it_ms is required in the next patch of
the series.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-10-09 20:50:08 +01:00
Jonathan Cameron 4166b47c2b iio:light: drop assign iio_info.driver_module and iio_trigger_ops.owner
The equivalent of both of these are now done via macro magic when
the relevant register calls are made.  The actual structure
elements will shortly go away.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
2017-08-22 21:31:57 +01:00
Manivannan Sadhasivam 5e7f47e495 iio:light: Add support for STMicro VL6180 sensor
This patch adds support for STMicro VL6180 - ALS, range and proximity sensor. Sensor is capable of measuring the light
intensity as well as object distance using TOF (Time of Flight) technology.

Signed-off-by: Manivannan Sadhasivam <manivannanece23@gmail.com>
Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-25 16:20:46 +00:00