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 370DF225A38; Sun, 26 Jan 2025 15:04:18 +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=1737903858; cv=none; b=GbRWlCWZ5zrRy9r2sJDFOFhrA5izzfKrpRQ5Fpv6kf1TWkX7PjnumedSVr57qnNmrBSgS0YVUjIbCmGfEBuJEFum3KI0UTIZeAON3qfIiaiaphMAml7W5749VKFTNEdZW82LTYvZyZsgipgC5aBuzuV940u3soqPyObQ5nSTCrw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737903858; c=relaxed/simple; bh=dF7HPZSbkgrxzh5sqxclVB6t40ygODd2Dm3q7AduncU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=kIkjaq6HqRi0iYMUxU9f6GSYrLkZb5y1fFLOhtdRPIUT9SCB3l7zLNOHXMWEGOAE2aql5hEWY1qYuNJt2DdL4sLiCtI0l0kB775TwJDtOZ3wVkSFh+spfkUq2c5vjNTeYXwOjsZr/BUk7IwfEOb318eQ1Qpzv1Ag6pYwpX/1it4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=caZinMW5; 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="caZinMW5" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2F580C4CEE3; Sun, 26 Jan 2025 15:04:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1737903858; bh=dF7HPZSbkgrxzh5sqxclVB6t40ygODd2Dm3q7AduncU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=caZinMW5vwcEXhnNEeSnQ1R/AUL7XxIk9Ps0Vf+0mIHyRXSXw7CvneqTEHYty2HY+ Suej9Woi/3mrOSQjAiIBQ/WYSwYQd7+wIi0G8EUIH8GNxp8VK8X6yC66YU0gEbRIOl zy2HYerSoUMiDMgmKKANIA5JtF8grQa5dMqXFhjq4bTWlN6CARXsBdMijbbNtORBE2 s3ligT3aObh9l8ppwO5XIbhjyzd19RAKMxFWabgrmQNot/cTq8NmLOPpAQIXukkI4Q WNGtwbgr6Yza1xndBUx8bihybIObPYKWM282h0w/2TBduLCVUmxBgOG8ERGZsNVRqy 3PM60jzlj1mSg== 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.1 11/17] i2c: Force ELAN06FA touchpad I2C bus freq to 100KHz Date: Sun, 26 Jan 2025 10:03:47 -0500 Message-Id: <20250126150353.957794-11-sashal@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250126150353.957794-1-sashal@kernel.org> References: <20250126150353.957794-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.1.127 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