From mboxrd@z Thu Jan 1 00:00:00 1970 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 D9E9FC4167B for ; Mon, 30 Oct 2023 19:41:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231685AbjJ3TlX (ORCPT ); Mon, 30 Oct 2023 15:41:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229905AbjJ3TlV (ORCPT ); Mon, 30 Oct 2023 15:41:21 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8DB8AB3; Mon, 30 Oct 2023 12:41:18 -0700 (PDT) Received: from lhrpeml500005.china.huawei.com (unknown [172.18.147.201]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4SK3Sb4Fw2z67ZHd; Tue, 31 Oct 2023 03:37:19 +0800 (CST) Received: from localhost (10.48.147.130) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Mon, 30 Oct 2023 19:41:15 +0000 Date: Mon, 30 Oct 2023 19:41:12 +0000 From: Jonathan Cameron To: Andy Shevchenko CC: Mika Westerberg , , , Andy Shevchenko , Linus Walleij , Paul Cercueil Subject: Re: [PATCH v3 01/17] pinctrl: intel: Provide Intel pin control wide PM ops structure Message-ID: <20231030194112.00001917@Huawei.com> In-Reply-To: <20231030120734.2831419-2-andriy.shevchenko@linux.intel.com> References: <20231030120734.2831419-1-andriy.shevchenko@linux.intel.com> <20231030120734.2831419-2-andriy.shevchenko@linux.intel.com> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.33; x86_64-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.48.147.130] X-ClientProxiedBy: lhrpeml100005.china.huawei.com (7.191.160.25) To lhrpeml500005.china.huawei.com (7.191.163.240) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 30 Oct 2023 14:07:18 +0200 Andy Shevchenko wrote: > With the help of EXPORT_NS_GPL_DEV_PM_OPS() and > NOIRQ_SYSTEM_SLEEP_PM_OPS() we may convert PM ops functions to become > static. This also takes into account the PM configuration options such > as CONFIG_PM and CONFIG_PM_SLEEP. Hence the first step is to provide > a generic PM ops structure that can be used by drivers directly. It's a good thing to do, but if rolling a v3, should mention that the export moves into the namespace. > > Signed-off-by: Andy Shevchenko Other than that, LGTM Reviewed-by: Jonathan Cameron > --- > drivers/pinctrl/intel/pinctrl-intel.c | 8 +++++--- > drivers/pinctrl/intel/pinctrl-intel.h | 4 ++-- > 2 files changed, 7 insertions(+), 5 deletions(-) > > diff --git a/drivers/pinctrl/intel/pinctrl-intel.c b/drivers/pinctrl/intel/pinctrl-intel.c > index b19527a8728e..9fbdc7bfa65c 100644 > --- a/drivers/pinctrl/intel/pinctrl-intel.c > +++ b/drivers/pinctrl/intel/pinctrl-intel.c > @@ -899,7 +899,7 @@ static int intel_gpio_to_pin(struct intel_pinctrl *pctrl, unsigned int offset, > * > * Return: a GPIO offset, or negative error code if translation can't be done. > */ > -static __maybe_unused int intel_pin_to_gpio(struct intel_pinctrl *pctrl, int pin) > +static int intel_pin_to_gpio(struct intel_pinctrl *pctrl, int pin) > { > const struct intel_community *community; > const struct intel_padgroup *padgrp; > @@ -1682,7 +1682,6 @@ const struct intel_pinctrl_soc_data *intel_pinctrl_get_soc_data(struct platform_ > } > EXPORT_SYMBOL_NS_GPL(intel_pinctrl_get_soc_data, PINCTRL_INTEL); > > -#ifdef CONFIG_PM_SLEEP > static bool __intel_gpio_is_direct_irq(u32 value) > { > return (value & PADCFG0_GPIROUTIOXAPIC) && (value & PADCFG0_GPIOTXDIS) && > @@ -1883,7 +1882,10 @@ int intel_pinctrl_resume_noirq(struct device *dev) > return 0; > } > EXPORT_SYMBOL_GPL(intel_pinctrl_resume_noirq); > -#endif > + > +EXPORT_NS_GPL_DEV_PM_OPS(intel_pinctrl_pm_ops, PINCTRL_INTEL) = { > + NOIRQ_SYSTEM_SLEEP_PM_OPS(intel_pinctrl_suspend_noirq, intel_pinctrl_resume_noirq) > +}; > > MODULE_AUTHOR("Mathias Nyman "); > MODULE_AUTHOR("Mika Westerberg "); > diff --git a/drivers/pinctrl/intel/pinctrl-intel.h b/drivers/pinctrl/intel/pinctrl-intel.h > index 2bb553598e8b..d3f511f97ed9 100644 > --- a/drivers/pinctrl/intel/pinctrl-intel.h > +++ b/drivers/pinctrl/intel/pinctrl-intel.h > @@ -255,10 +255,8 @@ struct intel_pinctrl { > int intel_pinctrl_probe_by_hid(struct platform_device *pdev); > int intel_pinctrl_probe_by_uid(struct platform_device *pdev); > > -#ifdef CONFIG_PM_SLEEP > int intel_pinctrl_suspend_noirq(struct device *dev); > int intel_pinctrl_resume_noirq(struct device *dev); > -#endif > > #define INTEL_PINCTRL_PM_OPS(_name) \ > const struct dev_pm_ops _name = { \ > @@ -266,6 +264,8 @@ const struct dev_pm_ops _name = { \ > intel_pinctrl_resume_noirq) \ > } > > +extern const struct dev_pm_ops intel_pinctrl_pm_ops; > + > struct intel_community *intel_get_community(struct intel_pinctrl *pctrl, unsigned int pin); > > int intel_get_groups_count(struct pinctrl_dev *pctldev);