AnsweredAssumed Answered

PCM052: How to add STMPE touchscreen in kernel 3.13?

Question asked by mpfgregory on Sep 16, 2015
Latest reply on Apr 6, 2017 by Catalin Crenguta

In kernel 3.13 the STMPE touchscreen device needs to be defined in the DTB. I already have I2C running (the RTC works fine). But I don't know how to make the touchscreen work. I have added the following entry to /arch/arm/boot/dts/vf610-pcm-952.dtsi:

 

&i2c2 {

    stmpe811: gpio-expander@41 {

        compatible = "st,stmpe811";

        #address-cells = <1>;

        #size-cells = <0>;

        reg = <0x41>;

        interrupts = <0 1>;

        interrupt-parent = <&gpio2>;

        interrupt-controller;

        /*irq-over-gpio;

        irq-gpios = <&gpio1 24 GPIO_ACTIVE_LOW>;*/

        id = <0>;

        blocks = <0x5>;

        irq-trigger = <0x1>;

 

        stmpegpio: stmpe-gpio {

            compatible = "stmpe,gpio";

            reg = <0>;

            gpio-controller;

            #gpio-cells = <2>;

            gpio,norequest-mask = <0xf3>;/*0xf0 does not work*/

        };

 

        stmpe610-ts {

            compatible = "stmpe,ts";

            reg = <0>;

            ts,sample-time = <4>;

            ts,mod-12b = <1>;

            ts,ref-sel = <0>;

            ts,adc-freq = <1>;

            ts,ave-ctrl = <3>;

            ts,touch-det-delay = <3>;

            ts,settling = <3>;

            ts,fraction-z = <6>;

            ts,i-drive = <0>;

        };

    };

};

 

By default there is only an entry: /* TODO Touch */, so I guess Timesys is working on it.

 

I have taken this definition form the AM335X BSP. I've changed the interrupt entries to match the FSL syntax (the AM335X interrupt entries are commented out). The interrupt CPU pin is PTB10, also known as GPIO32, or GPIO 0 of the second bank, therefore:

        interrupts = <0 1>;

        interrupt-parent = <&gpio2>;

 

The kernel ouputs the following messages:

stmpe-i2c 0-0041: failed to read regs 0x0: -22                            
stmpe-i2c: probe of 0-0041 failed with error -22                          
i2c i2c-0: IMX I2C adapter registered                                     

i2c /dev entries driver

 

What's going wrong here? Is this related to the interrupt, or is there a general I2C problem?

 

Best regards

Michael

Outcomes