XInput: Atmel maXTouch Digitizer touch screen

Ben Bucksch linux.news at bucksch.org
Mon Dec 26 09:59:24 PST 2011


On 22.12.2011 16:47, Chase Douglas wrote:
> If I had to guess, BTN_TOOL_FINGER is likely still getting in the way 
> of things in the evdev driver.
> ...
> the maXTouch chips are handled by atmel_mx_ts in 
> drivers/input/touchscreen/atmel_mx_ts.c.

I now hacked this file in a very crude way, by removing some of the 
finger code. Patch below.

This has the effect that the random spurious clicks are gone, but I now 
need a double-tap ("double-click") to effect a mouse click, and 
effecting a double click is almost impossible. Some click areas do not 
take my clicks at all (e.g. the app menu *icon* of XFCE4, while it works 
with a normal mouse), while others do (e.g. the label next to said icon).

So, it is barely usable, which is already progress, but not there yet. 
Unfortunately, that's about as far as I can go myself, without blindly 
stabbing in the dark.

Ben

--- atmel_mxt_ts.c.org  2011-12-26 00:24:57.603744096 +0100
+++ atmel_mxt_ts.c      2011-12-26 18:52:19.525592791 +0100
@@ -510,54 +510,17 @@ static int mxt_write_object(struct mxt_d
                 return -EINVAL;

         reg = object->start_address;
         return mxt_write_reg(data->client, reg + offset, val);
  }

  static void mxt_input_report(struct mxt_data *data, int single_id)
  {
-       struct mxt_finger *finger = data->finger;
         struct input_dev *input_dev = data->input_dev;
-       int status = finger[single_id].status;
-       int finger_num = 0;
-       int id;
-
-       for (id = 0; id < MXT_MAX_FINGER; id++) {
-               if (!finger[id].status)
-                       continue;
-
-               input_mt_slot(input_dev, id);
-               input_mt_report_slot_state(input_dev, MT_TOOL_FINGER,
-                               finger[id].status != MXT_RELEASE);
-
-               if (finger[id].status != MXT_RELEASE) {
-                       finger_num++;
-                       input_report_abs(input_dev, ABS_MT_TOUCH_MAJOR,
-                                       finger[id].area);
-                       input_report_abs(input_dev, ABS_MT_POSITION_X,
-                                       finger[id].x);
-                       input_report_abs(input_dev, ABS_MT_POSITION_Y,
-                                       finger[id].y);
-                       input_report_abs(input_dev, ABS_MT_PRESSURE,
-                                       finger[id].pressure);
-               } else {
-                       finger[id].status = 0;
-               }
-       }
-
-       input_report_key(input_dev, BTN_TOUCH, finger_num > 0);
-
-       if (status != MXT_RELEASE) {
-               input_report_abs(input_dev, ABS_X, finger[single_id].x);
-               input_report_abs(input_dev, ABS_Y, finger[single_id].y);
-               input_report_abs(input_dev,
-                                ABS_PRESSURE, finger[single_id].pressure);
-       }
-
         input_sync(input_dev);
  }

  static void mxt_input_touchevent(struct mxt_data *data,
                                       struct mxt_message *message, int id)
  {
         struct mxt_finger *finger = data->finger;
         struct device *dev = &data->client->dev;
@@ -1122,27 +1085,16 @@ static int __devinit mxt_probe(struct i2
         /* For single touch */
         input_set_abs_params(input_dev, ABS_X,
                              0, data->max_x, 0, 0);
         input_set_abs_params(input_dev, ABS_Y,
                              0, data->max_y, 0, 0);
         input_set_abs_params(input_dev, ABS_PRESSURE,
                              0, 255, 0, 0);

-       /* For multi touch */
-       input_mt_init_slots(input_dev, MXT_MAX_FINGER);
-       input_set_abs_params(input_dev, ABS_MT_TOUCH_MAJOR,
-                            0, MXT_MAX_AREA, 0, 0);
-       input_set_abs_params(input_dev, ABS_MT_POSITION_X,
-                            0, data->max_x, 0, 0);
-       input_set_abs_params(input_dev, ABS_MT_POSITION_Y,
-                            0, data->max_y, 0, 0);
-       input_set_abs_params(input_dev, ABS_MT_PRESSURE,
-                            0, 255, 0, 0);
-
         input_set_drvdata(input_dev, data);
         i2c_set_clientdata(client, data);

         error = mxt_initialize(data);
         if (error)
                 goto err_free_object;

         error = request_threaded_irq(client->irq, NULL, mxt_interrupt,




More information about the xorg mailing list