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 A39321420B0; Tue, 27 Feb 2024 14:17:44 +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=1709043464; cv=none; b=AF5CZ8Ng7IkyIEaKlNIqckQOyM6wOV7FcJ4+dTpfEt42rcJfyouc65SZa4FU02GKayWJFzRVOO8K5/9gGU3i/OFckOJzFysYxNc0e4JwjGUc/wYz0xKOiC09FPuxlKhgD2brBYe8WrjsidCfNqxkXhVqDHpyysVojwFNkyzZp6Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709043464; c=relaxed/simple; bh=UqcP5/HNtTUYf/QdHYsZQxazei7gvy9ZL5Vejx1ZyQk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Dm6WMTuYY3iUm5OSLWXQnjOUvR6tterHgCNdb3x4rz2hclRfQWvoszzAYU0VAjwUb7eBjNa/wHmBWIDLNh7T85hyo9YULR3LFTkPYILeupoG1i3efTQVxbNEObOJ8BwrApn/OtrMmppCqyFj7Y6tmp4aMA8rHIqhQEwDiBrNiJ0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=vl7hDAmP; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="vl7hDAmP" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 30770C433C7; Tue, 27 Feb 2024 14:17:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1709043464; bh=UqcP5/HNtTUYf/QdHYsZQxazei7gvy9ZL5Vejx1ZyQk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vl7hDAmP0HnF4Cv9iqpSp0OYZRmXYbiGtoQJhLMXHCrRwGK7I8DpmMpxJF5z7VjGp 0lV0izJ6M4qn6NpQUmn24FyNNxV4DwIb7JDTvPkMX/uWBTLdbFNJXrnE9ERJhk0xPu 8erbvA57U9FLfZU10NGpWtSeEAIC/3ifvyXBw7B0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Kuppuswamy Sathyanarayanan , Hans de Goede Subject: [PATCH 6.1 100/195] platform/x86: touchscreen_dmi: Allow partial (prefix) matches for ACPI names Date: Tue, 27 Feb 2024 14:26:01 +0100 Message-ID: <20240227131613.775826942@linuxfoundation.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240227131610.391465389@linuxfoundation.org> References: <20240227131610.391465389@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Hans de Goede commit dbcbfd662a725641d118fb3ae5ffb7be4e3d0fb0 upstream. On some devices the ACPI name of the touchscreen is e.g. either MSSL1680:00 or MSSL1680:01 depending on the BIOS version. This happens for example on the "Chuwi Hi8 Air" tablet where the initial commit's ts_data uses "MSSL1680:00" but the tablets from the github issue and linux-hardware.org probe linked below both use "MSSL1680:01". Replace the strcmp() match on ts_data->acpi_name with a strstarts() check to allow using a partial match on just the ACPI HID of "MSSL1680" and change the ts_data->acpi_name for the "Chuwi Hi8 Air" accordingly to fix the touchscreen not working on models where it is "MSSL1680:01". Note this drops the length check for I2C_NAME_SIZE. This never was necessary since the ACPI names used are never more then 11 chars and I2C_NAME_SIZE is 20 so the replaced strncmp() would always stop long before reaching I2C_NAME_SIZE. Link: https://linux-hardware.org/?computer=AC4301C0542A Fixes: bbb97d728f77 ("platform/x86: touchscreen_dmi: Add info for the Chuwi Hi8 Air tablet") Closes: https://github.com/onitake/gsl-firmware/issues/91 Cc: stable@vger.kernel.org Reviewed-by: Kuppuswamy Sathyanarayanan Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20240212120608.30469-1-hdegoede@redhat.com Signed-off-by: Greg Kroah-Hartman --- drivers/platform/x86/touchscreen_dmi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/platform/x86/touchscreen_dmi.c +++ b/drivers/platform/x86/touchscreen_dmi.c @@ -50,7 +50,7 @@ static const struct property_entry chuwi }; static const struct ts_dmi_data chuwi_hi8_air_data = { - .acpi_name = "MSSL1680:00", + .acpi_name = "MSSL1680", .properties = chuwi_hi8_air_props, }; @@ -1776,7 +1776,7 @@ static void ts_dmi_add_props(struct i2c_ int error; if (has_acpi_companion(dev) && - !strncmp(ts_data->acpi_name, client->name, I2C_NAME_SIZE)) { + strstarts(client->name, ts_data->acpi_name)) { error = device_create_managed_software_node(dev, ts_data->properties, NULL); if (error) dev_err(dev, "failed to add properties: %d\n", error);