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!
12-18-2009 12:02 AM
Hi,
My touch screen is connected thro ADS7846 by SPI bus. How do I see this in /dev? Can someone let me know the example?
TOM
12-18-2009 07:50 AM
Tom,
Looks like Linux actually has a driver for this touchscreen.
linux-2.6-xlnx/drivers/input/touchscreen/ads7846.c
Assuming that you've built a kernel with the Xilinx SPI driver and the driver for this touch screen, you'll need to figure out how to properly edit the device tree (the .dts file) to specify that this touchscreen is present. This driver is not device-tree aware, so you'll need to make use of the kernel's workaround for the device (99% of SPI drivers haven't yet been modified to use the device tree directly yet).
Find the name of the driver in ads7846.c:
static struct spi_driver ads7846_driver = {
.driver = {
.name = "ads7846",
.bus = &spi_bus_type,
.owner = THIS_MODULE,
},
.probe = ads7846_probe,
.remove = __devexit_p(ads7846_remove),
.suspend = ads7846_suspend,
.resume = ads7846_resume,
};
12-19-2009 12:38 AM
Hi, Thank you. I tried as you mentioned. The drivers fails for IRQ. It return with no IRQ? error. Any idea?
tom
12-19-2009 03:48 AM
Hi
When I skipped IRQ & No platform data errors, I get the following error
ads7846: probe of spi32766.0 failed with error -22
Please can you help?
tom
12-21-2009 07:02 AM
Hi
I do not get the error "no platform data".
I use the following dts
xps_spi_ts: xps-spi@42400000 {
compatible = "xlnx,xps-spi-2.01.b", "xlnx,xps-spi-2.00.a";
interrupt-parent = <&xps_intc_0>;
interrupts = < 2 2 >;
reg = < 0x42400000 0x200 >;
xlnx,family = "virtex4";
xlnx,fifo-exist = <0x1>;
xlnx,num-ss-bits = <0x1>;
xlnx,num-transfer-bits = <0x8>;
xlnx,sck-ratio = <0xd0>;
#address-cells = <1>;
#size-cells = <0>;
ts@0{
compatible = "spi,ads7846";
reg =<0>;
interrupt-parant =<&xps_intc_0>;
interrupts = <3 2>;
spi-max-frequency = <100000>;
#addr-size = <2>;
#page-size = <32>;
};
};
This is the dmesg info
bus: 'spi': add driver ads7846
bus: 'spi': driver_probe_device: matched device spi32766.0 with driver ads7846
bus: 'spi': really_probe: probing driver ads7846 with device spi32766.0
ADS 7846 Testing
no platform data
Please can you let me know what could be the problem?
12-21-2009 07:03 AM
sorry! I do get the error "no platform data"
tom
12-21-2009 07:38 AM
Tom,
I believe this problem stems from the driver not being device tree aware. The modalias table is a stop-gap (that doen't fill the gap in this case).
From looking at other (non device tree platforms) I see things like arch/arm/mach-at91/board-cap9adk.c where a
static struct ads7846_platform_data ads_info = {
.model = 7843,
.x_min = 150,
.x_max = 3830,
.y_min = 190,
.y_max = 3830,
.vref_delay_usecs = 100,
.x_plate_ohms = 450,
.y_plate_ohms = 250,
.pressure_max = 15000,
.debounce_max = 1,
.debounce_rep = 0,
.debounce_tol = (~0),
.get_pendown_state = ads7843_pendown_state,
};
etc... is found.
I believe you'll have to modifiy the driver to get this state from ... somewhere.... Choices abound; it depends how clean you'd like your solution to be.
-Brian
12-21-2009 07:42 AM
You may be able to just copy the scheme from the file I mentioned above to
linux-2.6-xlnx/arch/powerpc/platforms/44x/virtex.c
-Brian
12-21-2009 08:00 AM
Hi Thanks.
Where should I use the board info?
12-21-2009 08:03 AM
I'm not sure if this is helpful or not, but I attached a file (main.c) that I use for testing the spi eeprom when the eeprom driver doesn't support device tree.
I build a kernel module with this code and it works fine. Just trying to illustrate another way, but not necessarily saying it's the best way.
Thanks.
12-21-2009 08:41 AM
Hi
I have modified the ads7846.c file by including the ads_info & all given in AT board. Still I get the no platform data error msg.