brcm2708: update linux 4.4 patches to latest version
[openwrt/openwrt.git] / target / linux / brcm2708 / patches-4.4 / 0558-BCM270X_DT-Add-i2c-sensor-overlay.patch
1 From ec94d922b57bb7d6586eaf1e1af02e9383680d15 Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.org>
3 Date: Mon, 5 Dec 2016 17:10:44 +0000
4 Subject: [PATCH] BCM270X_DT: Add i2c-sensor overlay
5
6 The i2c-sensor overlay is a container for various pressure and
7 temperature sensors, currently bmp085 and bmp280. The standalone
8 bmp085_i2c-sensor overlay is now deprecated.
9
10 Signed-off-by: Phil Elwell <phil@raspberrypi.org>
11 ---
12 arch/arm/boot/dts/overlays/Makefile | 1 +
13 arch/arm/boot/dts/overlays/README | 12 ++++++--
14 arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts | 34 +++++++++++++++++++++++
15 3 files changed, 45 insertions(+), 2 deletions(-)
16 create mode 100644 arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts
17
18 diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile
19 index c4186aa..bc7f4a9 100644
20 --- a/arch/arm/boot/dts/overlays/Makefile
21 +++ b/arch/arm/boot/dts/overlays/Makefile
22 @@ -42,6 +42,7 @@ dtbo-$(RPI_DT_OVERLAYS) += i2c-gpio.dtbo
23 dtbo-$(RPI_DT_OVERLAYS) += i2c-mux.dtbo
24 dtbo-$(RPI_DT_OVERLAYS) += i2c-pwm-pca9685a.dtbo
25 dtbo-$(RPI_DT_OVERLAYS) += i2c-rtc.dtbo
26 +dtbo-$(RPI_DT_OVERLAYS) += i2c-sensor.dtbo
27 dtbo-$(RPI_DT_OVERLAYS) += i2c0-bcm2708.dtbo
28 dtbo-$(RPI_DT_OVERLAYS) += i2c1-bcm2708.dtbo
29 dtbo-$(RPI_DT_OVERLAYS) += i2s-gpio28-31.dtbo
30 diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README
31 index 4a77ee6..80ea3de 100644
32 --- a/arch/arm/boot/dts/overlays/README
33 +++ b/arch/arm/boot/dts/overlays/README
34 @@ -283,8 +283,7 @@ Params: swap_lr Reverse the channel allocation, which will also
35
36
37 Name: bmp085_i2c-sensor
38 -Info: Configures the BMP085/BMP180 digital barometric pressure and temperature
39 - sensors from Bosch Sensortec
40 +Info: This overlay is now deprecated - see i2c-sensor
41 Load: dtoverlay=bmp085_i2c-sensor
42 Params: <None>
43
44 @@ -536,6 +535,15 @@ Params: abx80x Select one of the ABx80x family:
45 source
46
47
48 +Name: i2c-sensor
49 +Info: Adds support for a number of I2C barometric pressure and temperature
50 + sensors on i2c_arm
51 +Load: dtoverlay=i2c-sensor,<param>=<val>
52 +Params: bmp085 Select the Bosch sensortronic BMP085
53 +
54 + bmp280 Select the Bosch sensortronic BMP280
55 +
56 +
57 Name: i2c0-bcm2708
58 Info: Enable the i2c_bcm2708 driver for the i2c0 bus. Not all pin combinations
59 are usable on all platforms.
60 diff --git a/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts b/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts
61 new file mode 100644
62 index 0000000..f6d134c
63 --- /dev/null
64 +++ b/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts
65 @@ -0,0 +1,34 @@
66 +// Definitions for a few digital barometric pressure and temperature sensors
67 +/dts-v1/;
68 +/plugin/;
69 +
70 +/ {
71 + compatible = "brcm,bcm2708";
72 +
73 + fragment@0 {
74 + target = <&i2c_arm>;
75 + __overlay__ {
76 + #address-cells = <1>;
77 + #size-cells = <0>;
78 + status = "okay";
79 +
80 + bmp085: bmp085@77 {
81 + compatible = "bosch,bmp085";
82 + reg = <0x77>;
83 + default-oversampling = <3>;
84 + status = "disable";
85 + };
86 +
87 + bmp280: bmp280@76 {
88 + compatible = "bosch,bmp280";
89 + reg = <0x76>;
90 + status = "disable";
91 + };
92 + };
93 + };
94 +
95 + __overrides__ {
96 + bmp085 = <&bmp085>,"status";
97 + bmp280 = <&bmp280>,"status";
98 + };
99 +};
100 --
101 2.1.4
102