From patchwork Tue Jun 7 13:34:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Chiu X-Patchwork-Id: 9161313 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1C10860572 for ; Tue, 7 Jun 2016 13:34:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0C71221C9A for ; Tue, 7 Jun 2016 13:34:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 011292656B; Tue, 7 Jun 2016 13:34:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8B05021C9A for ; Tue, 7 Jun 2016 13:34:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933018AbcFGNeW (ORCPT ); Tue, 7 Jun 2016 09:34:22 -0400 Received: from mail-pf0-f179.google.com ([209.85.192.179]:36487 "EHLO mail-pf0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932728AbcFGNeU (ORCPT ); Tue, 7 Jun 2016 09:34:20 -0400 Received: by mail-pf0-f179.google.com with SMTP id t190so4277439pfb.3 for ; Tue, 07 Jun 2016 06:34:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=endlessm-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=XZ+q7CHe+umndr2IXgiqyITHZvYHzq/IsIUQGY6Rfec=; b=fyrOugJWuYgUEj3VIPg8Yfq1kVoXwhj307Rwbqq4rkn4IspJuRLtkM90Z8pKoRxpVN 0n9qlpEUFI6yX2zlYTb4sJ37da0xDJLgf4h+NMMQbV7FQYm3whvDLT3Tuw8CNeROg5nv TIPHElhLU/RUQlicExcV+CJuaAEtuFVxIQxH2ww0Vy+RZ45C+uMjcA8JRECCfeC5KSUs SF+JFa1TBityZO4brdcN+hiOPqUqn7m+po6Oqcs8QRwFlyCEpH4fbXdPpzxlFF2Saz4y WPS3X9tBGsid7jt0XEOzYbHgSeOnJXX/DC6lRwkZe+4JhwGI59Wegb1LqKXXtfp7f1F8 gZgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=XZ+q7CHe+umndr2IXgiqyITHZvYHzq/IsIUQGY6Rfec=; b=FPAHJOUpHEbnVWVYLPOm7tjK+aSCPJiXwnzAa/ozlFkIQmyFA0eEXCOBLzQ/lEMSm/ Fwa2lYFRqu971e0IZKF5MQmjbYa70ZccQK8LWMKx2tMlL4jIyQWfNczEk1voQTZt6Unh +AJ9NnnxkNd+DT8FmHhpnY12GsLIzWr7zTQluqFnzTX5K+j8/SReEf0ZBXFxi49ISz2x sTtxpVoLc+n9HLIj3NogZ6Gv7YKZtV41Clq5ZJhjEZRTZOaEkIjlC+z+fv6eWDR4U4er TWDCTfj/KTUpK239xyxeFJ8MQ5DfhX8eS6a4/8RoW3evTDV02g6Qx93OVDHSnKcn3KW3 ityg== X-Gm-Message-State: ALyK8tLgArw+T0weFEGh0u34+Xi+32xO8Y3xS5tPF9Omrxr/A4HWxHb+spvphBBOuQkEZHWu X-Received: by 10.98.94.194 with SMTP id s185mr32101512pfb.32.1465306458975; Tue, 07 Jun 2016 06:34:18 -0700 (PDT) Received: from localhost.localdomain (36-234-246-153.dynamic-ip.hinet.net. [36.234.246.153]) by smtp.gmail.com with ESMTPSA id m65sm14474311pfm.91.2016.06.07.06.34.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Jun 2016 06:34:17 -0700 (PDT) From: Chris Chiu To: Dmitry Torokhov , duson , Charlie Mooney , Michele Curti , Krzysztof Kozlowski , Benson Leung , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Cc: linux@endlessm.com, Chris Chiu Subject: [PATCH] Input: elan_i2c - +200 ms delay before setting to ABS mode Date: Tue, 7 Jun 2016 21:34:09 +0800 Message-Id: <1465306449-28256-1-git-send-email-chiu@endlessm.com> X-Mailer: git-send-email 2.1.4 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When performing a warm reboot from a system which does not correctly support ELAN I2C touchpads, the touchpad will sometimes enter standard mouse mode, cursor then never respond to touchpad event, and making the driver discard the HID reports and flood dmesg with following error messages. "elan_i2c i2c-ELAN1000:00: invalid report id data (1)" This change is from ELAN's correction. It needs 200ms delay before set_mode() so that the mode setting will correctly take effect. Signed-off-by: Chris Chiu --- drivers/input/mouse/elan_i2c_core.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c index 2f58985..95080f9 100644 --- a/drivers/input/mouse/elan_i2c_core.c +++ b/drivers/input/mouse/elan_i2c_core.c @@ -210,18 +210,20 @@ static int __elan_initialize(struct elan_tp_data *data) return error; } - data->mode |= ETP_ENABLE_ABS; - error = data->ops->set_mode(client, data->mode); + error = data->ops->sleep_control(client, false); if (error) { dev_err(&client->dev, - "failed to switch to absolute mode: %d\n", error); + "failed to wake device up: %d\n", error); return error; } - error = data->ops->sleep_control(client, false); + msleep(200); + + data->mode |= ETP_ENABLE_ABS; + error = data->ops->set_mode(client, data->mode); if (error) { dev_err(&client->dev, - "failed to wake device up: %d\n", error); + "failed to switch to absolute mode: %d\n", error); return error; }