Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp211787ybh; Mon, 20 Jul 2020 14:42:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyh1MrtwZNjdnfGNYa49eEySXQADi7+DKT9d1KXW5us4mAAr4B43eaRwSd56dn0rk0mh8RO X-Received: by 2002:a17:906:dbe5:: with SMTP id yd5mr22794670ejb.328.1595281374965; Mon, 20 Jul 2020 14:42:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595281374; cv=none; d=google.com; s=arc-20160816; b=GyGHTkeEN2fEHTttWLt3+gTlGwGQNhwo6KI5j9Ik73lAueQSL/ELzbx0pE06/2WXwg NYy6MwEov2smDcBNfUH9ILJPkip8E7Uwed8Rc1q8PSkf3LpQENkloUw0XwKVlNREjkDR 9KDeCXq31J3Z0s60ATVAiU779MpfII2ggz2x/j6sxt/zG9sC285R5NS88Akzu7+Q7X53 8Ggh+dYEG3wNqABt1wiiPRC/Acy/Gl3YDFaS3Nw3Zey9oslm42sJqlmkp2mRHmMMRd88 LWAuP6JRDc21lOkpmShrHo76JivgBrA/9/BoaHWXlENL0Kwq9kHTAKtIEKbyd/q4gF5w g/hg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=3acAFC/RUNRq4WMtk0iIEw6wOMn2D4iZaaAsKQV/k7Q=; b=YkyLiwRopue4hSiNd317W+sCe+khhvNLdX3W5lRvbVyZFjejh7KYK5Vzqt6IyWq2mN Py1lFWJmheP7G8/fMERfchDRO+kvHKyp1G/A9ZmnH3U5lF1OcRcmIsWpkDJQ/eq+ktSX UUcznCDHHIMH7L7fkDhRfoEjzvQpd9zlO8f6XURRipdlGVY+bgVaEMGjqzfXAmv8kUHE DMaEha+kq6ISZ5Znt8YDqSOQeQ53veMQYE4QjXAUblrN92HFSj6CmD7ZMMMWEa+qosjh DesYtjD3xBW7UUJ+CCKKfnCTqG96Y5CI3ZBG72WnNqfWkF4c9qENXl5JX6+/VCL9f89u 1Ruw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="HEIxq/am"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lr3si9480074ejb.525.2020.07.20.14.42.31; Mon, 20 Jul 2020 14:42:54 -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="HEIxq/am"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728527AbgGTVji (ORCPT + 99 others); Mon, 20 Jul 2020 17:39:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:58252 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728347AbgGTVjG (ORCPT ); Mon, 20 Jul 2020 17:39:06 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A247622BF5; Mon, 20 Jul 2020 21:39:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595281146; bh=ck+t5BO0KC/lWu1r0TlgaUuIVf2Zmt5Tke3WUWETRiI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HEIxq/amYic9Ft+gLkTpSYd2C6xtRgqAXZTHs6Dexrtfn0sg9q1S0GLrydH64NxNs POEv7xrsJGbNMhkisXjn1a93fcek9z/RAZxuWLTmAvgDWZaKOjHMBYk+fUYxKUPr5v v+9Tqid1TSNY3YFdO1dtLjDp3BXT+SLQxkDoLLhc= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Derek Basehore , Dmitry Torokhov , Sasha Levin , linux-input@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 12/19] Input: elan_i2c - only increment wakeup count on touch Date: Mon, 20 Jul 2020 17:38:43 -0400 Message-Id: <20200720213851.407715-12-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200720213851.407715-1-sashal@kernel.org> References: <20200720213851.407715-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore 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 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c index ae012639ae1d5..82afaca2e1a67 100644 --- a/drivers/input/mouse/elan_i2c_core.c +++ b/drivers/input/mouse/elan_i2c_core.c @@ -917,6 +917,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)); @@ -939,6 +941,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"); @@ -963,7 +967,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]; @@ -989,7 +992,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