Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4337179pxj; Tue, 8 Jun 2021 11:51:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQTQTvql5W9MgLD8XBh0DSB9Lkhaf2aTQBOpiNocesUIl+8KH0idvhtOj5ddESX2ac36kk X-Received: by 2002:a17:906:394:: with SMTP id b20mr24859488eja.108.1623178272819; Tue, 08 Jun 2021 11:51:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623178272; cv=none; d=google.com; s=arc-20160816; b=q/3mMXuURDbtwBO3i5RMYYsTt0Tp1o7RMOXoB9oGfOtiiP/TcjaoRxVCoxhM/sWZmL ayJA0IXwM1aX3PenFKIiiJ972DFv3oS5UuE6rvYPiTQoBmEVZEW+D2a8lmxMlIQDv2va ipgcIclcC9AWIScGw1F+hkLdSE8TDPkpXrzwAbwP5Y9zmdbhMzPN5evd7mrQlWCE64K8 5ycCFn4GSHgckMEggj9V+ZCLzY+dIjwn07cKv66TBYSFoDtTcmaXEVZ5Jake3ykXHRqp p8ro6qUh8V1kLONrzv8a82/IEm8Eoi2zL+BAxjZEZbYyeBU9JmicKHJtjy7GixxrbNFl iMFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=e47MMPzrEHPyX04FcX0ra8DR3f9FKIMD5WPmcD/H6iM=; b=FgasoUd0U4MNxzQTlUEuKja6pUNn8baugZ/ExhXDIJWbWYKb3Bc4AOyfyUZHUl1u+9 6xnjIiN7IdTEsbL9IaCT8FXrwikV4lmkBFwRW4lXT2pugmCmmy1BEYO5t8n02+5NqWBk RKcwrJw6yIP+I7+NezzQlIlIaCOT02Emo1mQrpwKdCy4RTKp6J0LDUQPTHLJaTsiSWFV WF1axJrfr6C81xD7/JTh7rJ+l0PmErhr5LX1+L4TI8T77Jk4sT9jfJhVZeBa1fWkar1e hHH/Li0QtgnMNkdrRkrTL/WfepVD4wcKmtGjKFsrjaVQ6GALaQbnF4ufRKREPVpdoxAQ Pp7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=OkhpeRb0; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e24si365007ejl.425.2021.06.08.11.50.48; Tue, 08 Jun 2021 11:51:12 -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=@linuxfoundation.org header.s=korg header.b=OkhpeRb0; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236175AbhFHSuB (ORCPT + 99 others); Tue, 8 Jun 2021 14:50:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:42390 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235813AbhFHSpJ (ORCPT ); Tue, 8 Jun 2021 14:45:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6BA1E613E7; Tue, 8 Jun 2021 18:36:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1623177416; bh=aIVceECrece3lKh6IYH5h0B+zZvoHSSwcqkerJK00yo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OkhpeRb0SUpzhuC3zgUq/DE9DEVSoEYzrFM+HAbW5qRDadooW/9OAvdyKd7kUzAt1 6WEoaqf5V7DW670wSjdG0wp4t6RNiX+jS6GmG2v3+jcL5nznXI4xNem2Qy+yjOig6U fi+XP87OL/Vepm4IcLCjnwOHUGmPLWCaWnvxKgZ0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johnny Chuang , Harry Cutts , Douglas Anderson , Benjamin Tissoires Subject: [PATCH 5.4 44/78] HID: i2c-hid: Skip ELAN power-on command after reset Date: Tue, 8 Jun 2021 20:27:13 +0200 Message-Id: <20210608175936.753729257@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210608175935.254388043@linuxfoundation.org> References: <20210608175935.254388043@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Johnny Chuang commit ca66a6770bd9d6d99e469debd1c7363ac455daf9 upstream. For ELAN touchscreen, we found our boot code of IC was not flexible enough to receive and handle this command. Once the FW main code of our controller is crashed for some reason, the controller could not be enumerated successfully to be recognized by the system host. therefore, it lost touch functionality. Add quirk for skip send power-on command after reset. It will impact to ELAN touchscreen and touchpad on HID over I2C projects. Fixes: 43b7029f475e ("HID: i2c-hid: Send power-on command after reset"). Cc: stable@vger.kernel.org Signed-off-by: Johnny Chuang Reviewed-by: Harry Cutts Reviewed-by: Douglas Anderson Tested-by: Douglas Anderson Signed-off-by: Benjamin Tissoires Signed-off-by: Greg Kroah-Hartman --- drivers/hid/i2c-hid/i2c-hid-core.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) --- 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_BOGUS_IRQ BIT(4) #define I2C_HID_QUIRK_RESET_ON_RESUME BIT(5) #define I2C_HID_QUIRK_BAD_INPUT_SIZE BIT(6) +#define I2C_HID_QUIRK_NO_WAKEUP_AFTER_RESET BIT(7) /* flags */ @@ -185,6 +186,11 @@ static const struct i2c_hid_quirks { I2C_HID_QUIRK_RESET_ON_RESUME }, { USB_VENDOR_ID_ITE, I2C_DEVICE_ID_ITE_LENOVO_LEGION_Y720, I2C_HID_QUIRK_BAD_INPUT_SIZE }, + /* + * Sending the wakeup after reset actually break ELAN touchscreen controller + */ + { USB_VENDOR_ID_ELAN, HID_ANY_ID, + I2C_HID_QUIRK_NO_WAKEUP_AFTER_RESET }, { 0, 0 } }; @@ -468,7 +474,8 @@ static int i2c_hid_hwreset(struct i2c_cl } /* At least some SIS devices need this after reset */ - ret = i2c_hid_set_power(client, I2C_HID_PWR_ON); + if (!(ihid->quirks & I2C_HID_QUIRK_NO_WAKEUP_AFTER_RESET)) + ret = i2c_hid_set_power(client, I2C_HID_PWR_ON); out_unlock: mutex_unlock(&ihid->reset_lock);