Quantcast
Channel: Embedded Software (Read Only)
Viewing all articles
Browse latest Browse all 25965

Forum Post: RE: AM335xEVM + capacitive touchscreen Sitronix st1232 + ti-sdk-am335x-evm-06.00.00.00 linux

$
0
0

I have found a solution here: http://lists.atmark-techno.com/pipermail/armadillo/2013-July/009068.html

diff --git a/drivers/input/touchscreen/st1232.c b/drivers/input/touchscreen/st1232.c index 4ab3713..170123d 100644 --- a/drivers/input/touchscreen/st1232.c +++ b/drivers/input/touchscreen/st1232.c @@ -26,6 +26,8 @@  #include <linux/slab.h>  #include <linux/types.h>  +#define FORCE_SINGLE_EVENT +  #define ST1232_TS_NAME "st1232-ts"   #define MIN_X  0x00 @@ -100,11 +102,27 @@ static irqreturn_t st1232_ts_irq_handler(int irq, void *dev_id)   struct input_dev *input_dev = ts->input_dev;   int count = 0;   int i, ret; + static int pendown = 0;    ret = st1232_ts_read_data(ts);   if (ret < 0)    goto end;  +#ifdef FORCE_SINGLE_EVENT + for (i = 0; i < 1; i++) { +  if (!finger[i].is_valid) { +   pendown = 0; +   input_report_key(input_dev, BTN_TOUCH, 0); +   input_report_abs(input_dev, ABS_PRESSURE, 0); +  } else { +   if (pendown++ == 0) +    input_report_key(input_dev, BTN_TOUCH, 1); +   input_report_abs(input_dev, ABS_PRESSURE, 1); +   input_report_abs(input_dev, ABS_X, finger[i].x); +   input_report_abs(input_dev, ABS_Y, finger[i].y); +  } + } +#else   /* multi touch protocol */   for (i = 0; i < MAX_FINGERS; i++) {    if (!finger[i].is_valid) @@ -120,6 +138,7 @@ static irqreturn_t st1232_ts_irq_handler(int irq, void *dev_id)   /* SYN_MT_REPORT only if no contact */   if (!count)    input_mt_sync(input_dev); +#endif    /* SYN_REPORT */   input_sync(input_dev); @@ -164,9 +183,16 @@ static int __devinit st1232_ts_probe(struct i2c_client *client,   __set_bit(EV_KEY, input_dev->evbit);   __set_bit(EV_ABS, input_dev->evbit);  +#ifdef FORCE_SINGLE_EVENT + input_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH); + input_set_abs_params(input_dev, ABS_PRESSURE, 0, 1, 0, 0); + input_set_abs_params(input_dev, ABS_X, MIN_X, MAX_X, 0, 0); + input_set_abs_params(input_dev, ABS_Y, MIN_Y, MAX_Y, 0, 0); +#else   input_set_abs_params(input_dev, ABS_MT_TOUCH_MAJOR, 0, MAX_AREA, 0, 0);   input_set_abs_params(input_dev, ABS_MT_POSITION_X, MIN_X, MAX_X, 0, 0);   input_set_abs_params(input_dev, ABS_MT_POSITION_Y, MIN_Y, MAX_Y, 0, 0); +#endif    error = request_threaded_irq(client->irq, NULL, st1232_ts_irq_handler,           IRQF_ONESHOT, client->name, ts);

I think tslib does not understand multi-touch protocol, so the solution is using single-touch in st1232 driver. A better solution would be the latest tslib and Qt with multi-touch support.

Regards


Viewing all articles
Browse latest Browse all 25965

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>