Dear Akio, Marty:
Thanks for you.
I have finished the calibration of touch screen in spitz platform.
But I tuned it by manually, change the value and observe the behavior
in android.
The following the what I modified in linux-2.6.23/drivers/input/
touchscreen/corgi_ts.c
---
corgi_ts.c.org 2008-05-13 18:36:20.000000000 +0800
+++ corgi_ts.c 2008-05-22 13:07:56.000000000 +0800
@@ -167,8 +167,10 @@
return 0;
}
- corgi_ts->tc.x = x;
- corgi_ts->tc.y = y;
+ corgi_ts->tc.x = y - 300;
+ corgi_ts->tc.y = x - 200;
+
+
corgi_ts->tc.pressure = (x * (z2 - z1)) / z1;
return 1;
}
@@ -176,6 +178,7 @@
static void new_data(struct corgi_ts *corgi_ts)
{
struct input_dev *dev = corgi_ts->input;
+ int x,y;
if (corgi_ts->power_mode != PWR_MODE_ACTIVE)
return;
@@ -183,8 +186,15 @@
if (!corgi_ts->tc.pressure && corgi_ts->pendown == 0)
return;
- input_report_abs(dev, ABS_X, corgi_ts->tc.x);
- input_report_abs(dev, ABS_Y, corgi_ts->tc.y);
+ x = X_AXIS_MAX - corgi_ts->tc.x -220;
+ x = (x*106)/100;
+ y= corgi_ts->tc.y + 190;
+ y= (y*105)/100;
+
+ /*input_report_abs(dev, ABS_X, X_AXIS_MAX - corgi_ts->tc.x);*/
+ /*input_report_abs(dev, ABS_Y, corgi_ts->tc.y + 200);*/
+ input_report_abs(dev, ABS_X, x);
+ input_report_abs(dev, ABS_Y, y);
input_report_abs(dev, ABS_PRESSURE, corgi_ts->tc.pressure);
input_report_key(dev, BTN_TOUCH, corgi_ts->pendown);
input_sync(dev);
@@ -215,6 +225,8 @@
/* Enable Falling Edge */
set_irq_type(corgi_ts->irq_gpio, IRQT_FALLING);
corgi_ts->pendown = 0;
+ input_report_key(corgi_ts->input, BTN_TOUCH, corgi_ts-
>pendown);
+ input_sync(corgi_ts->input);
}
}
@@ -266,6 +278,17 @@
#define corgits_suspend NULL
#define corgits_resume NULL
#endif
+static int corgits_open(struct input_dev *input)
+{
+ printk("corgi_ts: open\n");
+ return 0;
+}
+
+static void corgits_close(struct input_dev *input)
+{
+ printk("corgi_ts: close\n");
+ return;
+}
static int __init corgits_probe(struct platform_device *pdev)
{
@@ -301,6 +324,8 @@
input_dev->id.product = 0x0002;
input_dev->id.version = 0x0100;
input_dev->dev.parent = &pdev->dev;
+ input_dev->open = corgits_open;
+ input_dev->close = corgits_close;
input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
input_dev->keybit[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH);