From patchwork Tue Aug 16 10:16:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heikki Krogerus X-Patchwork-Id: 597558 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 352DCC2BB41 for ; Tue, 16 Aug 2022 10:49:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235079AbiHPKtD (ORCPT ); Tue, 16 Aug 2022 06:49:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234970AbiHPKst (ORCPT ); Tue, 16 Aug 2022 06:48:49 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6A5CFC30F; Tue, 16 Aug 2022 03:16:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1660644984; x=1692180984; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=hkWcQNjVhGcUtHECBaMGjDVMJWJKeF34QritOqABUew=; b=ZrxRQfBCt5F+BNabZdkOjlN2hzvo5bqBcGoDzyZOfk0oG290X21MCRg0 SGpdd34hFVLX7ai4w7JH7RVonQnPCyea5jYmeBvGTa66INYPtFXDlMhWr L0k7OIh04E71OVijvoqB+uqrFbCpRdjoMYT3zaosQDP84xMD12fZPWvdT hzeBUrf0sh+EumLZwP9Ltq4+82xGfqLQMuBJN42EFvU9vHkGJ6X/Urmol 0WBcI5x0fj3MC/NIqfsGxSv+uP1Zsna6ytKbMhQD9cMFiE45qhTxQmL22 dQcvcEl4352ji8MlwTtwexEpn1Z90KVbk2p3UWko9tpePDgoHHaIJceE/ w==; X-IronPort-AV: E=McAfee;i="6400,9594,10440"; a="279141259" X-IronPort-AV: E=Sophos;i="5.93,240,1654585200"; d="scan'208";a="279141259" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Aug 2022 03:16:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,240,1654585200"; d="scan'208";a="749260748" Received: from black.fi.intel.com (HELO black.fi.intel.com.) ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 16 Aug 2022 03:16:19 -0700 From: Heikki Krogerus To: "Rafael J. Wysocki" , Greg Kroah-Hartman Cc: Utkarsh Patel , rajmohan.mani@intel.com, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH 1/6] usb: typec: intel_pmc_mux: Add new ACPI ID for Meteor Lake IOM device Date: Tue, 16 Aug 2022 13:16:24 +0300 Message-Id: <20220816101629.69054-2-heikki.krogerus@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220816101629.69054-1-heikki.krogerus@linux.intel.com> References: <20220816101629.69054-1-heikki.krogerus@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org From: Utkarsh Patel This adds the necessary ACPI ID for Intel Meteor Lake IOM devices. The callback function is_memory() is modified so that it also checks if the resource descriptor passed to it is a memory type "Address Space Resource Descriptor". On Intel Meteor Lake the ACPI memory resource is not described using the "32-bit Memory Range Descriptor" because the memory is outside of the 32-bit address space. The memory resource is described using the "Address Space Resource Descriptor" instead. Intel Meteor Lake is the first platform to describe the memory resource for this device with Address Space Resource Descriptor, but it most likely will not be the last. Therefore the change to the is_memory() callback function is made generic. Signed-off-by: Utkarsh Patel Cc: stable@vger.kernel.org [ heikki: Rewrote the commit message. ] Signed-off-by: Heikki Krogerus --- drivers/usb/typec/mux/intel_pmc_mux.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/usb/typec/mux/intel_pmc_mux.c b/drivers/usb/typec/mux/intel_pmc_mux.c index 47b733f78fb0d..a8e273fe204ab 100644 --- a/drivers/usb/typec/mux/intel_pmc_mux.c +++ b/drivers/usb/typec/mux/intel_pmc_mux.c @@ -571,9 +571,11 @@ static int pmc_usb_register_port(struct pmc_usb *pmc, int index, static int is_memory(struct acpi_resource *res, void *data) { - struct resource r; + struct resource_win win = {}; + struct resource *r = &win.res; - return !acpi_dev_resource_memory(res, &r); + return !(acpi_dev_resource_memory(res, r) || + acpi_dev_resource_address_space(res, &win)); } /* IOM ACPI IDs and IOM_PORT_STATUS_OFFSET */ @@ -583,6 +585,9 @@ static const struct acpi_device_id iom_acpi_ids[] = { /* AlderLake */ { "INTC1079", 0x160, }, + + /* Meteor Lake */ + { "INTC107A", 0x160, }, {} };