From patchwork Fri Nov 14 19:38:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 5309301 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 55EBFC11AC for ; Fri, 14 Nov 2014 19:41:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 80C0220176 for ; Fri, 14 Nov 2014 19:41:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9D1CC20131 for ; Fri, 14 Nov 2014 19:41:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161830AbaKNTlH (ORCPT ); Fri, 14 Nov 2014 14:41:07 -0500 Received: from mail-wi0-f182.google.com ([209.85.212.182]:57526 "EHLO mail-wi0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752607AbaKNTjB (ORCPT ); Fri, 14 Nov 2014 14:39:01 -0500 Received: by mail-wi0-f182.google.com with SMTP id h11so3713995wiw.15 for ; Fri, 14 Nov 2014 11:39:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=0i5r8hyE00bwPTCSkx0/e/l+h7xqKiMHqIzer5QfKl8=; b=N38SbCYT9/A8JtZN5TTFtK2ORx+DoWUHvEaDcraNJTNf8P15iGzrjf0gTdbvtaCYQx xZU7ZHd02AXB1LPG0A/eNtK6wS9zloGZrUpGC/SkeJCT5zk6ikaH4xPW6vR3/gpDjUYh Yej5iF70cBFWL3Pq8Oy1C6MvwYezxgaG6zBeN9C3qyvp9Xo7l/TYqVVvw6JYMe7hU+f3 MqF4ZRlffUgm9jJDCrmkfK2XU35ObSmJooMdTJQqYwdidBb0BKlDLpKC1c/FBAsQHG+1 FtzqN6LATIyXNWmYLlRk0mjnGho4VYJdeSiPd76vdC3UcfMFwbnd643IxD417IvMmVyO OBew== X-Received: by 10.194.235.135 with SMTP id um7mr17263611wjc.1.1415993940525; Fri, 14 Nov 2014 11:39:00 -0800 (PST) Received: from Pali-Latitude.kolej.mff.cuni.cz (pali.kolej.mff.cuni.cz. [78.128.193.202]) by mx.google.com with ESMTPSA id wr9sm40768945wjb.42.2014.11.14.11.38.59 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 14 Nov 2014 11:38:59 -0800 (PST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Dmitry Torokhov , Hans de Goede Cc: Yunkang Tang , Vadim Klishko , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Pali=20Roh=C3=A1r?= Subject: [PATCH 3/7] input: alps: Move alps_dolphin_get_device_area into alps_hw_init_dolphin_v1 Date: Fri, 14 Nov 2014 20:38:22 +0100 Message-Id: <1415993906-13307-4-git-send-email-pali.rohar@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1415993906-13307-1-git-send-email-pali.rohar@gmail.com> References: <1415993906-13307-1-git-send-email-pali.rohar@gmail.com> MIME-Version: 1.0 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.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_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 This patch moves function call alps_dolphin_get_device_area() from function alps_identify() to alps_hw_init_dolphin_v1() so alps_identify() will not call any other psmouse commands. Signed-off-by: Pali Rohár --- drivers/input/mouse/alps.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c index cbfdcfc..5603870 100644 --- a/drivers/input/mouse/alps.c +++ b/drivers/input/mouse/alps.c @@ -1991,9 +1991,9 @@ error: return -1; } -static int alps_dolphin_get_device_area(struct psmouse *psmouse, - struct alps_data *priv) +static int alps_dolphin_get_device_area(struct psmouse *psmouse) { + struct alps_data *priv = psmouse->private; struct ps2dev *ps2dev = &psmouse->ps2dev; unsigned char param[4] = {0}; int num_x_electrode, num_y_electrode; @@ -2042,6 +2042,9 @@ static int alps_hw_init_dolphin_v1(struct psmouse *psmouse) struct ps2dev *ps2dev = &psmouse->ps2dev; unsigned char param[2]; + if (alps_dolphin_get_device_area(psmouse)) + return -EIO; + /* This is dolphin "v1" as empirically defined by florin9doi */ param[0] = 0x64; param[1] = 0x28; @@ -2223,10 +2226,8 @@ static int alps_identify(struct psmouse *psmouse, struct alps_data *priv) ec[0] == 0x73 && (ec[1] == 0x01 || ec[1] == 0x02)) { priv->proto_version = ALPS_PROTO_V5; alps_set_defaults(priv); - if (alps_dolphin_get_device_area(psmouse, priv)) - return -EIO; - else - return 0; + + return 0; } else if (ec[0] == 0x88 && ((ec[1] & 0xf0) == 0xb0 || (ec[1] & 0xf0) == 0xc0)) { priv->proto_version = ALPS_PROTO_V7;