AnsweredAssumed Answered

LSM9DS1 Wake Up Interrupts

Question asked by Fernandez Pastrana on Nov 6, 2017
Latest reply on Apr 18, 2018 by Fernandez Pastrana

Hi everybody,

 

I am currently working with an LSM9DS1 and I am using the official Linux drivers. I want to use the hardware interrupts of the device to wake up my microprocessor. I have already do it with other GPIO interrupts. However, for same reason I am not able to do it with these.

 

I have configured the Device Tree as follows:

        /* LSM9DS1 magnetic sensor */
        lsm9ds1-m@0x1c {
                compatible = "st,lsm9ds1_mag";
                reg = <0x1C>;
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_imu_mag>;
                gpios = <&gpio4 12 GPIO_ACTIVE_HIGH>; /* INT1 - GPIO group 4 - GPIO number 12*/
                rot-matrix = /bits/ 16 <(1) (0) (0)
                        (0) (1) (0)
                        (0) (0) (1)>;
                poll-interval = <100>;
                min-interval = <13>;
                fs-range = <0>;
                interrupt-controller;
                interrupt-parent = <&gpio4>;
                #interrupt-cells = <2>;
                interrupts = <12 0x1>;
                wakeup-source;
        };

        /* LSM9DS1 accelerometer/gyroscope sensor */
        lsm9ds1-ag@0x6a {
                compatible = "st,lsm9ds1_acc_gyr"; /* Compatible device name, it should be register before */
                reg = <0x6A>;   /* I2C address */
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_imu_acc>; /* pinctrl regiter */
                gpios = <&gpio4 13 GPIO_ACTIVE_HIGH>, /* INT1 - GPIO group 4 - GPIO number 13*/
                        <&gpio4 14 GPIO_ACTIVE_HIGH>; /* INT2 - GPIO group 4 - GPIO number 14*/
                rot-matrix = /bits/ 16 <(1) (0) (0)
                        (0) (1) (0)
                        (0) (0) (1)>;
                g-poll-interval = <100>;
                g-min-interval = <2>;
                g-fs-range = <0>;
                x-poll-interval = <100>;
                x-min-interval = <1>;
                x-fs-range = <0>;
                aa-filter-bw = <0>;
                /* Interrupts defnition */
                interrupt-controller;
                interrupt-parent = <&gpio4>;
                #interrupt-cells = <2>;
                interrupts = <13 0x1>, <14 0x1>;
                wakeup-source;
        };

                pinctrl_imu_mag: gpioimxmaggrp {
                        fsl,pins = <
                                MX6UL_PAD_NAND_READY_B__GPIO4_IO12      0x80000000      /* IRQ */
                                MX6UL_PAD_NAND_WP_B__GPIO4_IO11         0x1b0b0         /* data ready */
                        >;
                };
                pinctrl_imu_acc: gpioimxaccgrp {
                        fsl,pins = <
                                MX6UL_PAD_NAND_CE0_B__GPIO4_IO13        0x80000000      /* INT1 */
                                MX6UL_PAD_NAND_CE1_B__GPIO4_IO14        0x80000000      /* INT2 */
                        >;

 

And the /proc/interrupts file look like this:

/proc/interrupts

As you can see, I have other signals that can wake up the system. However I am not able to do it with any of the LSM9DS1. Moreover, I do not know where I can configure the interrupts. The driver does not provide a file system to do it. Therefore, if you are using the driver, the only way that I know to configure and to check the values are reading and writing the LSM9DS1 registers directly.

 

Has anyone tried to wake up the Linux system using the inertial interrupts?

 

Thanks a lot and regards,

 

Javier.

Outcomes