From patchwork Tue Mar 19 16:27:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "James M. Leddy" X-Patchwork-Id: 229130 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 12A1A2C00A2 for ; Wed, 20 Mar 2013 03:27:42 +1100 (EST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1UHzNw-0007BL-Ly; Tue, 19 Mar 2013 16:27:36 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1UHzNq-000765-Tl for kernel-team@lists.ubuntu.com; Tue, 19 Mar 2013 16:27:30 +0000 Received: from ool-43509a93.dyn.optonline.net ([67.80.154.147] helo=neptune) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1UHzNq-0000Kp-Mb for kernel-team@lists.ubuntu.com; Tue, 19 Mar 2013 16:27:30 +0000 From: James M Leddy To: kernel-team@lists.ubuntu.com Subject: [Raring][PATCH 08/13] Input: ALPS - rework detection of Pinnacle AGx touchpads Date: Tue, 19 Mar 2013 12:27:07 -0400 Message-Id: <1363710432-6172-9-git-send-email-james.leddy@canonical.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1363710432-6172-1-git-send-email-james.leddy@canonical.com> References: <1363710432-6172-1-git-send-email-james.leddy@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com From: Kevin Cernekee The official ALPS driver uses the EC report, not the E7 report, to detect these devices. Also, they check for a range of values; the original table-based code only checked for two specific ones. Signed-off-by: Kevin Cernekee Tested-by: Dave Turvene Signed-off-by: Dmitry Torokhov (cherry picked from commit f673ceb11b880e8535476326612e54c3e0cace5b) --- drivers/input/mouse/alps.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c index 2221a00..eafeae2 100644 --- a/drivers/input/mouse/alps.c +++ b/drivers/input/mouse/alps.c @@ -109,8 +109,6 @@ static const struct alps_model_info alps_model_data[] = { { { 0x73, 0x02, 0x50 }, 0x00, ALPS_PROTO_V2, 0xcf, 0xcf, ALPS_FOUR_BUTTONS }, /* Dell Vostro 1400 */ { { 0x52, 0x01, 0x14 }, 0x00, ALPS_PROTO_V2, 0xff, 0xff, ALPS_PASS | ALPS_DUALPOINT | ALPS_PS2_INTERLEAVED }, /* Toshiba Tecra A11-11L */ - { { 0x73, 0x02, 0x64 }, 0x9b, ALPS_PROTO_V3, 0x8f, 0x8f, ALPS_DUALPOINT }, - { { 0x73, 0x02, 0x64 }, 0x9d, ALPS_PROTO_V3, 0x8f, 0x8f, ALPS_DUALPOINT }, { { 0x73, 0x02, 0x64 }, 0x8a, ALPS_PROTO_V4, 0x8f, 0x8f, 0 }, }; @@ -1412,6 +1410,10 @@ error: static void alps_set_defaults(struct alps_data *priv) { + priv->byte0 = 0x8f; + priv->mask0 = 0x8f; + priv->flags = ALPS_DUALPOINT; + switch (priv->proto_version) { case ALPS_PROTO_V1: case ALPS_PROTO_V2: @@ -1491,8 +1493,15 @@ static int alps_identify(struct psmouse *psmouse, struct alps_data *priv) alps_exit_command_mode(psmouse)) return -EIO; - if (alps_match_table(psmouse, priv, e7, ec) == 0) + if (alps_match_table(psmouse, priv, e7, ec) == 0) { + return 0; + } else if (ec[0] == 0x88 && ec[1] == 0x07 && + ec[2] >= 0x90 && ec[2] <= 0x9d) { + priv->proto_version = ALPS_PROTO_V3; + alps_set_defaults(priv); + return 0; + } psmouse_info(psmouse, "Unknown ALPS touchpad: E7=%2.2x %2.2x %2.2x, EC=%2.2x %2.2x %2.2x\n",