Received: by 2002:a17:90b:8d0:0:0:0:0 with SMTP id ds16csp4881098pjb; Mon, 27 Jul 2020 07:29:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLzy03qyv6ZXaoB+QAqTR7Fv3nnumlPkxiwVhfb6eEzxTpQoGKs/N1rhL4bQruqqjUr2Fo X-Received: by 2002:a17:906:f2cb:: with SMTP id gz11mr3584497ejb.58.1595860187658; Mon, 27 Jul 2020 07:29:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595860187; cv=none; d=google.com; s=arc-20160816; b=aL2LwpnX01j5tLz6nWc1N5aHF/8mKxLG2ZnNmcvXTiwiCd/zQq9DHzsDM/Y+Mmye7M J9w+Ekp4BrD2f1QFwawggP81lzzv/3IikaKCKHAGh9DW4hwskjgcZET5bAjWk5Jod6sW sTdOEHS/rkT5BLKWL6P9JYn9D8KmTImW+swleSfqpExFkY2Mbcf503+DYMTrcNBAdt7F +GI6kfNUyXN9bkufvjJv6Lo7ItmxbhgtgVN0t56A11KG0X1Q/HXFib9E40WAKTAhR9E0 NZWPQbVltpphuc2u4A/xbfuaDyIxrYkJFmbCSBXr4oq4hJPOLYyLAZZcR6tiBO7y3LjN Ov3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=R1DTIVtECmfHB0W176Rzh/tuc7XZcCMw5JaWJ/OxbaA=; b=mR9XOfi0TzvbFbxwt5XXkuDPdBYBHyIo8b5UMfZTRW2/7XOLhQrxTq+6Y6g02EWyDn 6qhi41SEe0dqUWCspty/MdWIwHY/rPrva7cs+IUctVk9EystZ9JtuOegHX9IB/welB/z tpMlnMPA2PiaYhlP445+9e8OzcpDIZKBvXS10OT7ms6QEI+BjjjkmZXkgzJ1Ri8EnnWR 4Iqb4oNdUHNI42z5NLHKC60UrRl9BBRSR6C7y7UqE+eCeQPIYcfkAWB0cQU+HlEj69LF nt+RZzEnazTCWS9TJLNCf6Vc9bMlZyxRPCfJTHGAk0eDZNVbemUUYoYXn1/ixUgUw0WU JOhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZRYnqueR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 12si5698565edx.70.2020.07.27.07.29.25; Mon, 27 Jul 2020 07:29:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZRYnqueR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732328AbgG0O2N (ORCPT + 99 others); Mon, 27 Jul 2020 10:28:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:54586 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730619AbgG0OYw (ORCPT ); Mon, 27 Jul 2020 10:24:52 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AE99E2075A; Mon, 27 Jul 2020 14:24:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595859892; bh=qR3qR1P8zCZPBL7I5aiHn7cQAkCbUrhl/7b8QvE1Xlo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZRYnqueRcJF8vRC1yL9uF4spC10xtdBFN+876DhC3HE9bKuczX85ZsNJH4Smos52k u2OfBRBgHZvNM64dS3eAb9rIqU34mFzJZQyyxM8pE6poruv+Kjb/+RUkvTsNkTZuVt 96qRYxTTR2yWmX7bFcA351fbkcPimxdplPwrD3+Y= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Derek Basehore , Dmitry Torokhov , Sasha Levin Subject: [PATCH 5.7 118/179] Input: elan_i2c - only increment wakeup count on touch Date: Mon, 27 Jul 2020 16:04:53 +0200 Message-Id: <20200727134938.403057177@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200727134932.659499757@linuxfoundation.org> References: <20200727134932.659499757@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Derek Basehore [ Upstream commit 966334dfc472bdfa67bed864842943b19755d192 ] This moves the wakeup increment for elan devices to the touch report. This prevents the drivers from incorrectly reporting a wakeup when the resume callback resets then device, which causes an interrupt to occur. Signed-off-by: Derek Basehore Link: https://lore.kernel.org/r/20200706235046.1984283-1-dbasehore@chromium.org Signed-off-by: Dmitry Torokhov Signed-off-by: Sasha Levin --- drivers/input/mouse/elan_i2c_core.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c index 8719da5403834..196e8505dd8d7 100644 --- a/drivers/input/mouse/elan_i2c_core.c +++ b/drivers/input/mouse/elan_i2c_core.c @@ -951,6 +951,8 @@ static void elan_report_absolute(struct elan_tp_data *data, u8 *packet) u8 hover_info = packet[ETP_HOVER_INFO_OFFSET]; bool contact_valid, hover_event; + pm_wakeup_event(&data->client->dev, 0); + hover_event = hover_info & 0x40; for (i = 0; i < ETP_MAX_FINGERS; i++) { contact_valid = tp_info & (1U << (3 + i)); @@ -974,6 +976,8 @@ static void elan_report_trackpoint(struct elan_tp_data *data, u8 *report) u8 *packet = &report[ETP_REPORT_ID_OFFSET + 1]; int x, y; + pm_wakeup_event(&data->client->dev, 0); + if (!data->tp_input) { dev_warn_once(&data->client->dev, "received a trackpoint report while no trackpoint device has been created. Please report upstream.\n"); @@ -998,7 +1002,6 @@ static void elan_report_trackpoint(struct elan_tp_data *data, u8 *report) static irqreturn_t elan_isr(int irq, void *dev_id) { struct elan_tp_data *data = dev_id; - struct device *dev = &data->client->dev; int error; u8 report[ETP_MAX_REPORT_LEN]; @@ -1016,8 +1019,6 @@ static irqreturn_t elan_isr(int irq, void *dev_id) if (error) goto out; - pm_wakeup_event(dev, 0); - switch (report[ETP_REPORT_ID_OFFSET]) { case ETP_REPORT_ID: elan_report_absolute(data, report); @@ -1026,7 +1027,7 @@ static irqreturn_t elan_isr(int irq, void *dev_id) elan_report_trackpoint(data, report); break; default: - dev_err(dev, "invalid report id data (%x)\n", + dev_err(&data->client->dev, "invalid report id data (%x)\n", report[ETP_REPORT_ID_OFFSET]); } -- 2.25.1