From patchwork Sat Aug 30 14:10:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulrik De Bie X-Patchwork-Id: 4813511 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7D6279F38C for ; Sat, 30 Aug 2014 14:11:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A82322012D for ; Sat, 30 Aug 2014 14:11:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 77C15200E5 for ; Sat, 30 Aug 2014 14:11:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751688AbaH3OL2 (ORCPT ); Sat, 30 Aug 2014 10:11:28 -0400 Received: from e2big.org ([198.61.226.133]:47764 "EHLO e2big.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751620AbaH3OL2 (ORCPT ); Sat, 30 Aug 2014 10:11:28 -0400 Received: from 78-23-174-213.access.telenet.be ([78.23.174.213] helo=lantern.debie) by e2big.org with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1XNjNH-0001XH-FD; Sat, 30 Aug 2014 16:11:27 +0200 From: Ulrik De Bie To: Dmitry Torokhov Cc: linux-input@vger.kernel.org, Hans de Goede , David Herrmann , ulrik.debie-os@e2big.org Subject: [PATCH 1/5] Input: elantech - use elantech_report_trackpoint for hardware v4 too Date: Sat, 30 Aug 2014 16:10:42 +0200 Message-Id: <1409407846-15449-2-git-send-email-ulrik.debie-os@e2big.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1409407846-15449-1-git-send-email-ulrik.debie-os@e2big.org> References: <1409407846-15449-1-git-send-email-ulrik.debie-os@e2big.org> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The Fujitsu H730 has hardware v4 with a trackpoint. This enables the elantech_report_trackpoint for v4. Reported-by: Stefan Valouch Tested-by: Stefan Valouch Tested-by: Alfredo Gemma Signed-off-by: Ulrik De Bie --- drivers/input/mouse/elantech.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c index da51738..f0a55b4d 100644 --- a/drivers/input/mouse/elantech.c +++ b/drivers/input/mouse/elantech.c @@ -792,6 +792,9 @@ static int elantech_packet_check_v4(struct psmouse *psmouse) unsigned char packet_type = packet[3] & 0x03; bool sanity_check; + if ((packet[3]&0x0f) == 0x06) + return PACKET_TRACKPOINT; + /* * Sanity check based on the constant bits of a packet. * The constant bits change depending on the value of @@ -877,10 +880,19 @@ static psmouse_ret_t elantech_process_byte(struct psmouse *psmouse) case 4: packet_type = elantech_packet_check_v4(psmouse); - if (packet_type == PACKET_UNKNOWN) + switch (packet_type) { + case PACKET_UNKNOWN: return PSMOUSE_BAD_DATA; - elantech_report_absolute_v4(psmouse, packet_type); + case PACKET_TRACKPOINT: + elantech_report_trackpoint(psmouse, packet_type); + break; + + default: + elantech_report_absolute_v4(psmouse, packet_type); + break; + } + break; }