Openmoko's S3C touchscreen driver porting question

6 messages Options
Embed this post
Permalink
Maurus Cuelenaere

Openmoko's S3C touchscreen driver porting question

Reply Threaded More More options
Print post
Permalink
Hi,

I'm working on porting the SmartQ 7 to mainline Linux, and as this
doesn't have any touchscreen drivers for the S3C6410, I tried using
Openmoko's one ([1]).

I got it compiling correctly, but when I press the screen, the driver
seems to endlessly print "stylus_action bug" (line 320 at s3c2410_ts.c).
The endless loop is probably because __kfifo_put() fails and so
S3C2410_ADCTSC doesn't get written.

What I don't understand though is why it fails (it seems to return 0),
any ideas?

[1]:
http://gitorious.org/mcuelenaere-smartq-kernel/mcuelenaere-smartq-kernel/commits/experimental-2.6.31-bd-ts

Thanks,
Maurus Cuelenaere


Nelson Castillo-2

Re: Openmoko's S3C touchscreen driver porting question

Reply Threaded More More options
Print post
Permalink
On Thu, Sep 17, 2009 at 6:56 PM, Maurus Cuelenaere
<[hidden email]> wrote:

> Hi,
>
> I'm working on porting the SmartQ 7 to mainline Linux, and as this doesn't
> have any touchscreen drivers for the S3C6410, I tried using Openmoko's one
> ([1]).
>
> I got it compiling correctly, but when I press the screen, the driver seems
> to endlessly print "stylus_action bug" (line 320 at s3c2410_ts.c).
> The endless loop is probably because __kfifo_put() fails and so
> S3C2410_ADCTSC doesn't get written.

#define TS_EVENT_FIFO_SIZE (2 << 6)

Should be enough. Try a different number but I think this should be enough.
Just for a test try (2 << 10).

A) I would also check if the coordinates make sense.
B) I would also check if event_send_timer_f (case 'P') is ever reached.

> What I don't understand though is why it fails (it seems to return 0), any
> ideas?

It should return "sizeof(int) * 3".

Try checking B.

PS: There is a newer version of this driver that uses the s3c-adc API.
Since this is what upstream wants. I guess I should submit the changes
for andy-tracking (or for one of the new branches).
http://nelson-patches.googlecode.com/svn/trunk/openmoko/kernel/ts-with-s3c-adc/

Maurus Cuelenaere

Re: Openmoko's S3C touchscreen driver porting question

Reply Threaded More More options
Print post
Permalink
Op 18-09-09 02:18, Nelson Castillo schreef:
> #define TS_EVENT_FIFO_SIZE (2<<  6)
>
> Should be enough. Try a different number but I think this should be enough.
> Just for a test try (2<<  10).
>    

I've tried this before, didn't work

> A) I would also check if the coordinates make sense.
>    

not sure how to do that?

> B) I would also check if event_send_timer_f (case 'P') is ever reached.
>    

doesn't get reached

> It should return "sizeof(int) * 3".
>
> Try checking B.
>
> PS: There is a newer version of this driver that uses the s3c-adc API.
> Since this is what upstream wants. I guess I should submit the changes
> for andy-tracking (or for one of the new branches).
> http://nelson-patches.googlecode.com/svn/trunk/openmoko/kernel/ts-with-s3c-adc/
>    

I haven't tried these patches yet as I'm currently chasing an SDHCI bug
which is blocking me from doing any "real" work.

Thanks for the help.

Regards,
Maurus Cuelenaere


Nelson Castillo-2

Re: Openmoko's S3C touchscreen driver porting question

Reply Threaded More More options
Print post
Permalink
On Sat, Sep 19, 2009 at 7:07 AM, Maurus Cuelenaere
<[hidden email]> wrote:

> Op 18-09-09 02:18, Nelson Castillo schreef:
>>
>> #define TS_EVENT_FIFO_SIZE (2<<  6)
>>
>> Should be enough. Try a different number but I think this should be
>> enough.
>> Just for a test try (2<<  10).
>>
>
> I've tried this before, didn't work
>
>> A) I would also check if the coordinates make sense.
>>
>
> not sure how to do that?
>
>> B) I would also check if event_send_timer_f (case 'P') is ever reached.
>>
>
> doesn't get reached

Mmm.

Next thing I would check is whether __kfifo_put() succeeds at least once.

tmp = __kfifo_put(ts.event_fifo, (unsigned char *)buf,sizeof(int) * 3);
printk(..., tmp)

If it does I'd try to check if the timer is working.

Maurus Cuelenaere

Re: Openmoko's S3C touchscreen driver porting question

Reply Threaded More More options
Print post
Permalink
Hi Nelson,

this is an update on your touchscreen driver on the S3C6410:

after some debugging I found out that the S3C6410's touchscreen differs
with the S3C24XX in that it has:

a) 12-bit ADC support (haven't looked at that atm)
b) additional registers used for clearing ADC and TS interrupts

Due to b), the FIFO constantly got filled with up/down messages as the
interrupt was never cleared.

I've added/hacked support for this in my tree currently, but am waiting
till your driver get in upstream
to rebase my tree and try merging my changes.

Regards,

Maurus Cuelenaere


Nelson Castillo-2

Re: Openmoko's S3C touchscreen driver porting question

Reply Threaded More More options
Print post
Permalink
On Thu, Oct 1, 2009 at 12:57 PM, Maurus Cuelenaere
<[hidden email]> wrote:

> Hi Nelson,
>
> this is an update on your touchscreen driver on the S3C6410:
>
> after some debugging I found out that the S3C6410's touchscreen differs with
> the S3C24XX in that it has:
>
> a) 12-bit ADC support (haven't looked at that atm)
> b) additional registers used for clearing ADC and TS interrupts
>
> Due to b), the FIFO constantly got filled with up/down messages as the
> interrupt was never cleared.
>
> I've added/hacked support for this in my tree currently, but am waiting till
> your driver get in upstream
> to rebase my tree and try merging my changes.


Oh, I see.

Ben Dooks has been maintaining a version of the driver based in the
same sources that is not public. He said he will prepare the patches
and send them to Linux-arm-kernel.

Nelson.-