iio: light: add support for APDS9960 sensor
Subsystems (2)
v5 cover iio: light: add support for APDS9960 sensor
This patchset adds support for the APDS9960 ALS + proximity + gesture sensor.
Included support for the various adjustable settings and controls:
* Falling and rising ALS + proximity thresholds events
* Gain controls
* ALS time integration
Changes from v4:
* Remove iio_trigger_poll() and interupt handler for the triggered buffer
* Push data directly to buffers avoiding needing use a irq_work queue
* Switch to apds9960_buffer_*disable in buffer setup ops
* Minor comment changes
Matt Ranostay (2):
iio: light: DT binding docs for APDS9960 driver
iio: light: add APDS9960 ALS + promixity driver
.../ABI/testing/sysfs-bus-iio-light-apds9960 | 7 + .../devicetree/bindings/iio/light/apds9960.txt | 22 + drivers/iio/light/Kconfig | 13 + drivers/iio/light/Makefile | 1 + drivers/iio/light/apds9960.c | 1167 ++++++++++++++++++++ 5 files changed, 1210 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-bus-iio-light-apds9960 create mode 100644 Documentation/devicetree/bindings/iio/light/apds9960.txt create mode 100644 drivers/iio/light/apds9960.c
Signature · 1 line
1.9.1
PATCH v5 1/2 iio: light: DT binding docs for APDS9960 driver
In reply to a message not in the archiveDocument compatible string, and required DT properties for APDS9960 chipset driver.
--- .../devicetree/bindings/iio/light/apds9960.txt | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Documentation/devicetree/bindings/iio/light/apds9960.txt
Documentation/devicetree/bindings/iio/light/apds9960.txt new file +22 -0
@@ -0,0 +1,22 @@ +* Avago APDS9960 gesture/RGB/ALS/proximity sensor + +http://www.avagotech.com/docs/AV02-4191EN + +Required properties: + + - compatible: must be "avago,apds9960" + - reg: the I2C address of the sensor + - interrupt-parent: should be the phandle for the interrupt controller + - interrupts : the sole interrupt generated by the device + + Refer to interrupt-controller/interrupts.txt for generic interrupt client + node bindings. + +Example: + +apds9960@39 { + compatible = "avago,apds9960"; + reg = <0x39>; + interrupt-parent = <&gpio1>; + interrupts = <16 1>; +};
Signature · 1 line
1.9.1
PATCH v5 2/2 iio: light: add APDS9960 ALS + promixity driver
In reply to a message not in the archiveAPDS9960 is a combination of ALS, proximity, and gesture sensors.
This patch adds support for these functions along with gain control, integration time, and event thresholds.
--- .../ABI/testing/sysfs-bus-iio-light-apds9960 | 7 + drivers/iio/light/Kconfig | 13 + drivers/iio/light/Makefile | 1 + drivers/iio/light/apds9960.c | 1167 ++++++++++++++++++++ 4 files changed, 1188 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-bus-iio-light-apds9960 create mode 100644 drivers/iio/light/apds9960.c
Documentation/ABI/testing/sysfs-bus-iio-light-apds9960 new file +7 -0
@@ -0,0 +1,7 @@ +What: /sys/bus/iio/devices/triggerX/name = "apds9960-gestureX" +KernelVersion: 4.2 +Contact: Matt Ranostay <[email protected]> +Description: + The APDS9960 kernel module provides a trigger which enables + the gesture engine that pushes motion data to the buffer when + it becomes available.
drivers/iio/light/Kconfig +13 -0
@@ -50,6 +50,19 @@ config APDS9300 To compile this driver as a module, choose M here: the module will be called apds9300. +config APDS9960 + tristate "Avago APDS9960 gesture/RGB/ALS/proximity sensor" + select REGMAP_I2C + select IIO_BUFFER + select IIO_TRIGGERED_BUFFER + depends on I2C + help + Say Y here to build I2C interface support for the Avago + APDS9960 gesture/RGB/ALS/proximity sensor. + + To compile this driver as a module, choose M here: the + module will be called apds9960 + config BH1750 tristate "ROHM BH1750 ambient light sensor" depends on I2C
drivers/iio/light/Makefile +1 -0
@@ -7,6 +7,7 @@ obj-$(CONFIG_ACPI_ALS) += acpi-als.o obj-$(CONFIG_ADJD_S311) += adjd_s311.o obj-$(CONFIG_AL3320A) += al3320a.o obj-$(CONFIG_APDS9300) += apds9300.o +obj-$(CONFIG_APDS9960) += apds9960.o obj-$(CONFIG_BH1750) += bh1750.o obj-$(CONFIG_CM32181) += cm32181.o obj-$(CONFIG_CM3232) += cm3232.o
drivers/iio/light/apds9960.c new file +1167 -0
1,167 lines not on this page · raw message
Signature · 1 line
1.9.1