overlays: i2c-sensor: Add mpu6050 and mpu9250
authorPhil Elwell <phil@raspberrypi.com>
Tue, 17 Jan 2023 15:47:04 +0000 (15:47 +0000)
committerPhil Elwell <phil@raspberrypi.com>
Tue, 17 Jan 2023 15:49:53 +0000 (15:49 +0000)
Add support for the MPU6050 and MPU9250 IMU sensors to the i2c-sensor
container overlay. At the same time, deprecate the standalone mpu6050
overlay, but keep it around for now.

(Also fix a few typos spotted while editing)

See: https://github.com/raspberrypi/linux/issues/5325

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
arch/arm/boot/dts/overlays/README
arch/arm/boot/dts/overlays/i2c-sensor-common.dtsi
arch/arm/boot/dts/overlays/overlay_map.dts

index a28af5c..12d7619 100644 (file)
@@ -1983,8 +1983,8 @@ Info:   Adds support for a number of I2C barometric pressure, temperature,
 Load:   dtoverlay=i2c-sensor,<param>=<val>
 Params: addr                    Set the address for the BH1750, BME280, BME680,
                                 BMP280, CCS811, DS1621, HDC100X, JC42, LM75,
-                                MCP980x, MS5637, MS5803, MS5805, MS5837, MS8607,
-                                SHT3x or TMP102
+                                MCP980x, MPU6050, MPU9250, MS5637, MS5803,
+                                MS5805, MS5837, MS8607, SHT3x or TMP102
 
         aht10                   Select the Aosong AHT10 temperature and humidity
                                 sensor
@@ -2016,8 +2016,8 @@ Params: addr                    Set the address for the BH1750, BME280, BME680,
 
         htu21                   Select the HTU21 temperature and humidity sensor
 
-        int_pin                 Set the GPIO to use for interrupts (max30102
-                                only)
+        int_pin                 Set the GPIO to use for interrupts (max30102,
+                                mpu6050 and mpu9250 only)
 
         jc42                    Select any of the many JEDEC JC42.4-compliant
                                 temperature sensors, including:
@@ -2045,6 +2045,12 @@ Params: addr                    Set the address for the BH1750, BME280, BME680,
                                 use the "jc42" option.
                                 Valid addresses are 0x18-0x1f (default 0x18)
 
+        mpu6050                 Select the InvenSense MPU6050 IMU. Valid
+                                valid addresses are 0x68 and 0x69 (default 0x68)
+
+        mpu9250                 Select the InvenSense MPU9250 IMU. Valid
+                                valid addresses are 0x68 and 0x69 (default 0x68)
+
         ms5637                  Select the Measurement Specialities MS5637
                                 pressure and temperature sensor.
 
@@ -2913,10 +2919,10 @@ Params: overclock_50            Clock (in MHz) to use when the MMC framework
 
 
 Name:   mpu6050
-Info:   Overlay for i2c connected mpu6050 imu
-Load:   dtoverlay=mpu6050,<param>=<val>
-Params: interrupt               GPIO pin for interrupt (default 4)
-        addr                    I2C address of the device (default 0x68)
+Info:   This overlay has been deprecated - use "dtoverlay=i2c-sensor,mpu6050"
+        instead. Note that "int_pin" is the new name for the "interrupt"
+        parameter.
+Load:   <Deprecated>
 
 
 Name:   mz61581
@@ -3416,7 +3422,7 @@ Params: <None>
 
 
 Name:   rpi-dac
-Info:   This overlay has been renaamed to i2s-dac.
+Info:   This overlay has been renamed to i2s-dac.
 Load:   <Deprecated>
 
 
@@ -3546,7 +3552,7 @@ Params: poe_fan_temp0           Temperature (in millicelcius) at which the fan
 
 
 Name:   rpi-proto
-Info:   This overlay has been renamaed to proto-codec.
+Info:   This overlay has been renamed to proto-codec.
 Load:   <Deprecated>
 
 
index 6504c75..4b3519e 100755 (executable)
                };
        };
 
+       fragment@28 {
+               target = <&i2cbus>;
+               __dormant__ {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       status = "okay";
+                        clock-frequency = <400000>;
+
+                        mpu6050: mpu6050@68 {
+                                compatible = "invensense,mpu6050";
+                                reg = <0x68>;
+                                interrupt-parent = <&gpio>;
+                                interrupts = <4 2>;
+                        };
+               };
+       };
+
+       fragment@29 {
+               target = <&i2cbus>;
+               __dormant__ {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       status = "okay";
+                        clock-frequency = <400000>;
+
+                        mpu9250: mpu9250@68 {
+                                compatible = "invensense,mpu9250";
+                                reg = <0x68>;
+                                interrupt-parent = <&gpio>;
+                                interrupts = <4 2>;
+                        };
+               };
+       };
+
        __overrides__ {
                bme280 = <0>,"+0";
                bmp085 = <0>,"+1";
                ms5805 = <0>,"+25";
                ms5837 = <0>,"+26";
                ms8607 = <0>,"+27";
+               mpu6050 = <0>,"+28";
+               mpu9250 = <0>,"+29";
 
                addr =  <&bme280>,"reg:0", <&bmp280>,"reg:0", <&tmp102>,"reg:0",
                        <&lm75>,"reg:0", <&hdc100x>,"reg:0", <&sht3x>,"reg:0",
                        <&ds1621>,"reg:0", <&bme680>,"reg:0", <&ccs811>,"reg:0",
                        <&bh1750>,"reg:0", <&mcp980x>,"reg:0", <&jc42>,"reg:0",
                        <&ms5637>,"reg:0", <&ms5803>,"reg:0", <&ms5805>,"reg:0",
-                       <&ms5837>,"reg:0", <&ms8607>,"reg:0";
-               int_pin = <&max30102>, "interrupts:0";
+                       <&ms5837>,"reg:0", <&ms8607>,"reg:0",
+                       <&mpu6050>, "reg:0", <&mpu9250>, "reg:0";
+               int_pin = <&max30102>, "interrupts:0",
+                       <&mpu6050>, "interrupts:0",
+                       <&mpu9250>, "interrupts:0";
                no_timeout = <&jc42>, "smbus-timeout-disable?";
        };
 };
index fda0364..f1d1e0c 100644 (file)
                bcm2711;
        };
 
+       mpu6050 {
+               deprecated = "use i2c-sensor,mpu6050";
+       };
+
        pcie-32bit-dma {
                bcm2711;
        };