Configure pca6416 as MPU6050 interrupt

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Configure pca6416 as MPU6050 interrupt

1,199 Views
khang_letruong1
Contributor I

Dear All,

I'm working on activating MPU6050 Linux driver for iMX8MM-EVK like below :

        inv-mpu6050@68 {
                compatible = "invensense,mpu6050";
                reg = <0x68>;
                /* interrupt-parent = <&gpio1>; */
                /* interrupts = <18 IRQ_TYPE_EDGE_RISING>; */
                mount-matrix = "-0.984807753012208",  /* x0 */
                               "0",                   /* y0 */
                               "-0.173648177666930",  /* z0 */
                               "0",                   /* x1 */
                               "-1",                  /* y1 */
                               "0",                   /* z1 */
                               "-0.173648177666930",  /* x2 */
                               "0",                   /* y2 */
                               "0.984807753012208";   /* z2 */
        };

I have the need to define the GPIO as interrupt pin for the IMU. But there's no direct GPIO available on the iMX8MM-EVK. Therefore, I would like to know how to configure the IO expander chip (PCA6416) for this task, please ?

Thank you in advance,

K.

Labels (1)
0 Kudos
2 Replies

1,019 Views
Rita_Wang
NXP TechSupport
NXP TechSupport

For the PCA6416, You can refer to the https://community.nxp.com/message/1285064 

0 Kudos

1,019 Views
khang_letruong1
Contributor I

Hi b45499‌,

Thanks very much for your quick reply. After consulting the link, I understand that is for enabling the interrupt from pca4616, isn't it ? However, in my case I need to generate the interrupt from the MPU's INT pin connected to one of EXP_IOx (x =0 .. 14) of pca6416. Therefore,  I'm still confused and I'd like to know where should I put the following lines :

        pinctrl-0 = <&pinctrl_imu_int>;
        interrupt-parent = <&gpio1>;
        interrupts = <12 IRQ_TYPE_LEVEL_LOW>;

To the pca6416 node, like below :

        pca6416: gpio@20 {
                compatible = "ti,tca6416";
                reg = <0x20>;
                gpio-controller;
                #gpio-cells = <2>;

                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_imu_int>:
                interrupt-parent = <&gpio1>;
                interrupts = <12 IRQ_TYPE_LEVEL_LOW>;

        };

or to the imu node, like below :

         inv-mpu6050@68 {

              compatible = "invensense,mpu6050";
              reg = <0x68>;
              pinctrl-names = "default";
              pinctrl-0 = <&pinctrl_imu_int>:
              interrupt-parent = <&gpio1>;
              interrupts = <12 IRQ_TYPE_LEVEL_LOW>;

             ...
         };

And how should I indicate the EXP_IOx that the IMU's interrupt signal is connected to?

Thanks and regards,

K.

0 Kudos