From patchwork Thu Dec 29 12:59:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 638308 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 492FBC3DA7D for ; Thu, 29 Dec 2022 12:59:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233290AbiL2M7i (ORCPT ); Thu, 29 Dec 2022 07:59:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233355AbiL2M7e (ORCPT ); Thu, 29 Dec 2022 07:59:34 -0500 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1008513DE9; Thu, 29 Dec 2022 04:59:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1672318774; x=1703854774; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=34P7+7ieU5tbrjpB2CMgoEmWUxpnYkYbmhyOoY0g5QI=; b=Cu4eGI03S8f2zxWZle3muOnBDAQ4QlcQ24u51MyUvNY8yXoiu3jdK3nG 9DWsmUM/dfHSmPysFa2I8EpJWDd4LJF4SkKVfkiDUfu2E4IjVClO0Cr8x A7MER7j5tklenQybwvNBQisHw/sAweCmuWhVlR0I9HQNIJfcJDPpI7VbO Y8bsJpNBazmWhDEEGig+TGqh95hBJUFdvmHmuJOruFvg9YPPxQJPFmejA pXzdqZd+Qwveaj9d8M8V+klLiF2cuIg8kmccgCv5O0KEo2mTLFV4NEpYf GCwIHqGa7USVl2486BAo2YAwjk5vOQKGocYHKDRMCOZtCXBwcanzLeLEf A==; X-IronPort-AV: E=McAfee;i="6500,9779,10574"; a="348247462" X-IronPort-AV: E=Sophos;i="5.96,284,1665471600"; d="scan'208";a="348247462" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Dec 2022 04:59:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10574"; a="777691260" X-IronPort-AV: E=Sophos;i="5.96,284,1665471600"; d="scan'208";a="777691260" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga004.jf.intel.com with ESMTP; 29 Dec 2022 04:59:30 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 52DE0F8; Thu, 29 Dec 2022 15:00:01 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Mika Westerberg , "Rafael J. Wysocki" , Paul Cercueil , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Cc: Andy Shevchenko , Linus Walleij , "Rafael J. Wysocki" , Len Brown , Pavel Machek Subject: [PATCH v1 1/3] pm: Introduce DEFINE_NOIRQ_DEV_PM_OPS() helper Date: Thu, 29 Dec 2022 14:59:55 +0200 Message-Id: <20221229125957.45923-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221229125957.45923-1-andriy.shevchenko@linux.intel.com> References: <20221229125957.45923-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org There are a few drivers and might be more in the future that open code the functionality of proposed DEFINE_NOIRQ_DEV_PM_OPS() helper. From now on they may switch to the new helper and save a few lines of code. Signed-off-by: Andy Shevchenko --- include/linux/pm.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/pm.h b/include/linux/pm.h index 93cd34f00822..eba96822b1d9 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h @@ -444,6 +444,11 @@ const struct dev_pm_ops __maybe_unused name = { \ SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \ } +#define DEFINE_NOIRQ_DEV_PM_OPS(name, suspend_fn, resume_fn) \ +const struct dev_pm_ops name = { \ + NOIRQ_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \ +} + #define pm_ptr(_ptr) PTR_IF(IS_ENABLED(CONFIG_PM), (_ptr)) #define pm_sleep_ptr(_ptr) PTR_IF(IS_ENABLED(CONFIG_PM_SLEEP), (_ptr)) From patchwork Thu Dec 29 12:59:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 637758 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 5FC0CC4332F for ; Thu, 29 Dec 2022 12:59:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230212AbiL2M7j (ORCPT ); Thu, 29 Dec 2022 07:59:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233383AbiL2M7f (ORCPT ); Thu, 29 Dec 2022 07:59:35 -0500 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E03D13E3A; Thu, 29 Dec 2022 04:59:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1672318774; x=1703854774; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=3WsSO9O51lFPB1otUWTEinjSTgtzgo4BI9Nj5m+iCzE=; b=fmEWMVTj3hxgA9jr76ZHXVZoK4s0GJLg04t4ROqaoGSHreJTOLuIAh4q OYteP2AkvPFOAX4+8Gp9Q5qdwogKekVCPocPFRmew8i1+6ELnQ5Y6fZnS stb22KFPIm4H2dh20fhVY0T9pvYKua1l/hjS/2SxU/FQWVu/+qvvQyjHG 5jNdI/ID2bth3UfLPD7OvgRvsPufRIL3fdML9ZLCAnf8oKvCXQTWtFyGB 7yTkDWzzH/a7tSjTpnTX9pzCq5efS4WWaXj36gMeUS9cd2dHLHCsGRozR kiKor624GzaH/bePF3NlZsGAcnaTl4kgDhOix/NOFew//3MRcNzj9aMn0 A==; X-IronPort-AV: E=McAfee;i="6500,9779,10574"; a="348247468" X-IronPort-AV: E=Sophos;i="5.96,284,1665471600"; d="scan'208";a="348247468" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Dec 2022 04:59:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10574"; a="777691263" X-IronPort-AV: E=Sophos;i="5.96,284,1665471600"; d="scan'208";a="777691263" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga004.jf.intel.com with ESMTP; 29 Dec 2022 04:59:30 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 5CBF719E; Thu, 29 Dec 2022 15:00:01 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Mika Westerberg , "Rafael J. Wysocki" , Paul Cercueil , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Cc: Andy Shevchenko , Linus Walleij , "Rafael J. Wysocki" , Len Brown , Pavel Machek Subject: [PATCH v1 2/3] pinctrl: intel: Switch to use DEFINE_NOIRQ_DEV_PM_OPS() helper Date: Thu, 29 Dec 2022 14:59:56 +0200 Message-Id: <20221229125957.45923-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221229125957.45923-1-andriy.shevchenko@linux.intel.com> References: <20221229125957.45923-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Since pm.h provides a helper for system no-IRQ PM callbacks, switch the driver to use it instead of open coded variant. Signed-off-by: Andy Shevchenko --- drivers/pinctrl/intel/pinctrl-intel.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/pinctrl/intel/pinctrl-intel.h b/drivers/pinctrl/intel/pinctrl-intel.h index 350328988571..207ef71f4a7d 100644 --- a/drivers/pinctrl/intel/pinctrl-intel.h +++ b/drivers/pinctrl/intel/pinctrl-intel.h @@ -261,9 +261,7 @@ int intel_pinctrl_probe_by_uid(struct platform_device *pdev); int intel_pinctrl_suspend_noirq(struct device *dev); int intel_pinctrl_resume_noirq(struct device *dev); -#define INTEL_PINCTRL_PM_OPS(_name) \ -const struct dev_pm_ops _name = { \ - NOIRQ_SYSTEM_SLEEP_PM_OPS(intel_pinctrl_suspend_noirq, intel_pinctrl_resume_noirq) \ -} +#define INTEL_PINCTRL_PM_OPS(name) \ + DEFINE_NOIRQ_DEV_PM_OPS((name), intel_pinctrl_suspend_noirq, intel_pinctrl_resume_noirq) #endif /* PINCTRL_INTEL_H */ From patchwork Thu Dec 29 12:59:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 638307 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 D2748C4708E for ; Thu, 29 Dec 2022 12:59:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233386AbiL2M7j (ORCPT ); Thu, 29 Dec 2022 07:59:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233376AbiL2M7e (ORCPT ); Thu, 29 Dec 2022 07:59:34 -0500 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54F4313E34; Thu, 29 Dec 2022 04:59:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1672318774; x=1703854774; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=cEYKSoq9ion/Msb52XFy1pALM0Lv1Yrd952UiRZkdb8=; b=UWWB2UmAg2uuSNqTDNEplkOTKevWDjfN+1lUl8W4RWjmKe2NYuDkUnrb jmte8hkQ+YojfLLpo9DMkiCuNoBZysUEZh/iZqG6Ve6eVltLIwcObXFw3 deY9HuLAo62XGe8DSa8hyHrHkotIFtkfAac3xP2gtg9Pa9RQOF4Frts7X I0qYNeEZTFUdpr5RoEU0yiSa/j6+J3IXyR6QoRrBp2Qx5FETYBzPUnLO2 lzoMVT5NHWCP48fO/PswtEfDP65ecte7UM1ET+pNp0LptrJmlI547gjBo aCEAiJ2qMoxuio4IpQdcm5bbiRznixSL3AQ8F32EQWAH5bXpOl60FE6Lb Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10574"; a="318722547" X-IronPort-AV: E=Sophos;i="5.96,284,1665471600"; d="scan'208";a="318722547" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Dec 2022 04:59:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10574"; a="684203053" X-IronPort-AV: E=Sophos;i="5.96,284,1665471600"; d="scan'208";a="684203053" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga008.jf.intel.com with ESMTP; 29 Dec 2022 04:59:30 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 660871CA; Thu, 29 Dec 2022 15:00:01 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Mika Westerberg , "Rafael J. Wysocki" , Paul Cercueil , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Cc: Andy Shevchenko , Linus Walleij , "Rafael J. Wysocki" , Len Brown , Pavel Machek Subject: [PATCH v1 3/3] pinctrl: cherryview: Switch to use DEFINE_NOIRQ_DEV_PM_OPS() helper Date: Thu, 29 Dec 2022 14:59:57 +0200 Message-Id: <20221229125957.45923-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221229125957.45923-1-andriy.shevchenko@linux.intel.com> References: <20221229125957.45923-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Since pm.h provides a helper for system no-IRQ PM callbacks, switch the driver to use it instead of open coded variant. Signed-off-by: Andy Shevchenko --- drivers/pinctrl/intel/pinctrl-cherryview.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/pinctrl/intel/pinctrl-cherryview.c b/drivers/pinctrl/intel/pinctrl-cherryview.c index 917563cef965..ddb83a40cce5 100644 --- a/drivers/pinctrl/intel/pinctrl-cherryview.c +++ b/drivers/pinctrl/intel/pinctrl-cherryview.c @@ -1875,9 +1875,7 @@ static int chv_pinctrl_resume_noirq(struct device *dev) return 0; } -static const struct dev_pm_ops chv_pinctrl_pm_ops = { - NOIRQ_SYSTEM_SLEEP_PM_OPS(chv_pinctrl_suspend_noirq, chv_pinctrl_resume_noirq) -}; +static DEFINE_NOIRQ_DEV_PM_OPS(chv_pinctrl_pm_ops, chv_pinctrl_suspend_noirq, chv_pinctrl_resume_noirq); static const struct acpi_device_id chv_pinctrl_acpi_match[] = { { "INT33FF", (kernel_ulong_t)chv_soc_data },