openwrt/target/linux/brcm2708/patches-4.4/0558-BCM270X_DT-Add-i2c-sensor-overlay.patch

103 lines
3.7 KiB
Diff
Raw Normal View History

From ec94d922b57bb7d6586eaf1e1af02e9383680d15 Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Mon, 5 Dec 2016 17:10:44 +0000
Subject: [PATCH] BCM270X_DT: Add i2c-sensor overlay
The i2c-sensor overlay is a container for various pressure and
temperature sensors, currently bmp085 and bmp280. The standalone
bmp085_i2c-sensor overlay is now deprecated.
Signed-off-by: Phil Elwell <phil@raspberrypi.org>
---
arch/arm/boot/dts/overlays/Makefile | 1 +
arch/arm/boot/dts/overlays/README | 12 ++++++--
arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts | 34 +++++++++++++++++++++++
3 files changed, 45 insertions(+), 2 deletions(-)
create mode 100644 arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts
diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile
index c4186aa..bc7f4a9 100644
--- a/arch/arm/boot/dts/overlays/Makefile
+++ b/arch/arm/boot/dts/overlays/Makefile
@@ -42,6 +42,7 @@ dtbo-$(RPI_DT_OVERLAYS) += i2c-gpio.dtbo
dtbo-$(RPI_DT_OVERLAYS) += i2c-mux.dtbo
dtbo-$(RPI_DT_OVERLAYS) += i2c-pwm-pca9685a.dtbo
dtbo-$(RPI_DT_OVERLAYS) += i2c-rtc.dtbo
+dtbo-$(RPI_DT_OVERLAYS) += i2c-sensor.dtbo
dtbo-$(RPI_DT_OVERLAYS) += i2c0-bcm2708.dtbo
dtbo-$(RPI_DT_OVERLAYS) += i2c1-bcm2708.dtbo
dtbo-$(RPI_DT_OVERLAYS) += i2s-gpio28-31.dtbo
diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README
index 4a77ee6..80ea3de 100644
--- a/arch/arm/boot/dts/overlays/README
+++ b/arch/arm/boot/dts/overlays/README
@@ -283,8 +283,7 @@ Params: swap_lr Reverse the channel allocation, which will also
Name: bmp085_i2c-sensor
-Info: Configures the BMP085/BMP180 digital barometric pressure and temperature
- sensors from Bosch Sensortec
+Info: This overlay is now deprecated - see i2c-sensor
Load: dtoverlay=bmp085_i2c-sensor
Params: <None>
@@ -536,6 +535,15 @@ Params: abx80x Select one of the ABx80x family:
source
+Name: i2c-sensor
+Info: Adds support for a number of I2C barometric pressure and temperature
+ sensors on i2c_arm
+Load: dtoverlay=i2c-sensor,<param>=<val>
+Params: bmp085 Select the Bosch sensortronic BMP085
+
+ bmp280 Select the Bosch sensortronic BMP280
+
+
Name: i2c0-bcm2708
Info: Enable the i2c_bcm2708 driver for the i2c0 bus. Not all pin combinations
are usable on all platforms.
diff --git a/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts b/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts
new file mode 100644
index 0000000..f6d134c
--- /dev/null
+++ b/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts
@@ -0,0 +1,34 @@
+// Definitions for a few digital barometric pressure and temperature sensors
+/dts-v1/;
+/plugin/;
+
+/ {
+ compatible = "brcm,bcm2708";
+
+ fragment@0 {
+ target = <&i2c_arm>;
+ __overlay__ {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "okay";
+
+ bmp085: bmp085@77 {
+ compatible = "bosch,bmp085";
+ reg = <0x77>;
+ default-oversampling = <3>;
+ status = "disable";
+ };
+
+ bmp280: bmp280@76 {
+ compatible = "bosch,bmp280";
+ reg = <0x76>;
+ status = "disable";
+ };
+ };
+ };
+
+ __overrides__ {
+ bmp085 = <&bmp085>,"status";
+ bmp280 = <&bmp280>,"status";
+ };
+};
--
2.1.4