From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 85652204C14; Sun, 26 Jan 2025 15:01:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737903706; cv=none; b=dt02FoO75i1jpRXRX+E66Y9B7n6iW/aljmo7Xhn/2XDrbZDsd7ZJKj4PQi71c9Hva7EcSLUzwgArohMYGTWSjT4V+I49d61VQLP4ULDihwPNcaC69RUE3I8jJZZ8fXYoq8exZEgQutH+gXWpcV/o72Be/P62T5txO2hvfCIsaUQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737903706; c=relaxed/simple; bh=dF7HPZSbkgrxzh5sqxclVB6t40ygODd2Dm3q7AduncU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ZHFpWeqDuYw55p1kPQWbty9k2YrWFix2CxQV0yJl78yJIloGuywTPSrGDw6lXazvJ3hmxrCqoM+VYdP5Emn3zQFPPZA/igwVr8cacUKUbiYseALFrq/IdmIVL8rk0GqpOH74O07Kdgzv9+gRDTKlY26A3stgIilMnrDbwdWHBN0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=tL9vKqCC; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="tL9vKqCC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 17FEBC4CEE2; Sun, 26 Jan 2025 15:01:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1737903705; bh=dF7HPZSbkgrxzh5sqxclVB6t40ygODd2Dm3q7AduncU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tL9vKqCCrrPlH2yIMCu56yp3mLi68X0n+6VGoRkapxxHubJFGLvv45K9MayZCX6Vd A1FS19rNHO2IEzRhYTjd7nrGli3PJzQ8C7PsWQMX46zZdb5FP/yynNNZcThbjh1n8i K3TkTU91mpowY6008damrCtank7O2fM9JwPOL66lPXBYtPVpkwANd/5iQegRl1NT02 V88nthBOi3U7p/khbbZj1Xz76uoIxTV6vx9bqDCLxDipaVKgXF6EUtSTo+tFuRhZsF 3mxK/ceaqVOwJqfjpU+nBny702XoEvj783j9lSnZx4IhW0sU6CoGwinuD/vdELS5UF GLGvowwg4KjIg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Randolph Ha , Mika Westerberg , Wolfram Sang , Sasha Levin , linux-i2c@vger.kernel.org, linux-acpi@vger.kernel.org Subject: [PATCH AUTOSEL 6.13 22/35] i2c: Force ELAN06FA touchpad I2C bus freq to 100KHz Date: Sun, 26 Jan 2025 10:00:16 -0500 Message-Id: <20250126150029.953021-22-sashal@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250126150029.953021-1-sashal@kernel.org> References: <20250126150029.953021-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.13 Content-Transfer-Encoding: 8bit From: Randolph Ha [ Upstream commit bfd74cd1fbc026f04446e67d6915c7e199c2bffd ] When a 400KHz freq is used on this model of ELAN touchpad in Linux, excessive smoothing (similar to when the touchpad's firmware detects a noisy signal) is sometimes applied. As some devices' (e.g, Lenovo V15 G4) ACPI tables specify a 400KHz frequency for this device and some I2C busses (e.g, Designware I2C) default to a 400KHz freq, force the speed to 100KHz as a workaround. For future investigation: This problem may be related to the default HCNT/LCNT values given by some busses' drivers, because they are not specified in the aforementioned devices' ACPI tables, and because the device works without issues on Windows at what is expected to be a 400KHz frequency. The root cause of the issue is not known. Signed-off-by: Randolph Ha Reviewed-by: Mika Westerberg Signed-off-by: Wolfram Sang Signed-off-by: Sasha Levin --- drivers/i2c/i2c-core-acpi.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/i2c/i2c-core-acpi.c b/drivers/i2c/i2c-core-acpi.c index 14ae0cfc325ef..d2499f302b508 100644 --- a/drivers/i2c/i2c-core-acpi.c +++ b/drivers/i2c/i2c-core-acpi.c @@ -355,6 +355,25 @@ static const struct acpi_device_id i2c_acpi_force_400khz_device_ids[] = { {} }; +static const struct acpi_device_id i2c_acpi_force_100khz_device_ids[] = { + /* + * When a 400KHz freq is used on this model of ELAN touchpad in Linux, + * excessive smoothing (similar to when the touchpad's firmware detects + * a noisy signal) is sometimes applied. As some devices' (e.g, Lenovo + * V15 G4) ACPI tables specify a 400KHz frequency for this device and + * some I2C busses (e.g, Designware I2C) default to a 400KHz freq, + * force the speed to 100KHz as a workaround. + * + * For future investigation: This problem may be related to the default + * HCNT/LCNT values given by some busses' drivers, because they are not + * specified in the aforementioned devices' ACPI tables, and because + * the device works without issues on Windows at what is expected to be + * a 400KHz frequency. The root cause of the issue is not known. + */ + { "ELAN06FA", 0 }, + {} +}; + static acpi_status i2c_acpi_lookup_speed(acpi_handle handle, u32 level, void *data, void **return_value) { @@ -373,6 +392,9 @@ static acpi_status i2c_acpi_lookup_speed(acpi_handle handle, u32 level, if (acpi_match_device_ids(adev, i2c_acpi_force_400khz_device_ids) == 0) lookup->force_speed = I2C_MAX_FAST_MODE_FREQ; + if (acpi_match_device_ids(adev, i2c_acpi_force_100khz_device_ids) == 0) + lookup->force_speed = I2C_MAX_STANDARD_MODE_FREQ; + return AE_OK; } -- 2.39.5