ARM: dts: ux500: configure the accelerometers open drain
authorLinus Walleij <linus.walleij@linaro.org>
Fri, 5 Feb 2016 13:00:00 +0000 (14:00 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 4 May 2016 07:33:25 +0000 (09:33 +0200)
Configure the two accelerometers sharing GPIO line 82 as:

- Open drain so that they can share the same interrupt line.

Configure the corresponding interrupt pin:

- Trigger on the falling edge since open drain implies that we
  do not actively drive the line high, but we will actively drive
  it low to generate interrupts and then it moves from high to low
  i.e. a falling edge.

- Pulled up so the line will be biased to high unless an IRQ
  is active on any device on the line, and thus it goes high
  again after the interrupt is deasserted.

Cc: linux-iio@vger.kernel.org
Cc: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
arch/arm/boot/dts/ste-href-tvk1281618.dtsi

index 54d80da..fc5e8ce 100644 (file)
                                /* Accelerometer */
                                compatible = "st,lsm303dlh-accel";
                                st,drdy-int-pin = <1>;
+                               drive-open-drain;
                                reg = <0x18>;
                                vdd-supply = <&ab8500_ldo_aux1_reg>;
                                vddio-supply = <&db8500_vsmps2_reg>;
                                pinctrl-names = "default";
                                pinctrl-0 = <&accel_tvk_mode>;
                                interrupt-parent = <&gpio2>;
-                               interrupts = <18 IRQ_TYPE_EDGE_RISING>,
-                                            <19 IRQ_TYPE_EDGE_RISING>;
+                               interrupts = <18 IRQ_TYPE_EDGE_FALLING>,
+                                            <19 IRQ_TYPE_EDGE_FALLING>;
                        };
                        lsm303dlh@1e {
                                /*
                                /* Accelerometer */
                                compatible = "st,lis331dl-accel";
                                st,drdy-int-pin = <1>;
+                               drive-open-drain;
                                reg = <0x1c>;
                                vdd-supply = <&ab8500_ldo_aux1_reg>;
                                vddio-supply = <&db8500_vsmps2_reg>;
                                pinctrl-names = "default";
                                pinctrl-0 = <&accel_tvk_mode>;
                                interrupt-parent = <&gpio2>;
-                               interrupts = <18 IRQ_TYPE_EDGE_RISING>,
-                                            <19 IRQ_TYPE_EDGE_RISING>;
+                               interrupts = <18 IRQ_TYPE_EDGE_FALLING>,
+                                            <19 IRQ_TYPE_EDGE_FALLING>;
                        };
                        ak8974@0f {
                                /* Magnetometer */
                                        /* Accelerometer interrupt lines 1 & 2 */
                                        tvk_cfg {
                                                pins = "GPIO82_C1", "GPIO83_D3";
-                                               ste,config = <&gpio_in_pd>;
+                                               ste,config = <&gpio_in_pu>;
                                        };
                                };
                        };