SPI - ADS7846 driver
Jothi Adithya
jothiadithya at yahoo.com
Tue Dec 29 00:23:27 EST 2009
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 at 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 at 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 at 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20091228/a87e729f/attachment.htm>
More information about the Linuxppc-dev
mailing list