On Sat, Mar 14, 2009 at 9:09 AM, David Brownell <david-b@xxxxxxxxxxx> wrote: > On Thursday 12 March 2009, Eric Miao wrote: >> > >> > This should be a workaround for broken hardware and I don't expect >> > this sync time on every boards. >> > >> >> The sync time depends on the moment of this sync between two HSYNC, >> I don't expect that to be very long, > > But how long is that? 1/(50 KHz) or so? > For Sharp Zaurus, let's say a poodle, with PXA255 and QVGA LCD portrait, a typical of 320 lines per frame (although counting in blank VSYNC will make this a bit larger), and 60Hz frame refresh rate: 1 HSYNC = 1/(60Hz * 320) = 52.08us An average sync time would be half of this, say, 26us. Having another interrupt to trigger the sampling will be a bit trickier and considering this average of 26us on a 400MHz PXA255, and another interrupt latency, I don't see too much benefit of doing that. And my personal feeling of the final result with the GUI seems quite responsive, though I didn't stress test that. > >> yet the hardware is broken enough to >> endure this latency. > > Actually I heard from someone else this morning that it's not just > "broken" hardware that sees touchscreen ADC sampling noise related > to hsync. So this patch makes sense ... although there's no way to > guarantee the SPI requests won't have queueing delays before they > arrive at the touchscreen controller, possibly hitting the next > hsync interval. > > It seems that it's surprisingly tricky to get clean samples from > touchscreens. There's physical oscillation to compensate, which > changes capacitance until it damps down. There's also electrical > oscillation from charging the various sense lines. Add to that a > bunch of honest-to-goodness noise associated with hsync and vsync... > yeech! It would be a Good Thing if someone were to split out the > sample filtering logic from this driver so it could be used with > other touchscreen drivers. > Yes, sample filtering can actually be made input device wise. There are actually some user-land solution to this, e.g. tslib. Yet this sync issue seems annoyingly unavoidable even with a fine grained filter, or maybe I didn't try my best to tweak those filters to a maximum potential yet, and I gave up on that finally. > - Dave > > -- Cheers - eric -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html