This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

SK-AM62B-P1: GPIO as peripheral interrupt line

Part Number: SK-AM62B-P1

Tool/software:

Hi,

I'm working on the SK-AM62B-P1, integrating a touch display.

I'm struggling on following: If I use a pin from a GPIO expander as the touch chip's interrupt line, the driver works without issue.

If I use a pin from the MPU itself as the interrupt, the finger touches are not detected.

Belo the working device tree part:

&main_i2c2 {
    i2c-switch@71 {
        i2c@0 {
            touchscreen: focaltech@38 {
                compatible = "edt,edt-ft5206";
                reg = <0x38>;
 
                interrupt-parent = <&exp1>;
                interrupts = <22 GPIO_ACTIVE_LOW>;              // TS_INT#
 
                reset-gpios = <&main_gpio0 33 GPIO_ACTIVE_LOW>; // EXP_GPIO0_33
 
                touchscreen-size-x = <1024>;
                touchscreen-size-y = <600>;
            };
        };
    };
};

Below the non-working part

&main_i2c2 {
    i2c-switch@71 {
        i2c@0 {
            touchscreen: focaltech@38 {
                compatible = "edt,edt-ft5206";
                reg = <0x38>;
 
                interrupt-parent = <&main_gpio1>;
                interrupts = <22 GPIO_ACTIVE_LOW>;              // EXP_GPIO1_22
 
                reset-gpios = <&main_gpio0 42 GPIO_ACTIVE_LOW>; // EXP_GPIO0_42
 
                touchscreen-size-x = <1024>;
                touchscreen-size-y = <600>;
            };
        };
    };
};

Are there some GPIOs that can't be used as interrupts ?

  • Hello,

    I'm not aware of any limitations of GPIOs being used as interrupts so I'm assuming all GPIOs should be interrupt capable. 


    Can you clarify if you are planning to have two panels connected at the same time? If so, the two dts snippits show that you are using the same i2c address on the same i2c bus for both.

    If its only one panel, then the interrupt parent is different. What is exp1 referencing? 

    Best Regards,

    Anshu

  • Hello,

    I use just one panel. The first dts is using the pin 22 of the GPIO expander 1 (&exp1) of the dev kit as the CTP interrupt line. On the second dts, I'm trying to do the same but with the MPU's GPIO 1 pin 22 as the interrupt line for the CTP. In that configuration, touches are not detected.

    Best regards

  • Hello Balthazar,

    What does CTP mean in this context?

    From a hardware perspective, is the panel connected the same way for both dts configurations?

    Thanks,

    Anshu

  • Hello,

    CTP means the touch panel controller.

    Yes it's harware connected twice the same way, the only difference is the GPIO used for the interrupt line: GPIO expander, pin 2 in the working case, main GPIO 1 pin 22 in the case that fails.

  • I finally found the issue; it was definitely my fault. I didn't set the pin as input in the pin config. Below DTS works:

    &main_pmx0 {
    	disp_pins_default: disp-pins-default {
    		bootph-all;
    		pinctrl-single,pins = <
    			AM62X_IOPAD(0x01d0, PIN_INPUT_PULLUP, 7) 	/* (B15) UART0_CTSn.GPIO1_22, used for interrupt 	*/
    			AM62X_IOPAD(0x00ac, PIN_OUTPUT_PULLUP, 7)	/* (H17) GPMC0_CSn1.GPIO0_42, used for reset 		*/
    		>;
    	};
    };
    
    &main_i2c2 {
    	i2c-switch@71 {
    		i2c@0 {
    			touchscreen: focaltech@38 {
    				compatible = "edt,edt-ft5206";
    				reg = <0x38>;
    
    				interrupt-parent = <&main_gpio1>;
    				interrupts = <22 GPIO_ACTIVE_LOW>;				// EXP_GPIO1_22
    
    				reset-gpios = <&main_gpio0 42 GPIO_ACTIVE_LOW>;	// EXP_GPIO0_42
    
    				touchscreen-size-x = <1024>;
    				touchscreen-size-y = <600>;
    
    				pinctrl-names = "default";
    				pinctrl-0 = <&disp_pins_default>;
    			};
    		};
    	};
    };