Skip to contentSkip to conversation

iio: light: add support for APDS9660 sensor

PATCH Superseded Matt Ranostay 1 participant 3 messages Jul 7, 2015 1 message not in the archive

Subsystems (2)

v1 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

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
#2 lore raw

PATCH 1/2 iio: light: DT binding docs for APDS9960 driver

In reply to a message not in the archive

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
new file mode 100644
index 0000000..7a47d28
@@ -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
#3 lore raw

PATCH 2/2 iio: light: add APDS9960 ALS + promixity driver

In reply to a message not in the archive

APDS9960 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
new file mode 100644
index 0000000..1a16732
@@ -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
index e6198b7..6a4a47c7 100644
@@ -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
index e2d50fd..0189ac7 100644
@@ -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