bcm27xx: update to latest patches from RPi foundation
[openwrt/openwrt.git] / target / linux / bcm27xx / patches-5.4 / 950-0346-overlays-Add-apds9960-overlay.patch
1 From 62cd48ebf18c1eb0bbddba080476201bdfae4126 Mon Sep 17 00:00:00 2001
2 From: Michael Kaplan <m.kaplan@evva.com>
3 Date: Fri, 8 Nov 2019 10:35:57 +0100
4 Subject: [PATCH] overlays: Add apds9960 overlay
5
6 Add an overlay for the AVAGO APDS9960 digital proximity, ambient light, rgb and gesture sensor.
7 Also update overlay README and Makefile.
8
9 Signed-off-by: Michael Kaplan <m.kaplan@evva.com>
10 ---
11 arch/arm/boot/dts/overlays/Makefile | 1 +
12 arch/arm/boot/dts/overlays/README | 8 +++
13 .../boot/dts/overlays/apds9960-overlay.dts | 57 +++++++++++++++++++
14 3 files changed, 66 insertions(+)
15 create mode 100644 arch/arm/boot/dts/overlays/apds9960-overlay.dts
16
17 --- a/arch/arm/boot/dts/overlays/Makefile
18 +++ b/arch/arm/boot/dts/overlays/Makefile
19 @@ -15,6 +15,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
20 allo-katana-dac-audio.dtbo \
21 allo-piano-dac-pcm512x-audio.dtbo \
22 allo-piano-dac-plus-pcm512x-audio.dtbo \
23 + apds9960.dtbo \
24 applepi-dac.dtbo \
25 at86rf233.dtbo \
26 audioinjector-addons.dtbo \
27 --- a/arch/arm/boot/dts/overlays/README
28 +++ b/arch/arm/boot/dts/overlays/README
29 @@ -441,6 +441,14 @@ Params: 24db_digital_gain Allow ga
30 better voice quality. (default Off)
31
32
33 +Name: apds9960
34 +Info: Configures the AVAGO APDS9960 digital proximity, ambient light, RGB and
35 + gesture sensor
36 +Load: dtoverlay=apds9960,<param>=<val>
37 +Params: gpiopin GPIO used for INT (default 4)
38 + noints Disable the interrupt GPIO line.
39 +
40 +
41 Name: applepi-dac
42 Info: Configures the Orchard Audio ApplePi-DAC audio card
43 Load: dtoverlay=applepi-dac
44 --- /dev/null
45 +++ b/arch/arm/boot/dts/overlays/apds9960-overlay.dts
46 @@ -0,0 +1,57 @@
47 +// Definitions for APDS-9960 ambient light and gesture sensor
48 +
49 +/dts-v1/;
50 +/plugin/;
51 +
52 +/ {
53 + compatible = "brcm,bcm2835";
54 +
55 + fragment@0 {
56 + target = <&i2c1>;
57 + __overlay__ {
58 + status = "okay";
59 + };
60 + };
61 +
62 + fragment@1 {
63 + target = <&gpio>;
64 + __overlay__ {
65 + apds9960_pins: apds9960_pins@39 {
66 + brcm,pins = <4>;
67 + brcm,function = <0>;
68 + };
69 + };
70 + };
71 +
72 + fragment@2 {
73 + target = <&i2c1>;
74 + __overlay__ {
75 + #address-cells = <1>;
76 + #size-cells = <0>;
77 +
78 + apds9960: apds@39 {
79 + compatible = "avago,apds9960";
80 + reg = <0x39>;
81 + status = "okay";
82 + };
83 + };
84 + };
85 +
86 + fragment@3 {
87 + target = <&i2c1>;
88 + __overlay__ {
89 + apds9960_irq: apds@39 {
90 + #interrupt-cells=<2>;
91 + interrupt-parent = <&gpio>;
92 + interrupts = <4 1>;
93 + };
94 + };
95 + };
96 +
97 + __overrides__ {
98 + gpiopin = <&apds9960_pins>,"brcm,pins:0",
99 + <&apds9960_irq>,"interrupts:0";
100 + noints = <0>,"!1!3";
101 + };
102 +};
103 +