[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20141109080504.GB34700@dtor-ws>
Date: Sun, 9 Nov 2014 00:05:04 -0800
From: Dmitry Torokhov <dmitry.torokhov@...il.com>
To: Pali Rohár <pali.rohar@...il.com>
Cc: Hans de Goede <hdegoede@...hat.com>,
Yunkang Tang <yunkang.tang@...alps.com>,
Tommy Will <tommywill2011@...il.com>,
linux-input@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 4/4] input: alps: Fix trackstick detection
Hi Pali,
On Sun, Nov 02, 2014 at 12:25:10AM +0100, Pali Rohár wrote:
> int alps_detect(struct psmouse *psmouse, bool set_properties)
> {
> - struct alps_data dummy;
> + unsigned char e6[4];
>
> - if (alps_identify(psmouse, &dummy) < 0)
> - return -1;
> + /*
> + * Try "E6 report".
> + * ALPS should return 0,0,10 or 0,0,100 if no buttons are pressed.
> + * The bits 0-2 of the first byte will be 1s if some buttons are
> + * pressed.
> + */
> + if (alps_rpt_cmd(psmouse, PSMOUSE_CMD_SETRES,
> + PSMOUSE_CMD_SETSCALE11, e6))
> + return -EIO;
> +
> + if ((e6[0] & 0xf8) != 0 || e6[1] != 0 || (e6[2] != 10 && e6[2] != 100))
> + return -EINVAL;
>
> if (set_properties) {
> + /*
> + * NOTE: To detect model and trackstick presence we need to do
> + * full device reset. To speed up detection and prevent
> + * calling duplicate initialization sequence (both in
> + * alps_detect() and alps_init()) we set model/protocol
> + * version and correct name in alps_init() (which will
> + * do full device reset). For now set name to DualPoint.
> + */
> psmouse->vendor = "ALPS";
> - psmouse->name = dummy.flags & ALPS_DUALPOINT ?
> - "DualPoint TouchPad" : "GlidePoint";
> - psmouse->model = dummy.proto_version << 8;
> + psmouse->name = "DualPoint TouchPad";
> }
> +
> return 0;
We can't do this; going by e6 only will give us false positives and
alps_detect is supposed to be authoritative.
Thanks.
--
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists