Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp1078625lqh; Fri, 29 Mar 2024 06:45:05 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXCgH5GrjHIpmAsMpc1TcE+NaLuLmuhmk7CIfo7OcyvR9SOIGXsZoNBDaaLiCvxY9qxNKvisa5p6m3YUGd60bZOMJZB0xWjof9AWgH20w== X-Google-Smtp-Source: AGHT+IFlKUmG6rLFkMvsowLSLzNXqlXTqXZgjaiGkUkYdYm6NSbysBRexFmsuxc4gPQgG+2Qi6Ll X-Received: by 2002:a17:907:6d24:b0:a4e:df0:e9e with SMTP id sa36-20020a1709076d2400b00a4e0df00e9emr2823037ejc.24.1711719905686; Fri, 29 Mar 2024 06:45:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711719905; cv=pass; d=google.com; s=arc-20160816; b=Zp1fj7NFelQ98YxBU7RsNXkIzamE63F0Pas35G3mDXV4LvjWWa+03aIhjU1vrMAM2i gNCHo5Bzy4I5UpTjxH35xTkunXWC6kRljATfDVHPjnV/zB9xbyEF3eRxgf6t1HbGzS3X POLuyF34lWHqbfteh2bjkpDq06dDVff+mZMMDi/S+YTYIfHmEdSk/qQLa98j7DhabKdJ iHdcojfikTijipwY0MaDMqAV40nJ9z3vdtkmHzVyVFGqlkr+Zdv4Ev1op3ZJWHr9Waa7 aLh3srDCRc829tPUeXX3dz22hb5tJoWHM2R4ZF5MIS5EVQ1kFjSFe9p0YO3EUkwlP+3f G0+g== 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=c818UsKK3Mk7Ioy+m+j77Pfb6+0F5ABEa1Vja2HlRNs=; fh=q9fl3dSneIABxMCZ3tp4EPeT0EHwSudhTtUH7HsxlC4=; b=ci00dCIAnlwiZ6k2DIi82XPM0si0Girkm6PWegZcl9OnvoV6Uod8FVALzcEg4Qlbys M6G8NHOFCI2nLkqchZ+xu5xGnelJLZsVQ5g92L9Pud7wqt4QpLEwE61VjNrk9FvORiSy cbJgqvYERmWETeLyM92s38CMIcQ93BL0ttsGREYTbL4YSU1ODWsaY26VU93xVWGF/ZVV V76ctdRYh+sfMPLMnRy2unZ0BynqVJQgnhPjOvbCWmMdKFcYaMa4lOBvFBB90kn+G/LN vgIoIHaOrraBi7xPNs3jRqA1Fh4qAiis7aStRcGzto3iEinhsPJgDGZts1FqzWYCQRMz sWEw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XAI0V5vS; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-124762-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-124762-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id n11-20020a170906118b00b00a474540f1besi1809306eja.128.2024.03.29.06.45.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Mar 2024 06:45:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-124762-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XAI0V5vS; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-124762-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-124762-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 61A021F225F4 for ; Fri, 29 Mar 2024 13:45:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1A1F31EA74; Fri, 29 Mar 2024 12:41:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="XAI0V5vS" 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 1FE13180A9A; Fri, 29 Mar 2024 12:41:38 +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=1711716099; cv=none; b=oAz2NxhS/Yg0bgSXyoxYWbMWNlL0rvi0rhiY81bJcjIDAfu3oIypZUmm/aDAHEtHESZlqXDcx++jzotqAzTW0bCE+Vb3UeRFXdDLA8UfsVxlDwcLs1jpqESFqDQnJAqH5YUaZ8ndJ/VLW3l+abG++Zt5hThIfsin/mdqwy82A/4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711716099; c=relaxed/simple; bh=6BB67VKYQcGGM39DP5isCx0F37YiOyTglODRH4ADdI8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IsDJW/Q4vlyKsB30efXIv2ZV3JrKkAwTVNyZNHdfGHKLu5NaMpy3+LNl5Yc/GeYFnB3hDwxhjjBqZeoDxl4LHxumOTheCiPGZzZo8SfbmfxNYkvM7foWogRCSBGbKmuJfH/OGXj92Yszk4mlToqKBdbKIe8yGd4i0P17xm8pFoc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=XAI0V5vS; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 64AD9C433F1; Fri, 29 Mar 2024 12:41:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711716098; bh=6BB67VKYQcGGM39DP5isCx0F37YiOyTglODRH4ADdI8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XAI0V5vSGY63cWGH5PmYi9yrfrM4UPTxnn4toWN2+UU0ZxjguAdtLNxWWtrob9Kcd ldb/Yn7u/zZR3q1rPYZf6/maJJKXG+Uk4tIxQxkK+jdAF40R7pYawnQBpHzObIUvRa kD0D8bPTNiFuBFCCugdAbwZJ9kzuabysYk4XrMNZiqzoHysgQRFE3Rt9PZKyLY5JJo Plq1PFORFDPC7FMBQaKwXHcn7ioK+pTBHxDGor47y2cJQ5bpbSS5z951wv2DhHMkAF Fbktahis0qmo4vn53LJ6Dko7hMbs8vejXlFxrPORRY6w4xp1tFsvjAL3jZv2wK0sq4 j7UIfardCtMbQ== 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, mario.limonciello@amd.com, michal.wilczynski@intel.com, raag.jadav@intel.com, mail@mariushoch.de, linux-acpi@vger.kernel.org Subject: [PATCH AUTOSEL 6.8 53/98] ACPI: x86: Add DELL0501 handling to acpi_quirk_skip_serdev_enumeration() Date: Fri, 29 Mar 2024 08:37:24 -0400 Message-ID: <20240329123919.3087149-53-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240329123919.3087149-1-sashal@kernel.org> References: <20240329123919.3087149-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.2 Content-Transfer-Encoding: 8bit From: Hans de Goede [ Upstream commit 99b572e6136eab69a8c91d72cf8595b256e304b5 ] Some recent(ish) Dell AIO devices have a backlight controller board connected to an UART. This UART has a DELL0501 HID with CID set to PNP0501 so that the UART is still handled by 8250_pnp.c. Unfortunately there is no separate ACPI device with an UartSerialBusV2() resource to model the backlight-controller. This causes the kernel to create a /dev/ttyS0 char-device for the UART instead of creating an in kernel serdev-controller + serdev-device pair for a kernel backlight driver. Use the existing acpi_quirk_skip_serdev_enumeration() mechanism to work around this by returning skip=true for tty-ctrl parents with a HID of DELL0501. Like other cases where the UartSerialBusV2() resource is missing or broken this will only create the serdev-controller device and the serdev-device itself will need to be instantiated by platform code. Unfortunately in this case there is no device for the platform-code instantiating the serdev-device to bind to. So also create a platform_device for this. 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, 20 insertions(+) diff --git a/drivers/acpi/x86/utils.c b/drivers/acpi/x86/utils.c index 8829a907eee02..90c3d2eab9e99 100644 --- a/drivers/acpi/x86/utils.c +++ b/drivers/acpi/x86/utils.c @@ -484,8 +484,28 @@ static int acpi_dmi_skip_serdev_enumeration(struct device *controller_parent, bo int acpi_quirk_skip_serdev_enumeration(struct device *controller_parent, bool *skip) { + struct acpi_device *adev = ACPI_COMPANION(controller_parent); + *skip = false; + /* + * The DELL0501 ACPI HID represents an UART (CID is set to PNP0501) with + * a backlight-controller attached. There is no separate ACPI device with + * an UartSerialBusV2() resource to model the backlight-controller. + * Set skip to true so that the tty core creates a serdev ctrl device. + * The backlight driver will manually create the serdev client device. + */ + if (acpi_dev_hid_match(adev, "DELL0501")) { + *skip = true; + /* + * Create a platform dev for dell-uart-backlight to bind to. + * This is a static device, so no need to store the result. + */ + platform_device_register_simple("dell-uart-backlight", PLATFORM_DEVID_NONE, + NULL, 0); + return 0; + } + return acpi_dmi_skip_serdev_enumeration(controller_parent, skip); } EXPORT_SYMBOL_GPL(acpi_quirk_skip_serdev_enumeration); -- 2.43.0