overlays: Add apds9960 overlay
authorMichael Kaplan <m.kaplan@evva.com>
Fri, 8 Nov 2019 09:35:57 +0000 (10:35 +0100)
committerpopcornmix <popcornmix@gmail.com>
Wed, 1 Jul 2020 15:33:10 +0000 (16:33 +0100)
Add an overlay for the AVAGO APDS9960 digital proximity, ambient light, rgb and gesture sensor.
Also update overlay README and Makefile.

Signed-off-by: Michael Kaplan <m.kaplan@evva.com>
arch/arm/boot/dts/overlays/Makefile
arch/arm/boot/dts/overlays/README
arch/arm/boot/dts/overlays/apds9960-overlay.dts [new file with mode: 0644]

index e9cd972..f7f5f0c 100644 (file)
@@ -15,6 +15,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
        allo-katana-dac-audio.dtbo \
        allo-piano-dac-pcm512x-audio.dtbo \
        allo-piano-dac-plus-pcm512x-audio.dtbo \
+       apds9960.dtbo \
        applepi-dac.dtbo \
        at86rf233.dtbo \
        audioinjector-addons.dtbo \
index 00a70a4..bacebaa 100644 (file)
@@ -441,6 +441,14 @@ Params: 24db_digital_gain       Allow gain to be applied via the PCM512x codec
                                 better voice quality. (default Off)
 
 
+Name:   apds9960
+Info:   Configures the AVAGO APDS9960 digital proximity, ambient light, RGB and
+        gesture sensor
+Load:   dtoverlay=apds9960,<param>=<val>
+Params: gpiopin                 GPIO used for INT (default 4)
+        noints                  Disable the interrupt GPIO line.
+
+
 Name:   applepi-dac
 Info:   Configures the Orchard Audio ApplePi-DAC audio card
 Load:   dtoverlay=applepi-dac
diff --git a/arch/arm/boot/dts/overlays/apds9960-overlay.dts b/arch/arm/boot/dts/overlays/apds9960-overlay.dts
new file mode 100644 (file)
index 0000000..c216932
--- /dev/null
@@ -0,0 +1,57 @@
+// Definitions for APDS-9960 ambient light and gesture sensor
+
+/dts-v1/;
+/plugin/;
+
+/ {
+       compatible = "brcm,bcm2835";
+
+       fragment@0 {
+               target = <&i2c1>;
+               __overlay__ {
+                       status = "okay";
+               };
+       };
+
+       fragment@1 {
+               target = <&gpio>;
+               __overlay__ {
+                       apds9960_pins: apds9960_pins@39 {
+                               brcm,pins = <4>;
+                               brcm,function = <0>;
+                       };
+               };
+       };
+
+       fragment@2 {
+               target = <&i2c1>;
+               __overlay__ {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       apds9960: apds@39 {
+                               compatible = "avago,apds9960";
+                               reg = <0x39>;
+                               status = "okay";
+                       };
+               };
+       };
+
+       fragment@3 {
+               target = <&i2c1>;
+               __overlay__ {
+                       apds9960_irq: apds@39 {
+                               #interrupt-cells=<2>;
+                               interrupt-parent = <&gpio>;
+                               interrupts = <4 1>;
+                       };
+               };
+       };
+
+       __overrides__ {
+               gpiopin = <&apds9960_pins>,"brcm,pins:0",
+                               <&apds9960_irq>,"interrupts:0";
+               noints = <0>,"!1!3";
+       };
+};
+