From nobody Mon Nov 25 01:33:58 2024 Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9D80B1494C2; Thu, 31 Oct 2024 07:34:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730360073; cv=none; b=TFFbcuxIYTD2aW1HAKtDmCpz7R9zDDG/HzzHla/H49SL8QcaELLPq9go8JEo759B9A2DTvYZjW1Afl2oR6fSzE1BP2HqTdA5qsJPm1guZhgLzKH2biAsvc2NmbN4kbTjBedQzp8Ruv2xRINnueBnnsSpnWljjTck0X4TJsgoVtc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730360073; c=relaxed/simple; bh=e6Pog+PUJbgFvmtTAGykTj42o4bKFsOKM7Q8vc2hwBo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BrTTLAX2LuteY5WAy4L4gwymTt8h+bFR2xL4M4WkKn4TDkCyMuHS3oqpdrw34uZd7gdBvDq22QZ/vqIezzLvUTqVmFzPYd4yA5UJlgoZAoAmVkRWD8poQsGfpcPZOdq6Z5Nhw1hUagfiYtdZHMtSbDnoCsuYmjBrq0NkONcAbBY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=SfqaJOqv; arc=none smtp.client-ip=209.85.128.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SfqaJOqv" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-43167ff0f91so5396265e9.1; Thu, 31 Oct 2024 00:34:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730360070; x=1730964870; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9+UmhsMuI1nWwTKnlzdKf3OeCG7YqHV/PjXBwOIOpZE=; b=SfqaJOqvEA8G7PoSSgrKovIVwrtuXYu1ELVYqz8E78b11hm42Q678UIbnMi4XGT9w1 vITFBeE5/NZM9YS9ioHc9JMtIX0zBj2koFwLPKE0kcS6Su59J/+TBrVbKfAPXugQ1rO/ QbSQDLge+ree9k5rgbLZk1d9zLxvXXjqFI/9zAYlEvAtcFmgnCXsjf1D5QEgdr6C/q3K +ZOOuQI/V3nnB2TOS5fmXA3vU7WdlRwaod03e6pRKz5o2lmbQDj4pfuEUVTT3/+3LxRP RpU/gkRgSCwl4ht8kE+hNH/tBE5x9xP2FlBX1GKXUck+N/QbVbQveUOiBrBX6giBFQbN scJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730360070; x=1730964870; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9+UmhsMuI1nWwTKnlzdKf3OeCG7YqHV/PjXBwOIOpZE=; b=XT43vwQQaNPxruq+aoiYaj4AcRJmHtBgcLZ+/y81V6NDVuIaPGGsg+PLjN5YfcZqgA PDN/xkMafi4NYwFDJPmkdjRtzUpLl0lRraFDnI1VFztpONll7CcEkVDjv7or5/d40iUk 1SIcUL2tDmyJTB8YJT+g3zLNO9TU4XZV4ULhhq4ZJeSJP1eB6+xvsENqYXfV0h9tGjar lK3jDpJ5uG6GIi+1D2Yb62UHsa2PUzKzFewiN3hmrntg0tTZssThy4dLegUqBIspC6qL F4FH2to0evvZrl1JTNTl10uCVT/Hod/aSCIK046NqV0sm21qs7+x2ylaHVXMhVely8wT 2OPg== X-Forwarded-Encrypted: i=1; AJvYcCW1eUajNrlouRnBoDq6FO1IFPLio2cGYIuQDK3W8KuR6mUursHcBippgT7r4HDFWrVJBmTqXrvv9OPvaw==@vger.kernel.org, AJvYcCXLF9nv0o4ZwO+QFHAMJtapCoAwW9BRN14054O/dgUfdEUUpq5eLnkxvM4N76FCiRAKhfTr1GLvWe/E0rIj@vger.kernel.org X-Gm-Message-State: AOJu0Yz+DXHnBBtchCYylm9ZhA2WVK8FS0a+c4WY0gdrnp0YoTaFroxg AzbvCJetHtpMc52rQe91/q6EvU0fqepAABv2qyz3JfKjqZI+IVu+sa5oyao= X-Google-Smtp-Source: AGHT+IEecKwth/zA+OIaGi4hGQ7SeAU2jzy5w0lTEZ8p3Bgq0+ItKkmCY2neAuKR+fuEpN1d2ktzsw== X-Received: by 2002:a05:600c:4f85:b0:430:5887:c238 with SMTP id 5b1f17b1804b1-4327b6fd60dmr19075015e9.11.1730360069505; Thu, 31 Oct 2024 00:34:29 -0700 (PDT) Received: from localhost.. (mob-194-230-148-189.cgn.sunrise.net. [194.230.148.189]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-381c116a781sm1248951f8f.96.2024.10.31.00.34.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Oct 2024 00:34:29 -0700 (PDT) From: Aleksandrs Vinarskis To: Jiri Kosina , Hans de Goede , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Benjamin Tissoires , Bryan.Kemp@dell.com, laurentiu.tudor1@dell.com, Aleksandrs Vinarskis Subject: [PATCH v2 1/2] HID: i2c-hid: introduce re-power-on quirk Date: Thu, 31 Oct 2024 08:31:41 +0100 Message-ID: <20241031073419.9189-2-alex.vinarskis@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241031073419.9189-1-alex.vinarskis@gmail.com> References: <20241031073419.9189-1-alex.vinarskis@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" It appears some keyboards from vendor 'QTEC' will not work properly until suspend & resume. Empirically narrowed down to solution of re-sending power on command _after_ initialization was completed before the end of initial probing. Signed-off-by: Aleksandrs Vinarskis --- drivers/hid/i2c-hid/i2c-hid-core.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/hid/i2c-hid/i2c-hid-core.c b/drivers/hid/i2c-hid/i2c-h= id-core.c index 43664a24176f..ad386ae878ef 100644 --- a/drivers/hid/i2c-hid/i2c-hid-core.c +++ b/drivers/hid/i2c-hid/i2c-hid-core.c @@ -51,6 +51,7 @@ #define I2C_HID_QUIRK_NO_WAKEUP_AFTER_RESET BIT(4) #define I2C_HID_QUIRK_NO_SLEEP_ON_SUSPEND BIT(5) #define I2C_HID_QUIRK_DELAY_WAKEUP_AFTER_RESUME BIT(6) +#define I2C_HID_QUIRK_RE_POWER_ON BIT(7) =20 /* Command opcodes */ #define I2C_HID_OPCODE_RESET 0x01 @@ -1069,7 +1070,11 @@ static int i2c_hid_core_register_hid(struct i2c_hid = *ihid) return ret; } =20 - return 0; + /* At least some QTEC devices need this after initialization */ + if (ihid->quirks & I2C_HID_QUIRK_RE_POWER_ON) + ret =3D i2c_hid_set_power(ihid, I2C_HID_PWR_ON); + + return ret; } =20 static int i2c_hid_core_probe_panel_follower(struct i2c_hid *ihid) --=20 2.45.2 From nobody Mon Nov 25 01:33:58 2024 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7526314AD1A; Thu, 31 Oct 2024 07:34:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730360075; cv=none; b=r20qzNkLIZn6Qpj+LlZTTFLYhhF4+9Hrie136HYtb2SLqrFcfJc57ElmrZhk/jiM2XxufcwscSzpnyZG7cG4PhSLzjTmkICqyScpSYtcpVKae4xVsktZ6ZjqOyM1U+ABD8rL7RDB4WkQf4wU5e59itf5H7qYSVJWuYpvjvnFk30= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730360075; c=relaxed/simple; bh=fHyL0O4T5JbEOMzjGGSZF5351215zmI6JGSKKxIAqk0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LsSg8g7rBTX0w9i7Py8zCcnrpHVdmWMxhKMdccx921SS2DjjLZiOhd4h0YwsWUcxJ6OWxpaxySVsCBc1J2bpIp8Vfy0gOH9mrFEs+hMNajsECXGGvQp5MDIBvYCPR2qfDmj2rizINeptjHeSyCkJovt80I3JBqCiETq6YuSMeWs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=OpSfXsTC; arc=none smtp.client-ip=209.85.128.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="OpSfXsTC" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-431481433bdso5310215e9.3; Thu, 31 Oct 2024 00:34:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730360072; x=1730964872; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=aVkvrLFdCTfWMavnxrW9/fdQDSbj240jTDkaE5rsp5w=; b=OpSfXsTCvdSUX5JE+s5rS3YUvoo3wm4T0XYSMwDfTpu6TZVYwYOAoH3edseJ1oj/wI G6WDlHU+KuOV9n2PU5HF5hdiAOzuqUVh7iP2/1TEFn+08aIFqQBlExCYDm9wIzll6rCv bl1GqPZlqPdWEHqJC9TEEP+2SQ8rp31f7irm0SlEqkgCeNxp22xs0fpaGfEeFEmpao8U vwAzao8lpzJS40iAaYFK5ZrYXs1XUX0gi/WQGXrzAfMs/1Cog5uGcBKO/G3y5Dh7y9sz K1BESQfqxN+3mBNuiX9va2m0G6FN4r3DCHYypATEaQKktcdeJmqLFQ9+PsLaxcFSpAiw ih6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730360072; x=1730964872; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aVkvrLFdCTfWMavnxrW9/fdQDSbj240jTDkaE5rsp5w=; b=GytZHux8+9xw6hnE7LPWKbfJVDLIHJU2VRDopI2cva7cV8ZfP44qJF+Gqn84EaytDt 7Dlnv1GDZdnw4u0mquVezYWisztEL0iRZsOHWjzGVFU8+arBL9/J6xMdUoyz6QPtHsdL KiFCstXpJ8lSA8A5oY3ne7lASbpoX6P3SQpz8LE5KKDqCEXiT+dVDryTC0UFR2GslSh6 VnC69mLJOSpXaBMrThhitglAbQe8mhQMFk2Q2UrRjUJ5c56yc3vwUCX/Tv+c9oEZONID 5Bs6g3rVnzH0DNXAWB+qUgmDWcznLF84HEmPYf/4yPxaQi7YyvrKHVUHQ9+MY/LivtFV V9jw== X-Forwarded-Encrypted: i=1; AJvYcCWi1QLS8SBR7HXmYKbRN5HT4w6MTjs6bOZyaf8zCbRlvnD8op/MKIAkebZD6tOnXn+ez6fl9UaQ2Tj/jBtU@vger.kernel.org, AJvYcCXsBFNqiCpJLCEnPYTs0fuOodEvVTBQjKBAvlbBBaDnThVR+nXMMFYdogCrcMQ+U3OVMcZKmUgL4OhnXA==@vger.kernel.org X-Gm-Message-State: AOJu0YwlXM0a63RXlVaNwumF5c1Tr3oSX5v2E3kpne10flLK26/b1r9z J237w3WxeYgsyeWj3EVeA1dCn4XdOKsnsahxCIwp1zIdjgai+wYqtFnM/4g= X-Google-Smtp-Source: AGHT+IGYUe3+hPL228rZ8KYhwjulTyVfF6wzY+21e7eFzFBqF/ZMAuUvYJI/JMQYYHkvZPMAGgH0uQ== X-Received: by 2002:a05:6000:42c2:b0:37d:f4b:b6ab with SMTP id ffacd0b85a97d-381bea29202mr1577840f8f.59.1730360071404; Thu, 31 Oct 2024 00:34:31 -0700 (PDT) Received: from localhost.. (mob-194-230-148-189.cgn.sunrise.net. [194.230.148.189]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-381c116a781sm1248951f8f.96.2024.10.31.00.34.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Oct 2024 00:34:31 -0700 (PDT) From: Aleksandrs Vinarskis To: Jiri Kosina , Hans de Goede , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Benjamin Tissoires , Bryan.Kemp@dell.com, laurentiu.tudor1@dell.com, Aleksandrs Vinarskis Subject: [PATCH v2 2/2] HID: i2c-hid: introduce qtec vendor, enable re-power-on quirk Date: Thu, 31 Oct 2024 08:31:42 +0100 Message-ID: <20241031073419.9189-3-alex.vinarskis@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241031073419.9189-1-alex.vinarskis@gmail.com> References: <20241031073419.9189-1-alex.vinarskis@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This solves keyboard not working until suspend&resume issue on Dell XPS 9345 13" (codenamed 'tributo'). Signed-off-by: Aleksandrs Vinarskis --- drivers/hid/hid-ids.h | 2 ++ drivers/hid/i2c-hid/i2c-hid-core.c | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index 30728997f4c0..cc9b9bdca117 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h @@ -1088,6 +1088,8 @@ #define USB_VENDOR_ID_PRODIGE 0x05af #define USB_DEVICE_ID_PRODIGE_CORDLESS 0x3062 =20 +#define I2C_VENDOR_ID_QTEC 0x6243 + #define USB_VENDOR_ID_QUANTA 0x0408 #define USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH 0x3000 #define USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH_3001 0x3001 diff --git a/drivers/hid/i2c-hid/i2c-hid-core.c b/drivers/hid/i2c-hid/i2c-h= id-core.c index ad386ae878ef..29c75e390a7d 100644 --- a/drivers/hid/i2c-hid/i2c-hid-core.c +++ b/drivers/hid/i2c-hid/i2c-hid-core.c @@ -136,6 +136,11 @@ static const struct i2c_hid_quirks { I2C_HID_QUIRK_BAD_INPUT_SIZE }, { I2C_VENDOR_ID_CIRQUE, I2C_PRODUCT_ID_CIRQUE_1063, I2C_HID_QUIRK_NO_SLEEP_ON_SUSPEND }, + /* + * Without additional power on command, at least some QTEC devices send g= arbage + */ + { I2C_VENDOR_ID_QTEC, HID_ANY_ID, + I2C_HID_QUIRK_RE_POWER_ON }, /* * Sending the wakeup after reset actually break ELAN touchscreen control= ler */ --=20 2.45.2