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: 12944620 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 7055FC3F6B0 for ; Tue, 16 Aug 2022 10:49:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235109AbiHPKtD (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-usb@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, }, {} }; From patchwork Tue Aug 16 10:16:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heikki Krogerus X-Patchwork-Id: 12944644 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 A130DC2BB41 for ; Tue, 16 Aug 2022 11:04:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235229AbiHPLEW (ORCPT ); Tue, 16 Aug 2022 07:04:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233171AbiHPLD5 (ORCPT ); Tue, 16 Aug 2022 07:03:57 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83B35F996E; Tue, 16 Aug 2022 03:16:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1660644986; x=1692180986; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=nJljPCZZ6aUR0hItDYXXREgJNCgutz8/X/G4rnfyXUs=; b=WzO1vPJikVc74zTxKwcWq0LUW8LuKjm4bxjnw3Yb5LIpfBx+fZa6sNby liWneasXsbSQwWoT3+oXm0vbZfFnzPZeUiljJ/0SZQeaM5jM2MQz37Fm0 jZGvc0xIZC8FADUgYIn+KemuyM3PI3m1H2Y+lDWxSJVHSXxsBZsM6wLEm EvZ6LeolSOEn//eJg7fcMvYw6jJj6Ad4Jcr/U7oJsjAWcyhQfybsB3ySq rqNj5UiGe2LEUmnkgfZrW4XfrOV+SOUEX2BNffBapmTwTZ9sAyVI54OSY 0WYlQOGwmK+cJINKiBglbDBmeybjoMicaq18JiJwYc5sywu2m0++W7Mmp w==; X-IronPort-AV: E=McAfee;i="6400,9594,10440"; a="279141266" X-IronPort-AV: E=Sophos;i="5.93,240,1654585200"; d="scan'208";a="279141266" 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:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,240,1654585200"; d="scan'208";a="749260762" 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:21 -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 Subject: [PATCH 2/6] ACPI: resource: Filter out the non memory resources in is_memory() Date: Tue, 16 Aug 2022 13:16:25 +0300 Message-Id: <20220816101629.69054-3-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-usb@vger.kernel.org This will generalise the function so it should become useful in more places. Signed-off-by: Heikki Krogerus --- drivers/acpi/resource.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/acpi/resource.c b/drivers/acpi/resource.c index 510cdec375c4d..e644e90d18847 100644 --- a/drivers/acpi/resource.c +++ b/drivers/acpi/resource.c @@ -690,6 +690,9 @@ static int is_memory(struct acpi_resource *ares, void *not_used) memset(&win, 0, sizeof(win)); + if (acpi_dev_filter_resource_type(ares, IORESOURCE_MEM)) + return 1; + return !(acpi_dev_resource_memory(ares, res) || acpi_dev_resource_address_space(ares, &win) || acpi_dev_resource_ext_address_space(ares, &win)); From patchwork Tue Aug 16 10:16:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heikki Krogerus X-Patchwork-Id: 12944665 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 A1F4DC32773 for ; Tue, 16 Aug 2022 11:15:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233375AbiHPLPv (ORCPT ); Tue, 16 Aug 2022 07:15:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235406AbiHPLP1 (ORCPT ); Tue, 16 Aug 2022 07:15:27 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E03974E11; Tue, 16 Aug 2022 03:16:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1660644992; x=1692180992; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=6zUPqg/E6WJ3Fq2O6W3oFh9h+ZOs8adLY8vipG0PDk0=; b=jyva4G3NI+lIsqimwh2EBMfSVs57p9C/NLr0alaoz39fAxsZuG59BEEI 76b9qlJcfkysP89FXVWyb3s4HJoSXL72pGff/bmh581gz4mJQa5t0Aik1 7pQdtExqNen1eyQ5Zvzsk4oSfoE6I/gqyIWeVtUIrGbj+lbDKOpxJs6wf hbL3YLyu94kfsxdynkUV+kx2AqN9XkpF6onCg1bYIa4VKk0tzBvdk77o9 1OEbV3NJIlUINe6c6Gk5E/PEpKxVM/bNH0J2WybdYXNMltI2YJ5XRb+O9 FwNsD26Wv2g7EHubpQSPpFIQ42FAJJXzkVKaI3/CS+yaVZz8H+f/LDBrF Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10440"; a="279141273" X-IronPort-AV: E=Sophos;i="5.93,240,1654585200"; d="scan'208";a="279141273" 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:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,240,1654585200"; d="scan'208";a="749260771" 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:24 -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 Subject: [PATCH 3/6] ACPI: resource: Add helper function acpi_dev_get_memory_resources() Date: Tue, 16 Aug 2022 13:16:26 +0300 Message-Id: <20220816101629.69054-4-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-usb@vger.kernel.org Wrapper function that finds all memory type resources by using acpi_dev_get_resources(). It removes the need for the drivers to check the resource data type separately. Signed-off-by: Heikki Krogerus --- drivers/acpi/resource.c | 17 +++++++++++++++++ include/linux/acpi.h | 1 + 2 files changed, 18 insertions(+) diff --git a/drivers/acpi/resource.c b/drivers/acpi/resource.c index e644e90d18847..8032d50ca9441 100644 --- a/drivers/acpi/resource.c +++ b/drivers/acpi/resource.c @@ -721,6 +721,23 @@ int acpi_dev_get_dma_resources(struct acpi_device *adev, struct list_head *list) } EXPORT_SYMBOL_GPL(acpi_dev_get_dma_resources); +/** + * acpi_dev_get_memory_resources - Get current memory resources of a device. + * @adev: ACPI device node to get the resources for. + * @list: Head of the resultant list of resources (must be empty). + * + * This is a helper function that locates all memory type resources of @adev + * with acpi_dev_get_resources(). + * + * The number of resources in the output list is returned on success, an error + * code reflecting the error condition is returned otherwise. + */ +int acpi_dev_get_memory_resources(struct acpi_device *adev, struct list_head *list) +{ + return acpi_dev_get_resources(adev, list, is_memory, NULL); +} +EXPORT_SYMBOL_GPL(acpi_dev_get_memory_resources); + /** * acpi_dev_filter_resource_type - Filter ACPI resource according to resource * types diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 6f64b2f3dc547..ed4aa395cc49b 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -506,6 +506,7 @@ int acpi_dev_get_resources(struct acpi_device *adev, struct list_head *list, void *preproc_data); int acpi_dev_get_dma_resources(struct acpi_device *adev, struct list_head *list); +int acpi_dev_get_memory_resources(struct acpi_device *adev, struct list_head *list); int acpi_dev_filter_resource_type(struct acpi_resource *ares, unsigned long types); From patchwork Tue Aug 16 10:16:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heikki Krogerus X-Patchwork-Id: 12944643 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 BDAD6C2BB41 for ; Tue, 16 Aug 2022 11:03:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234936AbiHPLDl (ORCPT ); Tue, 16 Aug 2022 07:03:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234904AbiHPLDS (ORCPT ); Tue, 16 Aug 2022 07:03:18 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E4D4167F0; Tue, 16 Aug 2022 03:16:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1660644993; x=1692180993; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=mxszK3Uza1MCMV3HzBQlULox8ga77e1nNvJrjaRmYY4=; b=lR/md7d8cJeq4rKvovu+Y/XN1TmS8NlzIolo/wY6wqduLe7TqhxG6/60 5e631+NOSfnQ2Ljo2vgMAy6P/6JdAXE6P2FI8ktInxEIJZxm0Dqz8S1cl Jq7Ch2uVugr9EZ21oLN3cullSpJhp5j4gs8KBgJq1FvQAdv89ak1DbhmC s5CDa7GIsM5DNXGwamoL08tlMAy+4r3vzUnSN4OXpt5dnljGcY44yr5gj lSp4xOqnC3yIyiV34BRIstCwXuufcJQ7SAbwtw0wgANTXxYXNSQAkr3Wp X4s8t2lLmU7oZsEnZSb35Hjfgn5i8WmP4UY05WAElBmH0MAd7oIIVrokh Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10440"; a="279141282" X-IronPort-AV: E=Sophos;i="5.93,240,1654585200"; d="scan'208";a="279141282" 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:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,240,1654585200"; d="scan'208";a="749260778" 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:26 -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 Subject: [PATCH 4/6] ACPI: APD: Use the helper acpi_dev_get_memory_resources() Date: Tue, 16 Aug 2022 13:16:27 +0300 Message-Id: <20220816101629.69054-5-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-usb@vger.kernel.org It removes the need to check the resource data type separately. Signed-off-by: Heikki Krogerus --- drivers/acpi/acpi_apd.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/acpi/acpi_apd.c b/drivers/acpi/acpi_apd.c index ad245bbd965ec..3bbe2276cac76 100644 --- a/drivers/acpi/acpi_apd.c +++ b/drivers/acpi/acpi_apd.c @@ -60,12 +60,6 @@ static int acpi_apd_setup(struct apd_private_data *pdata) } #ifdef CONFIG_X86_AMD_PLATFORM_DEVICE -static int misc_check_res(struct acpi_resource *ares, void *data) -{ - struct resource res; - - return !acpi_dev_resource_memory(ares, &res); -} static int fch_misc_setup(struct apd_private_data *pdata) { @@ -82,8 +76,7 @@ static int fch_misc_setup(struct apd_private_data *pdata) return -ENOMEM; INIT_LIST_HEAD(&resource_list); - ret = acpi_dev_get_resources(adev, &resource_list, misc_check_res, - NULL); + ret = acpi_dev_get_memory_resources(adev, &resource_list); if (ret < 0) return -ENOENT; From patchwork Tue Aug 16 10:16:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heikki Krogerus X-Patchwork-Id: 12944622 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 825EFC32773 for ; Tue, 16 Aug 2022 10:50:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233148AbiHPKuo (ORCPT ); Tue, 16 Aug 2022 06:50:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234722AbiHPKuT (ORCPT ); Tue, 16 Aug 2022 06:50:19 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62ECC11C37; Tue, 16 Aug 2022 03:16:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1660644995; x=1692180995; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=CZpVmaySJKsjTz2SEFDxIwCpiRQ3ZlOuaduB9ahdSIc=; b=XjpaOGbUhv+FoCa3Jjs4AVyUEo6Mx88MuwmuI8up35fif3k/FaBxcBPE nyLhzyxOusvvS1Zo23TFU3WKX67xjVwHZyok14U2AWnzg7gROOveGZ5VH uQP6aPDvWwwmP3wek4Qc5O/ZOP66gn/a8PfBAGqIB3ZmeFiD/bFAuNf+P mzJvmvZlAjAtw8EDgqsCKOve/U/BrfcYbzPNlbRqwEdlrED0DueXNPL+E ZxRf+K4ok3uAq3NvxWAxNNfPIfBPCB886smpuKm2AM0/AqF/6N92HPIY1 kE7xL4b2pj+PVZCtXZH+WMo7DelhLY5odAm3xCO/GAadPuQrLQdR+qehp Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10440"; a="279141292" X-IronPort-AV: E=Sophos;i="5.93,240,1654585200"; d="scan'208";a="279141292" 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:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,240,1654585200"; d="scan'208";a="749260787" 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:29 -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 Subject: [PATCH 5/6] ACPI: LPSS: Use the helper acpi_dev_get_memory_resources() Date: Tue, 16 Aug 2022 13:16:28 +0300 Message-Id: <20220816101629.69054-6-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-usb@vger.kernel.org It removes the need to check the resource data type separately. Signed-off-by: Heikki Krogerus --- drivers/acpi/acpi_lpss.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c index c4d4d21391d7b..4f6cba8fe8def 100644 --- a/drivers/acpi/acpi_lpss.c +++ b/drivers/acpi/acpi_lpss.c @@ -392,13 +392,6 @@ static const struct acpi_device_id acpi_lpss_device_ids[] = { #ifdef CONFIG_X86_INTEL_LPSS -static int is_memory(struct acpi_resource *res, void *not_used) -{ - struct resource r; - - return !acpi_dev_resource_memory(res, &r); -} - /* LPSS main clock device. */ static struct platform_device *lpss_clk_dev; @@ -659,7 +652,7 @@ static int acpi_lpss_create_device(struct acpi_device *adev, return -ENOMEM; INIT_LIST_HEAD(&resource_list); - ret = acpi_dev_get_resources(adev, &resource_list, is_memory, NULL); + ret = acpi_dev_get_memory_resources(adev, &resource_list); if (ret < 0) goto err_out; From patchwork Tue Aug 16 10:16:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heikki Krogerus X-Patchwork-Id: 12944652 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 03A8FC32774 for ; Tue, 16 Aug 2022 11:09:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235344AbiHPLJL (ORCPT ); Tue, 16 Aug 2022 07:09:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235232AbiHPLIk (ORCPT ); Tue, 16 Aug 2022 07:08:40 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 752DBD398E; Tue, 16 Aug 2022 03:16:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1660644997; x=1692180997; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=EtlYtiwteZxWDMzq7m+ATAtdiv2Skwb0e3zLFg2zc58=; b=bMo8Xr+kIfXW+5F6mupDnNVk8P8Wy2KWATOdiKWlvf9r+W+bgzwbtfeV SRDVfv62gmt8MiUPymnvvswcp+1B4eSnzLs4I26JbCrrLrP5n6/xM0k9O fIJyyXmwig+pWbsOdcqPsnvQDSQ2UHSQ08HdS9+01j22Je6XIv1YRCapT dtBZJlR7I9ilczx5aWzUcDzqOLAr9ZWPKSbC5ldAYwISi+7UAUGm5oAin 3yJjVgjpHgAHcaODYTIh6Oc1Cppc9/dhF01AarbHDx/MM8fEUFSA0EV3J JbdKt484r6Lz475NFCgbLrKkgKbbRxaBazoSWYVBDeIVCirU1Jrd+9mNe w==; X-IronPort-AV: E=McAfee;i="6400,9594,10440"; a="279141302" X-IronPort-AV: E=Sophos;i="5.93,240,1654585200"; d="scan'208";a="279141302" 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:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,240,1654585200"; d="scan'208";a="749260795" 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:31 -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 Subject: [PATCH 6/6] usb: typec: intel_pmc_mux: Use the helper acpi_dev_get_memory_resources() Date: Tue, 16 Aug 2022 13:16:29 +0300 Message-Id: <20220816101629.69054-7-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-usb@vger.kernel.org It removes the need to check the resource data type separately. Signed-off-by: Heikki Krogerus --- drivers/usb/typec/mux/intel_pmc_mux.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/drivers/usb/typec/mux/intel_pmc_mux.c b/drivers/usb/typec/mux/intel_pmc_mux.c index a8e273fe204ab..e1f4df7238bf4 100644 --- a/drivers/usb/typec/mux/intel_pmc_mux.c +++ b/drivers/usb/typec/mux/intel_pmc_mux.c @@ -569,15 +569,6 @@ static int pmc_usb_register_port(struct pmc_usb *pmc, int index, return ret; } -static int is_memory(struct acpi_resource *res, void *data) -{ - struct resource_win win = {}; - struct resource *r = &win.res; - - return !(acpi_dev_resource_memory(res, r) || - acpi_dev_resource_address_space(res, &win)); -} - /* IOM ACPI IDs and IOM_PORT_STATUS_OFFSET */ static const struct acpi_device_id iom_acpi_ids[] = { /* TigerLake */ @@ -611,7 +602,7 @@ static int pmc_usb_probe_iom(struct pmc_usb *pmc) return -ENODEV; INIT_LIST_HEAD(&resource_list); - ret = acpi_dev_get_resources(adev, &resource_list, is_memory, NULL); + ret = acpi_dev_get_memory_resources(adev, &resource_list); if (ret < 0) return ret;