Skip to content

Commit

Permalink
overlays: i2c-sensor: Add mpu6050 and mpu9250
Browse files Browse the repository at this point in the history
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: #5325

Signed-off-by: Phil Elwell <[email protected]>
  • Loading branch information
pelwell committed Jan 17, 2023
1 parent 964044d commit 67c499b
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 12 deletions.
26 changes: 16 additions & 10 deletions arch/arm/boot/dts/overlays/README
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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>


Expand Down Expand Up @@ -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>


Expand Down
43 changes: 41 additions & 2 deletions arch/arm/boot/dts/overlays/i2c-sensor-common.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,40 @@
};
};

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";
Expand Down Expand Up @@ -451,14 +485,19 @@
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?";
};
};
4 changes: 4 additions & 0 deletions arch/arm/boot/dts/overlays/overlay_map.dts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@
bcm2711;
};

mpu6050 {
deprecated = "use i2c-sensor,mpu6050";
};

pcie-32bit-dma {
bcm2711;
};
Expand Down

0 comments on commit 67c499b

Please sign in to comment.