UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Observer will.platts
Observer
5,438 Views
Registered: ‎03-05-2012

Using ADS7846 touchscreen controller with Linux

Hi,

 

I am trying to enable a touchscreen controller (ADS7846) in Linux (linux-xlnx). The controller is connected to SPI0 on CS. The #PENIRQ signal is connected to MIO52. I have compiled support for the driver into the kernel, and added the following to the device tree:

 

&spi0 {
    is-decoded-cs = <0>;
    num-cs = <2>;
    status = "okay";

    touchscreen@0 {
        reg = <0>;                    /* CS0 */
        compatible = "ti,ads7846";
        interrupt-parent = <&gpio0>;
        interrupts = <52 0>;
        spi-max-frequency = <1000000>;
        pendown-gpio = <&gpio0 52 0>;
        vcc-supply = <&regulator_vccpint>;        /* no idea! */
    };    

};

 

On boot, I get the following message:

 

ads7846: probe of spi32766.0 failed with error -22

 

Can anyone give me a clue as to what could be wrong? I think it is to do with setting up the interrupt, but I'm not sure.

 

Many thanks in advance

 

Will

0 Kudos
3 Replies
Scholar milosoftware
Scholar
5,409 Views
Registered: ‎10-26-2012

Re: Using ADS7846 touchscreen controller with Linux

Assuming you're using MIO 52 for the pen-down IRQ, your DT looks suspicous.

 

I'd expect that you need to specify either the gpio or the interrupt controller, but not both.

 

Usually the way to dig into this is to find the value "22" in errno.h, and if that doesn't help, look in the driver source where it would return that error. If that doesn't help, compile with DEBUG defined for that driver.

0 Kudos
Observer will.platts
Observer
5,393 Views
Registered: ‎03-05-2012

Re: Using ADS7846 touchscreen controller with Linux

Thanks - I will try those debug tactics.

 

The idea with the &gpio0 in the interrupt parent was to use the GPIO controller as the interrupt controller. (See: https://ez.analog.com/message/153150?forceNoRedirect=true post 2) - this is a different device but also for Zynq.

 

"Try to avoid to connect the IRQ directly to the GIC, this is known to have issues. Connect the pin to a EMIO GPIO pin instead and then use the GPIO controller as the interrupt controller. To use the GPIO controller as the interrupt controller use the following lines to setup the interrupt for the ad7879."

 

Is this not the proper way to do it? If not, are there any examples on how to connect a GPIO as an interrupt source in the device tree? How do I know which IRQ numbers to use, etc.?

 

Thanks

Will

0 Kudos
Explorer
Explorer
475 Views
Registered: ‎02-05-2008

Re: Using ADS7846 touchscreen controller with Linux

Hi

 

did you solve or find the solution for this issue?

0 Kudos