-
Notifications
You must be signed in to change notification settings - Fork 5.2k
mpu6050 device tree overlay #2031
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from the inline comments, I'd like an entry in the README (alphabetical order, max 80 columns, no TABS, strict indentation and 2 blank lines between entries) and a patch to bcmrpi_defconfig as well.
Otherwise it looks fine.
arch/arm/boot/dts/overlays/Makefile
Outdated
@@ -109,7 +109,8 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ | |||
vga666.dtbo \ | |||
w1-gpio.dtbo \ | |||
w1-gpio-pullup.dtbo \ | |||
wittypi.dtbo | |||
wittypi.dtbo \ | |||
mpu6050.dtbo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the other entries are in strict alphabetical order - please do the same. As well as being tidy and logical it helps to avoid merge conflicts.
compatible = "invensense,mpu6050"; | ||
reg = <0x68>; | ||
interrupt-parent = <&gpio>; | ||
interrupts = <4 1>; | ||
}; | ||
}; | ||
}; | ||
|
||
__overrides__ { | ||
mpu6050_interrupt_pin = <&mpu6050>,"interrupts:0"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need to qualify the parameter name with the device name - the parameters exposed by an overlay are only in scope until the next overlay is loaded, so it is safe to have multiple overlays all using the same parameter names. Other overlays have used interrupt
or int_pin
.
status = "okay"; | ||
clock-frequency = <400000>; | ||
|
||
inv-mpu6050@68 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the inv-
prefix adds anything - the dtbindings documentation just uses mpu6050@68
.
arch/arm/configs/bcm2709_defconfig
Outdated
@@ -1171,6 +1171,8 @@ CONFIG_IIO=m | |||
CONFIG_IIO_BUFFER=y | |||
CONFIG_IIO_BUFFER_CB=m | |||
CONFIG_IIO_KFIFO_BUF=m | |||
CONFIG_INV_MPU6050_IIO=m |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't what savedefconfig generates - I get:
index 9164668..575cf99 100644
--- a/arch/arm/configs/bcm2709_defconfig
+++ b/arch/arm/configs/bcm2709_defconfig
@@ -1171,15 +1171,12 @@ CONFIG_RASPBERRYPI_POWER=y
CONFIG_EXTCON=m
CONFIG_EXTCON_ARIZONA=m
CONFIG_IIO=m
-CONFIG_IIO_BUFFER=y
CONFIG_IIO_BUFFER_CB=m
-CONFIG_IIO_KFIFO_BUF=m
-CONFIG_INV_MPU6050_IIO=m
-CONFIG_INV_MPU6050_I2C=m
CONFIG_MCP320X=m
CONFIG_MCP3422=m
CONFIG_DHT11=m
CONFIG_HTU21=m
+CONFIG_INV_MPU6050_I2C=m
CONFIG_BMP280=m
CONFIG_PWM_BCM2835=m
Setting INV_MPU6050_I2C is enough to imply INV_MPU6050_IIO, IIO_BUFFER and IIO_KFIFO_BUF. The order in the Kconfig files determines where they should go.
Using make ARCH=arm savedefconfig
minimises the number of changes, and prevents others encountering spurious differences when they subsequently use the same mechanism themselves.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- clicked the wrong option *
Add fixes according to your comments |
Somehow I think you missed out bcmrpi_defconfig in your commits. If you could also change the node name from |
Merged. FYI you can also put parameters on the same line, e.g.
|
Add overlay and config options for InvenSense MPU6050 6-axis motion detector.
kernel: dwc_otg: make periodic scheduling behave properly for FS buses See: raspberrypi/linux#2020 kernel: HID: usbhid: extend polling interval configuration to joysticks See: raspberrypi/linux#2036 kernel: clk: bcm2835: Minimise clock jitter for PCM clock See: raspberrypi/linux#2016 kernel: Add mpu6050 device tree overlay See: raspberrypi/linux#2031 kernel: config: Add CONFIG_IPV6_SIT_6RD See: raspberrypi/linux#1598 kernel: config: Add CONFIG_IPV6_ROUTE_INFO See: raspberrypi/linux#1957
kernel: dwc_otg: make periodic scheduling behave properly for FS buses See: raspberrypi/linux#2020 kernel: HID: usbhid: extend polling interval configuration to joysticks See: raspberrypi/linux#2036 kernel: clk: bcm2835: Minimise clock jitter for PCM clock See: raspberrypi/linux#2016 kernel: Add mpu6050 device tree overlay See: raspberrypi/linux#2031 kernel: config: Add CONFIG_IPV6_SIT_6RD See: raspberrypi/linux#1598 kernel: config: Add CONFIG_IPV6_ROUTE_INFO See: raspberrypi/linux#1957
Add overlay and config options for InvenSense MPU6050 6-axis motion detector.
Add overlay and config options for InvenSense MPU6050 6-axis motion detector.
Add overlay and config options for InvenSense MPU6050 6-axis motion detector.
Add overlay and config options for InvenSense MPU6050 6-axis motion detector.
Add overlay and config options for InvenSense MPU6050 6-axis motion detector.
Add overlay and config options for InvenSense MPU6050 6-axis motion detector.
Add overlay and config options for InvenSense MPU6050 6-axis motion detector.
Add overlay and config options for InvenSense MPU6050 6-axis motion detector.
Add overlay and config options for InvenSense MPU6050 6-axis motion detector.
Add overlay and config options for InvenSense MPU6050 6-axis motion detector.
Add overlay and config options for InvenSense MPU6050 6-axis motion detector.
Add overlay and config options for InvenSense MPU6050 6-axis motion detector.
Add overlay and config options for InvenSense MPU6050 6-axis motion detector.
Add overlay and config options for InvenSense MPU6050 6-axis motion detector.
Add overlay and config options for InvenSense MPU6050 6-axis motion detector.
Add overlay and config options for InvenSense MPU6050 6-axis motion detector.
Add overlay and config options for InvenSense MPU6050 6-axis motion detector.
Add overlay and config options for InvenSense MPU6050 6-axis motion detector.
Add overlay and config options for InvenSense MPU6050 6-axis motion detector.
Add overlay and config options for InvenSense MPU6050 6-axis motion detector.
Add overlay and config options for InvenSense MPU6050 6-axis motion detector.
Add overlay and config options for InvenSense MPU6050 6-axis motion detector.
Add overlay and config options for InvenSense MPU6050 6-axis motion detector.
Add overlay and config options for InvenSense MPU6050 6-axis motion detector.
Add overlay and config options for InvenSense MPU6050 6-axis motion detector.
Add overlay and config options for InvenSense MPU6050 6-axis motion detector.
Add overlay and config options for InvenSense MPU6050 6-axis motion detector.
Add overlay and config options for InvenSense MPU6050 6-axis motion detector.
Add overlay and config options for InvenSense MPU6050 6-axis motion detector.
Add overlay and config options for InvenSense MPU6050 6-axis motion detector.
Add overlay and config options for InvenSense MPU6050 6-axis motion detector.
Add overlay and config options for InvenSense MPU6050 6-axis motion detector.
Add overlay and config options for InvenSense MPU6050 6-axis motion detector.
Allows to write in
/boot/config.txt
dtoverlay=mpu6050
and use mpu6050 connected on i2c interface from userspace
Also add ability to choose interrupt pin with
dtparam=mpu6050_interrupt_pin=<gpio_num>