ARM: dts: ux500: samsung-golden: Add IMU (accelerometer + gyroscope)
authorStephan Gerhold <stephan@gerhold.net>
Thu, 19 Dec 2019 20:20:48 +0000 (21:20 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 25 Dec 2019 23:11:09 +0000 (00:11 +0100)
samsung-golden has a InvenSense MPU-6051M IMU that provides an
accelerometer and gyroscope. It seems to be functionally compatible
with MPU-6050 so we can easily enable it by adding the necessary
device tree nodes.

Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Link: https://lore.kernel.org/r/20191219202052.19039-6-stephan@gerhold.net
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
arch/arm/boot/dts/ste-ux500-samsung-golden.dts

index 51f2afe..14a084e 100644 (file)
@@ -6,6 +6,7 @@
 #include "ste-dbx5x0-pinctrl.dtsi"
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/interrupt-controller/irq.h>
 
 /*
  * Note: This device tree cannot be booted directly with the Samsung bootloader.
                        pinctrl-1 = <&u2rxtx_c_1_sleep>;
                };
 
+               i2c@80128000 {
+                       status = "okay";
+
+                       pinctrl-names = "default", "sleep";
+                       pinctrl-0 = <&i2c2_b_2_default>;
+                       pinctrl-1 = <&i2c2_b_2_sleep>;
+
+                       imu@68 {
+                               compatible = "invensense,mpu6050";
+                               reg = <0x68>;
+
+                               /* GPIO206 (ACC_INT) */
+                               interrupt-parent = <&gpio6>;
+                               interrupts = <14 IRQ_TYPE_EDGE_RISING>;
+
+                               mount-matrix = "0", "1", "0",
+                                             "-1", "0", "0",
+                                              "0", "0", "1";
+
+                               vdd-supply = <&ab8500_ldo_aux1_reg>;
+                               vddio-supply = <&ab8500_ldo_aux8_reg>;
+
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&imu_default>;
+                       };
+               };
+
                prcmu@80157000 {
                        ab8505 {
                                ab8500_usb {
                };
        };
 
+       imu {
+               imu_default: imu_default {
+                       golden_cfg1 {
+                               pins = "GPIO206_AG24";  /* ACC_INT */
+                               ste,config = <&gpio_in_pd>;
+                       };
+               };
+       };
+
        vibrator {
                vibrator_default: vibrator_default {
                        golden_cfg1 {