Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2084628lqb; Mon, 27 May 2024 07:24:52 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX/2E4mGUWfnwYDRheJsAPxQ/iTwtl7xS4k8xGjk4UhhskkqAT4Emm61mjMcQZabEt/uS9m3kThofG49+CF9QSUCD3SeA/EvzBwrizknQ== X-Google-Smtp-Source: AGHT+IEzmDWfRvGQSGpdfCgag/7f0I0IPMTvc57Z8u12qiimXNlTfjxJtj4hDCfgfJK6gBqXjexg X-Received: by 2002:a67:ed0e:0:b0:47e:f56e:c1d9 with SMTP id ada2fe7eead31-48a38682c85mr7987574137.25.1716819892146; Mon, 27 May 2024 07:24:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716819892; cv=pass; d=google.com; s=arc-20160816; b=n96JC86IwoztFOR4Of2Q6i/ZDpNeguoh75aDXh3Eua5ka5sjukFodHkAJlcxhh4tem wWqGDGYSYWaK7pr9W3XDri+BhyGEoFOfRs/cmQogWBzt5kM/bxq8XAF7huPJiLuJc0mO Cn5oKNPnAmwsYAkNr6IMLqbJG8MYQYvHXp56x2A5m9umUkcFHU6XLlDH+/bagNihKTGW VGzAXeq3UrpFidJQslDrf218VSMg3UPvd2O6P1gbGeAC80kynWecroybC+kDV0HGp4AW wF3rnWX/scRocN/ivJY+NuNzqG2S/tocete2EJDgPT7Fhqj+Ey/JQ7Z1hp4DKgCA8nz2 aLHA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=+gDVu3re1Ke+kLzTMePRUnF0XB/KlwJSXQPqN1+6Dt0=; fh=GQYQejkaAUo/hFEqddJv/ohKRN8vMOi1icf0bR912C4=; b=IukpC0bucVJZ/NenGPznU3+8DiIMsbwSuegXeM9lazkYg0PPt5OKakmRqmEtLHBs1L uSOdErE+gE/u2Pec3J2Kg4umcVhbyu4tYJ3fk8+/T6dF3VkVPcvexRywb7HyUINry/BB sfGmT5y8EPB6f4qI81D7APgndc/D4FgMXP0FHFoj6XxH+FgHxEywMELm3Z7z5kvB6xZW YS5D1LKpttOpmaaqOiJfcoFPrSIyVW4itibUjY+z33nXaMPfPOVCtzRvle3nL4tuq65R QMkZyd+/tiOu2qeT63iXIEd2BlhGkJifXKbY4RbOxgxl2LlwA13/XcvmG9o+pbDVq48d Bohw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QgBuNUBt; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-190845-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-190845-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id ada2fe7eead31-48a3a3b01b5si1833526137.637.2024.05.27.07.24.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 07:24:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-190845-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QgBuNUBt; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-190845-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-190845-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id DA04D1C218EA for ; Mon, 27 May 2024 14:24:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 82BF6172BC1; Mon, 27 May 2024 14:14:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="QgBuNUBt" 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 A41FC172BAC; Mon, 27 May 2024 14:14:36 +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=1716819276; cv=none; b=SkUOmG2Pds1OMNHD97wyZNS0f9OoATnirdkBRwE8HQzZ+A9csn9W8418C6Dg6rrfMh7ZRrfaHKrUySODv605F/hEHX2lUukwvMc0aOmauCQ1sHJML0IlqGjxgUYHVLDN9sQpXndBLqoSt2728fSsx+EycR5sIP25UICiR/wd4Dk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716819276; c=relaxed/simple; bh=jcxLBEiIRpPiWOvQGwWAAHgqianBSi95X9Ie1UAGN0c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZVUUZlhat6bw3IPrdaMNp2/kado+4Sd7Zbgi99aoKtsvQT46Zz7CiK+fFFk7q5Jhx9K76cHuOFiCocBr7RMPIQX5XYRiO0inIDzAWPax7OuyApCk9P3WUrIzBHtwV6RsrKUClPWiHcyQ2EVYHI8RnSXyeft0kDXorHh0Vgebxss= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=QgBuNUBt; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 63A1FC32781; Mon, 27 May 2024 14:14:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716819276; bh=jcxLBEiIRpPiWOvQGwWAAHgqianBSi95X9Ie1UAGN0c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QgBuNUBt93XiYwe1/Uk/w8bsdK9o4ST8TVN6nXDllV2LLnTCw/QYRid6cvMy0TOP1 Irp0neo3ZvEfIa0DB6OCnXLetILeWD8+KvRxlccTFcYLYXLSsRABe1SKn8+Yw0oBIS jle1GwyHOZkKbH3tD1pelUtjUue6KR11OK9wy7YMLGlP8DH2TVfuRoM5NEKV7bovZ8 kLkdW7rJ/d+9lRsMbyxrdTdXxKy9clgnQ/moJ9S8anXfdwYE7ozoqnhbg9+4ofZdqA J5KWOQpGq8umS6Z2EDd+/KJz31GYD3iIOiyGIE0xGQway0fezhst9B60ON27nOfpLE 5myqvuzXy+42Q== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Hans de Goede , "Rafael J . Wysocki" , Sasha Levin , rafael@kernel.org, mika.westerberg@linux.intel.com, raag.jadav@intel.com, michal.wilczynski@intel.com, linux-acpi@vger.kernel.org Subject: [PATCH AUTOSEL 6.8 09/30] ACPI: x86: Add PNP_UART1_SKIP quirk for Lenovo Blade2 tablets Date: Mon, 27 May 2024 10:13:18 -0400 Message-ID: <20240527141406.3852821-9-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240527141406.3852821-1-sashal@kernel.org> References: <20240527141406.3852821-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@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.8.11 Content-Transfer-Encoding: 8bit From: Hans de Goede [ Upstream commit d8f20383a2fc3a3844b08a4999cf0e81164a0e56 ] The x86 Android tablets on which quirks to skip looking for a matching UartSerialBus resource and instead unconditionally create a serial bus device (serdev) are necessary there are 2 sorts of serialports: ACPI enumerated highspeed designware UARTs, these are the ones which typcially need to be skipped since they need a serdev for the attached BT HCI. A PNP enumerated UART which is part of the PCU. So far the existing quirks have ignored this. But on the Lenovo Yoga Tablet 2 Pro 1380 models this is used for a custom fastcharging protocol. There is a Micro USB switch which can switch the USB data lines to this uart and then a 600 baud protocol is used to configure the charger for a voltage higher then 5V. Add a new ACPI_QUIRK_PNP_UART1_SKIP quirk type and set this for the existing entry for the Lenovo Yoga Tablet 2 830 / 1050 models. Note this will lead to unnecessarily also creating a serdev for the PCU UART on the 830 / 1050 which don't need this, but the UART is not used otherwise there so that is not a problem. Signed-off-by: Hans de Goede Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin --- drivers/acpi/x86/utils.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/drivers/acpi/x86/utils.c b/drivers/acpi/x86/utils.c index 90c3d2eab9e99..e5612067ccac8 100644 --- a/drivers/acpi/x86/utils.c +++ b/drivers/acpi/x86/utils.c @@ -260,9 +260,10 @@ bool force_storage_d3(void) #define ACPI_QUIRK_SKIP_I2C_CLIENTS BIT(0) #define ACPI_QUIRK_UART1_SKIP BIT(1) #define ACPI_QUIRK_UART1_TTY_UART2_SKIP BIT(2) -#define ACPI_QUIRK_SKIP_ACPI_AC_AND_BATTERY BIT(3) -#define ACPI_QUIRK_USE_ACPI_AC_AND_BATTERY BIT(4) -#define ACPI_QUIRK_SKIP_GPIO_EVENT_HANDLERS BIT(5) +#define ACPI_QUIRK_PNP_UART1_SKIP BIT(3) +#define ACPI_QUIRK_SKIP_ACPI_AC_AND_BATTERY BIT(4) +#define ACPI_QUIRK_USE_ACPI_AC_AND_BATTERY BIT(5) +#define ACPI_QUIRK_SKIP_GPIO_EVENT_HANDLERS BIT(6) static const struct dmi_system_id acpi_quirk_skip_dmi_ids[] = { /* @@ -342,6 +343,7 @@ static const struct dmi_system_id acpi_quirk_skip_dmi_ids[] = { DMI_MATCH(DMI_BIOS_VERSION, "BLADE_21"), }, .driver_data = (void *)(ACPI_QUIRK_SKIP_I2C_CLIENTS | + ACPI_QUIRK_PNP_UART1_SKIP | ACPI_QUIRK_SKIP_ACPI_AC_AND_BATTERY), }, { @@ -440,14 +442,18 @@ static int acpi_dmi_skip_serdev_enumeration(struct device *controller_parent, bo if (ret) return 0; - /* to not match on PNP enumerated debug UARTs */ - if (!dev_is_platform(controller_parent)) - return 0; - dmi_id = dmi_first_match(acpi_quirk_skip_dmi_ids); if (dmi_id) quirks = (unsigned long)dmi_id->driver_data; + if (!dev_is_platform(controller_parent)) { + /* PNP enumerated UARTs */ + if ((quirks & ACPI_QUIRK_PNP_UART1_SKIP) && uid == 1) + *skip = true; + + return 0; + } + if ((quirks & ACPI_QUIRK_UART1_SKIP) && uid == 1) *skip = true; -- 2.43.0