BCM270X_DT: Improve i2c-sensor and i2c-rtc overlay
authorPhil Elwell <phil@raspberrypi.org>
Wed, 31 May 2017 14:27:39 +0000 (15:27 +0100)
committerRaspbian kernel package updater <root@raspbian.org>
Sat, 31 Mar 2018 14:54:17 +0000 (15:54 +0100)
Use the "__dormant__" feature to permit multiple instances of each
overlay, which is more useful now that changing the "reg" property
also changes the node address. Although the overlay grows slightly,
when applied only the requested node is included.

Usage does not change, except that the "lm75addr" parameter of the
i2c-sensor overlay has been deprecated in favour of the generic
"addr" parameter.

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
arch/arm/boot/dts/overlays/README
arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts
arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts

index 2f762bcf23859ccb0e922935ad158227514b34c5..bd7563be019c5a8086d6369c8fc24af7303f8610 100644 (file)
@@ -660,8 +660,8 @@ 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: addr                    Set the address for the BME280, BMP280 or
-                                TMP102
+Params: addr                    Set the address for the BME280, BMP280, TMP102
+                                or LM75
 
         bme280                  Select the Bosch Sensortronic BME280
                                 Valid addresses 0x76-0x77, default 0x76
@@ -674,9 +674,9 @@ Params: addr                    Set the address for the BME280, BMP280 or
                                 Valid addresses 0x76-0x77, default 0x76
 
         lm75                    Select the Maxim LM75 temperature sensor
+                                Valid addresses 0x48-0x4f, default 0x4f
 
-        lm75addr                Choose the address for the LM75 (0x48-0x4f -
-                                default 0x4f)
+        lm75addr                Deprecated - use addr parameter instead
 
         si7020                  Select the Silicon Labs Si7013/20/21 humidity/
                                 temperature sensor
index 1efcf0b712c9c5c19210545002ac1f0931db58f5..b73f902289c8e52705665d8da6d0e904eeaaaf18 100644 (file)
@@ -7,7 +7,7 @@
 
        fragment@0 {
                target = <&i2c_arm>;
-               __overlay__ {
+               __dormant__ {
                        #address-cells = <1>;
                        #size-cells = <0>;
                        status = "okay";
                                reg = <0x69>;
                                abracon,tc-diode = "standard";
                                abracon,tc-resistor = <0>;
-                               status = "disable";
+                               status = "okay";
                        };
+               };
+       };
+
+       fragment@1 {
+               target = <&i2c_arm>;
+               __dormant__ {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       status = "okay";
+
                        ds1307: ds1307@68 {
                                compatible = "maxim,ds1307";
                                reg = <0x68>;
-                               status = "disable";
+                               status = "okay";
                        };
+               };
+       };
+
+       fragment@2 {
+               target = <&i2c_arm>;
+               __dormant__ {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       status = "okay";
+
                        ds1339: ds1339@68 {
                                compatible = "dallas,ds1339";
                                trickle-resistor-ohms = <0>;
                                reg = <0x68>;
-                               status = "disable";
+                               status = "okay";
                        };
+               };
+       };
+
+       fragment@3 {
+               target = <&i2c_arm>;
+               __dormant__ {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       status = "okay";
+
                        mcp7940x: mcp7940x@6f {
                                compatible = "microchip,mcp7940x";
                                reg = <0x6f>;
-                               status = "disable";
+                               status = "okay";
                        };
+               };
+       };
+
+       fragment@4 {
+               target = <&i2c_arm>;
+               __dormant__ {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       status = "okay";
+
                        mcp7941x: mcp7941x@6f {
                                compatible = "microchip,mcp7941x";
                                reg = <0x6f>;
-                               status = "disable";
+                               status = "okay";
                        };
+               };
+       };
+
+       fragment@5 {
+               target = <&i2c_arm>;
+               __dormant__ {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       status = "okay";
+
                        ds3231: ds3231@68 {
                                compatible = "maxim,ds3231";
                                reg = <0x68>;
-                               status = "disable";
+                               status = "okay";
                        };
+               };
+       };
+
+       fragment@6 {
+               target = <&i2c_arm>;
+               __dormant__ {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       status = "okay";
+
                        pcf2127: pcf2127@51 {
                                compatible = "nxp,pcf2127";
                                reg = <0x51>;
-                               status = "disable";
+                               status = "okay";
                        };
+               };
+       };
+
+       fragment@7 {
+               target = <&i2c_arm>;
+               __dormant__ {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       status = "okay";
+
                        pcf8523: pcf8523@68 {
                                compatible = "nxp,pcf8523";
                                reg = <0x68>;
-                               status = "disable";
+                               status = "okay";
                        };
+               };
+       };
+
+       fragment@8 {
+               target = <&i2c_arm>;
+               __dormant__ {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       status = "okay";
+
                        pcf8563: pcf8563@51 {
                                compatible = "nxp,pcf8563";
                                reg = <0x51>;
-                               status = "disable";
+                               status = "okay";
                        };
                };
        };
+
        __overrides__ {
-               abx80x = <&abx80x>,"status";
-               ds1307 = <&ds1307>,"status";
-               ds1339 = <&ds1339>,"status";
-               ds3231 = <&ds3231>,"status";
-               mcp7940x = <&mcp7940x>,"status";
-               mcp7941x = <&mcp7941x>,"status";
-               pcf2127 = <&pcf2127>,"status";
-               pcf8523 = <&pcf8523>,"status";
-               pcf8563 = <&pcf8563>,"status";
+               abx80x = <0>,"+0";
+               ds1307 = <0>,"+1";
+               ds1339 = <0>,"+2";
+               ds3231 = <0>,"+3";
+               mcp7940x = <0>,"+4";
+               mcp7941x = <0>,"+5";
+               pcf2127 = <0>,"+6";
+               pcf8523 = <0>,"+7";
+               pcf8563 = <0>,"+8";
                trickle-diode-type = <&abx80x>,"abracon,tc-diode";
                trickle-resistor-ohms = <&ds1339>,"trickle-resistor-ohms:0",
                                        <&abx80x>,"abracon,tc-resistor";
index e86a13f92c3f75c14fa4425cdfb081d6795ff76a..d2f0008addfadac8f6ed774a6e4f3f97871c0d61 100644 (file)
@@ -7,7 +7,7 @@
 
        fragment@0 {
                target = <&i2c_arm>;
-               __overlay__ {
+               __dormant__ {
                        #address-cells = <1>;
                        #size-cells = <0>;
                        status = "okay";
                        bme280: bme280@76 {
                                compatible = "bosch,bme280";
                                reg = <0x76>;
-                               status = "disable";
+                               status = "okay";
                        };
+               };
+       };
+
+       fragment@1 {
+               target = <&i2c_arm>;
+               __dormant__ {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       status = "okay";
 
                        bmp085: bmp085@77 {
                                compatible = "bosch,bmp085";
                                reg = <0x77>;
                                default-oversampling = <3>;
-                               status = "disable";
+                               status = "okay";
                        };
+               };
+       };
+
+       fragment@2 {
+               target = <&i2c_arm>;
+               __dormant__ {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       status = "okay";
 
                        bmp180: bmp180@77 {
                                compatible = "bosch,bmp180";
                                reg = <0x77>;
-                               status = "disable";
+                               status = "okay";
                        };
+               };
+       };
+
+       fragment@3 {
+               target = <&i2c_arm>;
+               __dormant__ {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       status = "okay";
 
                        bmp280: bmp280@76 {
                                compatible = "bosch,bmp280";
                                reg = <0x76>;
-                               status = "disable";
+                               status = "okay";
                        };
+               };
+       };
+
+       fragment@4 {
+               target = <&i2c_arm>;
+               __dormant__ {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       status = "okay";
 
                        lm75: lm75@4f {
                                compatible = "lm75";
                                reg = <0x4f>;
-                               status = "disable";
+                               status = "okay";
                        };
+               };
+       };
+
+       fragment@5 {
+               target = <&i2c_arm>;
+               __dormant__ {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       status = "okay";
 
                        si7020: si7020@40 {
                                compatible = "si7020";
                                reg = <0x40>;
-                               status = "disable";
+                               status = "okay";
                        };
+               };
+       };
+
+       fragment@6 {
+               target = <&i2c_arm>;
+               __dormant__ {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       status = "okay";
 
                        tmp102: tmp102@48 {
                                compatible = "ti,tmp102";
                                reg = <0x48>;
-                               status = "disable";
+                               status = "okay";
                        };
                };
        };
 
        __overrides__ {
-               addr =  <&bme280>,"reg:0", <&bmp280>,"reg:0", <&tmp102>,"reg:0";
-               bme280 = <&bme280>,"status";
-               bmp085 = <&bmp085>,"status";
-               bmp180 = <&bmp180>,"status";
-               bmp280 = <&bmp280>,"status";
-               lm75 = <&lm75>,"status";
+               addr =  <&bme280>,"reg:0", <&bmp280>,"reg:0", <&tmp102>,"reg:0",
+                       <&lm75>,"reg:0";
+               bme280 = <0>,"+0";
+               bmp085 = <0>,"+1";
+               bmp180 = <0>,"+2";
+               bmp280 = <0>,"+3";
+               lm75 = <0>,"+4";
                lm75addr = <&lm75>,"reg:0";
-               si7020 = <&si7020>,"status";
-               tmp102 = <&tmp102>,"status";
+               si7020 = <0>,"+5";
+               tmp102 = <0>,"+6";
        };
 };