[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110824143520.GB23868@thinkpad-t410>
Date: Wed, 24 Aug 2011 09:35:20 -0500
From: Seth Forshee <seth.forshee@...onical.com>
To: JJ Ding <jj_ding@....com.tw>
Cc: linux-input@...r.kernel.org, linux-kernel@...r.kernel.org,
Dmitry Torokhov <dmitry.torokhov@...il.com>,
Aaron Huang <aaron_huang@....com.tw>,
Tom Lin <tom_lin@....com.tw>,
Éric Piel <E.A.B.Piel@...elft.nl>,
Daniel Kurtz <djkurtz@...omium.org>,
Chase Douglas <chase.douglas@...onical.com>,
Henrik Rydberg <rydberg@...omail.se>,
Alessandro Rubini <rubini@...l.unipv.it>
Subject: Re: [PATCH v2 7/7] Input: elantech - add v3 hardware support
On Wed, Aug 24, 2011 at 01:44:46PM +0800, JJ Ding wrote:
> @@ -403,11 +503,39 @@ static int elantech_packet_check_v2(struct psmouse *psmouse)
> }
>
> /*
> + * We check the constant bits to determine what packet type we get,
> + * so packet checking is mandatory for v3 hardware.
> + */
> +static int elantech_packet_check_v3(struct psmouse *psmouse)
> +{
> + unsigned char *packet = psmouse->packet;
> +
> + if ((packet[0] & 0x0c) == 0x04 &&
> + (packet[3] & 0xcf) == 0x02)
> + return PACKET_V3_HEAD;
> +
> + if ((packet[0] & 0x0c) == 0x0c &&
> + (packet[3] & 0xce) == 0x0c)
> + return PACKET_V3_TAIL;
> +
> + if (packet[0] == 0xc4 &&
> + packet[1] == 0xff &&
> + packet[2] == 0xff &&
> + packet[3] == 0x02 &&
> + packet[4] == 0xff &&
> + packet[5] == 0xff)
> + return PACKET_DEBOUNCE;
> +
> + return PACKET_UNKNOWN;
> +}
This will never return PACKET_DEBOUNCE, because those packets will have
already matched the conditions for PACKET_V3_HEAD. That condition needs
to be moved to the top of the function.
Seth
--
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