iio: light: add support for APDS9660 sensor
Subsystems (2)
cover iio: light: add support for APDS9660 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
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 | 125 ++ .../devicetree/bindings/iio/light/apds9960.txt | 19 + drivers/iio/light/Kconfig | 12 + drivers/iio/light/Makefile | 1 + drivers/iio/light/apds9960.c | 1219 ++++++++++++++++++++ 5 files changed, 1376 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
A message that is not in the archive (sent off-list or not yet received): 1436239334-15782-1-git-send-email-mranostay-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
PATCH 1/2 iio: light: DT binding docs for APDS9960 driver
Document compatible string, and required DT properties for APDS9960 chipset driver.
--- .../devicetree/bindings/iio/light/apds9960.txt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Documentation/devicetree/bindings/iio/light/apds9960.txt
Documentation/devicetree/bindings/iio/light/apds9960.txt new file +19 -0
@@ -0,0 +1,19 @@ +* 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: interrupt mapping for GPIO IRQ + +Example: + +apds9960@39 { + compatible = "avago,apds9960"; + reg = <0x39>; + interrupt-parent = <&gpio1>; + interrupts = <16 1>; +};
Signature · 1 line
1.9.1
PATCH 2/2 iio: light: add APDS9960 ALS + promixity driver
In reply to a message not in the archiveAPDS9960 is a combination ALS, proximity, and gesture sensor.
This patch adds support for these functions along with gain control, integration time, and event thresholds.
--- .../ABI/testing/sysfs-bus-iio-light-apds9960 | 125 ++ drivers/iio/light/Kconfig | 12 + drivers/iio/light/Makefile | 1 + drivers/iio/light/apds9960.c | 1219 ++++++++++++++++++++ 4 files changed, 1357 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 +125 -0
@@ -0,0 +1,125 @@ +What: /sys/bus/iio/devices/triggerX/name = "apds9960-gestureX" +KernelVersion: 4.2 +Contact: Matt Ranostay <[email protected]> +Description: + The APDS9960 kernel module provides an trigger, which sets the + driver in a mode, which gesture data is pushed to the buffer + when it becomes available. + +What /sys/bus/iio/devices/iio:deviceX/in_proximity0_raw +Date: July 2015 +KernelVersion: 4.2 +Contact: Matt Ranostay <[email protected]> +Description: + Get the current proximity value from 0-255. + +What /sys/bus/iio/devices/iio:deviceX/in_proximity1_raw +Date: July 2015 +KernelVersion: 4.2 +Contact: Matt Ranostay <[email protected]> +Description: + Get the current UP photodiode proximity value from 0-255. + Access is disabled to prevent the side effect of + userspace clearing the hardware FIFO. + +What /sys/bus/iio/devices/iio:deviceX/in_proximity2_raw +Date: July 2015 +KernelVersion: 4.2 +Contact: Matt Ranostay <[email protected]> +Description: + Get the current DOWN photodiode proximity value from 0-255. + Access is disabled to prevent the side effect of + userspace clearing the hardware FIFO. + +What /sys/bus/iio/devices/iio:deviceX/in_proximity3_raw +Date: July 2015 +KernelVersion: 4.2 +Contact: Matt Ranostay <[email protected]> +Description: + Get the current LEFT photodiode proximity value from 0-255. + Access is disabled to prevent the side effect of + userspace clearing the hardware FIFO. + +What /sys/bus/iio/devices/iio:deviceX/in_proximity4_raw +Date: July 2015 +KernelVersion: 4.2 +Contact: Matt Ranostay <[email protected]> +Description: + Get the current RIGHT photodiode proximity value from 0-255. + Access is disabled to prevent the side effect of + userspace clearing the hardware FIFO. + +What /sys/bus/iio/devices/iio:deviceX/in_intensity_clear_raw +Date: July 2015 +KernelVersion: 4.2 +Contact: Matt Ranostay <[email protected]> +Description: + Get the current unprocessed lux value for the clear/ALS + photodiode. + +What /sys/bus/iio/devices/iio:deviceX/in_intensity_red_raw +Date: July 2015 +KernelVersion: 4.2 +Contact: Matt Ranostay <[email protected]> +Description: + Get the current unprocessed lux value for the red photodiode. + +What /sys/bus/iio/devices/iio:deviceX/in_intensity_green_raw +Date: July 2015 +KernelVersion: 4.2 +Contact: Matt Ranostay <[email protected]> +Description: + Get the current unprocessed lux value for the green photodiode. + +What /sys/bus/iio/devices/iio:deviceX/in_intensity_blue_raw +Date: July 2015 +KernelVersion: 4.2 +Contact: Matt Ranostay <[email protected]> +Description: + Get the current unprocessed lux value for the blue photodiode. + +What /sys/bus/iio/devices/iio:deviceX/integration_time_available +Date: July 2015 +KernelVersion: 4.2 +Contact: Matt Ranostay <[email protected]> +Description: + Provide allowed integration time values in fractions of a second + for the ALS + RGB sensor engines. + +What /sys/bus/iio/devices/iio:deviceX/in_intensity_integration_time +Date: July 2015 +KernelVersion: 4.2 +Contact: Matt Ranostay <[email protected]> +Description: + Set integration time in fractions of a second for the ALS + RGB + sensor engines. + +What /sys/bus/iio/devices/iio:deviceX/in_proximity_calibscale_available +Date: July 2015 +KernelVersion: 4.2 +Contact: Matt Ranostay <[email protected]> +Description: + Provide the allowed gain values for the proximity + gesture + engines. + +What /sys/bus/iio/devices/iio:deviceX/in_proximity_calibscale +Date: July 2015 +KernelVersion: 4.2 +Contact: Matt Ranostay <[email protected]> +Description: + Set the gain value for the proximity + gesture engines. + +What /sys/bus/iio/devices/iio:deviceX/in_intensity_calibscale_available +Date: July 2015 +KernelVersion: 4.2 +Contact: Matt Ranostay <[email protected]> +Description: + Provide the allowed gain values for the ALS + RGB sensor + engines. + +What /sys/bus/iio/devices/iio:deviceX/in_intensity_calibscale +Date: July 2015 +KernelVersion: 4.2 +Contact: Matt Ranostay <[email protected]> +Description: + Set the gain value for the ALS + RGB sensor engines.
drivers/iio/light/Kconfig +12 -0
@@ -50,6 +50,18 @@ 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 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 +1219 -0
1,219 lines not on this page · raw message
Signature · 1 line
1.9.1