cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
tomams
Visitor
Visitor
2,996 Views
Registered: ‎11-02-2008

touchscreen

Hi

I am using Xilinx Virtex4 Powerpc. I am trying to interface with ADS7846 SPI touch screen controller. This is connected to the Xilinx SPI. The CS is connected to a GPIO & PEN_IRQ is connected to different GPIO.

My DTS is
            
             //Chip Select
              SPI_CS: gpio@81400000 {
compatible = "xlnx,xps-gpio-1.00.a";
reg = < 0x81400000 0x10000 >;
xlnx,all-inputs = <0x0>;
xlnx,all-inputs-2 = <0x0>;
xlnx,dout-default = <0x0>;
xlnx,dout-default-2 = <0x0>;
xlnx,family = "virtex4";
xlnx,gpio-width = <0x4>;
xlnx,interrupt-present = <0x0>;
xlnx,is-bidir = <0x1>;
xlnx,is-bidir-2 = <0x1>;
xlnx,is-dual = <0x0>;
xlnx,tri-default = <0xffffffff>;
xlnx,tri-default-2 = <0xffffffff>;
} ;

               //Touch Screen (ADS7846) pen irq
 
               ts_pen_irq: gpio@81c00000 {
compatible = "xlnx,xps-gpio-1.00.a";
interrupt-parent = <&xps_intc_0>;
interrupts = < 0 2 >;
reg = < 0x81c00000 0x10000 >;
xlnx,all-inputs = <0x1>;
xlnx,all-inputs-2 = <0x0>;
xlnx,dout-default = <0x0>;
xlnx,dout-default-2 = <0x0>;
xlnx,family = "virtex4";
xlnx,gpio-width = <0x1>;
xlnx,interrupt-present = <0x1>;
xlnx,is-bidir = <0x1>;
xlnx,is-bidir-2 = <0x1>;
xlnx,is-dual = <0x0>;
xlnx,tri-default = <0xffffffff>;
xlnx,tri-default-2 = <0xffffffff>;
} ;
       
               // This is SPI
               xps_spi_ts: xps-spi@42400000 {
compatible = "xlnx,xps-spi-2.00.b", "xlnx,xps-spi-2.00.a";
reg = < 0x42400000 0x200 >;
xlnx,family = "virtex4";
xlnx,fifo-exist = <0x0>;
xlnx,num-ss-bits = <0x1>;
xlnx,num-transfer-bits = <0x8>;
xlnx,sck-ratio = <0xd0>;
} ;

          when I include the ADS7846 info in virtex.c file, the ADS7846 is detected & I could see at /dev/input/event0. But I do not know how to call or access the particluat GPIO in virtex.c file for Chipselect & for Irq.

         Please let me know how to do this

         
0 Kudos
1 Reply
linnj
Xilinx Employee
Xilinx Employee
2,963 Views
Registered: ‎09-10-2008

You can access the gpio from user space as we document on the wiki (http://xilinx.wikidot.com/osl-gpio-driver).

 

But I don't think this will solve your problem as you really need the driver to be doing that problably.

 

I'm not sure how to make that work as I haven't done that.

 

Sorry, not much help.

0 Kudos