Skip to main content
Associate II
June 24, 2024
Question

How to add TSC2046 in STM32MP151AAC?

Dear All,

We have been using LCD module which supports touch screen.

Currently image can be displayed properly.

I just started debugging touch screen.

we use SPI2 to interface to touch screen ic, TSC2046.

This is setting spi2 in dts.

&spi2 {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&spi2_pins_a>;
pinctrl-1 = <&spi2_sleep_pins_a>;
cs-gpios = <&gpioi 0 0>;
status = "okay";
 
//spidev@0 {     
    //    compatible = "spidev";
    //    spi-max-frequency = <20000000>;
    //    reg = <0>;
    //};
 
    ads7846@0 {
                compatible = "ti,ads7846";
                reg = <0x0>;
                spi-max-frequency = <1000000>;
                interrupt-parent = <&gpioe>;
                interrupts = <12 IRQ_TYPE_EDGE_FALLING>;
                //gpios = <&gpioe 12 0>;
                pendown-gpio = <&gpioe 12 0>; /*GPIOE 12*/
                
                //ti,x-min = /bits/ 16 <0>;
                //ti,x-max = /bits/ 16 <2400>;
                //ti,y-min = /bits/ 16 <0>;
                //ti,y-max = /bits/ 16 <3200>;
                //ti,x-plate-ohms = /bits/ 16 <40>;
                //ti,pressure-max = /bits/ 16 <255>;
touchscreen-size-x = <240>;
touchscreen-size-y = <320>;
                wakeup-source;
                status = "okay";
    };
};

 

1. configure ADS7846 as 'M' by menuconfig

2. build kernel

3. update dtb and uimage

4. cp ads7846.ko to /lib/

 

I'm considering getting event through reading "/dev/input/event"

Could you advise how to make touch screen work?

Best wishes,

KIM

This topic has been closed for replies.

2 replies

yrkim05Author
Associate II
June 27, 2024

I change dts for spi2 as below.

&spi2 {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&spi2_pins_a>;
pinctrl-1 = <&spi2_sleep_pins_a>;
cs-gpios = <&gpioi 0 0>;
status = "okay";
 
//spidev@0 {     
    //    compatible = "spidev";
    //    spi-max-frequency = <20000000>;
    //    reg = <0>;
    //};
 
    ads7846@0 {
                compatible = "ti,ads7846";
                reg = <0x0>;
                spi-max-frequency = <1500000>;
                interrupt-parent = <&gpioe>;
                interrupts = <12 IRQ_TYPE_EDGE_FALLING>;
                //gpios = <&gpioe 12 0>;
                pendown-gpio = <&gpioe 12 0>; /*GPIOE 12*/
                
                ti,x-min = /bits/ 16 <0>;
                ti,x-max = /bits/ 16 <2400>;
                ti,y-min = /bits/ 16 <0>;
                ti,y-max = /bits/ 16 <3200>;
                ti,x-plate-ohms = /bits/ 16 <180>;
                ti,pressure-max = /bits/ 16 <255>;
 
                ti,debounce-max = /bits/ 16 <10>;
                ti,debounce-tol = /bits/ 16 <30>;
                ti,debounce-rep = /bits/ 16 <1>;
                
                ti,settle-delay-usec = /bits/ 16 <150>;
                ti,keep-vref-on = <1>;
//touchscreen-size-x = <240>;
//touchscreen-size-y = <320>;
                wakeup-source;
                status = "okay";
    };
};
 
I try to read event by "/dev/input/touchscreen0" but nothing is read.
I check interrupt signal by scope, driven as low when press lcd.
What shall I need to check?
 
 
 
 
yrkim05Author
Associate II
June 28, 2024

I checked input device by /proc/bus/input/devices.

Touchscreen is event2 handler, spi0.0/input0.

So I tried to check event by evtest but nothing happens.

What shall I need to check?