2010-10-01 04:41:03     ad7879 Positional Values

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

2010-10-01 04:41:03     ad7879 Positional Values

Jayaprabhu Nadarajan (INDIA)

Message: 94104   

 

Hi,

 

We are using BF527 board with ad7879 touch controller. The X and Y coordinates returned from the  driver is wrong sometimes. Following is the set of output for press and release at same region

     x=29    y=207

     x=31    y=205

     x=31    y=207

     x=37    y=207

     x=39    y=207

     x=38    y=210

     x=31    y=209

     x=29    y=213

     x=28    y=208

     x=30    y=206

     x=31    y=205

     x=28    y=208

     x=30    y=208

     x=33    y=212

     x=28    y=206

     x=29    y=209

     x=36    y=202

     x=36    y=203

     x=41    y=201

     x=45    y=205

     x=52    y=202

     x=53    y=208

     x=42    y=207

     x=45    y=203

     x=320   y=213

     x=41    y=200

     x=317   y=207

     x=39    y=204

     x=35    y=202

     x=318   y=195

     x=43    y=203

     x=33    y=201

     x=35    y=207

     x=36    y=203

 

For same region x becomes 320,317,318 .. which is wrong. We tried configuring the median and averaging filter values to avoid this noise but still the same issue remains.

Could you please let us know how to avoid this issue.

 

TIA

 

Regards,

Jp

QuoteReplyEditDelete

 

 

2010-10-01 05:06:31     ad7879 Positional Values

Michael Hennerich (GERMANY)

Message: 94105    Are you using the SPI or I2C option of the driver?

Can you explain how you connected it?

 

I never seen such out of area samples.

QuoteReplyEditDelete

 

 

2010-10-06 05:31:58     Re: ad7879 Positional Values

Jayaprabhu Nadarajan (INDIA)

Message: 94255   

 

Hi Michael,

 

We are using I2C option of the driver and the frequency is 400KHz.

 

Regards,

 

JP

QuoteReplyEditDelete

 

 

2010-10-06 05:43:00     Re: ad7879 Positional Values

Michael Hennerich (GERMANY)

Message: 94258    Did you try increasing the TS_PEN_UP_TIMEOUT?

Does the issue go away if you reduce SCL clock frequency?

 

As a note:

Blackfin TWI driver makes Clock high period, tHIGH equal to Clock low period, tLOW.

The AD7879 may operate up to 400kHz SCL, however tHIGHmin != tLOWmin.

 

From the AD7879 datasheet:

t2 1.3 μs min Clock low period, tLOW

t3 0.6 μs min Clock high period, tHIGH

 

So assuming tHIGHmin = tLOWmin = 1.3 μs:

SCLmax = 1/(1.3us + 1.3us) = 384 kHz

 

-Michael

QuoteReplyEditDelete

 

 

2010-10-08 07:58:34     Re: ad7879 Positional Values

Yathindran P (INDIA)

Message: 94334   

 

Hi Michael,

 

We did try to increase TS_PEN_UP_TIMEOUT till 200 but there was no progress, So what we changed CONFIG_I2C_BLACKFIN_TWI_CLK_KHZ=100 back to 100.

 

After changing this is what i did,

 

I Inserted a printk statement to print  x,y,Pressure in ad7879_report() function of ad7879.c and this is what i got for a single tap and release.

 

I got a series correct x,y values and when i released it i got a spurious x,y value. Even though this does not happen always it happens often (say once in 15 times). since the last value is spurious , the release event with pressure 0 is also spurious which is given from ad7879_ts_event_release() which happens after time out of jiffies + TS_PEN_UP_TIMEOUT(50,100,200). I have pasted the values i got for single tap and release and i have marked the spurious value in bold. Do we need a logic in application or tslib to ignore the noise ?

 

Thanks in Advance

 

Yathi

 

x1173 y552 p1117

 

x1173 y552 p779

 

x1191 y501 p791

 

x1195 y510 p674

x1194 y512 p633

 

x1195 y516 p616

 

x1195 y516 p670

 

x1205 y527 p676

 

x1160 y558 p2476

 

x1187 y572 p1473

 

x1227 y622 p1030

 

x1227 y559 p724

 

x1227 y559 p588

 

x1218 y549 p563

 

x1196 y559 p531

 

x1188 y549 p513

 

x1183 y557 p509

 

x1183 y557 p515

 

x1194 y568 p512

 

x1213 y589 p566

 

  x1216 y619 p807

 

  x1158 y580 p1149

 

  x1131 y4002 p140039

QuoteReplyEditDelete

 

 

2010-10-08 08:08:30     Re: ad7879 Positional Values

Michael Hennerich (GERMANY)

Message: 94336    In ad7879_report() can you also printk x,y,z1 and z2.

 

x = ts->conversion_data[AD7879_SEQ_XPOS] & MAX_12BIT;

y = ts->conversion_data[AD7879_SEQ_YPOS] & MAX_12BIT;

z1 = ts->conversion_data[AD7879_SEQ_Z1] & MAX_12BIT;

z2 = ts->conversion_data[AD7879_SEQ_Z2] & MAX_12BIT;

 

It should be easy to add some filter that suppresses events that have

an out of range pressure value associated.

 

-Michael

QuoteReplyEditDelete

 

 

2010-10-08 08:39:42     Re: ad7879 Positional Values

Yathindran P (INDIA)

Message: 94337   

 

Hi Michael,

 

I have pasted Z1 and Z2 values below. This is also for a single tap and remove

 

X660 Y646 Z1- 444 Z2- 3029 Rt582

 

X712 Y608 Z1- 438 Z2- 3000 Rt630

 

X716 Y609 Z1- 434 Z2- 3065 Rt657

 

X721 Y623 Z1- 423 Z2- 3049 Rt678

 

X724 Y627 Z1- 441 Z2- 3033 Rt644

 

X723 Y625 Z1- 439 Z2- 3035 Rt647

 

X724 Y626 Z1- 424 Z2 -3056 Rt680

 

X728 Y622 Z1- 6 Z2- 3570 Rt65456

 

X1236 Y3557 Z1- 6 Z2- 3570 Rt111131

 

Thanks in Advance,

yathi

QuoteReplyEditDelete

 

 

2010-10-11 11:54:44     Re: ad7879 Positional Values

Yathindran P (INDIA)

Message: 94407   

 

Hi Michael,

 

Out of the many samples i took, i get abnormal x,y positional values and high pressure values when z1 is too low. Also observed that when z1 is too low Y value increases. Is it advisable to have a filter to ignore when value in  z1 is too low ?

 

Also observed that when things are working fine,  z1 : z2 are in ratio 1:2 or 1:3 ? 

 

Can you also please tell how X,Y positional values are obtained for release events ?

 

 

 

Thanks in Advance,

 

yathindran

QuoteReplyEditDelete

 

 

2010-10-13 03:55:26     Re: ad7879 Positional Values

Michael Hennerich (GERMANY)

Message: 94461    Please try this patch. It's pretty common do to range filtering.

You can set pressure_max, that fits your touchscreen characteristics in your platform data.

A good value here - can be 2^12 = 4096.

 

drivers/input/touchscreen/ad7879.c | 7 +++++++

1 files changed, 7 insertions(+), 0 deletions(-)

 

diff --git a/drivers/input/touchscreen/ad7879.c b/drivers/input/touchscreen/ad7879.c

index ba6f0bd..355265a 100644

--- a/drivers/input/touchscreen/ad7879.c

+++ b/drivers/input/touchscreen/ad7879.c

@@ -175,6 +175,13 @@ static int ad7879_report(struct ad7879 *ts)

Rt /= z1;

Rt = (Rt + 2047) >> 12;

 

+ /*

+ * Sample found inconsistent by debouncing or pressure is beyond

+ * the maximum. Don't report it to user space

+ */

+ if (Rt > ts->pressure_max)

+ return -EINVAL;

+

if (!timer_pending(&ts->timer))

input_report_key(input_dev, BTN_TOUCH, 1);

 

I'll commit this patch soon.

 

-Michael

QuoteReplyEditDelete

 

 

2010-10-15 06:49:43     Re: ad7879 Positional Values

Yathindran P (INDIA)

Message: 94559   

 

Hi Michael,

 

I added and your path and tested , For values with large deviation the patch seems to work fine but in some cases( say once in 50 touches) i get data like the one below for a single touch. Is there any othe relationships between x,y,z1,z2 which can be used to filter erronous data ?

 

 

 

X 563 Y 3776 Z1 1340 Z2 3290 Rt 124

X 550 Y 3764 Z1 1962 Z2 3257 Rt 55

 

X 541 Y 3768 Z1 1960 Z2 3265 Rt 55

 

X 543 Y 3786 Z1 1265 Z2 3518 Rt 146

 

X 1594 Y 3774 Z1 1265 Z2 3518 Rt 430

 

Regards,

Yathindran

QuoteReplyEditDelete

 

 

2010-10-15 07:56:12     Re: ad7879 Positional Values

Michael Hennerich (GERMANY)

Message: 94560    >

 

The AD7879 median and average filters are supposed to suppress these

out of range events.

 

  docs.blackfin.uclinux.org/doku.php?id=linux-kernel:drivers:ad7879

 

Let me take a look if I can replicate errors on my side as well.

QuoteReplyEditDelete

 

 

2010-10-15 10:55:14     Re: ad7879 Positional Values

Michael Hennerich (GERMANY)

Message: 94565    >

Indeed I could verify, such behavior on a Blackfin platform.

In appears that sometimes the last sample of a touch series

includes these out of range values.

 

Based on the fact that this only happens in the last sample of the

repeated conversion sequence. We can simply skip the last.

This doesn't cause noticeable side effects, since the minimum

conversion interval is 9.44ms. We receive 100 waypoint samples

per second, so we simply delay the result by 9.44ms.

Actually this patch repeats the first waypoint twice and then skips the last.

 

Can you have a try - in the meantime I try to figure out why this happens.

 

 

Index: drivers/input/touchscreen/ad7879.c

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

--- drivers/input/touchscreen/ad7879.c (revision 9200)

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

@@ -129,6 +129,9 @@

u16 cmd_crtl1;

u16 cmd_crtl2;

u16 cmd_crtl3;

+ int x;

+ int y;

+ int Rt;

};

 

static int ad7879_read(struct ad7879 *ts, u8 reg)

@@ -175,13 +178,29 @@

Rt /= z1;

Rt = (Rt + 2047) >> 12;

 

- if (!timer_pending(&ts->timer))

+ /*

+ * Sample found inconsistent, pressure is beyond

+ * the maximum. Don't report it to user space.

+ */

+ if (Rt > ts->pressure_max)

+ return -EINVAL;

+

+ if (!timer_pending(&ts->timer)) {

+ ts->x = x;

+ ts->y = y;

+ ts->Rt = Rt;

input_report_key(input_dev, BTN_TOUCH, 1);

+ }

+

+ input_report_abs(input_dev, ABS_X, ts->x);

+ input_report_abs(input_dev, ABS_Y, ts->y);

+ input_report_abs(input_dev, ABS_PRESSURE, ts->Rt);

+ input_sync(input_dev);

 

- input_report_abs(input_dev, ABS_X, x);

- input_report_abs(input_dev, ABS_Y, y);

- input_report_abs(input_dev, ABS_PRESSURE, Rt);

- input_sync(input_dev);

+ ts->x = x;

+ ts->y = y;

+ ts->Rt = Rt;

+

return 0;

}

QuoteReplyEditDelete

 

 

2010-10-22 08:01:33     Re: ad7879 Positional Values

Yathindran P (INDIA)

Message: 94872   

 

Hi Michael,

 

Yes as u said most of the out of the range values appear at the last event but sometimes when environment is loaded i am getting only one sample. In some cases they are right and in some they are wrong. In this case the first sample is same as the last sample and hence out of range value appears.

 

is there anyway to increase the number of samples obtained for a touch by changing the value ad7879_platform_data ? please advice

 

Thanks a lot for ur patch.

 

Is there any specific reason why this out of range problem occurs in BF527 ?

 

regards,

 

Yathindran

QuoteReplyEditDelete

 

 

2010-10-22 08:14:19     Re: ad7879 Positional Values

Michael Hennerich (GERMANY)

Message: 94873    > Yes as u said most of the out of the range values appear at the last

> event but sometimes when environment is loaded i am getting only one

> sample.

 

Sorry I don't understand - what do you mean by "environment is loaded".

 

> is there anyway to increase the number of samples obtained for a touch

> by changing the value ad7879_platform_data ? please advice

 

I assume you are currently using 255 for pen_down_acc_interval?

 

/* [0..255] 0=OFF Starts at 1=550us and goes

* all the way to 9.440ms in steps of 35us.

*/

u8 pen_down_acc_interval;

 

Decreasing this value will increase the number of reported events/second.

 

> Is there any specific reason why this out of range problem occurs in

> BF527 ?

 

The issue with the last event reported bad is not specific to the platform.

It may happen everywhere.

 

However the other issue you reported at high I2C clocks with sometimes 1 second

delay is caused by the Blackfin TWI bus driver.

 

-Michael

QuoteReplyEditDelete

 

 

2010-10-22 09:19:50     Re: ad7879 Positional Values

Yathindran P (INDIA)

Message: 94875   

 

Hi Michael,

 

i did reduce pen_down_acc_interval till 50 and checked , still i am getting only one sample for a single tap and release.

 

However this happens only when multiple taps are done given quickly. If the time duration between 2 different taps is more than 1 second, many samples are obtained(in which sometimes only last sample will be out of range).

 

can you see any specific reason behind this behavior ?

 

 

 

Regards,

 

Yathindran

QuoteReplyEditDelete

 

 

2010-10-22 10:45:20     Re: ad7879 Positional Values

Michael Hennerich (GERMANY)

Message: 94877    > can you see any specific reason behind this behavior ?

 

No - for me this sounds like the bug in i2c-bfin-twi.

What release are you using?

 

Can you try to put some debug print code which triggers if

 

!wait_for_completion_timeout(&iface->complete, adap->timeout))

 

i2c-bfin-twi on svn trunk already prints an error.

2009R1 kernel doesn't.

 

 

[--snip--]

 

while (!iface->result) {

if (!wait_for_completion_timeout(&iface->complete,

adap->timeout)) {

iface->result = -1;

dev_err(&adap->dev, "smbus transfer timeout\n");

}

}

 

[--snip--]

 

while (!iface->result) {

if (!wait_for_completion_timeout(&iface->complete,

adap->timeout)) {

iface->result = -1;

dev_err(&adap->dev, "smbus transfer timeout\n");

}

}

[--snip--]

QuoteReplyEditDelete

 

 

2010-10-22 12:44:19     Re: ad7879 Positional Values

Yathindran P (INDIA)

Message: 94886   

 

Hi Michael,

 

Well i am using 2009R1 and release. I did add those print statements inside "if(!wait_for_completion_timeout(&iface->complete,adap->timeout)) " . When the issue occured these prints were not printed :-(

 

 

 

regards

 

Yathindran

 

2010-10-01 04:41:03     ad7879 Positional Values

Jayaprabhu Nadarajan (INDIA)

Message: 94104   

 

Hi,

 

We are using BF527 board with ad7879 touch controller. The X and Y coordinates returned from the  driver is wrong sometimes. Following is the set of output for press and release at same region

     x=29    y=207

     x=31    y=205

     x=31    y=207

     x=37    y=207

     x=39    y=207

     x=38    y=210

     x=31    y=209

     x=29    y=213

     x=28    y=208

     x=30    y=206

     x=31    y=205

     x=28    y=208

     x=30    y=208

     x=33    y=212

     x=28    y=206

     x=29    y=209

     x=36    y=202

     x=36    y=203

     x=41    y=201

     x=45    y=205

     x=52    y=202

     x=53    y=208

     x=42    y=207

     x=45    y=203

     x=320   y=213

     x=41    y=200

     x=317   y=207

     x=39    y=204

     x=35    y=202

     x=318   y=195

     x=43    y=203

     x=33    y=201

     x=35    y=207

     x=36    y=203

 

For same region x becomes 320,317,318 .. which is wrong. We tried configuring the median and averaging filter values to avoid this noise but still the same issue remains.

Could you please let us know how to avoid this issue.

 

TIA

 

Regards,

Jp

QuoteReplyEditDelete

 

 

2010-10-01 05:06:31     ad7879 Positional Values

Michael Hennerich (GERMANY)

Message: 94105    Are you using the SPI or I2C option of the driver?

Can you explain how you connected it?

 

I never seen such out of area samples.

QuoteReplyEditDelete

 

 

2010-10-06 05:31:58     Re: ad7879 Positional Values

Jayaprabhu Nadarajan (INDIA)

Message: 94255   

 

Hi Michael,

 

We are using I2C option of the driver and the frequency is 400KHz.

 

Regards,

 

JP

QuoteReplyEditDelete

 

 

2010-10-06 05:43:00     Re: ad7879 Positional Values

Michael Hennerich (GERMANY)

Message: 94258    Did you try increasing the TS_PEN_UP_TIMEOUT?

Does the issue go away if you reduce SCL clock frequency?

 

As a note:

Blackfin TWI driver makes Clock high period, tHIGH equal to Clock low period, tLOW.

The AD7879 may operate up to 400kHz SCL, however tHIGHmin != tLOWmin.

 

From the AD7879 datasheet:

t2 1.3 μs min Clock low period, tLOW

t3 0.6 μs min Clock high period, tHIGH

 

So assuming tHIGHmin = tLOWmin = 1.3 μs:

SCLmax = 1/(1.3us + 1.3us) = 384 kHz

 

-Michael

QuoteReplyEditDelete

 

 

2010-10-08 07:58:34     Re: ad7879 Positional Values

Yathindran P (INDIA)

Message: 94334   

 

Hi Michael,

 

We did try to increase TS_PEN_UP_TIMEOUT till 200 but there was no progress, So what we changed CONFIG_I2C_BLACKFIN_TWI_CLK_KHZ=100 back to 100.

 

After changing this is what i did,

 

I Inserted a printk statement to print  x,y,Pressure in ad7879_report() function of ad7879.c and this is what i got for a single tap and release.

 

I got a series correct x,y values and when i released it i got a spurious x,y value. Even though this does not happen always it happens often (say once in 15 times). since the last value is spurious , the release event with pressure 0 is also spurious which is given from ad7879_ts_event_release() which happens after time out of jiffies + TS_PEN_UP_TIMEOUT(50,100,200). I have pasted the values i got for single tap and release and i have marked the spurious value in bold. Do we need a logic in application or tslib to ignore the noise ?

 

Thanks in Advance

 

Yathi

 

x1173 y552 p1117

 

x1173 y552 p779

 

x1191 y501 p791

 

x1195 y510 p674

x1194 y512 p633

 

x1195 y516 p616

 

x1195 y516 p670

 

x1205 y527 p676

 

x1160 y558 p2476

 

x1187 y572 p1473

 

x1227 y622 p1030

 

x1227 y559 p724

 

x1227 y559 p588

 

x1218 y549 p563

 

x1196 y559 p531

 

x1188 y549 p513

 

x1183 y557 p509

 

x1183 y557 p515

 

x1194 y568 p512

 

x1213 y589 p566

 

  x1216 y619 p807

 

  x1158 y580 p1149

 

  x1131 y4002 p140039

QuoteReplyEditDelete

 

 

2010-10-08 08:08:30     Re: ad7879 Positional Values

Michael Hennerich (GERMANY)

Message: 94336    In ad7879_report() can you also printk x,y,z1 and z2.

 

x = ts->conversion_data[AD7879_SEQ_XPOS] & MAX_12BIT;

y = ts->conversion_data[AD7879_SEQ_YPOS] & MAX_12BIT;

z1 = ts->conversion_data[AD7879_SEQ_Z1] & MAX_12BIT;

z2 = ts->conversion_data[AD7879_SEQ_Z2] & MAX_12BIT;

 

It should be easy to add some filter that suppresses events that have

an out of range pressure value associated.

 

-Michael

QuoteReplyEditDelete

 

 

2010-10-08 08:39:42     Re: ad7879 Positional Values

Yathindran P (INDIA)

Message: 94337   

 

Hi Michael,

 

I have pasted Z1 and Z2 values below. This is also for a single tap and remove

 

X660 Y646 Z1- 444 Z2- 3029 Rt582

 

X712 Y608 Z1- 438 Z2- 3000 Rt630

 

X716 Y609 Z1- 434 Z2- 3065 Rt657

 

X721 Y623 Z1- 423 Z2- 3049 Rt678

 

X724 Y627 Z1- 441 Z2- 3033 Rt644

 

X723 Y625 Z1- 439 Z2- 3035 Rt647

 

X724 Y626 Z1- 424 Z2 -3056 Rt680

 

X728 Y622 Z1- 6 Z2- 3570 Rt65456

 

X1236 Y3557 Z1- 6 Z2- 3570 Rt111131

 

Thanks in Advance,

yathi

QuoteReplyEditDelete

 

 

2010-10-11 11:54:44     Re: ad7879 Positional Values

Yathindran P (INDIA)

Message: 94407   

 

Hi Michael,

 

Out of the many samples i took, i get abnormal x,y positional values and high pressure values when z1 is too low. Also observed that when z1 is too low Y value increases. Is it advisable to have a filter to ignore when value in  z1 is too low ?

 

Also observed that when things are working fine,  z1 : z2 are in ratio 1:2 or 1:3 ? 

 

Can you also please tell how X,Y positional values are obtained for release events ?

 

 

 

Thanks in Advance,

 

yathindran

QuoteReplyEditDelete

 

 

2010-10-13 03:55:26     Re: ad7879 Positional Values

Michael Hennerich (GERMANY)

Message: 94461    Please try this patch. It's pretty common do to range filtering.

You can set pressure_max, that fits your touchscreen characteristics in your platform data.

A good value here - can be 2^12 = 4096.

 

drivers/input/touchscreen/ad7879.c | 7 +++++++

1 files changed, 7 insertions(+), 0 deletions(-)

 

diff --git a/drivers/input/touchscreen/ad7879.c b/drivers/input/touchscreen/ad7879.c

index ba6f0bd..355265a 100644

--- a/drivers/input/touchscreen/ad7879.c

+++ b/drivers/input/touchscreen/ad7879.c

@@ -175,6 +175,13 @@ static int ad7879_report(struct ad7879 *ts)

Rt /= z1;

Rt = (Rt + 2047) >> 12;

 

+ /*

+ * Sample found inconsistent by debouncing or pressure is beyond

+ * the maximum. Don't report it to user space

+ */

+ if (Rt > ts->pressure_max)

+ return -EINVAL;

+

if (!timer_pending(&ts->timer))

input_report_key(input_dev, BTN_TOUCH, 1);

 

I'll commit this patch soon.

 

-Michael

QuoteReplyEditDelete

 

 

2010-10-15 06:49:43     Re: ad7879 Positional Values

Yathindran P (INDIA)

Message: 94559   

 

Hi Michael,

 

I added and your path and tested , For values with large deviation the patch seems to work fine but in some cases( say once in 50 touches) i get data like the one below for a single touch. Is there any othe relationships between x,y,z1,z2 which can be used to filter erronous data ?

 

 

 

X 563 Y 3776 Z1 1340 Z2 3290 Rt 124

X 550 Y 3764 Z1 1962 Z2 3257 Rt 55

 

X 541 Y 3768 Z1 1960 Z2 3265 Rt 55

 

X 543 Y 3786 Z1 1265 Z2 3518 Rt 146

 

X 1594 Y 3774 Z1 1265 Z2 3518 Rt 430

 

Regards,

Yathindran

QuoteReplyEditDelete

 

 

2010-10-15 07:56:12     Re: ad7879 Positional Values

Michael Hennerich (GERMANY)

Message: 94560    >

 

The AD7879 median and average filters are supposed to suppress these

out of range events.

 

  docs.blackfin.uclinux.org/doku.php?id=linux-kernel:drivers:ad7879

 

Let me take a look if I can replicate errors on my side as well.

QuoteReplyEditDelete

 

 

2010-10-15 10:55:14     Re: ad7879 Positional Values

Michael Hennerich (GERMANY)

Message: 94565    >

Indeed I could verify, such behavior on a Blackfin platform.

In appears that sometimes the last sample of a touch series

includes these out of range values.

 

Based on the fact that this only happens in the last sample of the

repeated conversion sequence. We can simply skip the last.

This doesn't cause noticeable side effects, since the minimum

conversion interval is 9.44ms. We receive 100 waypoint samples

per second, so we simply delay the result by 9.44ms.

Actually this patch repeats the first waypoint twice and then skips the last.

 

Can you have a try - in the meantime I try to figure out why this happens.

 

 

Index: drivers/input/touchscreen/ad7879.c

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

--- drivers/input/touchscreen/ad7879.c (revision 9200)

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

@@ -129,6 +129,9 @@

u16 cmd_crtl1;

u16 cmd_crtl2;

u16 cmd_crtl3;

+ int x;

+ int y;

+ int Rt;

};

 

static int ad7879_read(struct ad7879 *ts, u8 reg)

@@ -175,13 +178,29 @@

Rt /= z1;

Rt = (Rt + 2047) >> 12;

 

- if (!timer_pending(&ts->timer))

+ /*

+ * Sample found inconsistent, pressure is beyond

+ * the maximum. Don't report it to user space.

+ */

+ if (Rt > ts->pressure_max)

+ return -EINVAL;

+

+ if (!timer_pending(&ts->timer)) {

+ ts->x = x;

+ ts->y = y;

+ ts->Rt = Rt;

input_report_key(input_dev, BTN_TOUCH, 1);

+ }

+

+ input_report_abs(input_dev, ABS_X, ts->x);

+ input_report_abs(input_dev, ABS_Y, ts->y);

+ input_report_abs(input_dev, ABS_PRESSURE, ts->Rt);

+ input_sync(input_dev);

 

- input_report_abs(input_dev, ABS_X, x);

- input_report_abs(input_dev, ABS_Y, y);

- input_report_abs(input_dev, ABS_PRESSURE, Rt);

- input_sync(input_dev);

+ ts->x = x;

+ ts->y = y;

+ ts->Rt = Rt;

+

return 0;

}

QuoteReplyEditDelete

 

 

2010-10-22 08:01:33     Re: ad7879 Positional Values

Yathindran P (INDIA)

Message: 94872   

 

Hi Michael,

 

Yes as u said most of the out of the range values appear at the last event but sometimes when environment is loaded i am getting only one sample. In some cases they are right and in some they are wrong. In this case the first sample is same as the last sample and hence out of range value appears.

 

is there anyway to increase the number of samples obtained for a touch by changing the value ad7879_platform_data ? please advice

 

Thanks a lot for ur patch.

 

Is there any specific reason why this out of range problem occurs in BF527 ?

 

regards,

 

Yathindran

QuoteReplyEditDelete

 

 

2010-10-22 08:14:19     Re: ad7879 Positional Values

Michael Hennerich (GERMANY)

Message: 94873    > Yes as u said most of the out of the range values appear at the last

> event but sometimes when environment is loaded i am getting only one

> sample.

 

Sorry I don't understand - what do you mean by "environment is loaded".

 

> is there anyway to increase the number of samples obtained for a touch

> by changing the value ad7879_platform_data ? please advice

 

I assume you are currently using 255 for pen_down_acc_interval?

 

/* [0..255] 0=OFF Starts at 1=550us and goes

* all the way to 9.440ms in steps of 35us.

*/

u8 pen_down_acc_interval;

 

Decreasing this value will increase the number of reported events/second.

 

> Is there any specific reason why this out of range problem occurs in

> BF527 ?

 

The issue with the last event reported bad is not specific to the platform.

It may happen everywhere.

 

However the other issue you reported at high I2C clocks with sometimes 1 second

delay is caused by the Blackfin TWI bus driver.

 

-Michael

QuoteReplyEditDelete

 

 

2010-10-22 09:19:50     Re: ad7879 Positional Values

Yathindran P (INDIA)

Message: 94875   

 

Hi Michael,

 

i did reduce pen_down_acc_interval till 50 and checked , still i am getting only one sample for a single tap and release.

 

However this happens only when multiple taps are done given quickly. If the time duration between 2 different taps is more than 1 second, many samples are obtained(in which sometimes only last sample will be out of range).

 

can you see any specific reason behind this behavior ?

 

 

 

Regards,

 

Yathindran

QuoteReplyEditDelete

 

 

2010-10-22 10:45:20     Re: ad7879 Positional Values

Michael Hennerich (GERMANY)

Message: 94877    > can you see any specific reason behind this behavior ?

 

No - for me this sounds like the bug in i2c-bfin-twi.

What release are you using?

 

Can you try to put some debug print code which triggers if

 

!wait_for_completion_timeout(&iface->complete, adap->timeout))

 

i2c-bfin-twi on svn trunk already prints an error.

2009R1 kernel doesn't.

 

 

[--snip--]

 

while (!iface->result) {

if (!wait_for_completion_timeout(&iface->complete,

adap->timeout)) {

iface->result = -1;

dev_err(&adap->dev, "smbus transfer timeout\n");

}

}

 

[--snip--]

 

while (!iface->result) {

if (!wait_for_completion_timeout(&iface->complete,

adap->timeout)) {

iface->result = -1;

dev_err(&adap->dev, "smbus transfer timeout\n");

}

}

[--snip--]

QuoteReplyEditDelete

 

 

2010-10-22 12:44:19     Re: ad7879 Positional Values

Yathindran P (INDIA)

Message: 94886   

 

Hi Michael,

 

Well i am using 2009R1 and release. I did add those print statements inside "if(!wait_for_completion_timeout(&iface->complete,adap->timeout)) " . When the issue occured these prints were not printed :-(

 

 

 

regards

 

Yathindran

Attachments

    Outcomes