Hi Paul, Pierre,
On 2/9/07, Paul Sokolovsky <[EMAIL PROTECTED]> wrote:
Hello Pierre,
Saturday, February 3, 2007, 2:01:51 AM, you wrote:
> Hi,
> you will find attached a new X50 patch.
> It is mainly a modified version of the device-independent
> ADS7846/TSC2046 driver released by Paul a few days ago :
> - Kconfig takes into account all X50 variants (not really required for
> now, but allow to manage cleanly the axim family),
> - aximx50.c. includes the touchscreen driver information, and some
> unuseful udc code has been removed,
> - ads7846ts_ssp.c : read_xydata is now less value-dependent, and a
> mechanism derived from the tsc2046 driver to detect pen release (based
> on gpio) has been added. ADS/TSC commands are now on 24 bits,
> - ads7846_adc_ssp.c : re-use initialization from tsc2046 driver,
Ok, I finally found time to deal with ads7846ts_ssp.c/ads7846_adc_ssp.c on
pxa27x machines (hx4700 specifically). It turned out to be not that
easy, and I'd like to thank you for your patches - I actually failed
to bootstrap original version on hx4700, so used your patches as the base.
But after more detailed investigation the real cause of issues was found:
different touchscreens have different parameters, and hx4700's one
uncovers few issues in races in the old version driver. Still, your
version was not good for h4000 either.
At the end of story, there's now really machine independent driver
for ADS7846/TSC2046, tested on h4000 and hx4700. It still may need
some tweaks for other machines (ability to pass TS params via
platform_data), but otherwise pretty generic and debugged. As was expected,
no ads7846_adc_ssp.c changes were required - all those "24bits" stuff
is nothing but hacks, likely copied from wince drivers.
So, please try to use it on aximx50 - I keep my fingers crossed for
it to work out of the box. Feel free to use h4000 as the reference (I
didn't yet committed hx4700 patches).
Many thanks for taking this up. I'll immediately test this on the magician.
Why doesn't the ads7846 ssp driver use the functions from arch/mach-pxa/ssp.c?
Two minor nitpicks:
- IMHO ads7846_init_chip is misnamed. This function sets up the SSP
port, not the ads7846/tsc2046 chip.
- The header file shouldn't be in include/spi, when the point of this driver
is that it doesn't use the spi subsystem at all...
Oh, and:
WARNING: drivers/misc/adc/ads7846_adc_ssp.o - Section mismatch:
reference to .init.text:ads7846_ssp_probe from .data after '$d' (at
offset 0x0)
when compiling ads7846_adc_ssp as a module. What about:
Index: linux-2.6/drivers/misc/adc/ads7846_adc_ssp.c
===================================================================
--- linux-2.6.orig/drivers/misc/adc/ads7846_adc_ssp.c 2007-02-09
11:20:42.000000000 +0100
+++ linux-2.6/drivers/misc/adc/ads7846_adc_ssp.c 2007-02-09
11:20:43.000000000 +0100
@@ -84,7 +84,7 @@
SSCR0_P(port) |= SSCR0_SSE;
}
-static int __init ads7846_ssp_probe(struct platform_device *dev)
+static int __devinit ads7846_ssp_probe(struct platform_device *dev)
{
struct ads7846_ssp_platform_data *params = dev->dev.platform_data;
port = params->port;
@@ -99,7 +99,7 @@
return 0;
}
-static int ads7846_ssp_remove(struct platform_device *dev)
+static int __devexit ads7846_ssp_remove(struct platform_device *dev)
{
SSCR0_P(port) &= ~SSCR0_SSE;
return 0;
@@ -123,7 +123,7 @@
.name = "ads7846-ssp",
},
.probe = ads7846_ssp_probe,
- .remove = ads7846_ssp_remove,
+ .remove = __devexit_p(ads7846_ssp_remove),
#ifdef CONFIG_PM
.suspend = ads7846_ssp_suspend,
.resume = ads7846_ssp_resume,
thanks
Philipp
--
_______________________________________________
Aximx50-port mailing list
[email protected]
https://www.handhelds.org/mailman/listinfo/aximx50-port