Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp1136984imj; Thu, 14 Feb 2019 01:45:10 -0800 (PST) X-Google-Smtp-Source: AHgI3IZUEoaipD0U+KdJmEwtu74qBilW4N1LO1PRVzHeTJMSCSxy5I5p+NHxPx8P4K39TXK6ZKxg X-Received: by 2002:a62:3541:: with SMTP id c62mr3070302pfa.19.1550137510118; Thu, 14 Feb 2019 01:45:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550137510; cv=none; d=google.com; s=arc-20160816; b=qhAOMelSAFFnnO47utAhK5zTiKDnGBmJm6Zob6rTskILMuQ323U0Xay7Nfz04BZF9V qXtehh/w7fPYQostZ1A1bhqmRsYZYzN14Xey3InM3NWGwK7uvCXfWRKPzIMDiLgJQMaE NSwPoTkwkoAykVozA6C4QgjLO6sjwiPouI7De4QVyU1NPBbssz4Rm4vv+nvfpA5SxuvH 86ZjCSHbV7bnJ8cds1zMo7mnXW122BBUK1FtdVUywb/8vUVlTe4fH7xdmDicDASugmZQ RvucNW6dPDZYTJAU8vBYcFXgaUB2a5ptmKmETv6BEhW1ia2jIzwAbDG7UbxJMqStXyTy 0BTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature; bh=+Yibclb/8YZoG1uf+ycxrOLbKdliyKHb7ODHZ536Yrg=; b=S3bjHO3Rh5NOnKcYXXNSIswXiwfoEGj83p3cIfOf+XQr2lzt7gkrrnWeQOK1zk3SoY jUSF52Bw/dVv4dGruwUZ2PVFrxhiuqJWrRmnvFUMEuaZ0fyEQqJOJIHMTzuS/ZWcmh6G cU6z9b8+d2mSpAv6MpJ3I/eB2ux39DUM2qM8K92IjgPAklmetArNcEVDyWSLgbf4YvPH Jn2vBtZPunQ/hOM3jsfvI409YclNBDWPMSewehicdWmoj/1SFcbaiXUZ6BC/bIEKmD/+ 3aWjFVeYBbAHj/FxE3oWzkGmvoHaHNb70n20N34JuPURgr2X5sGPXBdQxt/Edz1Bz3hx JICQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="cSysp/0G"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id v4si1914652pfm.71.2019.02.14.01.44.53; Thu, 14 Feb 2019 01:45:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="cSysp/0G"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S2390244AbfBMXhd (ORCPT + 99 others); Wed, 13 Feb 2019 18:37:33 -0500 Received: from mail.kernel.org ([198.145.29.99]:48330 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728875AbfBMXhc (ORCPT ); Wed, 13 Feb 2019 18:37:32 -0500 Received: from pobox.suse.cz (prg-ext-pat.suse.com [213.151.95.130]) (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 B27912146E; Wed, 13 Feb 2019 23:37:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550101051; bh=mmw0Cz14/AR/9LF/3AzPMBAHhphh3tGJBq/njSqj7bE=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=cSysp/0Gwp6xQWLvzckob42fhXlEa6YgFSHzyZzYnVeU3oGs7NmS3P1G90Rl4poNk U+XNLQqacGfT/iD/OXDBzHGRJw9zvLLRtDHjDaH17Lt8Fy4Kdo0mmIogq37kXTX/LU Wz3rRVmUw8SVqEHJBPnVuBHT/AGrV0NB4Yh+tHDY= Date: Thu, 14 Feb 2019 00:37:28 +0100 (CET) From: Jiri Kosina To: Jim Broadus cc: kai.heng.feng@canonical.com, benjamin.tissoires@gmail.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] Fix resume for ELAN2097 touchscreen. In-Reply-To: <20190211070040.4569-1-jbroadus@gmail.com> Message-ID: References: <20190211070040.4569-1-jbroadus@gmail.com> User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 10 Feb 2019, Jim Broadus wrote: > Commit 52cf93e63ee6 ("HID: i2c-hid: Don't reset device upon system resume") > fixes the resume behavior of several devices. However, this breaks the > resume on the ELAN2097, used on Dell Inspiron laptops, with the same flood > of messages: > > [27009.817110] i2c_hid i2c-ELAN2097:00: i2c_hid_get_input: incomplete report (67/65535) > [27009.818867] i2c_hid i2c-ELAN2097:00: i2c_hid_get_input: incomplete report (67/65535) > [27009.820623] i2c_hid i2c-ELAN2097:00: i2c_hid_get_input: incomplete report (67/65535) > > This change adds a new I2C_HID_QUIRK_RESET_AFTER_RESUME and replaces the > original reset behavior for this device. > > Signed-off-by: Jim Broadus This should be fixed in hid.git#for-5.1/i2c-hid already by commit 1475af255e18f. Could you please confirm that? > --- > drivers/hid/hid-ids.h | 1 + > drivers/hid/i2c-hid/i2c-hid-core.c | 20 ++++++++++++++------ > 2 files changed, 15 insertions(+), 6 deletions(-) > > diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h > index 24f846d67478..38cc7033712a 100644 > --- a/drivers/hid/hid-ids.h > +++ b/drivers/hid/hid-ids.h > @@ -387,6 +387,7 @@ > #define USB_DEVICE_ID_TOSHIBA_CLICK_L9W 0x0401 > #define USB_DEVICE_ID_HP_X2 0x074d > #define USB_DEVICE_ID_HP_X2_10_COVER 0x0755 > +#define USB_DEVICE_ID_ELAN2097 0x2504 > > #define USB_VENDOR_ID_ELECOM 0x056e > #define USB_DEVICE_ID_ELECOM_BM084 0x0061 > diff --git a/drivers/hid/i2c-hid/i2c-hid-core.c b/drivers/hid/i2c-hid/i2c-hid-core.c > index c5edfa966343..fdbad29b4406 100644 > --- a/drivers/hid/i2c-hid/i2c-hid-core.c > +++ b/drivers/hid/i2c-hid/i2c-hid-core.c > @@ -50,6 +50,7 @@ > #define I2C_HID_QUIRK_NO_IRQ_AFTER_RESET BIT(1) > #define I2C_HID_QUIRK_NO_RUNTIME_PM BIT(2) > #define I2C_HID_QUIRK_DELAY_AFTER_SLEEP BIT(3) > +#define I2C_HID_QUIRK_RESET_AFTER_RESUME BIT(4) > > /* flags */ > #define I2C_HID_STARTED 0 > @@ -181,6 +182,8 @@ static const struct i2c_hid_quirks { > I2C_HID_QUIRK_NO_RUNTIME_PM }, > { I2C_VENDOR_ID_GOODIX, I2C_DEVICE_ID_GOODIX_01F0, > I2C_HID_QUIRK_NO_RUNTIME_PM }, > + { USB_VENDOR_ID_ELAN, USB_DEVICE_ID_ELAN2097, > + I2C_HID_QUIRK_RESET_AFTER_RESUME }, > { 0, 0 } > }; > > @@ -1279,12 +1282,17 @@ static int i2c_hid_resume(struct device *dev) > > enable_irq(client->irq); > > - /* Instead of resetting device, simply powers the device on. This > - * solves "incomplete reports" on Raydium devices 2386:3118 and > - * 2386:4B33 and fixes various SIS touchscreens no longer sending > - * data after a suspend/resume. > - */ > - ret = i2c_hid_set_power(client, I2C_HID_PWR_ON); > + if (ihid->quirks & I2C_HID_QUIRK_RESET_AFTER_RESUME) { > + ret = i2c_hid_hwreset(client); > + } else { > + /* Instead of resetting device, simply powers the device on. > + * This solves "incomplete reports" on Raydium devices 2386:3118 > + * and 2386:4B33 and fixes various SIS touchscreens no longer > + * sending data after a suspend/resume. > + */ > + ret = i2c_hid_set_power(client, I2C_HID_PWR_ON); > + } > + > if (ret) > return ret; > > -- > 2.20.1 > -- Jiri Kosina SUSE Labs