Re: Liyitec PS/2 touch panel driver [PATCH]

From: Dmitry Torokhov
Date: Tue Jan 31 2006 - 23:18:45 EST


On Tuesday 31 January 2006 17:59, Shaun Jackman wrote:
> +
> +static int liyitec_connect(struct serio *serio, struct serio_driver *drv)
> +{
> + struct liyitec *liyitec;
> + struct input_dev *input_dev;
> + int retval;
> +
> + liyitec = kzalloc(sizeof *liyitec, GFP_KERNEL);
> + input_dev = input_allocate_device();
> + if (liyitec == NULL || input_dev == NULL) {
> + retval = -ENOMEM;
> + goto out;
> + }
> +
> + liyitec->serio = serio;
> + liyitec->dev = input_dev;
> + sprintf(liyitec->phys, "%s/input0", serio->phys);
> +
> + input_dev->private = liyitec;
> + input_dev->name = "Liyitec PS/2 touch screen";
> + input_dev->phys = liyitec->phys;
> + input_dev->id.bustype = BUS_I8042;
> + input_dev->id.vendor = SERIO_LIYITEC;
> + input_dev->id.product = 0;
> + input_dev->id.version = 0x0100;
> + input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
> + input_dev->keybit[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH);
> + input_dev->keybit[LONG(BTN_MOUSE)] = BIT(BTN_RIGHT);
> + input_set_abs_params(liyitec->dev, ABS_X, 0, LIYITEC_MAX_X, 0, 0);
> + input_set_abs_params(liyitec->dev, ABS_Y, 0, LIYITEC_MAX_Y, 0, 0);
> +
> + serio_set_drvdata(serio, liyitec);
> + retval = serio_open(serio, drv);
> + if (retval)
> + goto out;
> + input_register_device(liyitec->dev);
> +
> + liyitec->count = -2;
> + retval = serio_write(serio, LIYITEC_CMD_SETSTREAM);
> + if (retval)
> + goto out;
> + retval = serio_write(serio, LIYITEC_CMD_ENABLE);
> +

Hi Shaun,

Thank you for adding support for the new touchscreen, however I have a
couple of questions:

What stops this driver form binding to serio ports that have devices other
that Liyitec touchscreen connected to them? Such as keyboard port when
keyboard works in non-translated mode or regular AUX port with standard
PS/2 mouse? Is there a way to query for presence of the touchscreen?

Moreover this driver should be integrated into psmouse so proper protocol
is selected automatically.

--
Dmitry
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/