Skip to contentSkip to conversation

iio:light: Add support for STMicro VL6180 sensor

PATCH Superseded Manivannan Sadhasivam 1 participant 1 message Mar 7, 2017

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 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.

---

Changes in v2:

1. Specified range in comments and Kconfig
2. Used cpu_to_be16 for endianess conversion
3. Fixed typos
4. Added necessary comments
5. Added Peter's signed-off-by:

For Jonathan:

1. I'm not clear about how to use cpu_to_be16 for vl6180_write_byte, as both address and values are mixed up in same buffer. I guess we can leave as it is.

 .../devicetree/bindings/iio/light/vl6180.txt       |  16 +
 drivers/iio/light/Kconfig                          |  10 +
 drivers/iio/light/Makefile                         |   1 +
 drivers/iio/light/vl6180.c                         | 541 +++++++++++++++++++++
 4 files changed, 568 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/light/vl6180.txt
 create mode 100644 drivers/iio/light/vl6180.c
Documentation/devicetree/bindings/iio/light/vl6180.txt new file +16 -0
new file mode 100644
index 0000000..8f77ccd
@@ -0,0 +1,16 @@
+STMicro VL6180 -  ALS, range and proximity sensor
+
+Link to datasheet: http://www.st.com/resource/en/datasheet/vl6180x.pdf
+
+Required properties:
+
+	-compatible: should be "st,vl6180"
+	-reg: the I2C address of the sensor
+
+Example:
+
+vl6180@29 {
+	compatible = "st,vl6180";
+	reg = <0x29>;
+};
+	
drivers/iio/light/Kconfig +10 -0
index 7c566f5..aec04ef 100644
@@ -352,4 +352,14 @@ config VEML6070
 	 To compile this driver as a module, choose M here: the
 	 module will be called veml6070.
 
+config VL6180
+	tristate "VL6180 ALS, range and proximity sensor"
+	depends on I2C
+	help
+	 Say Y here if you want to build a driver for the STMicroelectronics
+	 VL6180 combined ambient light, range and proximity sensor.
+
+	 To compile this driver as a module, choose M here: the
+	 module will be called vl6180.
+
 endmenu
drivers/iio/light/Makefile +1 -0
index 6f2a3c6..24a8d72 100644
@@ -33,3 +33,4 @@ obj-$(CONFIG_TSL4531)		+= tsl4531.o
 obj-$(CONFIG_US5182D)		+= us5182d.o
 obj-$(CONFIG_VCNL4000)		+= vcnl4000.o
 obj-$(CONFIG_VEML6070)		+= veml6070.o
+obj-$(CONFIG_VL6180)		+= vl6180.o
drivers/iio/light/vl6180.c new file +541 -0

541 lines not on this page · raw message

Signature · 1 line
2.7.4