Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp1079305lqh; Fri, 29 Mar 2024 06:46:13 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVJ9qcXO4bTtXTBGiaD//UCzmsHT+XCgghckpOst62zHxK3NFna7V9gN6oyGmssdwtqULvyCxK/gBIpD0zmHE9sd9nmD9JqvFXyoDgmoA== X-Google-Smtp-Source: AGHT+IElRs8hGtESB7c/AmIuSFqtvMSLVpXCs7ITLnpD/udwS63LQzOTywgyoPtIasdDKI8I8VNw X-Received: by 2002:a17:906:3818:b0:a4e:237a:82ac with SMTP id v24-20020a170906381800b00a4e237a82acmr1485031ejc.32.1711719973292; Fri, 29 Mar 2024 06:46:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711719973; cv=pass; d=google.com; s=arc-20160816; b=iGyR669ZNxmc7mDjPSGmm0kPevfnywhc4lTXiT7Kq5pKmGERehu14z3s0m2FsCfY8h 4RpO47kZpiDrOdSN9RM7SQNP4XOuai+oxLXxCYWG2cIr2w5SoQCYOUzKCG1hUX6h6sno u0xl8WAI1VZsCRR5tfEfl/P60SflnCD1vk+AEBKalcT4a1jfautwrZ0zELgQvG6auKW7 EP4h7v7/dhgshsJMkHzqIXJrB00RFfz6zOgAiiQlEa5K3rb65ZHRAw+EHYCwssJ5aGVB Ab0fLAe15FEJAcoq7xBzDIscWR5Zrhfy9gJT7P07MmOTrAYGMwKwTKnyjPap5vDKTCTc J2rg== 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=aRmEyehYezWjXEd6wrR3SXoImatk6jAyqJRyYvHrzP4=; fh=CWCRZGRSBBVoz8Or3PmynNSTL4ZgEAvu3fWL3dQv3vU=; b=OCPHFpuaU4ZF6fQexVkIcdykEwcm3ZCGrPh/uAzYTfGQFGQDlyYugJ746B9Wm1DYU2 tBMpa6Ekt1CeT0jBnq2MiRnLgbrnWFLB3rgE6qDkDgIK0aNvy+nklfikIEv2NjX3vhCP rTwhiv4BPz/eRkgiE8AcYI9PHSR4y1m+v5Hx2N5xyTtfTcI+WPnznl9O44Rt7DboS5UR kFniKpO5yo13WzRsRayMBB+BOzHrvKqbC6AhKM0oVaSobryMu/BkTjuSrfq5GGqtS94r tE8fB7KcjtKO0JzMy/RC2yswGLwpUYDvTpohnzSqSaWzngg+DAkMnz6xNSd1eL+RTWHw v34g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sHkiLZ6y; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-124767-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-124767-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 t3-20020a170906178300b00a4761adde1bsi1813446eje.607.2024.03.29.06.46.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Mar 2024 06:46:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-124767-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=sHkiLZ6y; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-124767-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-124767-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 CB5351F24C12 for ; Fri, 29 Mar 2024 13:46:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E4959181B91; Fri, 29 Mar 2024 12:41:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="sHkiLZ6y" 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 0070718149A; Fri, 29 Mar 2024 12:41: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=1711716106; cv=none; b=NCZPq8CKLhvt2JYuXsVYu1gXqTT1KLlx1JrId04Qihjosz89PqNChHVoHnLIB+6IKJVQ10gDGzUJChMAPHsPAVUhVgw3nntyYVNuU2KMtYv+U0icAAcek9LJb4HtWIIitUR58i4AY3/mdrnbfAbIVh++KiTyC/1iXWq7MpVRE1k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711716106; c=relaxed/simple; bh=cVy5o4gqda2LSzo6NAHgmfy/hS5KyU+uEO8/uv6RXm4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=B+q1+b6YnTyEqjTEP2AsLV5iMfuUl86ApRfhJeIuLz2PybLKdTXbgeSzKdCf90xlcoHG9NpRMf4ABXM22zDdYq+9ghcPgqUf8n3Gv7PhuJnOk9Rny31WQ0533C2fmLmHoyA/pqi/3mshQh7ZzsjgfmpyNwpKXYtUv2sQMvcsDso= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=sHkiLZ6y; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2897FC43390; Fri, 29 Mar 2024 12:41:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711716105; bh=cVy5o4gqda2LSzo6NAHgmfy/hS5KyU+uEO8/uv6RXm4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sHkiLZ6yt5UR0GFe8p4GlKJTquWdjtAnwOSP8IojR44rvIN1IPefs6BqjPLsp128r Bcy5ndnJhDBmKm8DEZk90sQ6SFCp4v5i3GdVgpY0PCYTim+cCu6ivKxdjNArmG1dYW jRX2tUqxEMGLOw0E6z1UFI5cb5shhxsUNxwgbMSve1tz5syDxaNC+YTc2vgsNFEJCj YZ1QCWvPydiRRtYntRuaRWF2bmUtZ7hBlFUc7XRy8GFBJHal3FWjXSRPkCVStwLVFk SVnjITB924isUtpVZcgamHmthHoraRlS5Y2T4GWqLTVOEBhOrdF1r5Z7igyuIS1lCv rwQdaLrspR/MQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Aleksandrs Vinarskis , Andy Shevchenko , Lee Jones , Sasha Levin Subject: [PATCH AUTOSEL 6.8 57/98] mfd: intel-lpss: Switch to generalized quirk table Date: Fri, 29 Mar 2024 08:37:28 -0400 Message-ID: <20240329123919.3087149-57-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: Aleksandrs Vinarskis [ Upstream commit ac9538f6007e1c80f1b8a62db7ecc391b4d78ae5 ] Introduce generic quirk table, and port existing walkaround for select Microsoft devices to it. This is a preparation for QUIRK_CLOCK_DIVIDER_UNITY. Signed-off-by: Aleksandrs Vinarskis Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20231221185142.9224-2-alex.vinarskis@gmail.com Signed-off-by: Lee Jones Signed-off-by: Sasha Levin --- drivers/mfd/intel-lpss-pci.c | 23 +++++++++++++++-------- drivers/mfd/intel-lpss.c | 2 +- drivers/mfd/intel-lpss.h | 9 ++++++++- 3 files changed, 24 insertions(+), 10 deletions(-) diff --git a/drivers/mfd/intel-lpss-pci.c b/drivers/mfd/intel-lpss-pci.c index 4621d3950b8f9..07713a2f694f3 100644 --- a/drivers/mfd/intel-lpss-pci.c +++ b/drivers/mfd/intel-lpss-pci.c @@ -23,12 +23,17 @@ #include "intel-lpss.h" -/* Some DSDTs have an unused GEXP ACPI device conflicting with I2C4 resources */ -static const struct pci_device_id ignore_resource_conflicts_ids[] = { - /* Microsoft Surface Go (version 1) I2C4 */ - { PCI_DEVICE_SUB(PCI_VENDOR_ID_INTEL, 0x9d64, 0x152d, 0x1182), }, - /* Microsoft Surface Go 2 I2C4 */ - { PCI_DEVICE_SUB(PCI_VENDOR_ID_INTEL, 0x9d64, 0x152d, 0x1237), }, +static const struct pci_device_id quirk_ids[] = { + { + /* Microsoft Surface Go (version 1) I2C4 */ + PCI_DEVICE_SUB(PCI_VENDOR_ID_INTEL, 0x9d64, 0x152d, 0x1182), + .driver_data = QUIRK_IGNORE_RESOURCE_CONFLICTS, + }, + { + /* Microsoft Surface Go 2 I2C4 */ + PCI_DEVICE_SUB(PCI_VENDOR_ID_INTEL, 0x9d64, 0x152d, 0x1237), + .driver_data = QUIRK_IGNORE_RESOURCE_CONFLICTS, + }, { } }; @@ -36,6 +41,7 @@ static int intel_lpss_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) { const struct intel_lpss_platform_info *data = (void *)id->driver_data; + const struct pci_device_id *quirk_pci_info; struct intel_lpss_platform_info *info; int ret; @@ -55,8 +61,9 @@ static int intel_lpss_pci_probe(struct pci_dev *pdev, info->mem = pci_resource_n(pdev, 0); info->irq = pci_irq_vector(pdev, 0); - if (pci_match_id(ignore_resource_conflicts_ids, pdev)) - info->ignore_resource_conflicts = true; + quirk_pci_info = pci_match_id(quirk_ids, pdev); + if (quirk_pci_info) + info->quirks = quirk_pci_info->driver_data; pdev->d3cold_delay = 0; diff --git a/drivers/mfd/intel-lpss.c b/drivers/mfd/intel-lpss.c index eff423f7dd284..aafa0da5f8dbf 100644 --- a/drivers/mfd/intel-lpss.c +++ b/drivers/mfd/intel-lpss.c @@ -412,7 +412,7 @@ int intel_lpss_probe(struct device *dev, return ret; lpss->cell->swnode = info->swnode; - lpss->cell->ignore_resource_conflicts = info->ignore_resource_conflicts; + lpss->cell->ignore_resource_conflicts = info->quirks & QUIRK_IGNORE_RESOURCE_CONFLICTS; intel_lpss_init_dev(lpss); diff --git a/drivers/mfd/intel-lpss.h b/drivers/mfd/intel-lpss.h index c1d72b117ed5e..2fa9ef9162580 100644 --- a/drivers/mfd/intel-lpss.h +++ b/drivers/mfd/intel-lpss.h @@ -11,16 +11,23 @@ #ifndef __MFD_INTEL_LPSS_H #define __MFD_INTEL_LPSS_H +#include #include +/* + * Some DSDTs have an unused GEXP ACPI device conflicting with I2C4 resources. + * Set to ignore resource conflicts with ACPI declared SystemMemory regions. + */ +#define QUIRK_IGNORE_RESOURCE_CONFLICTS BIT(0) + struct device; struct resource; struct software_node; struct intel_lpss_platform_info { struct resource *mem; - bool ignore_resource_conflicts; int irq; + unsigned int quirks; unsigned long clk_rate; const char *clk_con_id; const struct software_node *swnode; -- 2.43.0