From patchwork Fri Nov 14 19:38:20 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: 5309151 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 026CAC11AC for ; Fri, 14 Nov 2014 19:39:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EA39E20211 for ; Fri, 14 Nov 2014 19:39:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3BAA0201F4 for ; Fri, 14 Nov 2014 19:39:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754219AbaKNTjB (ORCPT ); Fri, 14 Nov 2014 14:39:01 -0500 Received: from mail-wi0-f174.google.com ([209.85.212.174]:62303 "EHLO mail-wi0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161540AbaKNTiy (ORCPT ); Fri, 14 Nov 2014 14:38:54 -0500 Received: by mail-wi0-f174.google.com with SMTP id h11so456542wiw.7 for ; Fri, 14 Nov 2014 11:38:53 -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=Vi7le7bAXUIpFa1tY7fLhna79Xr3LbzIKURkVmou9jU=; b=RJulvm3Ta/dR7A85wAsWPVkSStoZf1YnEynUBTho0oxgWeva3xAW8z2XjG7x0HpaPz PFmbdDqiBeaQ/acPGDXB3lvLcA4A6USSxsWJXfAB3oij9Wo4+EZt8KsdTSXLp5jKKp2b VM0t/HQDBydG1JYtxzv3beEoiBu44ZcTFcD+1msEmpf9HW2CxZcvryLIpUZWD+cxdhun wKB6B20ien1tlc16P0G1tkLkHfC/u6WXveVA7vaZJLS+2bXNm+9mCsJ2MNjw5zi7cZ1L qnPr8xASARwL9CkcbLXD3DjbwkyB7edtB44JQK2fmoPG6RFzDPZmR9tqXCTO7rErN5P3 Mdsg== X-Received: by 10.180.75.116 with SMTP id b20mr10055612wiw.49.1415993933769; Fri, 14 Nov 2014 11:38:53 -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.52 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 14 Nov 2014 11:38:52 -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 1/7] input: alps: Set correct name of psmouse device in alps_init() Date: Fri, 14 Nov 2014 20:38:20 +0100 Message-Id: <1415993906-13307-2-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 On some laptops after starting them from off state (not after reboot), function alps_probe_trackstick_v3() (called from function alps_identify()) does not detect trackstick. To fix this problem we need to reset device. But function alps_identify() is called also from alps_detect() and we do not want to reset device in detect function because it will slow down initialization of all other non alps devices. This patch moves code for setting correct device name & protocol from function alps_detect() to alps_init() which already doing full device reset. So this patch removes need to do trackstick detection in alps_detect() function. Signed-off-by: Pali Rohár --- drivers/input/mouse/alps.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c index 8d85c79..9ffa98d 100644 --- a/drivers/input/mouse/alps.c +++ b/drivers/input/mouse/alps.c @@ -2392,6 +2392,10 @@ int alps_init(struct psmouse *psmouse) if (input_register_device(priv->dev2)) goto init_fail; + if (!(priv->flags & ALPS_DUALPOINT)) + psmouse->name = "GlidePoint TouchPad"; + psmouse->model = priv->proto_version; + psmouse->protocol_handler = alps_process_byte; psmouse->poll = alps_poll; psmouse->disconnect = alps_disconnect; @@ -2422,11 +2426,18 @@ int alps_detect(struct psmouse *psmouse, bool set_properties) return -1; 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; }