2010-05-07 07:54:03     Events from AD7877 stops

Document created by Aaronwu Employee on Aug 21, 2013
Version 1Show Document
  • View in full screen mode

2010-05-07 07:54:03     Events from AD7877 stops

Martin Jensby (DENMARK)

Message: 89215   

 

Hey

 

Anyone that might be able to help with this little problem.

 

We are using the GPIO4 on the AD7877 touch controller,

 

The AD7877 driver have been modified as per this thread

 

https://blackfin.uclinux.org/gf/project/uclinux-dist/forum/?action=ForumBrowse&forum_id=39&thread_id=26484&_forum_action=ForumMessageBrowse

 

 

 

However when we read this GPIO, events from the touch stops,

 

I can do a ts_calibrate before the read of the GPIO but after it stops.

 

anyone that have experienced the same, and possibly have a solution?

 

 

 

So basicly when we read the GPIO the touchscreen stops working.

QuoteReplyEditDelete

 

 

2010-05-07 08:33:30     Events from AD7877 stops

Michael Hennerich (GERMANY)

Message: 89217    Reading and writing the extended registers on the AD7877 is a bit different.

From top of my head it might be that you exit MASTER mode, by using read().

Does the touch screen starting to work when you read one of the ADC registers after your modified GPIO4 read?

 

-Michael

QuoteReplyEditDelete

 

 

2010-05-07 08:36:55     Re: Events from AD7877 stops

Martin Jensby (DENMARK)

Message: 89218   

 

Before I modified the GPIO4 read, the touch worked just fine, but the value in the register was wrong.

 

It was never high even if the GPIO was high.

 

I have a board with a hook switch connected to it, so I can check it fast.

 

With the modification the GPIO have the expected value but the touch stops working

QuoteReplyEditDelete

 

 

2010-05-07 08:42:46     Re: Events from AD7877 stops

Michael Hennerich (GERMANY)

Message: 89220    > Before I modified the GPIO4 read, the touch worked just fine, but the

> value in the register was wrong.

>

> It was never high even if the GPIO was high.

 

You might have noticed - but GPIO4 was always meant to be a output only.

So reading GPIO4 returned the value previously written.

QuoteReplyEditDelete

 

 

2010-05-07 08:45:38     Re: Events from AD7877 stops

Martin Jensby (DENMARK)

Message: 89221   

 

true.

 

 

 

I'm still not that skilled in the driver writing.

 

You mentioned MASTER mode might be exited.

 

How can I test if that is the case?

 

And what can be done to prevent the touch from not giving events?

QuoteReplyEditDelete

 

 

2010-05-07 08:53:10     Re: Events from AD7877 stops

Michael Hennerich (GERMANY)

Message: 89222    Try if this fixes your problem...

 

Index: drivers/input/touchscreen/ad7877.c

===================================================================

--- drivers/input/touchscreen/ad7877.c (revision 8681)

+++ drivers/input/touchscreen/ad7877.c (working copy)

@@ -208,6 +208,7 @@

 

static int ad7877_read(struct spi_device *spi, u16 reg)

{

+ struct ad7877 *ts = dev_get_drvdata(&spi->dev);

struct ser_req *req;

int status, ret;

 

@@ -225,8 +226,12 @@

req->xfer[1].rx_buf = &req->sample;

req->xfer[1].len = 2;

 

+ req->xfer[2].tx_buf = &ts->cmd_crtl1; /*DEFAULT*/

+ req->xfer[2].len = 2;

+

spi_message_add_tail(&req->xfer[0], &req->msg);

spi_message_add_tail(&req->xfer[1], &req->msg);

+ spi_message_add_tail(&req->xfer[2], &req->msg);

 

status = spi_sync(spi, &req->msg);

ret = status ? : req->sample;

QuoteReplyEditDelete

 

 

2010-05-07 08:59:06     Re: Events from AD7877 stops

Martin Jensby (DENMARK)

Message: 89223   

 

It did the trick

 

 

 

Thank you very much.

 

Have a nice weekend.

QuoteReplyEditDelete

 

 

2010-05-07 09:00:36     Re: Events from AD7877 stops [SOLVED]

Martin Jensby (DENMARK)

Message: 89224   

 

SOLVED

Attachments

    Outcomes