Skip to content Skip to sidebar Skip to footer

How To Correctly Configure Interrupt For Int Line Of Atmel Mxt641t Touch Chip In Android 5 Kernel Device Tree?

I am having troubles getting a touch screen powered by an Atmel MXT641T on an Android 5 platform to work. The setup I have is as follows: Hardware: Inforce 6309 SBC with Qualcomm

Solution 1:

After finding out that there is already a more or less working touchscreen definition in the device tree but that the pins are different, I ended up with the following device tree:

&i2c_0 {

  atmel_maxtouch_ts@4a {
    compatible = "atmel,maxtouch";
    reg = <0x4a>;
    interrupt-parent = <&msm_gpio>;
    interrupts = <530x2008>;
    pinctrl-names = "pmx_ts_active","pmx_ts_suspend","pmx_ts_suspend";
    pinctrl-0 = <&ts_int_active &ts_reset_active>;
    pinctrl-1 = <&ts_int_suspend &ts_reset_suspend>;
    pinctrl-2 = <&ts_release>;
    atmel,irq-gpio = <&msm_gpio 530x2008>;
    atmel,reset-gpio = <&msm_gpio 540>;
    atmel,panel-coords = <00800480>;
    atmel,display-coords = <00800480>;
    atmel,family-id = <164>;
    atmel,variant-id = <2>;
    atmel,version = <21>;
    atmel,build = <0xaa>;
  };

};

so, the following lines are different:

interrupts = <53 0x2008>;
pinctrl-names = "pmx_ts_active","pmx_ts_suspend","pmx_ts_suspend";
pinctrl-0 = <&ts_int_active &ts_reset_active>;
pinctrl-1 = <&ts_int_suspend &ts_reset_suspend>;
pinctrl-2 = <&ts_release>;
atmel,irq-gpio = <&msm_gpio 53 0x2008>;
atmel,reset-gpio = <&msm_gpio 54 0>;

The 0x2008 is needed to make the Snapdragon pull up this interrupt line and trigger on the falling edge.

The pinctrl definitions were already located in qcom/msm8916-pinctrl.dtsi that comes with the BSP, however, for my case I had to change pin 12 to 54 and pin 13 to 53:

diff --git a/arch/arm/boot/dts/qcom/msm8916-pinctrl.dtsi b/arch/arm/boot/dts/qcom/msm8916-pinctrl.dtsiindex 204c718..80a2a6d 100644--- a/arch/arm/boot/dts/qcom/msm8916-pinctrl.dtsi+++ b/arch/arm/boot/dts/qcom/msm8916-pinctrl.dtsi@@ -30,16 +30,6 @@
                        };
                };

-               atmel-int-pin {-                       qcom,pins = <&gp 53>;-                       qcom,num-grp-pins = <1>;-                       label = "atmel-int-pin";-                       default {-                               drive-strength = <0>;-                               bias-pull-up;-                       };-               };-
                ext-cdc-tlmm-lines {
                        qcom,pins = <&gp 116>, <&gp 112>, <&gp 117>,
                                                <&gp 118>, <&gp 119>;
@@ -1175,7 +1165,7 @@

                /* add pingrp for touchscreen */
                pmx_ts_int_active {
-                       qcom,pins = <&gp 13>;+                       qcom,pins = <&gp 53>;
                        qcom,pin-func = <0>;
                        qcom,num-grp-pins = <1>;
                        label = "pmx_ts_int_active";
@@ -1187,7 +1177,7 @@
                };

                pmx_ts_int_suspend {
-                       qcom,pins = <&gp 13>;+                       qcom,pins = <&gp 53>;
                        qcom,pin-func = <0>;
                        qcom,num-grp-pins = <1>;
                        label = "pmx_ts_int_suspend";
@@ -1199,7 +1189,7 @@
                };

                pmx_ts_reset_active {
-                       qcom,pins = <&gp 12>;+                       qcom,pins = <&gp 54>;
                        qcom,pin-func = <0>;
                        qcom,num-grp-pins = <1>;
                        label = "pmx_ts_reset_active";
@@ -1211,7 +1201,7 @@
                };

                pmx_ts_reset_suspend {
-                       qcom,pins = <&gp 12>;+                       qcom,pins = <&gp 54>;
                        qcom,pin-func = <0>;
                        qcom,num-grp-pins = <1>;
                        label = "pmx_ts_reset_suspend";
@@ -1223,7 +1213,7 @@
                };

                pmx_ts_release {
-                       qcom,pins = <&gp 13>, <&gp 12>;+                       qcom,pins = <&gp 53>, <&gp 54>;
                        qcom,num-grp-pins = <2>;
                        label = "pmx_ts_release";

Post a Comment for "How To Correctly Configure Interrupt For Int Line Of Atmel Mxt641t Touch Chip In Android 5 Kernel Device Tree?"