Add tsc2046 to iMX6ULL

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Add tsc2046 to iMX6ULL

1,474 Views
malikov_nikita
Contributor I

Hi

I'm Trying to connect a TFT display 240x320 with TSC2046 touchscreen controller on iMX6ULL(OS Linux Debian 10.2. )

I ran into trouble in getting the TSC2046 (ads7846.c based) touchscreen controller up.

I have added the TS to my ecspi3. This is how the dts code looks.

&ecspi3 {
  fsl,spi-num-chipselects = <1>;
  cs-gpios = <&gpio1 20 0>;
  pinctrl-names = "default";
  pinctrl-0 = <&pinctrl_ecspi3>;
  status = "okay";


  tsc2046@0 {
    compatible = "ti,tsc2046";
    reg = <0>;
    interrupt-parent = <&gpio1>;
    interrupts = <2 0>;
    spi-max-frequency = <1000000>;
    pendown-gpio = <&gpio1 2 0>;
    vcc-supply = <&reg_vref_3v3>;


    ti,x-min = /bits/ 16 <0>;
    ti,x-max = /bits/ 16 <240>;
    ti,y-min = /bits/ 16 <0>;
    ti,y-max = /bits/ 16 <320>;
    ti,x-plate-ohms = /bits/ 16 <0>;
    ti,pressure-max = /bits/ 16 <255>;

    linux,wakeup;

   touchscreen-size-x = <240>;
   touchscreen-size-y = <320>;
   touchscreen-inverted-x;
   touchscreen-inverted-y;

  };
};

Also I added the driver (ads7846.c based attached) using menuconfig and I see in booting the following

[ 2.376757] ads7846 spi2.0: spi_imx_setup: mode 0, 8 bpw, 1000000 hz
[ 2.376802] ads7846 spi2.0: setup mode 0, 8 bits/w, 1000000 Hz max --> 0
[ 2.378130] ads7846 spi2.0: touchscreen, irq 70
[ 2.384151] input: ADS7846 Touchscreen as /devices/soc0/soc/2000000.aips-bus/2000000.spba-bus/2010000.spi/spi_master/spi2/spi2.0/input/input0
[ 8.065019] evbug: Connected device: input0 (ADS7846 Touchscreen at spi2.0/input0)

When I prees on the display in some points - it always pressed on the farthest point.

What can be the problem? Is it in the dts? or I need to set something inside OS?

 

 

0 Kudos
2 Replies

1,455 Views
igorpadykov
NXP Employee
NXP Employee
0 Kudos

1,446 Views
malikov_nikita
Contributor I

I did configuration in DTS as in the example.

Everywhere I click on the display, it responds as if we are clicking on one spot (bottom left) but SPI writes difrrent data for every spot on display.

 

What can be the reason?

IMG_2085.jpg

0 Kudos