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 b2a2630ad69cc2f76fc027f1e730d6d82f84ea82 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 --- a/arch/arm/boot/dts/overlays/Makefile
19 +++ b/arch/arm/boot/dts/overlays/Makefile
20 @@ -42,6 +42,7 @@ dtbo-$(RPI_DT_OVERLAYS) += i2c-gpio.dtbo
21 dtbo-$(RPI_DT_OVERLAYS) += i2c-mux.dtbo
22 dtbo-$(RPI_DT_OVERLAYS) += i2c-pwm-pca9685a.dtbo
23 dtbo-$(RPI_DT_OVERLAYS) += i2c-rtc.dtbo
24 +dtbo-$(RPI_DT_OVERLAYS) += i2c-sensor.dtbo
25 dtbo-$(RPI_DT_OVERLAYS) += i2c0-bcm2708.dtbo
26 dtbo-$(RPI_DT_OVERLAYS) += i2c1-bcm2708.dtbo
27 dtbo-$(RPI_DT_OVERLAYS) += i2s-gpio28-31.dtbo
28 --- a/arch/arm/boot/dts/overlays/README
29 +++ b/arch/arm/boot/dts/overlays/README
30 @@ -283,8 +283,7 @@ Params: swap_lr Reverse
31
32
33 Name: bmp085_i2c-sensor
34 -Info: Configures the BMP085/BMP180 digital barometric pressure and temperature
35 - sensors from Bosch Sensortec
36 +Info: This overlay is now deprecated - see i2c-sensor
37 Load: dtoverlay=bmp085_i2c-sensor
38 Params: <None>
39
40 @@ -536,6 +535,15 @@ Params: abx80x Select o
41 source
42
43
44 +Name: i2c-sensor
45 +Info: Adds support for a number of I2C barometric pressure and temperature
46 + sensors on i2c_arm
47 +Load: dtoverlay=i2c-sensor,<param>=<val>
48 +Params: bmp085 Select the Bosch sensortronic BMP085
49 +
50 + bmp280 Select the Bosch sensortronic BMP280
51 +
52 +
53 Name: i2c0-bcm2708
54 Info: Enable the i2c_bcm2708 driver for the i2c0 bus. Not all pin combinations
55 are usable on all platforms.
56 --- /dev/null
57 +++ b/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts
58 @@ -0,0 +1,34 @@
59 +// Definitions for a few digital barometric pressure and temperature sensors
60 +/dts-v1/;
61 +/plugin/;
62 +
63 +/ {
64 + compatible = "brcm,bcm2708";
65 +
66 + fragment@0 {
67 + target = <&i2c_arm>;
68 + __overlay__ {
69 + #address-cells = <1>;
70 + #size-cells = <0>;
71 + status = "okay";
72 +
73 + bmp085: bmp085@77 {
74 + compatible = "bosch,bmp085";
75 + reg = <0x77>;
76 + default-oversampling = <3>;
77 + status = "disable";
78 + };
79 +
80 + bmp280: bmp280@76 {
81 + compatible = "bosch,bmp280";
82 + reg = <0x76>;
83 + status = "disable";
84 + };
85 + };
86 + };
87 +
88 + __overrides__ {
89 + bmp085 = <&bmp085>,"status";
90 + bmp280 = <&bmp280>,"status";
91 + };
92 +};