cancel
Showing results for 
Search instead for 
Did you mean: 

How to add TSC2046 in STM32MP151AAC?

yrkim05
Associate II

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

2 REPLIES 2
yrkim05
Associate II

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?
 
 
 
 
yrkim05
Associate II

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?