From nobody Wed Apr 29 00:43:00 2026 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 8AA28C433EF for ; Thu, 26 May 2022 11:43:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346362AbiEZLnk (ORCPT ); Thu, 26 May 2022 07:43:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344229AbiEZLn3 (ORCPT ); Thu, 26 May 2022 07:43:29 -0400 Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A2493B01E for ; Thu, 26 May 2022 04:43:28 -0700 (PDT) Received: by mail-pg1-x536.google.com with SMTP id f4so1131749pgf.4 for ; Thu, 26 May 2022 04:43:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5ICLhiag2MG0TcU1CEpBsvSmVvNH61YfDddhyxbVjdo=; b=NW3YMKYJ2u6ZAxIW+TAVBUtdPiLuFvlZHr6YJoG4Ay6ruPQbO0BRBiUMuadLF1tS5P rMJvo1tBeBzSFjuOGuz8mSj3DHBFWTfsXKke8DCaoW2seKowZE30sbWA6tL0jdJ/D+Q9 Ys8sdsQ0yTjrTIANPxf1dmRwCkcC2X3G+MRJeq33yDWVMwB8vGdD1DnM63uZiVDpXKOJ mDmI5mHiiXFoi4BauIWA9/v5ynSrigrhSd5WYdnp5hx92XWD18qJhUbiVy1KQTq4VVea ZUpDY029BHf3cfjNe1KrQwGqkTW18KxMa0s7lCYmPUaFrwabwBlX2re4xTqmKcWbpRXE 9JYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5ICLhiag2MG0TcU1CEpBsvSmVvNH61YfDddhyxbVjdo=; b=ned+bvRCjxdJvMOUPYj2q/h3dbIZFd+9YIQPv2djzstUa0xmZGrnCb9W/FLRBLdCnJ XrONYcfJzxuT1AUuxfHEzhXxlngLZJW6/CAmOAgOG1v+VN7AsUikWiYKXZDouVeLXpNy GW1QFtpob4W3uvHDI4N2k2r5F+vDB9pOy0LoDi4NIxqohtzc8eUD/mK4veK3KPxYdLm7 KDHjhtjgJUYddHbkAwR/4uY3su2YLWyLBYCkwwP+/RHkUIjzVjd6/PW6sF6zNFHd7SnF +iZLF39ptk3AZRZz34M8xWDLB8MZieFa0imT4yki8TzVCD3r77N2sIS0TqzlTuqO6i4B BBSA== X-Gm-Message-State: AOAM531f2OecohwPZMSRELJGdfTLs3+swkF53diCxiGmuKFhbE6i0lDD VM26ohOM3JIUT1etHuOYN1VKug== X-Google-Smtp-Source: ABdhPJx/KoTEA762ymydMHQN0pjB5UfQPe0kbSUc+S/RuBIuRxVbzsu5Us3zo1Pk5dKcHW0zMevydg== X-Received: by 2002:a63:eb4e:0:b0:3fb:74d2:92d1 with SMTP id b14-20020a63eb4e000000b003fb74d292d1mr754826pgk.105.1653565407845; Thu, 26 May 2022 04:43:27 -0700 (PDT) Received: from localhost ([122.162.234.2]) by smtp.gmail.com with ESMTPSA id m1-20020a170902f64100b001618b70dcc9sm1328235plg.101.2022.05.26.04.43.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 May 2022 04:43:27 -0700 (PDT) From: Viresh Kumar To: Viresh Kumar , Nishanth Menon , Stephen Boyd Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , Rafael Wysocki , Krzysztof Kozlowski , linux-kernel@vger.kernel.org Subject: [PATCH 01/31] OPP: Track if clock name is configured by platform Date: Thu, 26 May 2022 17:12:00 +0530 Message-Id: <60d629a2f476598de60e44430ef754f0838ecc9d.1653564321.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Track if the clock name is configured by the platform or not. This is a preparatory change and will be used by later commits. This also makes the behavior of the clkname API similar to other ones, which allow repeated calls to the same API for each CPU. Signed-off-by: Viresh Kumar --- drivers/opp/core.c | 7 +++++++ drivers/opp/opp.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/drivers/opp/core.c b/drivers/opp/core.c index ff0364733dcb..254782b3a6a0 100644 --- a/drivers/opp/core.c +++ b/drivers/opp/core.c @@ -2277,6 +2277,10 @@ struct opp_table *dev_pm_opp_set_clkname(struct devi= ce *dev, const char *name) goto err; } =20 + /* Another CPU that shares the OPP table has set the clkname ? */ + if (opp_table->clk_configured) + return opp_table; + /* clk shouldn't be initialized at this point */ if (WARN_ON(opp_table->clk)) { ret =3D -EBUSY; @@ -2291,6 +2295,8 @@ struct opp_table *dev_pm_opp_set_clkname(struct devic= e *dev, const char *name) goto err; } =20 + opp_table->clk_configured =3D true; + return opp_table; =20 err: @@ -2311,6 +2317,7 @@ void dev_pm_opp_put_clkname(struct opp_table *opp_tab= le) =20 clk_put(opp_table->clk); opp_table->clk =3D ERR_PTR(-EINVAL); + opp_table->clk_configured =3D false; =20 dev_pm_opp_put_opp_table(opp_table); } diff --git a/drivers/opp/opp.h b/drivers/opp/opp.h index 45e3a55239a1..9e1cfcb0ea98 100644 --- a/drivers/opp/opp.h +++ b/drivers/opp/opp.h @@ -149,6 +149,7 @@ enum opp_table_access { * @supported_hw: Array of version number to support. * @supported_hw_count: Number of elements in supported_hw array. * @prop_name: A name to postfix to many DT properties, while parsing them. + * @clk_configured: Clock name is configured by the platform. * @clk: Device's clock handle * @regulators: Supply regulators * @regulator_count: Number of power supply regulators. Its value can be -1 @@ -200,6 +201,7 @@ struct opp_table { unsigned int *supported_hw; unsigned int supported_hw_count; const char *prop_name; + bool clk_configured; struct clk *clk; struct regulator **regulators; int regulator_count; --=20 2.31.1.272.g89b43f80a514 From nobody Wed Apr 29 00:43:00 2026 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 04AD7C433EF for ; Thu, 26 May 2022 11:43:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347209AbiEZLnv (ORCPT ); Thu, 26 May 2022 07:43:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345494AbiEZLne (ORCPT ); Thu, 26 May 2022 07:43:34 -0400 Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BAD853C49B for ; Thu, 26 May 2022 04:43:31 -0700 (PDT) Received: by mail-pj1-x1031.google.com with SMTP id l7-20020a17090aaa8700b001dd1a5b9965so1513333pjq.2 for ; Thu, 26 May 2022 04:43:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1SfGsAuCxadA/cDC19UzEIDjU/68K6RkhJ0RF22ULOY=; b=rbW8fueifXqw0HCB+T7bIwUUKmpncq69A58HME38ewGvneWCpXJINF4+3pXYVi8mMM sVjvpsnKL8B23XO0vR5r+vB/VRmko0NE3b7abTHcx8WZyxSjcAolF9m6yj7YTV+65/EJ 5XRPWkKGnqHsqsxiD6dlwTxOts9w4eQRw6Nj+Us2sqrS4qaEoI9RFbTH9SLJjn6CQZNW OqTy6sS/4TOKv7bflxJ88Arg2ZGp+7zM+aAq0ue4ZEOOLSyyZFUzGlx7raDbM674t6K6 DX0Krs505gxOK2/J07VN290ttpSt9gpjauYiO67qlTmTNsOdV6VdX+R9IQAVO3xSxcQs iEbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1SfGsAuCxadA/cDC19UzEIDjU/68K6RkhJ0RF22ULOY=; b=I9DedfTDdd6gYGljAMbpwZ+nIQYdr/kt4GMC2Ji3aj/27jeBK70gXKG130KcstHYtQ TFUX9rUdZMOqANi0p7zr9flGrjnaAT/wlIau81Soh3NkwVyOhsMISDo2MRrIfUVP78Xu CYkc1/fBZ3HVYv8jAqWEktWo1NR4sDRYJKfV3mpth63BqAzCsanw0bm1q34pLFiJvftc yLkpTE0z+aue1XYj9MLGCdRWR3V/edCyULQks8EPDvWNSCDt0mp6HHjmsuwmMsSPQecL PciGHGEa80UPVrW4rRQ0Q1u8a8iEQASIIytMFTApGXtIdtWfscvlNWgFQjaIoZ+IU+3U P7Jg== X-Gm-Message-State: AOAM530yF9Lz9oJaxi14za/Zk+bJ++C126S41xxmEAAAb6hPmMIEedqw arCoVgAKAvpVQ++2jnbHcc/a5HQnhAjYdA== X-Google-Smtp-Source: ABdhPJxy73Mag2moVhV6qx9boSqgvGT2G39KdgDtMteyXS2f66J7ZIFaU4ZWdVxmUBwORsIoXOOHKg== X-Received: by 2002:a17:902:e804:b0:161:969c:ab59 with SMTP id u4-20020a170902e80400b00161969cab59mr39025208plg.142.1653565411326; Thu, 26 May 2022 04:43:31 -0700 (PDT) Received: from localhost ([122.162.234.2]) by smtp.gmail.com with ESMTPSA id q20-20020a170902789400b0015eaa9aee50sm1271235pll.202.2022.05.26.04.43.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 May 2022 04:43:30 -0700 (PDT) From: Viresh Kumar To: Viresh Kumar , Nishanth Menon , Stephen Boyd , "Rafael J. Wysocki" Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , Rafael Wysocki , Krzysztof Kozlowski , linux-kernel@vger.kernel.org Subject: [PATCH 02/31] OPP: Add dev_pm_opp_set_config() and friends Date: Thu, 26 May 2022 17:12:01 +0530 Message-Id: <9c4b2bfe628bf7a583a96cee7cc3539e2e66245e.1653564321.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The OPP core already have few configuration specific APIs and it is getting complex or messy for both the OPP core and its users. Lets introduce a new set of API which will be used for all kind of different configurations, and shall eventually replace all the existing ones. Signed-off-by: Viresh Kumar --- drivers/opp/core.c | 145 +++++++++++++++++++++++++++++++++++++++++ include/linux/pm_opp.h | 42 ++++++++++++ 2 files changed, 187 insertions(+) diff --git a/drivers/opp/core.c b/drivers/opp/core.c index 254782b3a6a0..30dbef0f4d17 100644 --- a/drivers/opp/core.c +++ b/drivers/opp/core.c @@ -2618,6 +2618,151 @@ int devm_pm_opp_attach_genpd(struct device *dev, co= nst char * const *names, } EXPORT_SYMBOL_GPL(devm_pm_opp_attach_genpd); =20 +/** + * dev_pm_opp_set_config() - Set OPP configuration for the device. + * @dev: Device for which configuration is being set. + * @config: OPP configuration. + * + * This allows all device OPP configurations to be performed at once. + * + * This must be called before any OPPs are initialized for the device. Thi= s may + * be called multiple times for the same OPP table, for example once for e= ach + * CPU that share the same table. This must be balanced by the same number= of + * calls to dev_pm_opp_clear_config() in order to free the OPP table prope= rly. + */ +struct opp_table *dev_pm_opp_set_config(struct device *dev, + struct dev_pm_opp_config *config) +{ + struct opp_table *opp_table, *ret; + + opp_table =3D _add_opp_table(dev, false); + if (IS_ERR(opp_table)) + return opp_table; + + /* This should be called before OPPs are initialized */ + if (WARN_ON(!list_empty(&opp_table->opp_list))) { + ret =3D ERR_PTR(-EBUSY); + goto err; + } + + // Configure clock + if (config->clk_name) { + ret =3D dev_pm_opp_set_clkname(dev, config->clk_name); + if (IS_ERR(ret)) + goto err; + } + + // Configure property names + if (config->prop_name) { + ret =3D dev_pm_opp_set_prop_name(dev, config->prop_name); + if (IS_ERR(ret)) + goto err; + } + + // Configure opp helper + if (config->set_opp) { + ret =3D dev_pm_opp_register_set_opp_helper(dev, config->set_opp); + if (IS_ERR(ret)) + goto err; + } + + // Configure supported hardware + if (config->supported_hw) { + ret =3D dev_pm_opp_set_supported_hw(dev, config->supported_hw, + config->supported_hw_count); + if (IS_ERR(ret)) + goto err; + } + + // Configure supplies + if (config->regulator_names) { + ret =3D dev_pm_opp_set_regulators(dev, config->regulator_names, + config->regulator_count); + if (IS_ERR(ret)) + goto err; + } + + // Attach genpds + if (config->genpd_names) { + ret =3D dev_pm_opp_attach_genpd(dev, config->genpd_names, + config->virt_devs); + if (IS_ERR(ret)) + goto err; + } + + return opp_table; + +err: + dev_pm_opp_clear_config(opp_table); + return ret; +} +EXPORT_SYMBOL_GPL(dev_pm_opp_set_config); + +/** + * dev_pm_opp_clear_config() - Releases resources blocked for OPP configur= ation. + * @opp_table: OPP table returned from dev_pm_opp_set_config(). + * + * This allows all device OPP configurations to be cleared at once. This m= ust be + * called once for each call made to dev_pm_opp_set_config(), in order to = free + * the OPPs properly. + * + * Currently the first call itself ends up freeing all the OPP configurati= ons, + * while the later ones only drop the OPP table reference. This works well= for + * now as we would never want to use an half initialized OPP table and wan= t to + * remove the configurations together. + */ +void dev_pm_opp_clear_config(struct opp_table *opp_table) +{ + if (opp_table->genpd_virt_devs) + dev_pm_opp_detach_genpd(opp_table); + + if (opp_table->regulators) + dev_pm_opp_put_regulators(opp_table); + + if (opp_table->supported_hw) + dev_pm_opp_put_supported_hw(opp_table); + + if (opp_table->set_opp) + dev_pm_opp_unregister_set_opp_helper(opp_table); + + if (opp_table->prop_name) + dev_pm_opp_put_prop_name(opp_table); + + if (opp_table->clk_configured) + dev_pm_opp_put_clkname(opp_table); + + dev_pm_opp_put_opp_table(opp_table); +} +EXPORT_SYMBOL_GPL(dev_pm_opp_clear_config); + +static void devm_pm_opp_config_release(void *data) +{ + dev_pm_opp_clear_config(data); +} + +/** + * devm_pm_opp_set_config() - Set OPP configuration for the device. + * @dev: Device for which configuration is being set. + * @config: OPP configuration. + * + * This allows all device OPP configurations to be performed at once. + * This is a resource-managed variant of dev_pm_opp_set_config(). + * + * Return: 0 on success and errorno otherwise. + */ +int devm_pm_opp_set_config(struct device *dev, struct dev_pm_opp_config *c= onfig) +{ + struct opp_table *opp_table; + + opp_table =3D dev_pm_opp_set_config(dev, config); + if (IS_ERR(opp_table)) + return PTR_ERR(opp_table); + + return devm_add_action_or_reset(dev, devm_pm_opp_config_release, + opp_table); +} +EXPORT_SYMBOL_GPL(devm_pm_opp_set_config); + /** * dev_pm_opp_xlate_required_opp() - Find required OPP for @src_table OPP. * @src_table: OPP table which has @dst_table as one of its required OPP t= able. diff --git a/include/linux/pm_opp.h b/include/linux/pm_opp.h index 6708b4ec244d..0d5d07dd164a 100644 --- a/include/linux/pm_opp.h +++ b/include/linux/pm_opp.h @@ -90,6 +90,32 @@ struct dev_pm_set_opp_data { struct device *dev; }; =20 +/** + * struct dev_pm_opp_config - Device OPP configuration values + * @clk_name: Clk name. + * @prop_name: Name to postfix to properties. + * @set_opp: Custom set OPP helper. + * @supported_hw: Array of hierarchy of versions to match. + * @supported_hw_count: Number of elements in the array. + * @regulator_names: Array of pointers to the names of the regulator. + * @regulator_count: Number of regulators. + * @genpd_names: Null terminated array of pointers containing names of gen= pd to attach. + * @virt_devs: Pointer to return the array of virtual devices. + * + * This structure contains platform specific OPP configurations for the de= vice. + */ +struct dev_pm_opp_config { + const char *clk_name; + const char *prop_name; + int (*set_opp)(struct dev_pm_set_opp_data *data); + unsigned int *supported_hw; + unsigned int supported_hw_count; + const char * const *regulator_names; + unsigned int regulator_count; + const char * const *genpd_names; + struct device ***virt_devs; +}; + #if defined(CONFIG_PM_OPP) =20 struct opp_table *dev_pm_opp_get_opp_table(struct device *dev); @@ -154,6 +180,10 @@ int dev_pm_opp_disable(struct device *dev, unsigned lo= ng freq); int dev_pm_opp_register_notifier(struct device *dev, struct notifier_block= *nb); int dev_pm_opp_unregister_notifier(struct device *dev, struct notifier_blo= ck *nb); =20 +struct opp_table *dev_pm_opp_set_config(struct device *dev, struct dev_pm_= opp_config *config); +int devm_pm_opp_set_config(struct device *dev, struct dev_pm_opp_config *c= onfig); +void dev_pm_opp_clear_config(struct opp_table *opp_table); + struct opp_table *dev_pm_opp_set_supported_hw(struct device *dev, const u3= 2 *versions, unsigned int count); void dev_pm_opp_put_supported_hw(struct opp_table *opp_table); int devm_pm_opp_set_supported_hw(struct device *dev, const u32 *versions, = unsigned int count); @@ -419,6 +449,18 @@ static inline int devm_pm_opp_attach_genpd(struct devi= ce *dev, return -EOPNOTSUPP; } =20 +static inline struct opp_table *dev_pm_opp_set_config(struct device *dev, = struct dev_pm_opp_config *config) +{ + return ERR_PTR(-EOPNOTSUPP); +} + +static inline int devm_pm_opp_set_config(struct device *dev, struct dev_pm= _opp_config *config) +{ + return -EOPNOTSUPP; +} + +static inline void dev_pm_opp_clear_config(struct opp_table *opp_table) {} + static inline struct dev_pm_opp *dev_pm_opp_xlate_required_opp(struct opp_= table *src_table, struct opp_table *dst_table, struct dev_pm_opp *src_opp) { --=20 2.31.1.272.g89b43f80a514 From nobody Wed Apr 29 00:43:00 2026 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 BA9F0C4332F for ; Thu, 26 May 2022 11:44:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243164AbiEZLn5 (ORCPT ); Thu, 26 May 2022 07:43:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241420AbiEZLnr (ORCPT ); Thu, 26 May 2022 07:43:47 -0400 Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E26E53CA69 for ; Thu, 26 May 2022 04:43:34 -0700 (PDT) Received: by mail-pj1-x1031.google.com with SMTP id gk22so1536486pjb.1 for ; Thu, 26 May 2022 04:43:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kMTBzF5GicTdtcI+q0Njd7W32oNENUig/mMmCqOVS/0=; b=ECi8lONJz84vPA+6+yEdoeSZJvDmlwibpoOcQAEudBjrrORfDZ/A7oQAi1gqj8vgRR R+aqLr1rCe0jlBex5tphEGJ7fCpucrSMkTjnakJRfX97TsQII573ISpzpCCuM58QT9nH nXZ5IxBlFOY0JD+INnxF8anGEdvIsejZPxNtpwcXyOqsf0eWz3z4Nk0RTuKsXtgHsbvs 0HYW94kSNL3bXaYX2ZN84qn8SAu6dvkj+XsKjLzs78nPc836WmFnEydmRKvjQPiwZp5p Rs/39UtauVouAx7r0D/kbMkbS+cibwfpPKIo2VVimuLkcQPb6ZfAtSDavkUFyl2OxuET sYhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kMTBzF5GicTdtcI+q0Njd7W32oNENUig/mMmCqOVS/0=; b=tId0oY7YTYgHJHo6SylKAaWwAn1ftEbioNTgN5eczWfoFZetgOvgDP1tgme1eMsfmF IHWPAY5kItb3w+pemf2aveySpRmh6Ist/5sKxFe66/bqaQRL7gidtlsPdw++qGm4D30K 3eGQ+F5fwrwWaY6jHarBQku4ZJY5nbaoDYOUS4SpY1UB1bmmjs3c54NDInUIyR6Ic5Gv vM/YNG1E2x83pHN8+lz8NBtsbPBuH7IlV3ah5sEsFXI98gg58prc0Z+xT4Hjl3fC/QeM 12VVliYFx1WGK25vsmG6dH5C60CTDimjreENxGpGI53bHYuY/yYKIjvZPtrYVaY9o+iQ XIyw== X-Gm-Message-State: AOAM533+aH89tJjj2T9peUUjNGTqcwGqqZuok7LBClYPlD4Q2iIkbIet 2iLtz4UaNrm5jo27XvyFXS1Ljg== X-Google-Smtp-Source: ABdhPJzBbBXOIW7AH9VqiZmcSr1TWNB9MDwyZf88IfV8UNEVzAgf3SeMfmF1BnlsZTyvge51/vwdqw== X-Received: by 2002:a17:90b:4a8c:b0:1df:c71d:5104 with SMTP id lp12-20020a17090b4a8c00b001dfc71d5104mr2184562pjb.216.1653565414412; Thu, 26 May 2022 04:43:34 -0700 (PDT) Received: from localhost ([122.162.234.2]) by smtp.gmail.com with ESMTPSA id k3-20020a170902d58300b0016168e90f3fsm1314412plh.5.2022.05.26.04.43.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 May 2022 04:43:34 -0700 (PDT) From: Viresh Kumar To: "Rafael J. Wysocki" , Viresh Kumar Cc: linux-pm@vger.kernel.org, Vincent Guittot , Rafael Wysocki , Stephen Boyd , Nishanth Menon , Krzysztof Kozlowski , linux-kernel@vger.kernel.org Subject: [PATCH 03/31] cpufreq: dt: Migrate to dev_pm_opp_set_config() Date: Thu, 26 May 2022 17:12:02 +0530 Message-Id: X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The OPP core now provides a unified API for setting all configuration types, i.e. dev_pm_opp_set_config(). Lets start using it. Signed-off-by: Viresh Kumar --- drivers/cpufreq/cpufreq-dt.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c index 8fcaba541539..65f299acb0c4 100644 --- a/drivers/cpufreq/cpufreq-dt.c +++ b/drivers/cpufreq/cpufreq-dt.c @@ -220,12 +220,16 @@ static int dt_cpufreq_early_init(struct device *dev, = int cpu) */ reg_name =3D find_supply_name(cpu_dev); if (reg_name) { - priv->opp_table =3D dev_pm_opp_set_regulators(cpu_dev, ®_name, - 1); + struct dev_pm_opp_config config =3D { + .regulator_names =3D ®_name, + .regulator_count =3D 1, + }; + + priv->opp_table =3D dev_pm_opp_set_config(cpu_dev, &config); if (IS_ERR(priv->opp_table)) { ret =3D PTR_ERR(priv->opp_table); if (ret !=3D -EPROBE_DEFER) - dev_err(cpu_dev, "failed to set regulators: %d\n", + dev_err(cpu_dev, "failed to set OPP config: %d\n", ret); goto free_cpumask; } @@ -295,7 +299,7 @@ static int dt_cpufreq_early_init(struct device *dev, in= t cpu) out: if (priv->have_static_opps) dev_pm_opp_of_cpumask_remove_table(priv->cpus); - dev_pm_opp_put_regulators(priv->opp_table); + dev_pm_opp_clear_config(priv->opp_table); free_cpumask: free_cpumask_var(priv->cpus); return ret; @@ -309,7 +313,7 @@ static void dt_cpufreq_release(void) dev_pm_opp_free_cpufreq_table(priv->cpu_dev, &priv->freq_table); if (priv->have_static_opps) dev_pm_opp_of_cpumask_remove_table(priv->cpus); - dev_pm_opp_put_regulators(priv->opp_table); + dev_pm_opp_clear_config(priv->opp_table); free_cpumask_var(priv->cpus); list_del(&priv->node); } --=20 2.31.1.272.g89b43f80a514 From nobody Wed Apr 29 00:43:00 2026 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 E63D2C433FE for ; Thu, 26 May 2022 11:45:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347227AbiEZLpF (ORCPT ); Thu, 26 May 2022 07:45:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345972AbiEZLnt (ORCPT ); Thu, 26 May 2022 07:43:49 -0400 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6DF163DDEA for ; Thu, 26 May 2022 04:43:38 -0700 (PDT) Received: by mail-pj1-x1035.google.com with SMTP id z11so1520298pjc.3 for ; Thu, 26 May 2022 04:43:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rm1D/w2QvTu4or6R4hVEWZEG7Ji+GbsLOWNM+13EdT0=; b=Fd6PbFwGgpst1ab5pqOOW4QTQNxMqsotRztlxhyBXRB9vSU8cR6l8K41Jbn967c9An MFLcQSGLMm7Mf/rirshMD4Sv+3ABPCSjnyZ4krYlhRhdAd5Dl1q4SJGjZ5qNaqRWihRA J9+lJtvhvQ0tBVhuUY6uoz/0PBzfEC2kioPqVDuMoYW2Z6WEawIjGAjeZJ6Y4UMAX7xj CRP/wK7D/TBdX68CnrinT62c0JI4dD8dZOHu33+1NBXljRLPA3AVTGkfToUUYDAN+Cg8 7HJrhThNKB0IqEON+9/H65bREo6Gg0wtQKOGiUfo/5mZbA0Uzsc54ww9Dcu8PborF3qP 7oGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rm1D/w2QvTu4or6R4hVEWZEG7Ji+GbsLOWNM+13EdT0=; b=00vV+rj3+OpWv2vbKy0rZ65ZvqWJwP+ST1nkDdaXE+hpi6ryvksL+0Zz+i+elmlUUT +mwwrIF9loOXKknOp7soN7RAgEGKn97uJan2/xLUoEYBi5wofvw3Qz75Mf6TWDuAt0la bRB67eYJZBfcIorD2rotzfbR7nw+bnjSLqvfeXHqf6FvzI10k/a5VzjG1Y+QX4LG4fSG 8RoIBh06flHz0hCZH5NtmLSRZ5H3NgmSRzhaxSkv4I7C8oUCk/0sMItUzZY9I4l8uqb0 pL1qTzRwoEWs5w9pf1V+zQ9r1T7lXUzi01kUJFzpX9hYkPBPfQeSfL4MgoNxv+I8vCgP k1bA== X-Gm-Message-State: AOAM531H+A+FqqCwcm7a2LP7Bq4GbzSWGup9GkZGAAmWn5FZFxHvgxKU uLLkq8XBfZ3cmJkaelWsZ6IoBQ== X-Google-Smtp-Source: ABdhPJwL2+vUZJljvm15zkMsICuHtMSjWDz1W5QvpfO7supCE+5odduI8PvAbAnWZVnkOOf/YRXaHQ== X-Received: by 2002:a17:90a:8916:b0:1e0:9f07:6d39 with SMTP id u22-20020a17090a891600b001e09f076d39mr2200543pjn.163.1653565417763; Thu, 26 May 2022 04:43:37 -0700 (PDT) Received: from localhost ([122.162.234.2]) by smtp.gmail.com with ESMTPSA id o20-20020a63fb14000000b003ed6b3dc52esm1331741pgh.55.2022.05.26.04.43.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 May 2022 04:43:37 -0700 (PDT) From: Viresh Kumar To: "Rafael J. Wysocki" , Viresh Kumar , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team Cc: linux-pm@vger.kernel.org, Vincent Guittot , Rafael Wysocki , Stephen Boyd , Nishanth Menon , Krzysztof Kozlowski , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 04/31] cpufreq: imx: Migrate to dev_pm_opp_set_config() Date: Thu, 26 May 2022 17:12:03 +0530 Message-Id: <2d9e2996d9ca9da1561f50f58520c7f2ced53e0a.1653564321.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The OPP core now provides a unified API for setting all configuration types, i.e. dev_pm_opp_set_config(). Lets start using it. Signed-off-by: Viresh Kumar --- drivers/cpufreq/imx-cpufreq-dt.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/cpufreq/imx-cpufreq-dt.c b/drivers/cpufreq/imx-cpufreq= -dt.c index 3fe9125156b4..57917b0670f2 100644 --- a/drivers/cpufreq/imx-cpufreq-dt.c +++ b/drivers/cpufreq/imx-cpufreq-dt.c @@ -86,6 +86,10 @@ static int imx_cpufreq_dt_probe(struct platform_device *= pdev) u32 cell_value, supported_hw[2]; int speed_grade, mkt_segment; int ret; + struct dev_pm_opp_config config =3D { + .supported_hw =3D supported_hw, + .supported_hw_count =3D ARRAY_SIZE(supported_hw), + }; =20 cpu_dev =3D get_cpu_device(0); =20 @@ -153,17 +157,17 @@ static int imx_cpufreq_dt_probe(struct platform_devic= e *pdev) dev_info(&pdev->dev, "cpu speed grade %d mkt segment %d supported-hw %#x = %#x\n", speed_grade, mkt_segment, supported_hw[0], supported_hw[1]); =20 - cpufreq_opp_table =3D dev_pm_opp_set_supported_hw(cpu_dev, supported_hw, = 2); + cpufreq_opp_table =3D dev_pm_opp_set_config(cpu_dev, &config); if (IS_ERR(cpufreq_opp_table)) { ret =3D PTR_ERR(cpufreq_opp_table); - dev_err(&pdev->dev, "Failed to set supported opp: %d\n", ret); + dev_err(&pdev->dev, "Failed to set Opp config: %d\n", ret); return ret; } =20 cpufreq_dt_pdev =3D platform_device_register_data( &pdev->dev, "cpufreq-dt", -1, NULL, 0); if (IS_ERR(cpufreq_dt_pdev)) { - dev_pm_opp_put_supported_hw(cpufreq_opp_table); + dev_pm_opp_clear_config(cpufreq_opp_table); ret =3D PTR_ERR(cpufreq_dt_pdev); dev_err(&pdev->dev, "Failed to register cpufreq-dt: %d\n", ret); return ret; @@ -176,7 +180,7 @@ static int imx_cpufreq_dt_remove(struct platform_device= *pdev) { platform_device_unregister(cpufreq_dt_pdev); if (!of_machine_is_compatible("fsl,imx7ulp")) - dev_pm_opp_put_supported_hw(cpufreq_opp_table); + dev_pm_opp_clear_config(cpufreq_opp_table); else clk_bulk_put(ARRAY_SIZE(imx7ulp_clks), imx7ulp_clks); =20 --=20 2.31.1.272.g89b43f80a514 From nobody Wed Apr 29 00:43:01 2026 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 54E0CC433EF for ; Thu, 26 May 2022 11:44:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347231AbiEZLog (ORCPT ); Thu, 26 May 2022 07:44:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347165AbiEZLnu (ORCPT ); Thu, 26 May 2022 07:43:50 -0400 Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5AF2C3EBA9 for ; Thu, 26 May 2022 04:43:41 -0700 (PDT) Received: by mail-pg1-x536.google.com with SMTP id x12so1122326pgj.7 for ; Thu, 26 May 2022 04:43:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=C1aSxoXPeQBXlB3qL18aLGtP/jLnJcgk49cmVEjZDqY=; b=kXLq05FZBLbJAaTe80aq29sNfqJD7IT3RIS7chlu+dkCEmzO1U1sbIbbTSt+r7eiRK pHRIZV78aRurYDHxEDxC87/tyCowtiuh3J1q8BO0WuEGu8ddjIXMdRcikwRMb7I7O7og s10o19L/EiZalAkrXMbbgaB7gwtLAGOphCpO7gcXjV6rK9xV7moRearJ5j2DlpWNTqP4 tlYCqMIUBFYvIURsAxHBrlTPTsdHD5jjuIe8Lg2BhfBt2M9FE6nbZFrpVIU66Bj1TmJQ He78mg87wqSE6yb8ml71Tra0HXEXB2NM4YlUIv9wNUm3JfbzQk2DMYq0lD8aC7BFbj0h t3hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=C1aSxoXPeQBXlB3qL18aLGtP/jLnJcgk49cmVEjZDqY=; b=WVKC0dZGw8a0OqcbbfwFOri+iUJJb+PVDHKW0d1N9GAO6Qe/k94FqH+7lF07x1qEhN UmIgwE3vzPNRYbU73bYUq0uR7aYfahLz4ID4fDFvErPDbVgOm+ce+UeRIgQqo5+V8q3p zSA6QcKWrDO9AIfPI83UORHDz1H8o8itgx1NI9dEMhn+bYlarF6PT6yV4Ax4bxhd8WUa Qxjm1tS/AdeAbwxUpxbMpTSE3zSEL/nuH9mwlll2p+xwz2HK1RKWiM78oHZTsL1j4Kso oEDApUm+ZiUAUd0ZckH43Xq1L+OIGoaxro0G5rySlcettWxbIvG3fDklldrO4KtpJEKK Fo2A== X-Gm-Message-State: AOAM531EK96dilzRGHf665DcTnrYzIF8hawrDOSTG/Magx4bNeNSyebw LVgh50xs/eyCDWKZm8A5jRo1gA== X-Google-Smtp-Source: ABdhPJxWRgVUAVoXBqPYan+UY9BAEdKbGzQtd1Y+4MoI7hCORnXl47xbN0MT2uthDuMSymRjvtUyQw== X-Received: by 2002:a62:1b06:0:b0:518:1649:bb6d with SMTP id b6-20020a621b06000000b005181649bb6dmr38679459pfb.25.1653565420831; Thu, 26 May 2022 04:43:40 -0700 (PDT) Received: from localhost ([122.162.234.2]) by smtp.gmail.com with ESMTPSA id o20-20020a170903301400b0015e8d4eb234sm1280322pla.126.2022.05.26.04.43.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 May 2022 04:43:40 -0700 (PDT) From: Viresh Kumar To: Andy Gross , Bjorn Andersson , Ilia Lin , "Rafael J. Wysocki" , Viresh Kumar Cc: linux-pm@vger.kernel.org, Vincent Guittot , Rafael Wysocki , Stephen Boyd , Nishanth Menon , Krzysztof Kozlowski , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 05/31] cpufreq: qcom-nvmem: Migrate to dev_pm_opp_set_config() Date: Thu, 26 May 2022 17:12:04 +0530 Message-Id: X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The OPP core now provides a unified API for setting all configuration types, i.e. dev_pm_opp_set_config(). Lets start using it. Signed-off-by: Viresh Kumar --- drivers/cpufreq/qcom-cpufreq-nvmem.c | 107 ++++++++------------------- 1 file changed, 29 insertions(+), 78 deletions(-) diff --git a/drivers/cpufreq/qcom-cpufreq-nvmem.c b/drivers/cpufreq/qcom-cp= ufreq-nvmem.c index 6dfa86971a75..4166b8d93b70 100644 --- a/drivers/cpufreq/qcom-cpufreq-nvmem.c +++ b/drivers/cpufreq/qcom-cpufreq-nvmem.c @@ -55,9 +55,7 @@ struct qcom_cpufreq_match_data { }; =20 struct qcom_cpufreq_drv { - struct opp_table **names_opp_tables; - struct opp_table **hw_opp_tables; - struct opp_table **genpd_opp_tables; + struct opp_table **opp_tables; u32 versions; const struct qcom_cpufreq_match_data *data; }; @@ -315,72 +313,44 @@ static int qcom_cpufreq_probe(struct platform_device = *pdev) } of_node_put(np); =20 - drv->names_opp_tables =3D kcalloc(num_possible_cpus(), - sizeof(*drv->names_opp_tables), + drv->opp_tables =3D kcalloc(num_possible_cpus(), + sizeof(*drv->opp_tables), GFP_KERNEL); - if (!drv->names_opp_tables) { + if (!drv->opp_tables) { ret =3D -ENOMEM; goto free_drv; } - drv->hw_opp_tables =3D kcalloc(num_possible_cpus(), - sizeof(*drv->hw_opp_tables), - GFP_KERNEL); - if (!drv->hw_opp_tables) { - ret =3D -ENOMEM; - goto free_opp_names; - } - - drv->genpd_opp_tables =3D kcalloc(num_possible_cpus(), - sizeof(*drv->genpd_opp_tables), - GFP_KERNEL); - if (!drv->genpd_opp_tables) { - ret =3D -ENOMEM; - goto free_opp; - } =20 for_each_possible_cpu(cpu) { + struct dev_pm_opp_config config =3D { + .supported_hw =3D NULL, + }; + cpu_dev =3D get_cpu_device(cpu); if (NULL =3D=3D cpu_dev) { ret =3D -ENODEV; - goto free_genpd_opp; + goto free_opp; } =20 if (drv->data->get_version) { + config.supported_hw =3D &drv->versions; + config.supported_hw_count =3D 1; =20 - if (pvs_name) { - drv->names_opp_tables[cpu] =3D dev_pm_opp_set_prop_name( - cpu_dev, - pvs_name); - if (IS_ERR(drv->names_opp_tables[cpu])) { - ret =3D PTR_ERR(drv->names_opp_tables[cpu]); - dev_err(cpu_dev, "Failed to add OPP name %s\n", - pvs_name); - goto free_opp; - } - } - - drv->hw_opp_tables[cpu] =3D dev_pm_opp_set_supported_hw( - cpu_dev, &drv->versions, 1); - if (IS_ERR(drv->hw_opp_tables[cpu])) { - ret =3D PTR_ERR(drv->hw_opp_tables[cpu]); - dev_err(cpu_dev, - "Failed to set supported hardware\n"); - goto free_genpd_opp; - } + if (pvs_name) + config.prop_name =3D pvs_name; } =20 if (drv->data->genpd_names) { - drv->genpd_opp_tables[cpu] =3D - dev_pm_opp_attach_genpd(cpu_dev, - drv->data->genpd_names, - NULL); - if (IS_ERR(drv->genpd_opp_tables[cpu])) { - ret =3D PTR_ERR(drv->genpd_opp_tables[cpu]); - if (ret !=3D -EPROBE_DEFER) - dev_err(cpu_dev, - "Could not attach to pm_domain: %d\n", - ret); - goto free_genpd_opp; + config.genpd_names =3D drv->data->genpd_names; + config.virt_devs =3D NULL; + } + + if (config.supported_hw || config.genpd_names) { + drv->opp_tables[cpu] =3D dev_pm_opp_set_config(cpu_dev, &config); + if (IS_ERR(drv->opp_tables[cpu])) { + ret =3D PTR_ERR(drv->opp_tables[cpu]); + dev_err(cpu_dev, "Failed to set OPP config\n"); + goto free_opp; } } } @@ -395,27 +365,13 @@ static int qcom_cpufreq_probe(struct platform_device = *pdev) ret =3D PTR_ERR(cpufreq_dt_pdev); dev_err(cpu_dev, "Failed to register platform device\n"); =20 -free_genpd_opp: - for_each_possible_cpu(cpu) { - if (IS_ERR(drv->genpd_opp_tables[cpu])) - break; - dev_pm_opp_detach_genpd(drv->genpd_opp_tables[cpu]); - } - kfree(drv->genpd_opp_tables); free_opp: for_each_possible_cpu(cpu) { - if (IS_ERR(drv->names_opp_tables[cpu])) + if (IS_ERR(drv->opp_tables[cpu])) break; - dev_pm_opp_put_prop_name(drv->names_opp_tables[cpu]); + dev_pm_opp_clear_config(drv->opp_tables[cpu]); } - for_each_possible_cpu(cpu) { - if (IS_ERR(drv->hw_opp_tables[cpu])) - break; - dev_pm_opp_put_supported_hw(drv->hw_opp_tables[cpu]); - } - kfree(drv->hw_opp_tables); -free_opp_names: - kfree(drv->names_opp_tables); + kfree(drv->opp_tables); free_drv: kfree(drv); =20 @@ -429,15 +385,10 @@ static int qcom_cpufreq_remove(struct platform_device= *pdev) =20 platform_device_unregister(cpufreq_dt_pdev); =20 - for_each_possible_cpu(cpu) { - dev_pm_opp_put_supported_hw(drv->names_opp_tables[cpu]); - dev_pm_opp_put_supported_hw(drv->hw_opp_tables[cpu]); - dev_pm_opp_detach_genpd(drv->genpd_opp_tables[cpu]); - } + for_each_possible_cpu(cpu) + dev_pm_opp_clear_config(drv->opp_tables[cpu]); =20 - kfree(drv->names_opp_tables); - kfree(drv->hw_opp_tables); - kfree(drv->genpd_opp_tables); + kfree(drv->opp_tables); kfree(drv); =20 return 0; --=20 2.31.1.272.g89b43f80a514 From nobody Wed Apr 29 00:43:01 2026 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 D00E5C433EF for ; Thu, 26 May 2022 11:44:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347174AbiEZLoF (ORCPT ); Thu, 26 May 2022 07:44:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347192AbiEZLnv (ORCPT ); Thu, 26 May 2022 07:43:51 -0400 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06E2E3F8BB for ; Thu, 26 May 2022 04:43:44 -0700 (PDT) Received: by mail-pl1-x629.google.com with SMTP id m1so1236034plx.3 for ; Thu, 26 May 2022 04:43:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=q5eTD6wz1RXfj8aC8lU6FuYhpZBKLogZOeVce0BXIgM=; b=hyg3hFnQcPvN2g1w1Dk7J+XwKPQZFfUbC4t8cmaoD+p2EK9JJlbZowvdc5GDn2InTZ U/hmhwfU0LvuiYyE9robqo4jdwQQqInnjxW/Pl1wzI0O8uW2DwgSLzevQlopXFz5fDDQ RBQIZ9BWrpxnWvDDB6UO4Hu1VYTzO5OEyoI4iJEmWmlERXPuhRtdi+9kJFFKZ9NM/Dkf 8ua/vHhARhWTbkCkUyI66x1IC49r09iZw7/dTHhXSC6CKW282fnDITCiULd3xIY0vgsc vSiEWao+Zffi8wJQ/olvRqsXhWfsfPpTo3oNS1m8pjS0ILEDsUMoNYBT2Irwy/NprreE 2ctg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=q5eTD6wz1RXfj8aC8lU6FuYhpZBKLogZOeVce0BXIgM=; b=1//OJNqBmwpFd2NtFNDYL02xy5dj8ablZd2nGVEoaXx+OG4kE9XKvfs7jkEBZDff5/ tWN6+XSwUXTowG91dwrDYvW1Fd1fazxSMGoUEGO34Sw+/pN5lkPfA5R5CkcyMr4BYCFT 823H6jevWUnZxnWtjFOSbLH/1omaHII3swtZcqtkaUbtXLPaDpONzMLVeEQWHsJIszLd sLHu9PjQRaz4e6SbEmREEn9SnEEIngwet7PO/T3UEOADujV1j7mgQ5RruhLW8B8DVxc5 fspespM6FcGIvhZZF13o2UnPylajetLs2MQRKzV4826aaSBQZvQcnwEI+JbRlEEZHZGv Np2w== X-Gm-Message-State: AOAM530ouWqoaKcrHFgQivMxeBRbFriMMX96JkbDPsZoXjFfVuooetrl KBEFYTKCBAyurLrlUIkSuAfXOA== X-Google-Smtp-Source: ABdhPJxX52apzdGJ+G31jFpsd6qyzr51sC9eQfAIoKm53t4NTL029WnhH6PlgGdl81lH5onahxYScQ== X-Received: by 2002:a17:90b:1d87:b0:1dc:a9c0:3d49 with SMTP id pf7-20020a17090b1d8700b001dca9c03d49mr2272677pjb.12.1653565423783; Thu, 26 May 2022 04:43:43 -0700 (PDT) Received: from localhost ([122.162.234.2]) by smtp.gmail.com with ESMTPSA id i2-20020a170902e48200b001617e18e253sm221482ple.143.2022.05.26.04.43.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 May 2022 04:43:43 -0700 (PDT) From: Viresh Kumar To: Patrice Chotard , "Rafael J. Wysocki" , Viresh Kumar Cc: linux-pm@vger.kernel.org, Vincent Guittot , Rafael Wysocki , Stephen Boyd , Nishanth Menon , Krzysztof Kozlowski , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 06/31] cpufreq: sti: Migrate to dev_pm_opp_set_config() Date: Thu, 26 May 2022 17:12:05 +0530 Message-Id: X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The OPP core now provides a unified API for setting all configuration types, i.e. dev_pm_opp_set_config(). Lets start using it. Signed-off-by: Viresh Kumar --- drivers/cpufreq/sti-cpufreq.c | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/drivers/cpufreq/sti-cpufreq.c b/drivers/cpufreq/sti-cpufreq.c index fdb0a722d881..f4121a9d27e5 100644 --- a/drivers/cpufreq/sti-cpufreq.c +++ b/drivers/cpufreq/sti-cpufreq.c @@ -159,6 +159,11 @@ static int sti_cpufreq_set_opp_info(void) int ret; char name[MAX_PCODE_NAME_LEN]; struct opp_table *opp_table; + struct dev_pm_opp_config config =3D { + .supported_hw =3D version, + .supported_hw_count =3D ARRAY_SIZE(version), + .prop_name =3D name, + }; =20 reg_fields =3D sti_cpufreq_match(); if (!reg_fields) { @@ -210,21 +215,14 @@ static int sti_cpufreq_set_opp_info(void) =20 snprintf(name, MAX_PCODE_NAME_LEN, "pcode%d", pcode); =20 - opp_table =3D dev_pm_opp_set_prop_name(dev, name); - if (IS_ERR(opp_table)) { - dev_err(dev, "Failed to set prop name\n"); - return PTR_ERR(opp_table); - } - version[0] =3D BIT(major); version[1] =3D BIT(minor); version[2] =3D BIT(substrate); =20 - opp_table =3D dev_pm_opp_set_supported_hw(dev, version, VERSION_ELEMENTS); + opp_table =3D dev_pm_opp_set_config(dev, &config); if (IS_ERR(opp_table)) { - dev_err(dev, "Failed to set supported hardware\n"); - ret =3D PTR_ERR(opp_table); - goto err_put_prop_name; + dev_err(dev, "Failed to set OPP config\n"); + return PTR_ERR(opp_table); } =20 dev_dbg(dev, "pcode: %d major: %d minor: %d substrate: %d\n", @@ -233,10 +231,6 @@ static int sti_cpufreq_set_opp_info(void) version[0], version[1], version[2]); =20 return 0; - -err_put_prop_name: - dev_pm_opp_put_prop_name(opp_table); - return ret; } =20 static int sti_cpufreq_fetch_syscon_registers(void) --=20 2.31.1.272.g89b43f80a514 From nobody Wed Apr 29 00:43:01 2026 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 85CAAC433EF for ; Thu, 26 May 2022 11:44:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345416AbiEZLoU (ORCPT ); Thu, 26 May 2022 07:44:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347196AbiEZLnv (ORCPT ); Thu, 26 May 2022 07:43:51 -0400 Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B0CB4131C for ; Thu, 26 May 2022 04:43:47 -0700 (PDT) Received: by mail-pj1-x1032.google.com with SMTP id nn3-20020a17090b38c300b001e0e091cf03so787831pjb.1 for ; Thu, 26 May 2022 04:43:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tnA5+J+gH2mj2CPHfO10MW0xEpoxi+NxT/Ss2uVLmF8=; b=AVIp74S5w8hFRIvL44O8yvtl+fDjhV4Adadv/8mJ+X8nnqJGEThB9Kugaum863mxh2 h9QuOLBSkznxR24EctnKbI9qmhWgcU3DWDFidsDc2fYwO+1F5dcjE8DMFq69+MK23MOE A2D664nA5pvQdof/UuQ5L/JNBfmbziqu3a1t3Q+WBqadmHvmtFBW863HQtRfsx3o9iFv U7RJQyWAEnlH/UAcghhdjnUwN0vjoTwksBEp3VT3kxKIAylChAm5SfCvCCHZ/8+uj6fT 3Pn2GlOIIiC/KHtC45LCPo2xysWCycP3oSH7Wy3Yo7Bn2z3W9qoyVg93iL+7FRzxvTiw fyTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tnA5+J+gH2mj2CPHfO10MW0xEpoxi+NxT/Ss2uVLmF8=; b=MgaOAiSR+II2JEmKCJEQJbYS7BVNROcABEzNKaTxeUcnlIqaPmyvX0Su8NfRnA/Qe3 6YxUvw10wkpN6bV7CAW6E7fVtW06cgHX/1aRqX4wsUQ83NX/oJg8/tmWxeyGNGMbKreM SGOw4rvRAQLoUCfoUvH4fNQ3oHF03X+IY9B9dpSz+OyHHbtn2Jh5OXRcxLvRf8GKPeoO HgnRAO4Vuy59nuYa4HTG4s7uAcNZI5gxWchA5CSqWizLbM+3HMjoAiALojLbOZqe3+1z nj4tIOL1qNM7szQwLidSxt7tapR634TNUnNgQcVGwV2RjCs1HBwbBkvcPsMmJ2MKgOhl kmfQ== X-Gm-Message-State: AOAM532j8FR9PTtQMxXNjlLI3BOY96L1KovBCZUiMPpt+qRiuzUcnp66 kGZyyFawVZzgHB/GjnUbfrNSmg== X-Google-Smtp-Source: ABdhPJzRIDXg5OmHJJdS+VFy81IjKYyN226dUfeZcatLo6D42DjmKKzBNFVKfJNIlfgyTjHRouDHZw== X-Received: by 2002:a17:90b:2c43:b0:1e1:9ff4:fd12 with SMTP id rw3-20020a17090b2c4300b001e19ff4fd12mr1736285pjb.107.1653565426930; Thu, 26 May 2022 04:43:46 -0700 (PDT) Received: from localhost ([122.162.234.2]) by smtp.gmail.com with ESMTPSA id l12-20020a170902f68c00b0016198062800sm1374400plg.161.2022.05.26.04.43.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 May 2022 04:43:46 -0700 (PDT) From: Viresh Kumar To: Yangtao Li , "Rafael J. Wysocki" , Viresh Kumar , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: linux-pm@vger.kernel.org, Vincent Guittot , Rafael Wysocki , Stephen Boyd , Nishanth Menon , Krzysztof Kozlowski , linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH 07/31] cpufreq: sun50i: Migrate to dev_pm_opp_set_config() Date: Thu, 26 May 2022 17:12:06 +0530 Message-Id: <32db8386ad53c0d0b71c5afba18273e90072c081.1653564321.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The OPP core now provides a unified API for setting all configuration types, i.e. dev_pm_opp_set_config(). Lets start using it. Signed-off-by: Viresh Kumar --- drivers/cpufreq/sun50i-cpufreq-nvmem.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/cpufreq/sun50i-cpufreq-nvmem.c b/drivers/cpufreq/sun50= i-cpufreq-nvmem.c index 2deed8d8773f..c1bee39758e2 100644 --- a/drivers/cpufreq/sun50i-cpufreq-nvmem.c +++ b/drivers/cpufreq/sun50i-cpufreq-nvmem.c @@ -104,6 +104,9 @@ static int sun50i_cpufreq_nvmem_probe(struct platform_d= evice *pdev) snprintf(name, MAX_NAME_LEN, "speed%d", speed); =20 for_each_possible_cpu(cpu) { + struct dev_pm_opp_config config =3D { + .prop_name =3D name, + }; struct device *cpu_dev =3D get_cpu_device(cpu); =20 if (!cpu_dev) { @@ -111,10 +114,10 @@ static int sun50i_cpufreq_nvmem_probe(struct platform= _device *pdev) goto free_opp; } =20 - opp_tables[cpu] =3D dev_pm_opp_set_prop_name(cpu_dev, name); + opp_tables[cpu] =3D dev_pm_opp_set_config(cpu_dev, &config); if (IS_ERR(opp_tables[cpu])) { ret =3D PTR_ERR(opp_tables[cpu]); - pr_err("Failed to set prop name\n"); + pr_err("Failed to set OPP config\n"); goto free_opp; } } @@ -133,7 +136,7 @@ static int sun50i_cpufreq_nvmem_probe(struct platform_d= evice *pdev) for_each_possible_cpu(cpu) { if (IS_ERR_OR_NULL(opp_tables[cpu])) break; - dev_pm_opp_put_prop_name(opp_tables[cpu]); + dev_pm_opp_clear_config(opp_tables[cpu]); } kfree(opp_tables); =20 @@ -148,7 +151,7 @@ static int sun50i_cpufreq_nvmem_remove(struct platform_= device *pdev) platform_device_unregister(cpufreq_dt_pdev); =20 for_each_possible_cpu(cpu) - dev_pm_opp_put_prop_name(opp_tables[cpu]); + dev_pm_opp_clear_config(opp_tables[cpu]); =20 kfree(opp_tables); =20 --=20 2.31.1.272.g89b43f80a514 From nobody Wed Apr 29 00:43:01 2026 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 E8831C433FE for ; Thu, 26 May 2022 11:44:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345906AbiEZLo1 (ORCPT ); Thu, 26 May 2022 07:44:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347210AbiEZLnw (ORCPT ); Thu, 26 May 2022 07:43:52 -0400 Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 531F63DA54 for ; Thu, 26 May 2022 04:43:50 -0700 (PDT) Received: by mail-pf1-x432.google.com with SMTP id y199so1475898pfb.9 for ; Thu, 26 May 2022 04:43:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=At8FyujAWdCUO+FjxXSxheFtkPMDnLD38WsTFqXV9zc=; b=Dgq+KUb9LbagAUGbz4g0hK4phFFYr+29FnN0mX4TX4b1/v4uD7L3UQUKMNMl57R56h Daverzmf41qCwAAuAj/D9h6tWFPYUhKd80gTK5fBqh3Mwes4+U9vtaCWZq2xdMCR3s2g wifI86NL4+O3Rr4ByA0AIeTo1grob/6IktN4l9k8wSWxFJC4HxZBjN8mS39qpcfSDWUK oFZrLn2mJGf+QVSnZktWapMm4qpa8nu9h9Din01EFuezVnNmsJh2EqQxgToMrO1ABl5O jJLD5JFE3gBXwBVphDzJX4ajUKra9m1MEz6sXiTgVkzfyQXevD9S9ukiLZByjYPBFDOc P/pA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=At8FyujAWdCUO+FjxXSxheFtkPMDnLD38WsTFqXV9zc=; b=wWV+jrjAOXXOkHqrSfuUmH51QhaC4t9mF/FrOZNn91jgX5OR4POVAAPT4Dicx/DHys G9dbgJ+VlnT6GdaZ2gEuh5Anq9X18STNlJl2xH2GzOgF5HemzeKOpKi4uOIFx4/Pmy+t rUcB/k3c9hWo2AXp6IeNz/pbGOSgMxxgU3+Da6XSlFt+/YYG4PP2+vNm7jX2GR9xtDw2 V5+vODfiLJU+KXtLrMCaTEsYsqFnLlUMw2qYN0ij6u3ZySfZ6fMZwHXwW1wNE4B8nwr7 E2rXPvXe3a4g9cmKKs8LN6c+LBS/6Cn9qn2FFTo54pA6+FQCo/M/QMP5+7yKLB2B6Pi7 jihw== X-Gm-Message-State: AOAM533JV30BRe3d0up5VC5Hvoq9XDYKW1K7BK+t/sse7puBC1JmKJwu xgDmgIz639Y3xV7PGEV5yH6CTw== X-Google-Smtp-Source: ABdhPJwhHEen29vpBKJyeKDZPt00TZiDzvOdz8gm8EwEypTNkA+35hLqP4GfxTeaCSrp7uJrK2g+zw== X-Received: by 2002:a05:6a00:1792:b0:519:80a:9598 with SMTP id s18-20020a056a00179200b00519080a9598mr5231833pfg.10.1653565429812; Thu, 26 May 2022 04:43:49 -0700 (PDT) Received: from localhost ([122.162.234.2]) by smtp.gmail.com with ESMTPSA id z17-20020a170902d55100b0015e8d4eb269sm1298652plf.179.2022.05.26.04.43.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 May 2022 04:43:49 -0700 (PDT) From: Viresh Kumar To: "Rafael J. Wysocki" , Viresh Kumar , Thierry Reding , Jonathan Hunter Cc: linux-pm@vger.kernel.org, Vincent Guittot , Rafael Wysocki , Stephen Boyd , Nishanth Menon , Krzysztof Kozlowski , linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 08/31] cpufreq: tegra20: Migrate to dev_pm_opp_set_config() Date: Thu, 26 May 2022 17:12:07 +0530 Message-Id: <4b38ceed657bfcf87ff9ab0dd69dd1f2f5658b24.1653564321.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The OPP core now provides a unified API for setting all configuration types, i.e. dev_pm_opp_set_config(). Lets start using it. Signed-off-by: Viresh Kumar --- drivers/cpufreq/tegra20-cpufreq.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/cpufreq/tegra20-cpufreq.c b/drivers/cpufreq/tegra20-cp= ufreq.c index e8db3d75be25..2c73623e3abb 100644 --- a/drivers/cpufreq/tegra20-cpufreq.c +++ b/drivers/cpufreq/tegra20-cpufreq.c @@ -34,7 +34,7 @@ static bool cpu0_node_has_opp_v2_prop(void) =20 static void tegra20_cpufreq_put_supported_hw(void *opp_table) { - dev_pm_opp_put_supported_hw(opp_table); + dev_pm_opp_clear_config(opp_table); } =20 static void tegra20_cpufreq_dt_unregister(void *cpufreq_dt) @@ -49,6 +49,10 @@ static int tegra20_cpufreq_probe(struct platform_device = *pdev) struct device *cpu_dev; u32 versions[2]; int err; + struct dev_pm_opp_config config =3D { + .supported_hw =3D versions, + .supported_hw_count =3D ARRAY_SIZE(versions), + }; =20 if (!cpu0_node_has_opp_v2_prop()) { dev_err(&pdev->dev, "operating points not found\n"); @@ -71,10 +75,10 @@ static int tegra20_cpufreq_probe(struct platform_device= *pdev) if (WARN_ON(!cpu_dev)) return -ENODEV; =20 - opp_table =3D dev_pm_opp_set_supported_hw(cpu_dev, versions, 2); - err =3D PTR_ERR_OR_ZERO(opp_table); + opp_table =3D dev_pm_opp_set_config(cpu_dev, &config); + err =3D PTR_ERR(opp_table); if (err) { - dev_err(&pdev->dev, "failed to set supported hw: %d\n", err); + dev_err(&pdev->dev, "failed to set OPP config: %d\n", err); return err; } =20 --=20 2.31.1.272.g89b43f80a514 From nobody Wed Apr 29 00:43:01 2026 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 D1ED6C433EF for ; Thu, 26 May 2022 11:44:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242593AbiEZLoc (ORCPT ); Thu, 26 May 2022 07:44:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347214AbiEZLnx (ORCPT ); Thu, 26 May 2022 07:43:53 -0400 Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 381A143382 for ; Thu, 26 May 2022 04:43:53 -0700 (PDT) Received: by mail-pj1-x1032.google.com with SMTP id nn3-20020a17090b38c300b001e0e091cf03so787831pjb.1 for ; Thu, 26 May 2022 04:43:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HMXTDiDSe4RWBZyUjzABNpjeeM5K5/JQo7rqiocgzqs=; b=RK5uBuHgkP4THzzr3r/8dgZy3FWz+tJFUf5pFEH2NKf3Qo8z2A9A9cpIs44f9K7W/i CSuQRuxCvRDe7Sjwg/hAU/XrbTZ+V1rXUfNo8cQ3A5e70gVsrRlGKQYVDDgJ2vyz8Kno 45U0HtZ1q7n7a62KeqoYG50+OPkgwhPsgjF/Z4SfIhYGm67202SWgGE9y5whATkaGC1k +zNHSa0VYEJcpCzLCGFRe5xde824pdhGGj1Z4te7t0BwTWUdoufDgZlMqIOv5tB20pxd 7uHVe9GgKNaCrw8FV+kzRoLJimizK3UngS2CnT1ILUgepmG43bnb9KMCqZUWto5v151+ 085Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=HMXTDiDSe4RWBZyUjzABNpjeeM5K5/JQo7rqiocgzqs=; b=MJL8t6uvAdGsWzU/uCNsv/QpBGo/MVXfQhv4yXMsmIFl4EwOx2teHuo0J5bKHWklTC gRJ+Lv5i+b+OImnTsjhMnoZiVaw8uD0vCPjxEOsilZ181g3DPf2/4Hy+LA1qZ92xVqLc /Mw0hVkO+Ra5mt6ASa2SE5z2wMpwyvgXGKpIEUwFb6SEmYHhK5E8D78Wq6CCEgAfyxsu N5Fq5pk+vvJH94LIy10tZHalj6W4EL0BNLkObfNBDh0RTzeXzhPKduodLGB3lSU1qXRz KieTAPF7iptLck7X5mwGr8Y2shzibjgVTyqVytcEyFcuA+OZcBJFqRLu8EIJMGwW5+0a 6RGg== X-Gm-Message-State: AOAM532i0gnOTtDC0Gt/2eFGHTT7UrILna7aj35BPU4T6UHxbbZQaR0O 6YvdvFehTRsSbmh0s91ctEU/FQ== X-Google-Smtp-Source: ABdhPJx1qO+JonnXRyCzQD/eZ/vKC/txcRft5Cqc/9mtqbr6w3kFnO87zVh92dYdVJmYb7R1+w/ZcA== X-Received: by 2002:a17:90a:8005:b0:1df:ecbc:bd2c with SMTP id b5-20020a17090a800500b001dfecbcbd2cmr2213497pjn.10.1653565432970; Thu, 26 May 2022 04:43:52 -0700 (PDT) Received: from localhost ([122.162.234.2]) by smtp.gmail.com with ESMTPSA id x2-20020a1709029a4200b001635f7a54e8sm1311884plv.1.2022.05.26.04.43.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 May 2022 04:43:52 -0700 (PDT) From: Viresh Kumar To: "Rafael J. Wysocki" , Viresh Kumar Cc: linux-pm@vger.kernel.org, Vincent Guittot , Rafael Wysocki , Stephen Boyd , Nishanth Menon , Krzysztof Kozlowski , linux-kernel@vger.kernel.org Subject: [PATCH 09/31] cpufreq: ti: Migrate to dev_pm_opp_set_config() Date: Thu, 26 May 2022 17:12:08 +0530 Message-Id: X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The OPP core now provides a unified API for setting all configuration types, i.e. dev_pm_opp_set_config(). Lets start using it. Signed-off-by: Viresh Kumar --- drivers/cpufreq/ti-cpufreq.c | 38 +++++++++++++++--------------------- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/drivers/cpufreq/ti-cpufreq.c b/drivers/cpufreq/ti-cpufreq.c index 8f9fdd864391..cc58675df5c4 100644 --- a/drivers/cpufreq/ti-cpufreq.c +++ b/drivers/cpufreq/ti-cpufreq.c @@ -324,10 +324,13 @@ static int ti_cpufreq_probe(struct platform_device *p= dev) { u32 version[VERSION_COUNT]; const struct of_device_id *match; - struct opp_table *ti_opp_table; struct ti_cpufreq_data *opp_data; const char * const default_reg_names[] =3D {"vdd", "vbb"}; int ret; + struct dev_pm_opp_config config =3D { + .supported_hw =3D version, + .supported_hw_count =3D ARRAY_SIZE(version), + }; =20 match =3D dev_get_platdata(&pdev->dev); if (!match) @@ -370,33 +373,24 @@ static int ti_cpufreq_probe(struct platform_device *p= dev) if (ret) goto fail_put_node; =20 - ti_opp_table =3D dev_pm_opp_set_supported_hw(opp_data->cpu_dev, - version, VERSION_COUNT); - if (IS_ERR(ti_opp_table)) { - dev_err(opp_data->cpu_dev, - "Failed to set supported hardware\n"); - ret =3D PTR_ERR(ti_opp_table); - goto fail_put_node; - } - - opp_data->opp_table =3D ti_opp_table; - if (opp_data->soc_data->multi_regulator) { - const char * const *reg_names =3D default_reg_names; + config.regulator_count =3D ARRAY_SIZE(default_reg_names); =20 if (opp_data->soc_data->reg_names) - reg_names =3D opp_data->soc_data->reg_names; - ti_opp_table =3D dev_pm_opp_set_regulators(opp_data->cpu_dev, - reg_names, - ARRAY_SIZE(default_reg_names)); - if (IS_ERR(ti_opp_table)) { - dev_pm_opp_put_supported_hw(opp_data->opp_table); - ret =3D PTR_ERR(ti_opp_table); - goto fail_put_node; - } + config.regulator_names =3D opp_data->soc_data->reg_names; + else + config.regulator_names =3D default_reg_names; + } + + opp_data->opp_table =3D dev_pm_opp_set_config(opp_data->cpu_dev, &config); + if (IS_ERR(opp_data->opp_table)) { + dev_err(opp_data->cpu_dev, "Failed to set OPP config\n"); + ret =3D PTR_ERR(opp_data->opp_table); + goto fail_put_node; } =20 of_node_put(opp_data->opp_node); + register_cpufreq_dt: platform_device_register_simple("cpufreq-dt", -1, NULL, 0); =20 --=20 2.31.1.272.g89b43f80a514 From nobody Wed Apr 29 00:43:01 2026 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 9A56FC4332F for ; Thu, 26 May 2022 11:44:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230080AbiEZLon (ORCPT ); Thu, 26 May 2022 07:44:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347188AbiEZLn5 (ORCPT ); Thu, 26 May 2022 07:43:57 -0400 Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C53D745AF8 for ; Thu, 26 May 2022 04:43:56 -0700 (PDT) Received: by mail-pj1-x1030.google.com with SMTP id n10so1513810pjh.5 for ; Thu, 26 May 2022 04:43:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=O6FKGuWTYeL9CyJXF/nui49yX2g2b8cAfQUyL7WS+yM=; b=H3PWYr6fgVdEpbNbAbKBUEcwfB5VncU0s52oMLsps2/EtOooxFx/vAzuIunub4nQIL bUREhE1yrLHPFBXLeuqAeehyM/+oP8dTM7Z9y+FgL7MjBtuMGm1gyYEvAQXf3kzIC4iK ovmdTFDrKNF+RsdaTOThoaul/xyMb5UDuKCtrIJAseOtW2k2uCsEETZWvFr8rpAP47tY F8es6ydbBX/oQWmIydzYPb464BkSllrspADZPLf7grD2dJI7PXk9YarEUyU/JLQYankt ptpi/g+6Gs9tpYmNsHyyPYO7qkeVDcy3fdkFnm5L4ugdVizMFdg9L30cYcph3vWSsS1j n03A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=O6FKGuWTYeL9CyJXF/nui49yX2g2b8cAfQUyL7WS+yM=; b=74HxnLns7fEmo+I0XcC+UA1HKpxAB0Si+mzXD0yFH/2mw9uRbIhGeNuNw0sB61diSl 46L6yu09VVh/xZf0EejaIBCLUYV8DeohDZvGYpA5EP3Mj4clUd/gR/7Q++FctqeVpc+b N5zqveBOuzQXjqQdXfwf/ZzUz06qhsmjJcdMTiRmHr217Ng18eGnoEmR8FEcu7oxc891 5l3ymz1jymkgi8f/b2fVZentcB3K2BF6VokGlk+o9fXKwB+xBAFee8LE6GH/bm23+I+e CLlncXC8XiBygypCFrKrjxYub77qj9zNCJuEhQ/SYXL4V+1r9Hfpcr9TqqxGq3gZZbD8 Gp/g== X-Gm-Message-State: AOAM531LlbiEi1WacIczYnmQVfNJTHMmpzC9szh8Obna67/5SYGXVr2d t//A0eqjfmn8rwX4AiJmlUy07w== X-Google-Smtp-Source: ABdhPJylJuyVRIVUb54hEn87GYfGffdmIDUn3OCcqUeKNw1PX/9AHVDbO9nW+pEOObcVYIfVJpAAvQ== X-Received: by 2002:a17:90a:5515:b0:1dc:c1f1:59bd with SMTP id b21-20020a17090a551500b001dcc1f159bdmr2205074pji.81.1653565436253; Thu, 26 May 2022 04:43:56 -0700 (PDT) Received: from localhost ([122.162.234.2]) by smtp.gmail.com with ESMTPSA id ce17-20020a17090aff1100b001e09a4afd69sm1284556pjb.7.2022.05.26.04.43.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 May 2022 04:43:55 -0700 (PDT) From: Viresh Kumar To: Chanwoo Choi , MyungJoo Ham , Kyungmin Park , Krzysztof Kozlowski , Alim Akhtar Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , Rafael Wysocki , Stephen Boyd , Nishanth Menon , Krzysztof Kozlowski , linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 10/31] devfreq: exynos: Migrate to dev_pm_opp_set_config() Date: Thu, 26 May 2022 17:12:09 +0530 Message-Id: <052c4937ce408a01de5cd7d7e359d333f9b11e57.1653564321.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The OPP core now provides a unified API for setting all configuration types, i.e. dev_pm_opp_set_config(). Lets start using it. Signed-off-by: Viresh Kumar --- drivers/devfreq/exynos-bus.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c index e689101abc93..780e525eb92a 100644 --- a/drivers/devfreq/exynos-bus.c +++ b/drivers/devfreq/exynos-bus.c @@ -161,7 +161,7 @@ static void exynos_bus_exit(struct device *dev) =20 dev_pm_opp_of_remove_table(dev); clk_disable_unprepare(bus->clk); - dev_pm_opp_put_regulators(bus->opp_table); + dev_pm_opp_clear_config(bus->opp_table); bus->opp_table =3D NULL; } =20 @@ -182,11 +182,15 @@ static int exynos_bus_parent_parse_of(struct device_n= ode *np, struct opp_table *opp_table; const char *vdd =3D "vdd"; int i, ret, count, size; + struct dev_pm_opp_config config =3D { + .regulator_names =3D &vdd, + .regulator_count =3D 1, + }; =20 - opp_table =3D dev_pm_opp_set_regulators(dev, &vdd, 1); + opp_table =3D dev_pm_opp_set_config(dev, &config); if (IS_ERR(opp_table)) { ret =3D PTR_ERR(opp_table); - dev_err(dev, "failed to set regulators %d\n", ret); + dev_err(dev, "failed to set OPP config %d\n", ret); return ret; } =20 @@ -236,7 +240,7 @@ static int exynos_bus_parent_parse_of(struct device_nod= e *np, return 0; =20 err_regulator: - dev_pm_opp_put_regulators(bus->opp_table); + dev_pm_opp_clear_config(bus->opp_table); bus->opp_table =3D NULL; =20 return ret; @@ -459,7 +463,7 @@ static int exynos_bus_probe(struct platform_device *pde= v) dev_pm_opp_of_remove_table(dev); clk_disable_unprepare(bus->clk); err_reg: - dev_pm_opp_put_regulators(bus->opp_table); + dev_pm_opp_clear_config(bus->opp_table); bus->opp_table =3D NULL; =20 return ret; --=20 2.31.1.272.g89b43f80a514 From nobody Wed Apr 29 00:43:01 2026 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 CBF58C433F5 for ; Thu, 26 May 2022 11:44:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347407AbiEZLo5 (ORCPT ); Thu, 26 May 2022 07:44:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347181AbiEZLoF (ORCPT ); Thu, 26 May 2022 07:44:05 -0400 Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3DF8496B6 for ; Thu, 26 May 2022 04:43:59 -0700 (PDT) Received: by mail-pj1-x102c.google.com with SMTP id gz24so1532053pjb.2 for ; Thu, 26 May 2022 04:43:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6s0x8dJmuy2Ybw2lPLVZk+KMGhxE6UiFXXt2n7Y53xs=; b=U7t6fFDjDa0Ctor2pMs5mB+RkfuEaQPk9jAll6z0ozbTwHH7hCCOV39QhC1AudH7B7 mQNpvXHdoHtmlP/l8G9ftM8cnpNgbGwwGz9I+OmYGanwKqbuDAFiLpXAxWh8NKaVHaAA aBOK8br6uQdtX1bFAvIQ7JvqoxwHiCHDyyeEoXHWCbLWoVvk7zriP5dvMGGKYIuZyP3N Ec0tGGa/3p+cdA3hyyIF0IaJc8Wg1rXpfwN5vn1/9ccbu8Tx6TT0v0YsqfAustZYcUM+ AEv36mJY1RccxXovNcGZX5iR8HI63Dc4GaojNxWzAlkrNrcHbTysqe9W1RvbTeEt6NOm 3OfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6s0x8dJmuy2Ybw2lPLVZk+KMGhxE6UiFXXt2n7Y53xs=; b=ik4TJdSIKBwJl5HBixwgKkr2Kj+qMEa3LARkbmpEa9u03ZFpLXLQAn3sUA5yVPPN5V zAQmxGxFa+44ynKvE00UodwwgXQ4ay82JRmjPqfcCyMI9027kEdiaR1qOexo7pWImIYE OfibDTDnaTcAC8xhPekC6k2Equ2vbxkusLys8oA98wMYM279xpyW71nqY06w7472yGqx 8qKCdtJ4F8OXR4eGPi7rCfGvGaYX02V3I8myJo77d3SMX+3vXn8u1gldcA3cbAVb4mMA meXBshAaom9m7NveX+D37i+XuJyO8HcDlrXLa8MFRjomgyT5zkydTU+65f1YgLKrJvLi mxCQ== X-Gm-Message-State: AOAM5316P7G0jcDJWEXN4deZLaRTlTlQx1HnMz5+BzthAIblFIWTDtIF M9ZmWP+pcSRz1fb9Z1tpD5QEBpjE8QvqeQ== X-Google-Smtp-Source: ABdhPJxbhS8femEgYxRhuPmf1pbTSv1ParpKVoHJCFN/pCA01ph85V+OU8iJG6Dir5uT/slHjL/sTg== X-Received: by 2002:a17:90a:4cc2:b0:1dd:1010:d10d with SMTP id k60-20020a17090a4cc200b001dd1010d10dmr2174506pjh.205.1653565439389; Thu, 26 May 2022 04:43:59 -0700 (PDT) Received: from localhost ([122.162.234.2]) by smtp.gmail.com with ESMTPSA id v5-20020a62a505000000b005183434ec86sm1261317pfm.135.2022.05.26.04.43.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 May 2022 04:43:59 -0700 (PDT) From: Viresh Kumar To: MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , Rafael Wysocki , Stephen Boyd , Nishanth Menon , Krzysztof Kozlowski , linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH 11/31] devfreq: sun8i: Migrate to dev_pm_opp_set_config() Date: Thu, 26 May 2022 17:12:10 +0530 Message-Id: <276f3e9b7d9b696cbfa1e5546f79db7029510fb4.1653564321.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The OPP core now provides a unified API for setting all configuration types, i.e. dev_pm_opp_set_config(). Lets start using it. Signed-off-by: Viresh Kumar --- drivers/devfreq/sun8i-a33-mbus.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/devfreq/sun8i-a33-mbus.c b/drivers/devfreq/sun8i-a33-m= bus.c index 13d32213139f..125b479c9d6d 100644 --- a/drivers/devfreq/sun8i-a33-mbus.c +++ b/drivers/devfreq/sun8i-a33-mbus.c @@ -337,6 +337,9 @@ static int sun8i_a33_mbus_probe(struct platform_device = *pdev) unsigned int max_state; const char *err; int i, ret; + struct dev_pm_opp_config config =3D { + .clk_name =3D "dram", + }; =20 variant =3D device_get_match_data(dev); if (!variant) @@ -404,9 +407,9 @@ static int sun8i_a33_mbus_probe(struct platform_device = *pdev) priv->profile.freq_table =3D priv->freq_table; priv->profile.max_state =3D max_state; =20 - ret =3D devm_pm_opp_set_clkname(dev, "dram"); + ret =3D devm_pm_opp_set_config(dev, &config); if (ret) { - err =3D "failed to add OPP table\n"; + err =3D "failed to set OPP config\n"; goto err_unlock_mbus; } =20 --=20 2.31.1.272.g89b43f80a514 From nobody Wed Apr 29 00:43:01 2026 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 E04B0C433FE for ; Thu, 26 May 2022 11:44:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347239AbiEZLox (ORCPT ); Thu, 26 May 2022 07:44:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344666AbiEZLoG (ORCPT ); Thu, 26 May 2022 07:44:06 -0400 Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A073F45AF7 for ; Thu, 26 May 2022 04:44:02 -0700 (PDT) Received: by mail-pg1-x52b.google.com with SMTP id d129so1120032pgc.9 for ; Thu, 26 May 2022 04:44:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=11qGt7qh8zRe6KglTXx56ADtsrAzF8XGakYWw73nu7U=; b=B10RnQ+4h3rJ31p7/lyMfDOmSs4vHMBIqdYH/jhUlv+RtqyWrCKWHK7xC5dAO8JVzl O+s+7KTuEoYA134U7uTjPfU4njmVrFjfbNKbdAC/mc4y2pdFVyazvM5n2LgD+c3Bp4Xd 8ZMXN3NUen2pWITJUoJz7YpJABh11SHblcNfaghlJmBToJLVUOSCuYpaF8vNtF8VALBF cw1kbqq49Wo4AYmaeTVN/xTzM7YaHjTF5RbwUThblJBXtw6qvCeTxZ+zuC8RWvUr/caZ T6ZtXwAoLeQbU9jEIN2aiWBlX6ta1z1j5OBAtwPU37YS4GpryQtAfo5vW+CnkdElTQwC hIAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=11qGt7qh8zRe6KglTXx56ADtsrAzF8XGakYWw73nu7U=; b=PQ+SG9YZsT2cyG9ETLHnABdDZeFvLEamtMleI2SaTXy2XCEztJMLhtlTmOucz/SMZU YN2n4G286rZQuYymLdh7C/HIaTeadcUdGBzoZf3fiGeGuZYRowdoPeU6p6Iqy4wiTmSm +6XfA8grJIlcEsNf+5V0UnzQpTIa3OfvI/Z01YOl7bUH0EOZIDoLEpkdvzh8vG9cd/sg r+6SqrsuBDo3OLVS3piuV6mP29BUbJMoYKDsZdZ871ZnXDGDnwTSmjSfSqrp9LjM/HRJ LBY+uvkdaer/PlXbO/W7oC1CJQhLVou5H3rtNsd0iQqgylwvLzsvDjlmbuEh/G63dKCt Go8A== X-Gm-Message-State: AOAM533fbjWTjVDlS88+f2QpgPJh8I4l6ZjFil7wg4mmp2hx/Flsby3u HGq3iTtyWl8hZlz/cjTJ3G6LJQ== X-Google-Smtp-Source: ABdhPJwVgHoxb/fCbZF3mP2Q0s1t8l7NyGjFM6en7hyZyhg8rEMRObWrGwGkProaqe8dmm38mDCa9Q== X-Received: by 2002:aa7:83d0:0:b0:50c:eb2b:8e8a with SMTP id j16-20020aa783d0000000b0050ceb2b8e8amr38168150pfn.31.1653565442488; Thu, 26 May 2022 04:44:02 -0700 (PDT) Received: from localhost ([122.162.234.2]) by smtp.gmail.com with ESMTPSA id e17-20020a170903241100b0015e8d4eb208sm1318377plo.82.2022.05.26.04.44.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 May 2022 04:44:02 -0700 (PDT) From: Viresh Kumar To: Dmitry Osipenko , MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Thierry Reding , Jonathan Hunter Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , Rafael Wysocki , Stephen Boyd , Nishanth Menon , Krzysztof Kozlowski , linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 12/31] devfreq: tegra30: Migrate to dev_pm_opp_set_config() Date: Thu, 26 May 2022 17:12:11 +0530 Message-Id: X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The OPP core now provides a unified API for setting all configuration types, i.e. dev_pm_opp_set_config(). Lets start using it. Signed-off-by: Viresh Kumar --- drivers/devfreq/tegra30-devfreq.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/devfreq/tegra30-devfreq.c b/drivers/devfreq/tegra30-de= vfreq.c index 65ecf17a36f4..30382bdfc655 100644 --- a/drivers/devfreq/tegra30-devfreq.c +++ b/drivers/devfreq/tegra30-devfreq.c @@ -830,6 +830,10 @@ static int tegra_devfreq_probe(struct platform_device = *pdev) unsigned int i; long rate; int err; + struct dev_pm_opp_config config =3D { + .supported_hw =3D &hw_version, + .supported_hw_count =3D 1, + }; =20 tegra =3D devm_kzalloc(&pdev->dev, sizeof(*tegra), GFP_KERNEL); if (!tegra) @@ -874,9 +878,9 @@ static int tegra_devfreq_probe(struct platform_device *= pdev) return err; } =20 - err =3D devm_pm_opp_set_supported_hw(&pdev->dev, &hw_version, 1); + err =3D devm_pm_opp_set_config(&pdev->dev, &config); if (err) { - dev_err(&pdev->dev, "Failed to set supported HW: %d\n", err); + dev_err(&pdev->dev, "Failed to set OPP config: %d\n", err); return err; } =20 --=20 2.31.1.272.g89b43f80a514 From nobody Wed Apr 29 00:43:01 2026 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 39F6EC433EF for ; Thu, 26 May 2022 11:45:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233032AbiEZLpT (ORCPT ); Thu, 26 May 2022 07:45:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347168AbiEZLoU (ORCPT ); Thu, 26 May 2022 07:44:20 -0400 Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C66D3C6E5A for ; Thu, 26 May 2022 04:44:06 -0700 (PDT) Received: by mail-pg1-x52a.google.com with SMTP id e66so1121585pgc.8 for ; Thu, 26 May 2022 04:44:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3XNML7XiFhEmWhS7Wmn0QQk81yeWXZBxdfXtoqtiuEE=; b=F0RZwf+QVtfdPntABkUWCqnKWd9ZvaRtPa4RLbnjoS3Mv9huYArM/2p97ntmluKcx5 sbuzSjy+OWEN6dzN7C6RYQgoNFlHohr4VKNTUfutPa7zwq1JV6AtX9/fNvPMAlVNPSPb KXM9WqnEd/bX9iVNhvKaU4SeqlFiBrGMgDvhqFvZDYJz3W6jnOESDByw3Ffm0L/ubDbR Bsb4ZMDq0fueO+vqGE5Nen8Ix6yV//gu8uLXJcIAIAtx1hxrVAeCjxHqFjCo+/yp4cL8 YAFRMkagm/VLnmb1a+Jz/JKzq00ysjOHsH0DS9QGm64iB/sk/GCEc4J+kb224nRIYVL/ uK7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3XNML7XiFhEmWhS7Wmn0QQk81yeWXZBxdfXtoqtiuEE=; b=JkaHPcyy0S6T359ABpGUCuE9jtsGrbJ6cKSds6d/b4F0/jqq0HQTmvm0d+77YnT2wB HkroeUltMAjS87bsNw2gCD17LaUcza0GklhO/LNo6WvKubW/WO5q/gB5kMDSMoYOocHq OFeXFPL8atbdQOF7CCMdMdtGuay38InFz7vaU9EEboEjRAcXvp4cb3j3ulOBACzGOVnr 1QhTwj+HCzqMHdpOeB4RYHt/JoRsOt4FM18KAbRlummMXD85PRCqdsS6QyP6kWDjijl3 9Y6A8DiON8aRtR8CBP9uBYANgLMG7OzYtKn3N2mM4eRzleLB17RsK8bfgqOQGNcJO+Ye to2g== X-Gm-Message-State: AOAM532E1fuv4Se4/6IdH4XlqtYJdBZjPgLXsEU93raIiAAn7vSlRpu8 UCkAbnhl8n2nUXpt7GlAa/J8kA== X-Google-Smtp-Source: ABdhPJz4oCK0FlHgCt3OpAXEyjzMx8MM0BIoifZPvN2PfUIfJKR2EWbMtcAxZKXzchUrRLOzNjahKA== X-Received: by 2002:a05:6a00:1487:b0:518:b952:889b with SMTP id v7-20020a056a00148700b00518b952889bmr16382659pfu.43.1653565445537; Thu, 26 May 2022 04:44:05 -0700 (PDT) Received: from localhost ([122.162.234.2]) by smtp.gmail.com with ESMTPSA id o13-20020a170903210d00b0015e8d4eb213sm1283995ple.93.2022.05.26.04.44.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 May 2022 04:44:05 -0700 (PDT) From: Viresh Kumar To: Qiang Yu Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , Rafael Wysocki , Stephen Boyd , Nishanth Menon , Krzysztof Kozlowski , dri-devel@lists.freedesktop.org, lima@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 13/31] drm/lima: Migrate to dev_pm_opp_set_config() Date: Thu, 26 May 2022 17:12:12 +0530 Message-Id: <22268a714109e8f18ee0612d2e0f746a357af9c3.1653564321.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The OPP core now provides a unified API for setting all configuration types, i.e. dev_pm_opp_set_config(). Lets start using it. Signed-off-by: Viresh Kumar --- drivers/gpu/drm/lima/lima_devfreq.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/lima/lima_devfreq.c b/drivers/gpu/drm/lima/lim= a_devfreq.c index 8989e215dfc9..e792ab5cd76a 100644 --- a/drivers/gpu/drm/lima/lima_devfreq.c +++ b/drivers/gpu/drm/lima/lima_devfreq.c @@ -111,6 +111,11 @@ int lima_devfreq_init(struct lima_device *ldev) struct dev_pm_opp *opp; unsigned long cur_freq; int ret; + struct dev_pm_opp_config config =3D { + .regulator_names =3D (const char *[]){ "mali" }, + .regulator_count =3D 1, + .clk_name =3D "core", + }; =20 if (!device_property_present(dev, "operating-points-v2")) /* Optional, continue without devfreq */ @@ -118,11 +123,7 @@ int lima_devfreq_init(struct lima_device *ldev) =20 spin_lock_init(&ldevfreq->lock); =20 - ret =3D devm_pm_opp_set_clkname(dev, "core"); - if (ret) - return ret; - - ret =3D devm_pm_opp_set_regulators(dev, (const char *[]){ "mali" }, 1); + ret =3D devm_pm_opp_set_config(dev, &config); if (ret) { /* Continue if the optional regulator is missing */ if (ret !=3D -ENODEV) --=20 2.31.1.272.g89b43f80a514 From nobody Wed Apr 29 00:43:01 2026 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 79C0FC433F5 for ; Thu, 26 May 2022 11:45:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237717AbiEZLpZ (ORCPT ); Thu, 26 May 2022 07:45:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347218AbiEZLoW (ORCPT ); Thu, 26 May 2022 07:44:22 -0400 Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE20CAFAFD for ; Thu, 26 May 2022 04:44:09 -0700 (PDT) Received: by mail-pl1-x62f.google.com with SMTP id i1so1222278plg.7 for ; Thu, 26 May 2022 04:44:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bM3evDjfiE3dprTsclqC+/G6p3TK8Ys0Oy1ZcImUYfI=; b=laC4QuTRCSg15JyXcb0ZD2Q4k53G7vghjfyxzv8umgfoorTsmmpQfMbYRec0NDOGhY ZE0ZNojePoqY3DSa/G78FdLptguqGGFfqzBBeXXMtwm/h7U7JYySMx7+JuJ2G2PWb3bF PeCNYJfs5DMIsiIbeRrYXdDW32Yaz4CxTKzg74MkpPCwWlM8X1FpLYNQf3pyAK8WTICf 8TYeST48ot3aMLkvlkVrIqlqckVx0E8VRNIYFTuZMyd/flWwH0p6GgIs0sTfN2G+gAse HFr9P6EcchTDffeVhYQex9XhPyJ9Fh+fa8aoXzjKUaa1c3/Z2YLN8kK8lbl24keZ9tzc tJaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bM3evDjfiE3dprTsclqC+/G6p3TK8Ys0Oy1ZcImUYfI=; b=e3Odd+ZgC6c2Ycu17iWeZo8VSAO+S5SjGDughafqJsNIe1JWm0shs+ZAsiRkPlY3QZ /DyoTHZg4NlMMEQo8g+H8qnOpKhnqjA/YdgcvZtBq74ddWz2KKXvDZ6cS+1yvBiFfY72 IkfvjwSiLbvg/2MbZ/J2LWxmyWgIB5oAx2UGgFwhZtr5HOGg7l2ui8XalCpaUAVkMG/d AyRslDAzO2pbaLzHcoCBkiRKqmThaWzKMn2apkLPjiOz1w4HHD9PfnGOfJGPr5pUpe3s QVO2BRg5hLuYcCwT76EWRv8BLVzQairUpqxSSqihdgd2n5l0KQEWRXsYgq0AJvqml42j XXvA== X-Gm-Message-State: AOAM5305Sm+tQzhQpnVivnHd3JfAxHtLEe4DZLbZJVTj9hNcJHonJGEO UkWH0OVK2cRm4//t+2s4ak6KUg== X-Google-Smtp-Source: ABdhPJzFEsV7cJrNzaIFA5do0FQhIQLA3swJDrst+zf/HBD8jNqWQ/kokmEk7NyfDIO4ycChLj/aKw== X-Received: by 2002:a17:90a:4803:b0:1dc:b4c9:1958 with SMTP id a3-20020a17090a480300b001dcb4c91958mr2177698pjh.61.1653565449495; Thu, 26 May 2022 04:44:09 -0700 (PDT) Received: from localhost ([122.162.234.2]) by smtp.gmail.com with ESMTPSA id jb14-20020a170903258e00b00161527e1d9fsm1270109plb.294.2022.05.26.04.44.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 May 2022 04:44:09 -0700 (PDT) From: Viresh Kumar To: Rob Clark , Sean Paul , Abhinav Kumar Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , Rafael Wysocki , Stephen Boyd , Nishanth Menon , Krzysztof Kozlowski , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 14/31] drm/msm: Migrate to dev_pm_opp_set_config() Date: Thu, 26 May 2022 17:12:13 +0530 Message-Id: X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The OPP core now provides a unified API for setting all configuration types, i.e. dev_pm_opp_set_config(). Lets start using it. Signed-off-by: Viresh Kumar --- drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 8 ++++++-- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 10 +++++----- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 5 ++++- drivers/gpu/drm/msm/dp/dp_ctrl.c | 5 ++++- drivers/gpu/drm/msm/dsi/dsi_host.c | 5 ++++- 5 files changed, 23 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c b/drivers/gpu/drm/msm/ad= reno/a5xx_gpu.c index 407f50a15faa..c39fb085a762 100644 --- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c @@ -1728,10 +1728,14 @@ static void check_speed_bin(struct device *dev) { struct nvmem_cell *cell; u32 val; + struct dev_pm_opp_config config =3D { + .supported_hw =3D &val, + .supported_hw_count =3D 1, + }; =20 /* * If the OPP table specifies a opp-supported-hw property then we have - * to set something with dev_pm_opp_set_supported_hw() or the table + * to set something with dev_pm_opp_set_config() or the table * doesn't get populated so pick an arbitrary value that should * ensure the default frequencies are selected but not conflict with any * actual bins @@ -1753,7 +1757,7 @@ static void check_speed_bin(struct device *dev) nvmem_cell_put(cell); } =20 - devm_pm_opp_set_supported_hw(dev, &val, 1); + devm_pm_opp_set_config(dev, &config); } =20 struct msm_gpu *a5xx_gpu_init(struct drm_device *dev) diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/ad= reno/a6xx_gpu.c index 83c31b2ad865..ddb2812b1ff7 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c @@ -1805,6 +1805,10 @@ static int a6xx_set_supported_hw(struct device *dev,= struct adreno_rev rev) u32 supp_hw =3D UINT_MAX; u32 speedbin; int ret; + struct dev_pm_opp_config config =3D { + .supported_hw =3D &supp_hw, + .supported_hw_count =3D 1, + }; =20 ret =3D adreno_read_speedbin(dev, &speedbin); /* @@ -1823,11 +1827,7 @@ static int a6xx_set_supported_hw(struct device *dev,= struct adreno_rev rev) supp_hw =3D fuse_to_supp_hw(dev, rev, speedbin); =20 done: - ret =3D devm_pm_opp_set_supported_hw(dev, &supp_hw, 1); - if (ret) - return ret; - - return 0; + return devm_pm_opp_set_config(dev, &config); } =20 static const struct adreno_gpu_funcs funcs =3D { diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/= disp/dpu1/dpu_kms.c index e29796c4f27b..43f943fdfde5 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c @@ -1203,12 +1203,15 @@ static int dpu_bind(struct device *dev, struct devi= ce *master, void *data) struct drm_device *ddev =3D priv->dev; struct dpu_kms *dpu_kms; int ret =3D 0; + struct dev_pm_opp_config config =3D { + .clk_name =3D "core", + }; =20 dpu_kms =3D devm_kzalloc(&pdev->dev, sizeof(*dpu_kms), GFP_KERNEL); if (!dpu_kms) return -ENOMEM; =20 - ret =3D devm_pm_opp_set_clkname(dev, "core"); + ret =3D devm_pm_opp_set_config(dev, &config); if (ret) return ret; /* OPP table is optional */ diff --git a/drivers/gpu/drm/msm/dp/dp_ctrl.c b/drivers/gpu/drm/msm/dp/dp_c= trl.c index 53568567e05b..54bdb33eef45 100644 --- a/drivers/gpu/drm/msm/dp/dp_ctrl.c +++ b/drivers/gpu/drm/msm/dp/dp_ctrl.c @@ -1974,6 +1974,9 @@ struct dp_ctrl *dp_ctrl_get(struct device *dev, struc= t dp_link *link, { struct dp_ctrl_private *ctrl; int ret; + struct dev_pm_opp_config config =3D { + .clk_name =3D "ctrl_link", + }; =20 if (!dev || !panel || !aux || !link || !catalog) { @@ -1987,7 +1990,7 @@ struct dp_ctrl *dp_ctrl_get(struct device *dev, struc= t dp_link *link, return ERR_PTR(-ENOMEM); } =20 - ret =3D devm_pm_opp_set_clkname(dev, "ctrl_link"); + ret =3D devm_pm_opp_set_config(dev, &config); if (ret) { dev_err(dev, "invalid DP OPP table in device tree\n"); /* caller do PTR_ERR(opp_table) */ diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/d= si_host.c index d51e70fab93d..7d5b027629d2 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_host.c +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c @@ -1801,6 +1801,9 @@ int msm_dsi_host_init(struct msm_dsi *msm_dsi) struct msm_dsi_host *msm_host =3D NULL; struct platform_device *pdev =3D msm_dsi->pdev; int ret; + struct dev_pm_opp_config config =3D { + .clk_name =3D "byte", + }; =20 msm_host =3D devm_kzalloc(&pdev->dev, sizeof(*msm_host), GFP_KERNEL); if (!msm_host) { @@ -1862,7 +1865,7 @@ int msm_dsi_host_init(struct msm_dsi *msm_dsi) goto fail; } =20 - ret =3D devm_pm_opp_set_clkname(&pdev->dev, "byte"); + ret =3D devm_pm_opp_set_config(&pdev->dev, &config); if (ret) return ret; /* OPP table is optional */ --=20 2.31.1.272.g89b43f80a514 From nobody Wed Apr 29 00:43:01 2026 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 34379C433F5 for ; Thu, 26 May 2022 11:45:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347132AbiEZLph (ORCPT ); Thu, 26 May 2022 07:45:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347190AbiEZLof (ORCPT ); Thu, 26 May 2022 07:44:35 -0400 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B0A8D0289 for ; Thu, 26 May 2022 04:44:13 -0700 (PDT) Received: by mail-pj1-x1033.google.com with SMTP id l7-20020a17090aaa8700b001dd1a5b9965so1514751pjq.2 for ; Thu, 26 May 2022 04:44:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HsZm01W7lVAYoixKo6Nk800vk4WIHy3MlJNuyYghC/E=; b=Wu/JMipJ6JOhMstgYzE3dXXw6nfzo+Z40qL43mmLs92tnCkqEchuC0GkobCAide8pC 9dAMVYodIG1r8gvpVHuxSNdfQpIoHGrVGx/GFK/zzgLOiU8yag8npVq/xiFZQdlQy5lv 3UT1eW4xeo6Igg8MmXPt8iJQw/p6UIFhczgqv67ux8KvehwfVHIQyiCvfBxxDP9IJiie GosfMVhgFvoDmzkA7yln56NRSwmneRV6Ur4rGXDVVnE2RZCPFS57Ls2pgOpgItOmuSvh XFrxNBsETuUFY8EFBPK1TdYiZRtorTjeHslF1AqfpYTuCWS3mmz7/hEbQ3f+cD8+o+A6 2P3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=HsZm01W7lVAYoixKo6Nk800vk4WIHy3MlJNuyYghC/E=; b=ABxObW+6P20nOmHcxmvxkId/1Fx06wtJTzJuk9WId689yZzerUWSEWwUw468BPzpyL 75PxhiNmj+oSZPPnCr3Hvv359ZdOCPW8r1ZpAbgIEjZBnikk5sVDwQvjhSW4Q/m5V0z7 lPXGfovJvuFWyypF7Ejvc8UVAJti50j/IK9UFSkMuhmz4Vz0p6UWU+uhOSQeF2uZApt0 L1RsK+QtLutGOQ3BYums+ljh8QpWPsZe9qIxlraY8RLBVZzzWH+zRXiF1as43A1Ovm1i ArgdVet4zMpwQ6N5UJgXDa6QquayScSBgr+RHPmdsGfmELuVt6/mrotLPv1uWMZ6rBo1 E+vQ== X-Gm-Message-State: AOAM532Ec70pzSnC+X7bqCq1WpMPZU1avSDEV7MdtvLzERuINYmgwxFE o1+x2RI8OSOrIUTrzgsIm9YH9Q== X-Google-Smtp-Source: ABdhPJyfcjHj9Ly12wH9ItwVX3s2KDOb31DEq1TzBbFi6yJUwSS4pqWWAqG68J0QgVbGcfhWH2g6lQ== X-Received: by 2002:a17:902:f70a:b0:153:88c7:774 with SMTP id h10-20020a170902f70a00b0015388c70774mr37348147plo.166.1653565452780; Thu, 26 May 2022 04:44:12 -0700 (PDT) Received: from localhost ([122.162.234.2]) by smtp.gmail.com with ESMTPSA id q12-20020a170902eb8c00b0015e8d4eb1d7sm1270604plg.33.2022.05.26.04.44.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 May 2022 04:44:12 -0700 (PDT) From: Viresh Kumar To: Rob Herring , Tomeu Vizoso , Steven Price , Alyssa Rosenzweig Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , Rafael Wysocki , Stephen Boyd , Nishanth Menon , Krzysztof Kozlowski , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 15/31] drm/panfrost: Migrate to dev_pm_opp_set_config() Date: Thu, 26 May 2022 17:12:14 +0530 Message-Id: <2a0970a5cf1fc92e16eb2b782798a6b609594cdc.1653564321.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The OPP core now provides a unified API for setting all configuration types, i.e. dev_pm_opp_set_config(). Lets start using it. Signed-off-by: Viresh Kumar Acked-by: Steven Price --- drivers/gpu/drm/panfrost/panfrost_devfreq.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_devfreq.c b/drivers/gpu/drm/= panfrost/panfrost_devfreq.c index 194af7f607a6..7826d9366d35 100644 --- a/drivers/gpu/drm/panfrost/panfrost_devfreq.c +++ b/drivers/gpu/drm/panfrost/panfrost_devfreq.c @@ -91,6 +91,10 @@ int panfrost_devfreq_init(struct panfrost_device *pfdev) struct devfreq *devfreq; struct thermal_cooling_device *cooling; struct panfrost_devfreq *pfdevfreq =3D &pfdev->pfdevfreq; + struct dev_pm_opp_config config =3D { + .regulator_names =3D pfdev->comp->supply_names, + .regulator_count =3D pfdev->comp->num_supplies, + }; =20 if (pfdev->comp->num_supplies > 1) { /* @@ -101,13 +105,12 @@ int panfrost_devfreq_init(struct panfrost_device *pfd= ev) return 0; } =20 - ret =3D devm_pm_opp_set_regulators(dev, pfdev->comp->supply_names, - pfdev->comp->num_supplies); + ret =3D devm_pm_opp_set_config(dev, &config); if (ret) { /* Continue if the optional regulator is missing */ if (ret !=3D -ENODEV) { if (ret !=3D -EPROBE_DEFER) - DRM_DEV_ERROR(dev, "Couldn't set OPP regulators\n"); + DRM_DEV_ERROR(dev, "Couldn't set OPP config\n"); return ret; } } --=20 2.31.1.272.g89b43f80a514 From nobody Wed Apr 29 00:43:01 2026 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 7ADAEC433FE for ; Thu, 26 May 2022 11:45:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344635AbiEZLpb (ORCPT ); Thu, 26 May 2022 07:45:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347205AbiEZLog (ORCPT ); Thu, 26 May 2022 07:44:36 -0400 Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 522C2D0299 for ; Thu, 26 May 2022 04:44:16 -0700 (PDT) Received: by mail-pf1-x433.google.com with SMTP id j6so1463938pfe.13 for ; Thu, 26 May 2022 04:44:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Mf/PBhXudWeikzmFArA4THf+WTmY69KBHxrOKvhpwhE=; b=JJrDny96JbGaIUMj4x/xpDMp+oQkXSZkQxSJGDuiTpnzlerMBuCp6OEPjlDrZjuPGT Ko/TRfplkx+duYaqEwQlc0npS3jyDJoPUUj95Jj7S1x78QZlaZpnETowzov1T7FLNHKU WwhZ5zjbbr6Y21jmTQLTrFTh3LFNLxfdnUmOgs8YH+knP5vuy3iYUy+BqPnqIgXEJgQF 6MlBwSUd/twgwhmgeO4ve2f17aHiDTqmPYpNpwHO8HQ5mZCaJ6iDUFUENAp/dQOh8H7d XjUQRyeQoBQTh7b7PW0XCab62PJdTIzFONf+GOV+J2n7JXOk0ovYgBxDCyJ7plc4qzKt +rvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Mf/PBhXudWeikzmFArA4THf+WTmY69KBHxrOKvhpwhE=; b=vJZlWvDGeUlhj6vdrv87aqS1GK6MZ6eWXWQ+RJ769XArRUDPfB6q3OuYK20zjsYbF5 VCirddO8ZU4RjjWXlRt+zc7pb3dBQ4L8/z9akPPlG0RwBfw70ubZWBXu8RfcClSNtDHS 1o6uhix++aHLEJv2/CudnxbMW/792iCGvNwl2fxIS3HEOgDZtwydffxH9kebQ2iBlcP4 AZbcV6wfZ7COtnCOtjS9IIPMfD8RVQRiQtJdm7/WZeayMKqL+jDqk48Q9xCccMayMj0g mXx2FB4XBeZJc8C9VaNBHb+TN/O2QPB88pRM1vK57ayJfb5OkE0Pcn+WrmmpCtRTvwoO pvOA== X-Gm-Message-State: AOAM530lErIZeRiBtUFtLPHdesMFFGRq1cuppRz4abrKjxRgdYTosG88 6HZc7HVCoTALfPpHS3sPkePNmA== X-Google-Smtp-Source: ABdhPJziKnYEnwECbcUqLKProhmiWCkQ4BTngGPQbdjiQrftLw4d0/7RPvrSr33wj3o4SRqnCdRUlQ== X-Received: by 2002:a62:15ca:0:b0:518:2bd1:aa65 with SMTP id 193-20020a6215ca000000b005182bd1aa65mr37845386pfv.78.1653565455809; Thu, 26 May 2022 04:44:15 -0700 (PDT) Received: from localhost ([122.162.234.2]) by smtp.gmail.com with ESMTPSA id j17-20020a170903025100b00161b407771dsm1313142plh.48.2022.05.26.04.44.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 May 2022 04:44:15 -0700 (PDT) From: Viresh Kumar To: Thierry Reding , Jonathan Hunter Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , Rafael Wysocki , Stephen Boyd , Nishanth Menon , Krzysztof Kozlowski , dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 16/31] drm/tegra: Migrate to dev_pm_opp_set_config() Date: Thu, 26 May 2022 17:12:15 +0530 Message-Id: X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The OPP core now provides a unified API for setting all configuration types, i.e. dev_pm_opp_set_config(). Lets start using it. Signed-off-by: Viresh Kumar --- drivers/gpu/drm/tegra/gr3d.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/tegra/gr3d.c b/drivers/gpu/drm/tegra/gr3d.c index a1fd3113ea96..05c45c104e13 100644 --- a/drivers/gpu/drm/tegra/gr3d.c +++ b/drivers/gpu/drm/tegra/gr3d.c @@ -389,6 +389,10 @@ static int gr3d_init_power(struct device *dev, struct = gr3d *gr3d) struct device_link *link; unsigned int i; int err; + struct dev_pm_opp_config config =3D { + .genpd_names =3D opp_genpd_names, + .virt_devs =3D &opp_virt_devs, + }; =20 err =3D of_count_phandle_with_args(dev->of_node, "power-domains", "#power-domain-cells"); @@ -421,7 +425,7 @@ static int gr3d_init_power(struct device *dev, struct g= r3d *gr3d) if (dev->pm_domain) return 0; =20 - err =3D devm_pm_opp_attach_genpd(dev, opp_genpd_names, &opp_virt_devs); + err =3D devm_pm_opp_set_config(dev, &config); if (err) return err; =20 --=20 2.31.1.272.g89b43f80a514 From nobody Wed Apr 29 00:43:01 2026 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 7370AC433F5 for ; Thu, 26 May 2022 11:45:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241631AbiEZLpk (ORCPT ); Thu, 26 May 2022 07:45:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347255AbiEZLoi (ORCPT ); Thu, 26 May 2022 07:44:38 -0400 Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0C6BD02B0 for ; Thu, 26 May 2022 04:44:19 -0700 (PDT) Received: by mail-pl1-x62a.google.com with SMTP id q4so1208571plr.11 for ; Thu, 26 May 2022 04:44:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JPsuNO4IJ7T2z2weCPNLXji/1rrU6SbwmIuvAfLuJdM=; b=gXnGQSuj+c45yeKB+8j1h5YrFgbmZ/F+ScjvzuqHVRExHvwyEIyIm5m2DGsq4eRivF P+M98Z8RwNJBIogL2m0HYIZ/Fwa/lLhneVU4VJ4Mj/sOV0eRgziQBZkii377HVD6QyY1 2bI/Muk5RxlNiPNzwLamtJMg9nie/mRGw9lFbmQU1dDJfGWsoTyOloH1ViyUb9qy2iog R08xQMgbo7j+fugthPtNqBSIqZ60i0bcEzLumfuUcIQbXxbNMflFxtoh2dfLplEfco3s Mk6gkTfQyPxNUeu4yHFaMQt3tnDVqPzUxf2Z/qjS5HuGEXrcPAUGpj/kBGYO/P3ecI86 SX9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JPsuNO4IJ7T2z2weCPNLXji/1rrU6SbwmIuvAfLuJdM=; b=th9GXuIcVGNQlfmwQP1VZ5fA7uedmgwHN71B8oPKq0NVHG1oAUvOcRP+f6S/+4Wa0a 11aNTa/ZzX5KiDdi851YYCgs/ZfKwNbxYRO9elcyVprZ1gUiSZDe3ufgm24BS+jF9YRE /R1hpM7lzmZJdtEDwj8UqeUg/Yaf0YnxDrm1rbr3hfk/BZJ/Z6dH8gvJkplOao43nmNX 7kjZ011UbDCmYDIwUoRKlSF0N0ot2+3mWtANlrSyEIVNNW5pqPX/Y51/ah5KGXb1SA+h 9W2NaC//dg/+44UBYnfl1iN4u8uhX4/aVHFIul+jz97nt8D/ma56hwGy02m4zIVtz+h6 pyGA== X-Gm-Message-State: AOAM530gvvFbUyC0glRmB19n0HQctJXHlOv+xf/wMQwY8nPLzS8WaB6K ouMQXvSE5puV/dG5CHEduiJxMA== X-Google-Smtp-Source: ABdhPJxHkvspcXsVc/hjxvjqkI2gYKKMuKYXQeyh/YgUZZoPbuby4lZj7ryI8rRuulEhYMTROUIvnQ== X-Received: by 2002:a17:90a:de02:b0:1df:3f94:811c with SMTP id m2-20020a17090ade0200b001df3f94811cmr2197205pjv.112.1653565459142; Thu, 26 May 2022 04:44:19 -0700 (PDT) Received: from localhost ([122.162.234.2]) by smtp.gmail.com with ESMTPSA id u30-20020a63235e000000b003c14af505fcsm1319907pgm.20.2022.05.26.04.44.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 May 2022 04:44:18 -0700 (PDT) From: Viresh Kumar To: Stanimir Varbanov , Andy Gross , Bjorn Andersson Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , Rafael Wysocki , Stephen Boyd , Nishanth Menon , Krzysztof Kozlowski , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 17/31] media: venus: Migrate to dev_pm_opp_set_config() Date: Thu, 26 May 2022 17:12:16 +0530 Message-Id: <1f243f35b02d53fde5bf730a7da1a789186f62b1.1653564321.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The OPP core now provides a unified API for setting all configuration types, i.e. dev_pm_opp_set_config(). Lets start using it. Signed-off-by: Viresh Kumar --- drivers/media/platform/qcom/venus/pm_helpers.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media= /platform/qcom/venus/pm_helpers.c index cb48c5ff3dee..16f8849896a9 100644 --- a/drivers/media/platform/qcom/venus/pm_helpers.c +++ b/drivers/media/platform/qcom/venus/pm_helpers.c @@ -294,12 +294,15 @@ static int load_scale_v1(struct venus_inst *inst) static int core_get_v1(struct venus_core *core) { int ret; + struct dev_pm_opp_config config =3D { + .clk_name =3D "core", + }; =20 ret =3D core_clks_get(core); if (ret) return ret; =20 - ret =3D devm_pm_opp_set_clkname(core->dev, "core"); + ret =3D devm_pm_opp_set_config(core->dev, &config); if (ret) return ret; =20 @@ -862,6 +865,10 @@ static int vcodec_domains_get(struct venus_core *core) const struct venus_resources *res =3D core->res; struct device *pd; unsigned int i; + struct dev_pm_opp_config config =3D { + .genpd_names =3D res->opp_pmdomain, + .virt_devs =3D &opp_virt_dev, + }; =20 if (!res->vcodec_pmdomains_num) goto skip_pmdomains; @@ -879,7 +886,7 @@ static int vcodec_domains_get(struct venus_core *core) return 0; =20 /* Attach the power domain for setting performance state */ - ret =3D devm_pm_opp_attach_genpd(dev, res->opp_pmdomain, &opp_virt_dev); + ret =3D devm_pm_opp_set_config(dev, &config); if (ret) goto opp_attach_err; =20 @@ -978,6 +985,9 @@ static int core_get_v4(struct venus_core *core) struct device *dev =3D core->dev; const struct venus_resources *res =3D core->res; int ret; + struct dev_pm_opp_config config =3D { + .clk_name =3D "core", + }; =20 ret =3D core_clks_get(core); if (ret) @@ -1003,7 +1013,7 @@ static int core_get_v4(struct venus_core *core) if (legacy_binding) return 0; =20 - ret =3D devm_pm_opp_set_clkname(dev, "core"); + ret =3D devm_pm_opp_set_config(dev, &config); if (ret) return ret; =20 --=20 2.31.1.272.g89b43f80a514 From nobody Wed Apr 29 00:43:01 2026 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 3FFEAC433F5 for ; Thu, 26 May 2022 11:46:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347173AbiEZLqd (ORCPT ); Thu, 26 May 2022 07:46:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347267AbiEZLoj (ORCPT ); Thu, 26 May 2022 07:44:39 -0400 Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA40D45AF8 for ; Thu, 26 May 2022 04:44:22 -0700 (PDT) Received: by mail-pl1-x62f.google.com with SMTP id n18so1228603plg.5 for ; Thu, 26 May 2022 04:44:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JDQmr69N/dl5Dq6JBRKXlWACskRSPFONQYIFomxUe+4=; b=fjSvNeVTUzzKQj774ztXjpUw9ebSX9tuHPbUVSBhP2kCSmHxqdjdLVvoZi4zRsOwAo IuM3v4wlNfUCWAfOlajUQ3TK04x0FgViwJGJ98eo5eYpWI3wY+ughlZaZ5U/altE/sr0 O1dEBMXcZdtXQpOV2RMwY81ZfdHLdKV+Iw6FkzSC82sNSfSULfuSOHzeLRCWs0mBVMD+ 1L2XZwGHgUzeGy4KLIKQOtggFj2X+KjfLDIAJeHaGKj7Qffz/I+/MOy4ZG7/RJn1d0+6 556j/tr8OQqeNXwZDQr8+i3boAhpqvMSgfKmN09MBu7L/Yl6QoDPqfhEu0y686C5Hyu6 jmSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JDQmr69N/dl5Dq6JBRKXlWACskRSPFONQYIFomxUe+4=; b=0UsSr2YWZZFgF8ygkJKocixohKYPBgfbk4tCMHHcXfKHTHNQNX4nhHGlueyrWauB0o C7J6uqliX61f5VmEdWah/AT9XjGQnWKTk/4+fQoqmtjTjTadXHcYYlWOkhRALhuMUICM w9UoJuRP4S+Lh2Ci0ZnPe8qBKuc7kgiUkQHF9D9upG0R7eFy2DUruYjQjnvw49a0DfAA Z0mk2rw0/rizH5sTO26YnWx4lBirUA2A5fdwHNXPZhav2TE9YO+XTSov0ddCtgRLJ3Ug NgoQGBrZmmK2RCspIBO0RKyBNzDo2hMD/Z33AmK/DfgApl2mWFsZ+Qq/Xrh/IaL1NeE1 Nqfw== X-Gm-Message-State: AOAM531GlV8ku8PnhH4loFe6BMmjF3injc6ArykSvC5rbFK1T/OlYZbg zdGCUxjelhMU8gWtci9hZSDOhw== X-Google-Smtp-Source: ABdhPJxByslYzaPrFJBCGZDzY/gRdK8UOblXVaYz51u2TNu9nIEwRROLsSZebLnfRSSRxACNF3ljLA== X-Received: by 2002:a17:90a:ead5:b0:1df:8229:87b7 with SMTP id ev21-20020a17090aead500b001df822987b7mr2253959pjb.104.1653565462245; Thu, 26 May 2022 04:44:22 -0700 (PDT) Received: from localhost ([122.162.234.2]) by smtp.gmail.com with ESMTPSA id u21-20020a631415000000b003c14af50626sm1262487pgl.62.2022.05.26.04.44.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 May 2022 04:44:21 -0700 (PDT) From: Viresh Kumar To: Krzysztof Kozlowski , Thierry Reding , Jonathan Hunter Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , Rafael Wysocki , Stephen Boyd , Nishanth Menon , Krzysztof Kozlowski , linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org Subject: [PATCH 18/31] media: tegra: Migrate to dev_pm_opp_set_config() Date: Thu, 26 May 2022 17:12:17 +0530 Message-Id: <67b10cc516558405bfff0fc7749cee9d3bf02fc0.1653564321.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The OPP core now provides a unified API for setting all configuration types, i.e. dev_pm_opp_set_config(). Lets start using it. Signed-off-by: Viresh Kumar --- drivers/memory/tegra/tegra124-emc.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/memory/tegra/tegra124-emc.c b/drivers/memory/tegra/teg= ra124-emc.c index 908f8d5392b2..d1e8f9ffef63 100644 --- a/drivers/memory/tegra/tegra124-emc.c +++ b/drivers/memory/tegra/tegra124-emc.c @@ -1395,13 +1395,17 @@ static int tegra_emc_interconnect_init(struct tegra= _emc *emc) static int tegra_emc_opp_table_init(struct tegra_emc *emc) { u32 hw_version =3D BIT(tegra_sku_info.soc_speedo_id); - struct opp_table *hw_opp_table; + struct opp_table *opp_table; int err; + struct dev_pm_opp_config config =3D { + .supported_hw =3D &hw_version, + .supported_hw_count =3D 1, + }; =20 - hw_opp_table =3D dev_pm_opp_set_supported_hw(emc->dev, &hw_version, 1); - err =3D PTR_ERR_OR_ZERO(hw_opp_table); + opp_table =3D dev_pm_opp_set_config(emc->dev, &config); + err =3D PTR_ERR_OR_ZERO(opp_table); if (err) { - dev_err(emc->dev, "failed to set OPP supported HW: %d\n", err); + dev_err(emc->dev, "failed to set OPP config: %d\n", err); return err; } =20 @@ -1430,7 +1434,7 @@ static int tegra_emc_opp_table_init(struct tegra_emc = *emc) remove_table: dev_pm_opp_of_remove_table(emc->dev); put_hw_table: - dev_pm_opp_put_supported_hw(hw_opp_table); + dev_pm_opp_clear_config(opp_table); =20 return err; } --=20 2.31.1.272.g89b43f80a514 From nobody Wed Apr 29 00:43:01 2026 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 A04BBC433EF for ; Thu, 26 May 2022 11:46:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244837AbiEZLqp (ORCPT ); Thu, 26 May 2022 07:46:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347274AbiEZLoj (ORCPT ); Thu, 26 May 2022 07:44:39 -0400 Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E25A7D02BD for ; Thu, 26 May 2022 04:44:25 -0700 (PDT) Received: by mail-pf1-x42a.google.com with SMTP id p8so1483174pfh.8 for ; Thu, 26 May 2022 04:44:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=aFDZFO8zcq3mdOYMY85R5XhCqGoT7ekIVqfcal4vq9k=; b=DdLAOSyeCe3VdSlghPOPR26L4TtMKKCTQ5eKXAKK+10kIhUkQ83tMrA/1RpbabSazS kV6nbvicZrBGsl5IcdntaWX0fV6MCSW1wdiQJTxyHiodRUYUZ11tf5PZA2ahicLgxrUo 6ZacmpFJ5OF6b5gRWNANLmf6dpaESFfPH99GDIPXtJ3SwlNJutaOa3SCUTYIXpdBo+Vd I8V9aMtIybOdUujY41iWsXh0sgD7XOPwT6wyHWCJDn/ZIfp5B3sfGTv08/HbdRdVSuce kSLvoxCYkqh6y9ZDmfwO4qM+DWWM36B5cyqGUtzByYX9EUBXqpGlCNxEkh2MUme2AAB9 K6kA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=aFDZFO8zcq3mdOYMY85R5XhCqGoT7ekIVqfcal4vq9k=; b=b6YCfHDTzBas9fIeun/aeSbeBzugWQBxwuoBCBCD1Nq+rUazTfIHvhMU7O8BF9G6Jr Yaw/8iXocYGorUSyHgFZzjPeH6HxPYcfDWe7TRLv0slEgQi/C9SvG2flpUr/YuTKOlzu tB7N75zVoT9H4TYbWCenDLufQiF4M09sRCH8tyZJWjNFIUK8i9jM4rPK/SC9GAAxufJF ZzQEZJ5+Mgebtgg2a6AdNsbkPFHLO9IliBUfPJP7fuA1yqhQW3vb5HyoDhp/9Q7GYxMI tgS2fwBX3Ky/sN18xBu3lPVsjuxgvS7OJiFBUPesVCGTIoHB5bgmG17Ugcl0k7RsHm2h dUXg== X-Gm-Message-State: AOAM530X8UKKEC8zP5NBpEBJDgAUQOpjGKMUD5BZyBWL7tMD1X/eZtpM eKYakS8e5XhVpJjImS+4J8WXcQ== X-Google-Smtp-Source: ABdhPJymmr3E7XzXOfh11AxGgFOnPpiUnAkMyJxfXNlpjU0Cl3k3slf4lmK7hGJQYeI+J0tXrl2TGQ== X-Received: by 2002:a63:8bc1:0:b0:3f9:f00b:f877 with SMTP id j184-20020a638bc1000000b003f9f00bf877mr21914328pge.378.1653565465428; Thu, 26 May 2022 04:44:25 -0700 (PDT) Received: from localhost ([122.162.234.2]) by smtp.gmail.com with ESMTPSA id f13-20020aa782cd000000b0051887e34143sm1269772pfn.129.2022.05.26.04.44.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 May 2022 04:44:25 -0700 (PDT) From: Viresh Kumar To: Andy Gross , Bjorn Andersson , Adrian Hunter , Ulf Hansson Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , Rafael Wysocki , Stephen Boyd , Nishanth Menon , Krzysztof Kozlowski , linux-mmc@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 19/31] mmc: sdhci-msm: Migrate to dev_pm_opp_set_config() Date: Thu, 26 May 2022 17:12:18 +0530 Message-Id: <80314068d96eb53e0d9838736415b96015803844.1653564321.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The OPP core now provides a unified API for setting all configuration types, i.e. dev_pm_opp_set_config(). Lets start using it. Signed-off-by: Viresh Kumar Acked-by: Ulf Hansson --- drivers/mmc/host/sdhci-msm.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c index 50c71e0ba5e4..994f3f0231f7 100644 --- a/drivers/mmc/host/sdhci-msm.c +++ b/drivers/mmc/host/sdhci-msm.c @@ -2496,6 +2496,9 @@ static int sdhci_msm_probe(struct platform_device *pd= ev) const struct sdhci_msm_offset *msm_offset; const struct sdhci_msm_variant_info *var_info; struct device_node *node =3D pdev->dev.of_node; + struct dev_pm_opp_config opp_config =3D { + .clk_name =3D "core", + }; =20 host =3D sdhci_pltfm_init(pdev, &sdhci_msm_pdata, sizeof(*msm_host)); if (IS_ERR(host)) @@ -2564,7 +2567,7 @@ static int sdhci_msm_probe(struct platform_device *pd= ev) if (ret) goto bus_clk_disable; =20 - ret =3D devm_pm_opp_set_clkname(&pdev->dev, "core"); + ret =3D devm_pm_opp_set_config(&pdev->dev, &opp_config); if (ret) goto bus_clk_disable; =20 --=20 2.31.1.272.g89b43f80a514 From nobody Wed Apr 29 00:43:01 2026 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 94209C433F5 for ; Thu, 26 May 2022 11:46:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347399AbiEZLqM (ORCPT ); Thu, 26 May 2022 07:46:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347293AbiEZLoj (ORCPT ); Thu, 26 May 2022 07:44:39 -0400 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD3FDD4123 for ; Thu, 26 May 2022 04:44:28 -0700 (PDT) Received: by mail-pj1-x102a.google.com with SMTP id pq9-20020a17090b3d8900b001df622bf81dso1498543pjb.3 for ; Thu, 26 May 2022 04:44:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FnikfB78qN2eYHl4FR7LPxdyycjHoZ9Hgqa39kltcXQ=; b=iLa9+C/z31eA64sQJIWGTLNaXb2oUnaLppIs8+xdJ+XS+eVWwbWjVMA1xaMtm/g9zp fQK8S0t8bACe27kKS2NezrOJtXk1UeWGGwn9TKiXdBS0+LJRJhibcPm7xOP8qWahqAE9 wrwX6s2oR2W5dBzZQOMePd7wqgxPgGxbxcC2u/tuK3e11BTC6KPzWM7Bf1KBb+FhBuB7 XeyVcxMN8gM1gxShGrX9udLdNm6cM8mbfl1U3BpT40Mdaxu0QX0mapb1COoDfpVtox3v fVzHqig8Cr/AdA65AdyNFmbPd+6yQyBnL/vqPuOzSmFD+PI2I0dgpW98NtFROFkI168M LhVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FnikfB78qN2eYHl4FR7LPxdyycjHoZ9Hgqa39kltcXQ=; b=Sr7y/+Ta2pNUlKgXPPZ8VhYFMG8zmuQ/csfrM7p6gjyFWZ7ZCLGYNIEzCmphxP07We 8zRIkaX9BD61JnF0yC16RJMRXExUK8PigMXQ6ToRs3bX4xu/+VTMuKG6+G1UY+4Whfyx o1tVs4DA/ZqPWy9hzRWaGqOPIgpJXZAkAvaoeZP6z122ZibJJSIyvfl30QXmY5ItLnGy ZlinLXRKtSeJJFBlHXgQl5QXReV6u76qtCWLsf5eV0duWxcJiA+sT+LKMVr8R3UN12n/ 2ygTD7ODCDk2bwg3oxohLg0APsj1ZyCVuCs1CGkTXwnP7FGovoA2rf6yjuLE3Yz1C1dR 9Ixg== X-Gm-Message-State: AOAM5321NK9ocbb6TZ6MgyS8w8xe2WF+Z2tqOqnChJ8HIfq/r7JzrAsj /5JFlHUp8qc+nOGl6cOa5ospsQ== X-Google-Smtp-Source: ABdhPJxxhjUF1JGPGdIx5+uHDoJrHMIiF47mG2/D6YAqtvdWuR0wXd119OG9/t5XyNMERogQGTBd8Q== X-Received: by 2002:a17:902:8f86:b0:162:22ff:496b with SMTP id z6-20020a1709028f8600b0016222ff496bmr19413781plo.105.1653565468446; Thu, 26 May 2022 04:44:28 -0700 (PDT) Received: from localhost ([122.162.234.2]) by smtp.gmail.com with ESMTPSA id w67-20020a623046000000b00518424f8922sm1294114pfw.77.2022.05.26.04.44.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 May 2022 04:44:28 -0700 (PDT) From: Viresh Kumar To: Viresh Kumar , Nishanth Menon , Stephen Boyd Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , Rafael Wysocki , Krzysztof Kozlowski , linux-kernel@vger.kernel.org Subject: [PATCH 20/31] OPP: ti: Migrate to dev_pm_opp_set_config() Date: Thu, 26 May 2022 17:12:19 +0530 Message-Id: X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The OPP core now provides a unified API for setting all configuration types, i.e. dev_pm_opp_set_config(). Lets start using it. Signed-off-by: Viresh Kumar --- drivers/opp/ti-opp-supply.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/opp/ti-opp-supply.c b/drivers/opp/ti-opp-supply.c index bd4771f388ab..a30825dc30cf 100644 --- a/drivers/opp/ti-opp-supply.c +++ b/drivers/opp/ti-opp-supply.c @@ -382,6 +382,9 @@ static int ti_opp_supply_probe(struct platform_device *= pdev) const struct of_device_id *match; const struct ti_opp_supply_of_data *of_data; int ret =3D 0; + struct dev_pm_opp_config config =3D { + .set_opp =3D ti_opp_supply_set_opp, + }; =20 match =3D of_match_device(ti_opp_supply_of_match, dev); if (!match) { @@ -405,8 +408,7 @@ static int ti_opp_supply_probe(struct platform_device *= pdev) return ret; } =20 - ret =3D PTR_ERR_OR_ZERO(dev_pm_opp_register_set_opp_helper(cpu_dev, - ti_opp_supply_set_opp)); + ret =3D PTR_ERR_OR_ZERO(dev_pm_opp_set_config(cpu_dev, &config)); if (ret) _free_optimized_voltages(dev, &opp_data); =20 --=20 2.31.1.272.g89b43f80a514 From nobody Wed Apr 29 00:43:01 2026 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 52EFDC433EF for ; Thu, 26 May 2022 11:45:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233528AbiEZLpp (ORCPT ); Thu, 26 May 2022 07:45:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347164AbiEZLos (ORCPT ); Thu, 26 May 2022 07:44:48 -0400 Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2F50D413D for ; Thu, 26 May 2022 04:44:31 -0700 (PDT) Received: by mail-pf1-x433.google.com with SMTP id j6so1463938pfe.13 for ; Thu, 26 May 2022 04:44:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=S0NlDi35C5TiI50sHYYZcC2yRcLHKFC/rVdhF6VTtZA=; b=hRbGmYeFezjznrIp6yTfpw+NAJasDPpaj4RCuJ9Zkc9Hx9bRHX1aGwtxb+ttllpkpo HLhzlDBANM4W4V2dV3v0vbi7c0VVdukcxzwN8T0pXIoY1ZhMWW1FfPOqnYocpfV2Au1E R1lxkbwd8ftyzVbS4NwDBGfPVSd3C08h7F1diUnpRcU/XDv1TJc3wkiiJJ/0/cQsGT5Z X/3zjBpy7CG/rrWaeWuVsSnhEM/UcaJX6lImTX20/h1dp/nmXjEoaan8oVGwVw6RmZXO Ko71ST7dsuTWw6JbAzwj6A+8OLpQXwGv7ZiGwmiOHwNWc8I6LRFRf5kr+sYlMMoYtjci 8ATw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=S0NlDi35C5TiI50sHYYZcC2yRcLHKFC/rVdhF6VTtZA=; b=eCZvEtC2xKJUqh47E4lKW0Cj7XPT7uXLPkRzRfZL/xNQE92SPfpbpvGVQDgBJQnvJz +QuUU+B11TlsP9j7+G5qO2RZIHI67Icq46CVVLyj4u3ER6SJ50CkXRuubwLWN0cAHPVo q+gLrvw3h3oooesmVlFAcPhYrhj6KXWcvwavlmSqKwVdEOwTCg4zgNVcyMaKCuQG17ak vbj2Kq0IyAEbTUSy+L7Z5gC67ij03Ro9h0rLeECekb6msTo6abgrKkwpCbNxaS6mvKgN hHcHOpCwAcQl/e74TiVJc4TZOlwOu80eob1a/aooyY1S31+pMXOPmnRorBLmDTzWjzdW G3/g== X-Gm-Message-State: AOAM5307jf8A7xVtwKSvjT5bH4yx0y6HSZbKmWXmi+iglFyYVTOnTsKN CbFOZoHxx02E76kwznecVjaEjg== X-Google-Smtp-Source: ABdhPJwHYkyoY4z87/UCZHUe3lYmt8OLgjsm6sOa4UfL7geTmMxhXMYYb7I+ABhdvJyb8MwWGgj82A== X-Received: by 2002:a05:6a00:cc9:b0:518:c96f:5c8b with SMTP id b9-20020a056a000cc900b00518c96f5c8bmr13088695pfv.59.1653565471507; Thu, 26 May 2022 04:44:31 -0700 (PDT) Received: from localhost ([122.162.234.2]) by smtp.gmail.com with ESMTPSA id e13-20020a17090301cd00b0015e8d4eb1cesm1403105plh.24.2022.05.26.04.44.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 May 2022 04:44:31 -0700 (PDT) From: Viresh Kumar To: Thierry Reding , Jonathan Hunter Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , Rafael Wysocki , Stephen Boyd , Nishanth Menon , Krzysztof Kozlowski , Dmitry Osipenko , linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 21/31] soc/tegra: Remove the call to devm_pm_opp_set_clkname() Date: Thu, 26 May 2022 17:12:20 +0530 Message-Id: <1e88b248352afe03cd3bf0e887b1f2be86b5afb5.1653564321.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The OPP core already performs devm_pm_opp_set_clkname() with name as NULL, the callers shouldn't be doing the same unless they have a different clock name to add here. Drop the call. Cc: Dmitry Osipenko Signed-off-by: Viresh Kumar --- drivers/soc/tegra/common.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/soc/tegra/common.c b/drivers/soc/tegra/common.c index 32c346b72635..49a5360f4507 100644 --- a/drivers/soc/tegra/common.c +++ b/drivers/soc/tegra/common.c @@ -108,12 +108,6 @@ int devm_tegra_core_dev_init_opp_table(struct device *= dev, u32 hw_version; int err; =20 - err =3D devm_pm_opp_set_clkname(dev, NULL); - if (err) { - dev_err(dev, "failed to set OPP clk: %d\n", err); - return err; - } - /* Tegra114+ doesn't support OPP yet */ if (!of_machine_is_compatible("nvidia,tegra20") && !of_machine_is_compatible("nvidia,tegra30")) --=20 2.31.1.272.g89b43f80a514 From nobody Wed Apr 29 00:43:01 2026 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 2156EC433EF for ; Thu, 26 May 2022 11:46:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347328AbiEZLp7 (ORCPT ); Thu, 26 May 2022 07:45:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347253AbiEZLox (ORCPT ); Thu, 26 May 2022 07:44:53 -0400 Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com [IPv6:2607:f8b0:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8702D681D for ; Thu, 26 May 2022 04:44:35 -0700 (PDT) Received: by mail-pf1-x436.google.com with SMTP id b135so1466438pfb.12 for ; Thu, 26 May 2022 04:44:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OpIXnp/tGO9yryIO5uLfqtwQ8qkcQ6bLFqmnA/PDaH8=; b=MFdcYu76oyCuRELMA/UT6I8+Uofdl+CvLDfOYzFOWIDdBxChsj2ZxhDT5WiAjixcEc aNbPSVIFjJFn0IADZdzVqnNa8KIpeqZTDGjQgmAOp0jJJipQREmct/n8fxQFoStBFY5O ceSwO/I0g+3z6RImm1ZiCxOvTwLgh1oUhAWmwSx6ih3HRTkHW2K21qXMkQV4A712055U f1AzYPZbCrF6UL5z47AxpwYGQmblPs75rpg/3QrmtQHVIlszkefIP1282rDXPOSLO8p7 w2Bj7FcLCz5ojSB/RKKm3zJ1By1+iFemQNhw+4k/SRNI8mGMuEtgyUsXIso9qnsP1D4v nW7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OpIXnp/tGO9yryIO5uLfqtwQ8qkcQ6bLFqmnA/PDaH8=; b=Blb/pcTiJqxL7R3npj2PF221Ada8yC+VX6UBCwWZ0uR9oiyJZ0A0NfY0Gxgw8kjiAQ eYMytYmPK0LC/KC/74fAMk9E7IuZQEgicEDFYKLc5b46PKZr+prhUmKxV7o86coSSQ1c d9C6UqE9DyNop3icZ1QFUbdSlGYt4NWTfUeyqfqn3aPNWFBF17s6Y3ZTIh0dJ5U2/xyC 5uHau9X8VlZIiXqNxpFKTKa1lF0A+lZwyhC7LgVJYh4Xu77yxUcQ1+Wb3idHBAlH7w8V uT9PmnWhBsK6ky4CLPv+F0YhunVGDC/RbFad8tTDN9xW2M7w8/rbO1M5PvOaSfgblZ1Z DnOQ== X-Gm-Message-State: AOAM532k2T7498e9tASL3Qz6g6wnejLoBtn6/O+ee6TRPcDGrQctiSf7 /rOAa/YYblc6Qirg0tYsrJoAjg== X-Google-Smtp-Source: ABdhPJz53ecZNA5N1GA7gWB/uJLUku58lnZBPmy2rotuPeH9S8qnNu4uShufq05gKx8Ahp/HIrEYxA== X-Received: by 2002:aa7:84d6:0:b0:518:8b7d:bdad with SMTP id x22-20020aa784d6000000b005188b7dbdadmr24393258pfn.59.1653565474829; Thu, 26 May 2022 04:44:34 -0700 (PDT) Received: from localhost ([122.162.234.2]) by smtp.gmail.com with ESMTPSA id e2-20020a170902e0c200b0015e8d4eb260sm1256061pla.170.2022.05.26.04.44.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 May 2022 04:44:34 -0700 (PDT) From: Viresh Kumar To: Thierry Reding , Jonathan Hunter Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , Rafael Wysocki , Stephen Boyd , Nishanth Menon , Krzysztof Kozlowski , linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 22/31] soc/tegra: Migrate to dev_pm_opp_set_config() Date: Thu, 26 May 2022 17:12:21 +0530 Message-Id: <449b344f037c7ef1970bc84d31e0d4c4cb4d2951.1653564321.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The OPP core now provides a unified API for setting all configuration types, i.e. dev_pm_opp_set_config(). Lets start using it. Signed-off-by: Viresh Kumar Tested-by: Dmitry Osipenko --- drivers/soc/tegra/common.c | 8 ++++++-- drivers/soc/tegra/pmc.c | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/soc/tegra/common.c b/drivers/soc/tegra/common.c index 49a5360f4507..7ba15cb836e8 100644 --- a/drivers/soc/tegra/common.c +++ b/drivers/soc/tegra/common.c @@ -107,6 +107,10 @@ int devm_tegra_core_dev_init_opp_table(struct device *= dev, { u32 hw_version; int err; + struct dev_pm_opp_config config =3D { + .supported_hw =3D &hw_version, + .supported_hw_count =3D 1, + }; =20 /* Tegra114+ doesn't support OPP yet */ if (!of_machine_is_compatible("nvidia,tegra20") && @@ -118,9 +122,9 @@ int devm_tegra_core_dev_init_opp_table(struct device *d= ev, else hw_version =3D BIT(tegra_sku_info.soc_speedo_id); =20 - err =3D devm_pm_opp_set_supported_hw(dev, &hw_version, 1); + err =3D devm_pm_opp_set_config(dev, &config); if (err) { - dev_err(dev, "failed to set OPP supported HW: %d\n", err); + dev_err(dev, "failed to set OPP config: %d\n", err); return err; } =20 diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c index fdf508e03400..01ec76dd433d 100644 --- a/drivers/soc/tegra/pmc.c +++ b/drivers/soc/tegra/pmc.c @@ -1366,6 +1366,10 @@ static int tegra_pmc_core_pd_add(struct tegra_pmc *p= mc, struct device_node *np) struct generic_pm_domain *genpd; const char *rname =3D "core"; int err; + struct dev_pm_opp_config config =3D { + .regulator_names =3D &rname, + .regulator_count =3D 1, + }; =20 genpd =3D devm_kzalloc(pmc->dev, sizeof(*genpd), GFP_KERNEL); if (!genpd) @@ -1375,10 +1379,10 @@ static int tegra_pmc_core_pd_add(struct tegra_pmc *= pmc, struct device_node *np) genpd->set_performance_state =3D tegra_pmc_core_pd_set_performance_state; genpd->opp_to_performance_state =3D tegra_pmc_core_pd_opp_to_performance_= state; =20 - err =3D devm_pm_opp_set_regulators(pmc->dev, &rname, 1); + err =3D devm_pm_opp_set_config(pmc->dev, &config); if (err) return dev_err_probe(pmc->dev, err, - "failed to set core OPP regulator\n"); + "failed to set OPP config\n"); =20 err =3D pm_genpd_init(genpd, NULL, false); if (err) { --=20 2.31.1.272.g89b43f80a514 From nobody Wed Apr 29 00:43:01 2026 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 01B5DC433F5 for ; Thu, 26 May 2022 11:45:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345162AbiEZLpw (ORCPT ); Thu, 26 May 2022 07:45:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347321AbiEZLoy (ORCPT ); Thu, 26 May 2022 07:44:54 -0400 Received: from mail-pg1-x529.google.com (mail-pg1-x529.google.com [IPv6:2607:f8b0:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F845CFE26 for ; Thu, 26 May 2022 04:44:38 -0700 (PDT) Received: by mail-pg1-x529.google.com with SMTP id 137so1129936pgb.5 for ; Thu, 26 May 2022 04:44:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=sbZ69EBj+CLxahhE5rw5q494M5c4cxGAZWpQHb2IOAc=; b=CYrVjUIuWd0zfRIJSi8HO31AD9AB7Z/b4ZGo/R1bvdZBPaGfQHMVsp9no9MCPRLZSu Rx1UKPigFvdWFI3gG/HlfhuEFFhdBc8tINuYmFZ2So48AD+5LQVHGJMBlzObMv8wxjVS yxTShzVoWieKyQP/hK9o+Iv3sCcjl67EpSLJ4d2H1lHxljTM5NdTslfMlya8H+j/wS4D 5jzP9DwrV/aPT9HOxUtxo26dGuXTskGfoJK1LPz5Wf7KLcG8wn5snDKw2cATPMw3anCP 5FnfmuUON+mH1UD1VSlbTe1asCjQWGQZLQNt973KfqWmp4KKOCgcij5STXxI/EUUQ76d 2vrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=sbZ69EBj+CLxahhE5rw5q494M5c4cxGAZWpQHb2IOAc=; b=ic8fq9q7D2OJM1o+nNg0X3Es/ODRsd1mU50G70QOJh+/2ibe7RmfvoSvtD25WnTmuD JEymGEHuv4J5RC2lbs4xrTpVYV0hUl5cfl+Z9ZgGObgmctMNnou6Xfwh+Htqkv9hf5UE /AcpLGT0nRwbrFVUxDTfgD1bPkfHBjRU+Y6IU79+/ef3flcNAQfxUTkFI5o3TST21Lc5 HF5CdeqlyfkGJE7D9I3//Fthmb4ynTP6xMnv9p9fHm/vXHqO3s9z8L7QQQM7HVkbITDZ Y5yzt0QmiksWpe1u9ZTR+l24taFA0kCFtENyP6bHvW9ub3/JiVSTld5IwYIYWdN5BMK+ wYkw== X-Gm-Message-State: AOAM530889Ufr43stNhN7XUti1cO8i+R01b2Eh5y0B5jtapaIGWlji3r CQHKtMjmV6FlGSNDOjSqg2x1YQ== X-Google-Smtp-Source: ABdhPJyI36Xh7JTRb61yxLCPh2nssAdsbatU80ZBS3PRQ6y4gvF9EpP1vtaAGYqIfWJADbOhRY1hSw== X-Received: by 2002:a05:6a00:ad2:b0:4f1:2734:a3d9 with SMTP id c18-20020a056a000ad200b004f12734a3d9mr38397886pfl.61.1653565478103; Thu, 26 May 2022 04:44:38 -0700 (PDT) Received: from localhost ([122.162.234.2]) by smtp.gmail.com with ESMTPSA id d4-20020a170902c18400b001637d72b314sm1231655pld.10.2022.05.26.04.44.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 May 2022 04:44:37 -0700 (PDT) From: Viresh Kumar To: Andy Gross , Bjorn Andersson , Mark Brown Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , Rafael Wysocki , Stephen Boyd , Nishanth Menon , Krzysztof Kozlowski , linux-arm-msm@vger.kernel.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 23/31] spi: qcom: Migrate to dev_pm_opp_set_config() Date: Thu, 26 May 2022 17:12:22 +0530 Message-Id: <09fde85449e0e189572ea847e86148943aff8b2e.1653564321.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The OPP core now provides a unified API for setting all configuration types, i.e. dev_pm_opp_set_config(). Lets start using it. Signed-off-by: Viresh Kumar Acked-by: Mark Brown --- drivers/spi/spi-geni-qcom.c | 5 ++++- drivers/spi/spi-qcom-qspi.c | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-geni-qcom.c b/drivers/spi/spi-geni-qcom.c index 4e83cc5b445d..d869f270dcca 100644 --- a/drivers/spi/spi-geni-qcom.c +++ b/drivers/spi/spi-geni-qcom.c @@ -892,6 +892,9 @@ static int spi_geni_probe(struct platform_device *pdev) void __iomem *base; struct clk *clk; struct device *dev =3D &pdev->dev; + struct dev_pm_opp_config config =3D { + .clk_name =3D "se", + }; =20 irq =3D platform_get_irq(pdev, 0); if (irq < 0) @@ -922,7 +925,7 @@ static int spi_geni_probe(struct platform_device *pdev) mas->se.base =3D base; mas->se.clk =3D clk; =20 - ret =3D devm_pm_opp_set_clkname(&pdev->dev, "se"); + ret =3D devm_pm_opp_set_config(&pdev->dev, &config); if (ret) return ret; /* OPP table is optional */ diff --git a/drivers/spi/spi-qcom-qspi.c b/drivers/spi/spi-qcom-qspi.c index c334dfec4117..5ab3ae406ef7 100644 --- a/drivers/spi/spi-qcom-qspi.c +++ b/drivers/spi/spi-qcom-qspi.c @@ -458,6 +458,9 @@ static int qcom_qspi_probe(struct platform_device *pdev) struct device *dev; struct spi_master *master; struct qcom_qspi *ctrl; + struct dev_pm_opp_config config =3D { + .clk_name =3D "core", + }; =20 dev =3D &pdev->dev; =20 @@ -529,7 +532,7 @@ static int qcom_qspi_probe(struct platform_device *pdev) master->handle_err =3D qcom_qspi_handle_err; master->auto_runtime_pm =3D true; =20 - ret =3D devm_pm_opp_set_clkname(&pdev->dev, "core"); + ret =3D devm_pm_opp_set_config(&pdev->dev, &config); if (ret) return ret; /* OPP table is optional */ --=20 2.31.1.272.g89b43f80a514 From nobody Wed Apr 29 00:43:01 2026 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 563F2C433FE for ; Thu, 26 May 2022 11:46:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344879AbiEZLqH (ORCPT ); Thu, 26 May 2022 07:46:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347353AbiEZLo4 (ORCPT ); Thu, 26 May 2022 07:44:56 -0400 Received: from mail-pg1-x534.google.com (mail-pg1-x534.google.com [IPv6:2607:f8b0:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 255ABD029E for ; Thu, 26 May 2022 04:44:42 -0700 (PDT) Received: by mail-pg1-x534.google.com with SMTP id x12so1124120pgj.7 for ; Thu, 26 May 2022 04:44:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Ea7OeFJXlMpFcPLCRl9ByzN+8R9kDLKU8gAyymKSibQ=; b=M6bRg+ULJ96LPwVQ7+5mReEW6ZqyIV3Sw0mUefHoAbPfZkGsn0gU5r1icGCEjYkHeS LZYzMws85x1JW1ZIVi11yxmJEZt9nPXRXAzUBUiJRa2eWGg/HEfMPMQxVATCKPOD+jrx OdWVyEgzxpUBJzJcm/blvmIT/3RPW2UkGXrAjD/+ovhUmhml8N2JhwpaDLxJjLWK+yOA UT0x1q9jF/CQPOmxPMdb8UK++Y+myFIm6xEWiyNyKBiN3dqv8crhWv2uDYjW7mTv+eVX TZdFxHmBplkzg1lzvyh+YKaqrQJ/aFOtFsAR4POd2B9XTCgETMvLsA8VT1Wf3E+qIgb+ rZaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Ea7OeFJXlMpFcPLCRl9ByzN+8R9kDLKU8gAyymKSibQ=; b=DX63RWM9aPEX+3j1+IeaxsnE77f0QwiuDlLxlsEqcODO4re8uDMQGho1j60DUp3oeh +Hboa0G5IKtVw9xtxsb2pqlMv5lhbgXHAPrIsLuj7w+WEUHXYYEg3aeWslC/7mCRrMF7 PEb/8dOgGjxMJUl192Q9csHwSM+N7dFCn3HfFbZ+sO/SEaWfinPWTyhb2qgYBEbiLMcs q5yrc+Gc8SHGx9Nco0+F0scdHJyhf4Vg1+I+CSGwKQNjJBCwEU5D0aEVeK5TptcGT/33 4xa9BpfV39xisxYnLbR8o1wA84V9mpYobMmyC4UT8ls5tRsyBepCvF5HxUKtQ9cwU+M4 5uPg== X-Gm-Message-State: AOAM531OdFjQvSaGCmzabZWjS8jnTZgM/D02m9iCOfSfLnmm36hL2jnF tIQg773a4OKTafSa2voHAqoB816Z8V33cQ== X-Google-Smtp-Source: ABdhPJxmzRiAXnitzctuPYAA9jUL7Rnfwu6jdDAlzlKlkWUlBLdlfPYGPy437OiWOPMUX61OXwUPFQ== X-Received: by 2002:a05:6a00:1d1d:b0:518:421c:b65e with SMTP id a29-20020a056a001d1d00b00518421cb65emr35712261pfx.43.1653565481268; Thu, 26 May 2022 04:44:41 -0700 (PDT) Received: from localhost ([122.162.234.2]) by smtp.gmail.com with ESMTPSA id i13-20020a170902eb4d00b001635f9b6e2fsm1360265pli.61.2022.05.26.04.44.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 May 2022 04:44:40 -0700 (PDT) From: Viresh Kumar To: Andy Gross , Bjorn Andersson , Greg Kroah-Hartman , Jiri Slaby Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , Rafael Wysocki , Stephen Boyd , Nishanth Menon , Krzysztof Kozlowski , linux-arm-msm@vger.kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 24/31] serial: qcom: Migrate to dev_pm_opp_set_config() Date: Thu, 26 May 2022 17:12:23 +0530 Message-Id: <49aff8c5f72dae52ef7e9acb4f821d0c3e097813.1653564321.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The OPP core now provides a unified API for setting all configuration types, i.e. dev_pm_opp_set_config(). Lets start using it. Signed-off-by: Viresh Kumar --- drivers/tty/serial/qcom_geni_serial.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qco= m_geni_serial.c index 1543a6028856..391fcc3a0f61 100644 --- a/drivers/tty/serial/qcom_geni_serial.c +++ b/drivers/tty/serial/qcom_geni_serial.c @@ -1331,6 +1331,9 @@ static int qcom_geni_serial_probe(struct platform_dev= ice *pdev) int irq; bool console =3D false; struct uart_driver *drv; + struct dev_pm_opp_config config =3D { + .clk_name =3D "se", + }; =20 if (of_device_is_compatible(pdev->dev.of_node, "qcom,geni-debug-uart")) console =3D true; @@ -1414,7 +1417,7 @@ static int qcom_geni_serial_probe(struct platform_dev= ice *pdev) if (of_property_read_bool(pdev->dev.of_node, "cts-rts-swap")) port->cts_rts_swap =3D true; =20 - ret =3D devm_pm_opp_set_clkname(&pdev->dev, "se"); + ret =3D devm_pm_opp_set_config(&pdev->dev, &config); if (ret) return ret; /* OPP table is optional */ --=20 2.31.1.272.g89b43f80a514 From nobody Wed Apr 29 00:43:01 2026 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 AC1E2C433F5 for ; Thu, 26 May 2022 11:46:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235436AbiEZLqU (ORCPT ); Thu, 26 May 2022 07:46:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347373AbiEZLo4 (ORCPT ); Thu, 26 May 2022 07:44:56 -0400 Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0379AD6816 for ; Thu, 26 May 2022 04:44:44 -0700 (PDT) Received: by mail-pf1-x42c.google.com with SMTP id c14so1506434pfn.2 for ; Thu, 26 May 2022 04:44:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2GyYsGJSyLdpY6YjxA3xivfl9Pu65955UdoiLRgF0nI=; b=l8dxC5jwAwaKkGfZE/RaVevT1zFOqmGKUMqy3FpkiXne/z70OeEIECPflRPW7Q/Q6q vgL+4EYhQJmQF9x94iJehCaU/NO+bdf/s8cH1LIasc4Xe/UHp8D7R+CkOqwCysrgsEs6 SosYZXHGvcrTLUC5xRKSzyFLrx/ZgOb/assJ9CVCbwUUPHhJjJOWajmiCtw8ttFdK59B f5pj57HHznA7bMim/Ujtfx5+wc+xPHAnLU6+MxhaLfY3C4O7jaHTXqHa/RyxtXnuBm1O 9YSEew7XrNZmAzjRnDJQEXvOLIg7lfUOmldw2KGs0B96bU1m8KtJncLXbof6HB+IrwaO 61GQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2GyYsGJSyLdpY6YjxA3xivfl9Pu65955UdoiLRgF0nI=; b=kQ2/j5Burw8nibHK2s1e90CNqz32fvChBkgJBq2nlFGvdaITyTfqx37+KXKgF8p4mr rz3x8l0SSFoJ0kCNbG0rlTFLL1x0ijKJDFCKavXdn65rmP8c6nXTEblaGb1SqGTFpPLY MnrtR+/+fP/i9DdW7istJIjJdDF44Q9C2CObyeqKioUi26m6fifOlKy4NdxhuYV0bnEx um1bS1FP+SpK9zNUO4yPM9SxHEvgNX332z2QSWsosgKGOYQLYixjZRgMFw79iuY2iy/n FVIq1rcpKOOUoZKt/npkq9m92JbKQ4noyxZAw/Y8zuFyTXqV1hFg4cv0hsFKak/D7a+T OEvQ== X-Gm-Message-State: AOAM531Z399eySu3fuT8ojFwHQK6UG+sXaMda06sDhsRzTP0pJ/2XrWp oBj1vxblPFJ4n3hDthn00sJbQQ== X-Google-Smtp-Source: ABdhPJy3YcgtcoDGxztR99tPx35mpt5XTIrynFTggmeVtJAPk0xKZu9fo/mKxviLaJs+DkLe26O7Rg== X-Received: by 2002:a63:e449:0:b0:3fb:10d9:ec18 with SMTP id i9-20020a63e449000000b003fb10d9ec18mr2812166pgk.43.1653565484562; Thu, 26 May 2022 04:44:44 -0700 (PDT) Received: from localhost ([122.162.234.2]) by smtp.gmail.com with ESMTPSA id n16-20020aa79050000000b00518c6887217sm1277301pfo.58.2022.05.26.04.44.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 May 2022 04:44:44 -0700 (PDT) From: Viresh Kumar To: Viresh Kumar , Nishanth Menon , Stephen Boyd , "Rafael J. Wysocki" Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , Rafael Wysocki , Krzysztof Kozlowski , linux-kernel@vger.kernel.org Subject: [PATCH 25/31] OPP: Remove dev_pm_opp_set_regulators() and friends Date: Thu, 26 May 2022 17:12:24 +0530 Message-Id: <799420aa820061490aadedc0e88e456ae6435401.1653564321.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Now that everyone has migrated to dev_pm_opp_set_config(), remove the public interface for dev_pm_opp_set_regulators() and friends. Signed-off-by: Viresh Kumar --- drivers/opp/core.c | 95 ++++++++++-------------------------------- include/linux/pm_opp.h | 17 -------- 2 files changed, 22 insertions(+), 90 deletions(-) diff --git a/drivers/opp/core.c b/drivers/opp/core.c index 30dbef0f4d17..9297b5e944f7 100644 --- a/drivers/opp/core.c +++ b/drivers/opp/core.c @@ -987,8 +987,8 @@ static int _set_opp_custom(const struct opp_table *opp_= table, int size; =20 /* - * We support this only if dev_pm_opp_set_regulators() was called - * earlier. + * We support this only if dev_pm_opp_set_config() was called + * earlier to set regulators. */ if (opp_table->sod_supplies) { size =3D sizeof(*old_opp->supplies) * opp_table->regulator_count; @@ -2093,7 +2093,7 @@ void dev_pm_opp_put_prop_name(struct opp_table *opp_t= able) EXPORT_SYMBOL_GPL(dev_pm_opp_put_prop_name); =20 /** - * dev_pm_opp_set_regulators() - Set regulator names for the device + * _opp_set_regulators() - Set regulator names for the device * @dev: Device for which regulator name is being set. * @names: Array of pointers to the names of the regulator. * @count: Number of regulators. @@ -2104,36 +2104,22 @@ EXPORT_SYMBOL_GPL(dev_pm_opp_put_prop_name); * * This must be called before any OPPs are initialized for the device. */ -struct opp_table *dev_pm_opp_set_regulators(struct device *dev, - const char * const names[], - unsigned int count) +static int _opp_set_regulators(struct opp_table *opp_table, struct device = *dev, + const char * const names[], unsigned int count) { struct dev_pm_opp_supply *supplies; - struct opp_table *opp_table; struct regulator *reg; int ret, i; =20 - opp_table =3D _add_opp_table(dev, false); - if (IS_ERR(opp_table)) - return opp_table; - - /* This should be called before OPPs are initialized */ - if (WARN_ON(!list_empty(&opp_table->opp_list))) { - ret =3D -EBUSY; - goto err; - } - /* Another CPU that shares the OPP table has set the regulators ? */ if (opp_table->regulators) - return opp_table; + return 0; =20 opp_table->regulators =3D kmalloc_array(count, sizeof(*opp_table->regulators), GFP_KERNEL); - if (!opp_table->regulators) { - ret =3D -ENOMEM; - goto err; - } + if (!opp_table->regulators) + return -ENOMEM; =20 for (i =3D 0; i < count; i++) { reg =3D regulator_get_optional(dev, names[i]); @@ -2163,7 +2149,7 @@ struct opp_table *dev_pm_opp_set_regulators(struct de= vice *dev, } mutex_unlock(&opp_table->lock); =20 - return opp_table; + return 0; =20 free_regulators: while (i !=3D 0) @@ -2172,26 +2158,20 @@ struct opp_table *dev_pm_opp_set_regulators(struct = device *dev, kfree(opp_table->regulators); opp_table->regulators =3D NULL; opp_table->regulator_count =3D -1; -err: - dev_pm_opp_put_opp_table(opp_table); =20 - return ERR_PTR(ret); + return ret; } -EXPORT_SYMBOL_GPL(dev_pm_opp_set_regulators); =20 /** - * dev_pm_opp_put_regulators() - Releases resources blocked for regulator - * @opp_table: OPP table returned from dev_pm_opp_set_regulators(). + * _opp_put_regulators() - Releases resources blocked for regulator + * @opp_table: OPP table returned from _opp_set_regulators(). */ -void dev_pm_opp_put_regulators(struct opp_table *opp_table) +static void _opp_put_regulators(struct opp_table *opp_table) { int i; =20 - if (unlikely(!opp_table)) - return; - if (!opp_table->regulators) - goto put_opp_table; + return; =20 if (opp_table->enabled) { for (i =3D opp_table->regulator_count - 1; i >=3D 0; i--) @@ -2214,41 +2194,7 @@ void dev_pm_opp_put_regulators(struct opp_table *opp= _table) kfree(opp_table->regulators); opp_table->regulators =3D NULL; opp_table->regulator_count =3D -1; - -put_opp_table: - dev_pm_opp_put_opp_table(opp_table); -} -EXPORT_SYMBOL_GPL(dev_pm_opp_put_regulators); - -static void devm_pm_opp_regulators_release(void *data) -{ - dev_pm_opp_put_regulators(data); -} - -/** - * devm_pm_opp_set_regulators() - Set regulator names for the device - * @dev: Device for which regulator name is being set. - * @names: Array of pointers to the names of the regulator. - * @count: Number of regulators. - * - * This is a resource-managed variant of dev_pm_opp_set_regulators(). - * - * Return: 0 on success and errorno otherwise. - */ -int devm_pm_opp_set_regulators(struct device *dev, - const char * const names[], - unsigned int count) -{ - struct opp_table *opp_table; - - opp_table =3D dev_pm_opp_set_regulators(dev, names, count); - if (IS_ERR(opp_table)) - return PTR_ERR(opp_table); - - return devm_add_action_or_reset(dev, devm_pm_opp_regulators_release, - opp_table); } -EXPORT_SYMBOL_GPL(devm_pm_opp_set_regulators); =20 /** * dev_pm_opp_set_clkname() - Set clk name for the device @@ -2634,6 +2580,7 @@ struct opp_table *dev_pm_opp_set_config(struct device= *dev, struct dev_pm_opp_config *config) { struct opp_table *opp_table, *ret; + int err; =20 opp_table =3D _add_opp_table(dev, false); if (IS_ERR(opp_table)) @@ -2676,10 +2623,13 @@ struct opp_table *dev_pm_opp_set_config(struct devi= ce *dev, =20 // Configure supplies if (config->regulator_names) { - ret =3D dev_pm_opp_set_regulators(dev, config->regulator_names, - config->regulator_count); - if (IS_ERR(ret)) + err =3D _opp_set_regulators(opp_table, dev, + config->regulator_names, + config->regulator_count); + if (err) { + ret =3D ERR_PTR(err); goto err; + } } =20 // Attach genpds @@ -2716,8 +2666,7 @@ void dev_pm_opp_clear_config(struct opp_table *opp_ta= ble) if (opp_table->genpd_virt_devs) dev_pm_opp_detach_genpd(opp_table); =20 - if (opp_table->regulators) - dev_pm_opp_put_regulators(opp_table); + _opp_put_regulators(opp_table); =20 if (opp_table->supported_hw) dev_pm_opp_put_supported_hw(opp_table); diff --git a/include/linux/pm_opp.h b/include/linux/pm_opp.h index 0d5d07dd164a..11896ebe1fb1 100644 --- a/include/linux/pm_opp.h +++ b/include/linux/pm_opp.h @@ -189,9 +189,6 @@ void dev_pm_opp_put_supported_hw(struct opp_table *opp_= table); int devm_pm_opp_set_supported_hw(struct device *dev, const u32 *versions, = unsigned int count); struct opp_table *dev_pm_opp_set_prop_name(struct device *dev, const char = *name); void dev_pm_opp_put_prop_name(struct opp_table *opp_table); -struct opp_table *dev_pm_opp_set_regulators(struct device *dev, const char= * const names[], unsigned int count); -void dev_pm_opp_put_regulators(struct opp_table *opp_table); -int devm_pm_opp_set_regulators(struct device *dev, const char * const name= s[], unsigned int count); struct opp_table *dev_pm_opp_set_clkname(struct device *dev, const char *n= ame); void dev_pm_opp_put_clkname(struct opp_table *opp_table); int devm_pm_opp_set_clkname(struct device *dev, const char *name); @@ -409,20 +406,6 @@ static inline struct opp_table *dev_pm_opp_set_prop_na= me(struct device *dev, con =20 static inline void dev_pm_opp_put_prop_name(struct opp_table *opp_table) {} =20 -static inline struct opp_table *dev_pm_opp_set_regulators(struct device *d= ev, const char * const names[], unsigned int count) -{ - return ERR_PTR(-EOPNOTSUPP); -} - -static inline void dev_pm_opp_put_regulators(struct opp_table *opp_table) = {} - -static inline int devm_pm_opp_set_regulators(struct device *dev, - const char * const names[], - unsigned int count) -{ - return -EOPNOTSUPP; -} - static inline struct opp_table *dev_pm_opp_set_clkname(struct device *dev,= const char *name) { return ERR_PTR(-EOPNOTSUPP); --=20 2.31.1.272.g89b43f80a514 From nobody Wed Apr 29 00:43:01 2026 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 6A834C433EF for ; Thu, 26 May 2022 11:46:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347181AbiEZLqr (ORCPT ); Thu, 26 May 2022 07:46:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347403AbiEZLo5 (ORCPT ); Thu, 26 May 2022 07:44:57 -0400 Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66B8AD6834 for ; Thu, 26 May 2022 04:44:48 -0700 (PDT) Received: by mail-pl1-x62f.google.com with SMTP id n18so1228603plg.5 for ; Thu, 26 May 2022 04:44:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=aBl1CC0647PH0W5NTycQQML4b7lHvkQNUHifdM1GDAY=; b=XU6kHOyVAe6IVpqMU7mG7mrqIele38tK/JE36YPUd6201Yvo2CZj62/LV3oLeN+lyO TodZyd/JTrQHXAUhZuHFofbvf9oXBuJQMQxS1BBCR3N9TEQL6FJ00w42/etUQfdvWIk1 NcP6llHTwf0aceT5mdHaijXhyAIQq92uTXX6LlJRliMPc3BwFfdqXxqWBfXm10d45wsG lTEhCwCsMk2e6bCOndjaujvO9dZzzkevXZkke3SC5JIubIhlLpO/iyFPrf1NHverHb0a Qd0UyugsV2QfUrpqNVFJj1cfHiwZ0bl6ImlqwC4KWyVi1E9c+l92441XrvCsnDnaEhEO N/WQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=aBl1CC0647PH0W5NTycQQML4b7lHvkQNUHifdM1GDAY=; b=V5L3hbElbyE1EyhUW4NQlHWaplfRRlhJd46lUs/aYkHdGoov1siq2x6/bu2iLn5dX4 4rDSGIYRszTtbirGYygyxnp02onBcZublGRkr30lM6e0Mu3Rh2l/DVUe0/U9iUB3ycHp Oo1It80a5M2in1vrfMfCLLxUKxhY2jPfPlp54V6FhXn9jYE2hqGgtYjGKLzHrPr4x6gI 9r7dj+NE86Kg1/KPE04ClNR2RWQvMxqxLIXnJcBCwoS8dXr/xEjW9d/sv7rLu2QNB9z+ +r24ZlAJibRcwKU5+v43AatYYxuXq+urkXWgv/XyYDJcMmsS140SdUFZERaRmxsbNj8/ E5NQ== X-Gm-Message-State: AOAM531h/zeB4HG+ptA5EPWglKBRrMyN5QOZZGnqMq6Mosh4vmvY/v2Y ugDAPHupzvAbtl4dazJ3H1eUKA== X-Google-Smtp-Source: ABdhPJz3zYjTuxMYWiz3B6eAEhxfQdRcN7ZzzRRNKFLbGJu16yTRln18Pe6QDLjgBngfPyNCQLwP1g== X-Received: by 2002:a17:902:9b94:b0:161:5a74:aa6c with SMTP id y20-20020a1709029b9400b001615a74aa6cmr36906593plp.108.1653565488042; Thu, 26 May 2022 04:44:48 -0700 (PDT) Received: from localhost ([122.162.234.2]) by smtp.gmail.com with ESMTPSA id br19-20020a17090b0f1300b001d954837197sm3420044pjb.22.2022.05.26.04.44.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 May 2022 04:44:47 -0700 (PDT) From: Viresh Kumar To: Viresh Kumar , Nishanth Menon , Stephen Boyd , "Rafael J. Wysocki" Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , Rafael Wysocki , Krzysztof Kozlowski , linux-kernel@vger.kernel.org Subject: [PATCH 26/31] OPP: Remove dev_pm_opp_set_supported_hw() and friends Date: Thu, 26 May 2022 17:12:25 +0530 Message-Id: X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Now that everyone has migrated to dev_pm_opp_set_config(), remove the public interface for dev_pm_opp_set_supported_hw() and friends. Signed-off-by: Viresh Kumar --- drivers/opp/core.c | 88 +++++++++++------------------------------- include/linux/pm_opp.h | 19 --------- 2 files changed, 22 insertions(+), 85 deletions(-) diff --git a/drivers/opp/core.c b/drivers/opp/core.c index 9297b5e944f7..07cb8ff33a6d 100644 --- a/drivers/opp/core.c +++ b/drivers/opp/core.c @@ -1948,7 +1948,7 @@ int _opp_add_v1(struct opp_table *opp_table, struct d= evice *dev, } =20 /** - * dev_pm_opp_set_supported_hw() - Set supported platforms + * _opp_set_supported_hw() - Set supported platforms * @dev: Device for which supported-hw has to be set. * @versions: Array of hierarchy of versions to match. * @count: Number of elements in the array. @@ -1958,84 +1958,39 @@ int _opp_add_v1(struct opp_table *opp_table, struct= device *dev, * OPPs, which are available for those versions, based on its 'opp-support= ed-hw' * property. */ -struct opp_table *dev_pm_opp_set_supported_hw(struct device *dev, - const u32 *versions, unsigned int count) +static int _opp_set_supported_hw(struct opp_table *opp_table, + const u32 *versions, unsigned int count) { - struct opp_table *opp_table; - - opp_table =3D _add_opp_table(dev, false); - if (IS_ERR(opp_table)) - return opp_table; - - /* Make sure there are no concurrent readers while updating opp_table */ - WARN_ON(!list_empty(&opp_table->opp_list)); - /* Another CPU that shares the OPP table has set the property ? */ if (opp_table->supported_hw) - return opp_table; + return 0; =20 opp_table->supported_hw =3D kmemdup(versions, count * sizeof(*versions), GFP_KERNEL); - if (!opp_table->supported_hw) { - dev_pm_opp_put_opp_table(opp_table); - return ERR_PTR(-ENOMEM); - } + if (!opp_table->supported_hw) + return -ENOMEM; =20 opp_table->supported_hw_count =3D count; =20 - return opp_table; + return 0; } -EXPORT_SYMBOL_GPL(dev_pm_opp_set_supported_hw); =20 /** - * dev_pm_opp_put_supported_hw() - Releases resources blocked for supporte= d hw - * @opp_table: OPP table returned by dev_pm_opp_set_supported_hw(). + * _opp_put_supported_hw() - Releases resources blocked for supported hw + * @opp_table: OPP table returned by _opp_set_supported_hw(). * * This is required only for the V2 bindings, and is called for a matching - * dev_pm_opp_set_supported_hw(). Until this is called, the opp_table stru= cture + * _opp_set_supported_hw(). Until this is called, the opp_table structure * will not be freed. */ -void dev_pm_opp_put_supported_hw(struct opp_table *opp_table) -{ - if (unlikely(!opp_table)) - return; - - kfree(opp_table->supported_hw); - opp_table->supported_hw =3D NULL; - opp_table->supported_hw_count =3D 0; - - dev_pm_opp_put_opp_table(opp_table); -} -EXPORT_SYMBOL_GPL(dev_pm_opp_put_supported_hw); - -static void devm_pm_opp_supported_hw_release(void *data) -{ - dev_pm_opp_put_supported_hw(data); -} - -/** - * devm_pm_opp_set_supported_hw() - Set supported platforms - * @dev: Device for which supported-hw has to be set. - * @versions: Array of hierarchy of versions to match. - * @count: Number of elements in the array. - * - * This is a resource-managed variant of dev_pm_opp_set_supported_hw(). - * - * Return: 0 on success and errorno otherwise. - */ -int devm_pm_opp_set_supported_hw(struct device *dev, const u32 *versions, - unsigned int count) +static void _opp_put_supported_hw(struct opp_table *opp_table) { - struct opp_table *opp_table; - - opp_table =3D dev_pm_opp_set_supported_hw(dev, versions, count); - if (IS_ERR(opp_table)) - return PTR_ERR(opp_table); - - return devm_add_action_or_reset(dev, devm_pm_opp_supported_hw_release, - opp_table); + if (opp_table->supported_hw) { + kfree(opp_table->supported_hw); + opp_table->supported_hw =3D NULL; + opp_table->supported_hw_count =3D 0; + } } -EXPORT_SYMBOL_GPL(devm_pm_opp_set_supported_hw); =20 /** * dev_pm_opp_set_prop_name() - Set prop-extn name @@ -2615,10 +2570,12 @@ struct opp_table *dev_pm_opp_set_config(struct devi= ce *dev, =20 // Configure supported hardware if (config->supported_hw) { - ret =3D dev_pm_opp_set_supported_hw(dev, config->supported_hw, - config->supported_hw_count); - if (IS_ERR(ret)) + err =3D _opp_set_supported_hw(opp_table, config->supported_hw, + config->supported_hw_count); + if (err) { + ret =3D ERR_PTR(err); goto err; + } } =20 // Configure supplies @@ -2668,8 +2625,7 @@ void dev_pm_opp_clear_config(struct opp_table *opp_ta= ble) =20 _opp_put_regulators(opp_table); =20 - if (opp_table->supported_hw) - dev_pm_opp_put_supported_hw(opp_table); + _opp_put_supported_hw(opp_table); =20 if (opp_table->set_opp) dev_pm_opp_unregister_set_opp_helper(opp_table); diff --git a/include/linux/pm_opp.h b/include/linux/pm_opp.h index 11896ebe1fb1..b80982e5a067 100644 --- a/include/linux/pm_opp.h +++ b/include/linux/pm_opp.h @@ -184,9 +184,6 @@ struct opp_table *dev_pm_opp_set_config(struct device *= dev, struct dev_pm_opp_co int devm_pm_opp_set_config(struct device *dev, struct dev_pm_opp_config *c= onfig); void dev_pm_opp_clear_config(struct opp_table *opp_table); =20 -struct opp_table *dev_pm_opp_set_supported_hw(struct device *dev, const u3= 2 *versions, unsigned int count); -void dev_pm_opp_put_supported_hw(struct opp_table *opp_table); -int devm_pm_opp_set_supported_hw(struct device *dev, const u32 *versions, = unsigned int count); struct opp_table *dev_pm_opp_set_prop_name(struct device *dev, const char = *name); void dev_pm_opp_put_prop_name(struct opp_table *opp_table); struct opp_table *dev_pm_opp_set_clkname(struct device *dev, const char *n= ame); @@ -369,22 +366,6 @@ static inline int dev_pm_opp_unregister_notifier(struc= t device *dev, struct noti return -EOPNOTSUPP; } =20 -static inline struct opp_table *dev_pm_opp_set_supported_hw(struct device = *dev, - const u32 *versions, - unsigned int count) -{ - return ERR_PTR(-EOPNOTSUPP); -} - -static inline void dev_pm_opp_put_supported_hw(struct opp_table *opp_table= ) {} - -static inline int devm_pm_opp_set_supported_hw(struct device *dev, - const u32 *versions, - unsigned int count) -{ - return -EOPNOTSUPP; -} - static inline struct opp_table *dev_pm_opp_register_set_opp_helper(struct = device *dev, int (*set_opp)(struct dev_pm_set_opp_data *data)) { --=20 2.31.1.272.g89b43f80a514 From nobody Wed Apr 29 00:43:01 2026 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 CAB6EC433FE for ; Thu, 26 May 2022 11:46:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346440AbiEZLqx (ORCPT ); Thu, 26 May 2022 07:46:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238032AbiEZLo6 (ORCPT ); Thu, 26 May 2022 07:44:58 -0400 Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 41461D8090 for ; Thu, 26 May 2022 04:44:52 -0700 (PDT) Received: by mail-pg1-x52c.google.com with SMTP id e66so1122949pgc.8 for ; Thu, 26 May 2022 04:44:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gAxtECM05PzG/Tji4CAVaBCkNnxvwBxiF1rKgSbAS7k=; b=IjQikfoaO7L/MsZ9JQx/BST3wDHalycaIFjh7JZMnim1nvhyRMqMCOKENl+sdy0fo8 BRDbsF6yLDdx7IZid3mbTMxB8kRqmFW+vKiwa3Wm3uFWjiy3QURC7rfiP8+mhijN/gq0 iuDDSX544E5hxNx7Q6Pv3NVMWYX3IUExUwxmt9fd6fE9GmcZgIPZ9jV6dJzWcNir2ikH aut7Dgsm/FL3RPvEkZAY1GfJeT0Ury7eGcIGjh5zM345Zmzv0AwLL2FhWCHqobE3IBVj 8qcEtqVxELs0mm0xvc+rb6NvXy70Ox+4wZ1OJCG+a8Pp7otfDtjdyBi0Hs0TrDT7dBEV zYJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gAxtECM05PzG/Tji4CAVaBCkNnxvwBxiF1rKgSbAS7k=; b=Ti4JfKBoR3PdjO9x4TKOMKv2stEmAWBn3VpttWZOvRhm6w6ORwy8/u1NU0nGfErV6y QnTh0HxI3vx5pE4R16KJ3BEjb53Ot7U2MCQ2JdQ4nT+O8WYUma3PqOJ803VpUbWCbean ni5RAnc6afHmijRqTlhLdkFhB0YdZTAFFd7Lc07m2Z5CtnSWitOpJMNer2g9LT9mq8xu /IKgQou8BiyesWmempNjC4x8XnQLC1CXUoRl7RpWmAEK9Fo/gTzU4mpMDLC3XN5HZ//s HM7i9kOffi1bhihYSZa2a4HRSLEe3aI5abmZZvpnQTpe55VM8zi29NYKzMFE7Vc8nWxJ qTPw== X-Gm-Message-State: AOAM5303uu4yePmk2dkS3+VR9unD5rj8jdm0NrtxhpAq01kqEGtQ5phv F54FnlIqJ+ftqsp7J8mZ9Dcc+Q== X-Google-Smtp-Source: ABdhPJzWLutPUzX6PUXXIQ+ONdk7t8pldnwM+fEQ3bXC4gZ/bxFrAIy/sLqyWwcbQFrAIIOKbkgMeQ== X-Received: by 2002:a65:63c4:0:b0:3f6:3a63:3148 with SMTP id n4-20020a6563c4000000b003f63a633148mr30750750pgv.33.1653565491496; Thu, 26 May 2022 04:44:51 -0700 (PDT) Received: from localhost ([122.162.234.2]) by smtp.gmail.com with ESMTPSA id mm12-20020a17090b358c00b001cd4989ff62sm1270324pjb.41.2022.05.26.04.44.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 May 2022 04:44:51 -0700 (PDT) From: Viresh Kumar To: Viresh Kumar , Nishanth Menon , Stephen Boyd , "Rafael J. Wysocki" Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , Rafael Wysocki , Krzysztof Kozlowski , linux-kernel@vger.kernel.org Subject: [PATCH 27/31] OPP: Remove dev_pm_opp_set_clkname() and friends Date: Thu, 26 May 2022 17:12:26 +0530 Message-Id: <8b51e3f21c469472f2dbe43fef8963b911fde135.1653564321.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Now that everyone has migrated to dev_pm_opp_set_config(), remove the public interface for dev_pm_opp_set_clkname() and friends. Signed-off-by: Viresh Kumar --- drivers/opp/core.c | 93 ++++++++++-------------------------------- include/linux/pm_opp.h | 15 ------- 2 files changed, 21 insertions(+), 87 deletions(-) diff --git a/drivers/opp/core.c b/drivers/opp/core.c index 07cb8ff33a6d..c2590c0c05a0 100644 --- a/drivers/opp/core.c +++ b/drivers/opp/core.c @@ -2152,7 +2152,7 @@ static void _opp_put_regulators(struct opp_table *opp= _table) } =20 /** - * dev_pm_opp_set_clkname() - Set clk name for the device + * _opp_set_clkname() - Set clk name for the device * @dev: Device for which clk name is being set. * @name: Clk name. * @@ -2163,93 +2163,41 @@ static void _opp_put_regulators(struct opp_table *o= pp_table) * * This must be called before any OPPs are initialized for the device. */ -struct opp_table *dev_pm_opp_set_clkname(struct device *dev, const char *n= ame) +static int _opp_set_clkname(struct opp_table *opp_table, struct device *de= v, + const char *name) { - struct opp_table *opp_table; - int ret; - - opp_table =3D _add_opp_table(dev, false); - if (IS_ERR(opp_table)) - return opp_table; - - /* This should be called before OPPs are initialized */ - if (WARN_ON(!list_empty(&opp_table->opp_list))) { - ret =3D -EBUSY; - goto err; - } - /* Another CPU that shares the OPP table has set the clkname ? */ if (opp_table->clk_configured) - return opp_table; + return 0; =20 /* clk shouldn't be initialized at this point */ - if (WARN_ON(opp_table->clk)) { - ret =3D -EBUSY; - goto err; - } + if (WARN_ON(opp_table->clk)) + return -EBUSY; =20 /* Find clk for the device */ opp_table->clk =3D clk_get(dev, name); if (IS_ERR(opp_table->clk)) { - ret =3D dev_err_probe(dev, PTR_ERR(opp_table->clk), + return dev_err_probe(dev, PTR_ERR(opp_table->clk), "%s: Couldn't find clock\n", __func__); - goto err; } =20 opp_table->clk_configured =3D true; =20 - return opp_table; - -err: - dev_pm_opp_put_opp_table(opp_table); - - return ERR_PTR(ret); -} -EXPORT_SYMBOL_GPL(dev_pm_opp_set_clkname); - -/** - * dev_pm_opp_put_clkname() - Releases resources blocked for clk. - * @opp_table: OPP table returned from dev_pm_opp_set_clkname(). - */ -void dev_pm_opp_put_clkname(struct opp_table *opp_table) -{ - if (unlikely(!opp_table)) - return; - - clk_put(opp_table->clk); - opp_table->clk =3D ERR_PTR(-EINVAL); - opp_table->clk_configured =3D false; - - dev_pm_opp_put_opp_table(opp_table); -} -EXPORT_SYMBOL_GPL(dev_pm_opp_put_clkname); - -static void devm_pm_opp_clkname_release(void *data) -{ - dev_pm_opp_put_clkname(data); + return 0; } =20 /** - * devm_pm_opp_set_clkname() - Set clk name for the device - * @dev: Device for which clk name is being set. - * @name: Clk name. - * - * This is a resource-managed variant of dev_pm_opp_set_clkname(). - * - * Return: 0 on success and errorno otherwise. + * _opp_put_clkname() - Releases resources blocked for clk. + * @opp_table: OPP table returned from _opp_set_clkname(). */ -int devm_pm_opp_set_clkname(struct device *dev, const char *name) +static void _opp_put_clkname(struct opp_table *opp_table) { - struct opp_table *opp_table; - - opp_table =3D dev_pm_opp_set_clkname(dev, name); - if (IS_ERR(opp_table)) - return PTR_ERR(opp_table); - - return devm_add_action_or_reset(dev, devm_pm_opp_clkname_release, - opp_table); + if (opp_table->clk_configured) { + clk_put(opp_table->clk); + opp_table->clk =3D ERR_PTR(-EINVAL); + opp_table->clk_configured =3D false; + } } -EXPORT_SYMBOL_GPL(devm_pm_opp_set_clkname); =20 /** * dev_pm_opp_register_set_opp_helper() - Register custom set OPP helper @@ -2549,9 +2497,11 @@ struct opp_table *dev_pm_opp_set_config(struct devic= e *dev, =20 // Configure clock if (config->clk_name) { - ret =3D dev_pm_opp_set_clkname(dev, config->clk_name); - if (IS_ERR(ret)) + err =3D _opp_set_clkname(opp_table, dev, config->clk_name); + if (err) { + ret =3D ERR_PTR(err); goto err; + } } =20 // Configure property names @@ -2633,8 +2583,7 @@ void dev_pm_opp_clear_config(struct opp_table *opp_ta= ble) if (opp_table->prop_name) dev_pm_opp_put_prop_name(opp_table); =20 - if (opp_table->clk_configured) - dev_pm_opp_put_clkname(opp_table); + _opp_put_clkname(opp_table); =20 dev_pm_opp_put_opp_table(opp_table); } diff --git a/include/linux/pm_opp.h b/include/linux/pm_opp.h index b80982e5a067..7afa8160590d 100644 --- a/include/linux/pm_opp.h +++ b/include/linux/pm_opp.h @@ -186,9 +186,6 @@ void dev_pm_opp_clear_config(struct opp_table *opp_tabl= e); =20 struct opp_table *dev_pm_opp_set_prop_name(struct device *dev, const char = *name); void dev_pm_opp_put_prop_name(struct opp_table *opp_table); -struct opp_table *dev_pm_opp_set_clkname(struct device *dev, const char *n= ame); -void dev_pm_opp_put_clkname(struct opp_table *opp_table); -int devm_pm_opp_set_clkname(struct device *dev, const char *name); struct opp_table *dev_pm_opp_register_set_opp_helper(struct device *dev, i= nt (*set_opp)(struct dev_pm_set_opp_data *data)); void dev_pm_opp_unregister_set_opp_helper(struct opp_table *opp_table); int devm_pm_opp_register_set_opp_helper(struct device *dev, int (*set_opp)= (struct dev_pm_set_opp_data *data)); @@ -387,18 +384,6 @@ static inline struct opp_table *dev_pm_opp_set_prop_na= me(struct device *dev, con =20 static inline void dev_pm_opp_put_prop_name(struct opp_table *opp_table) {} =20 -static inline struct opp_table *dev_pm_opp_set_clkname(struct device *dev,= const char *name) -{ - return ERR_PTR(-EOPNOTSUPP); -} - -static inline void dev_pm_opp_put_clkname(struct opp_table *opp_table) {} - -static inline int devm_pm_opp_set_clkname(struct device *dev, const char *= name) -{ - return -EOPNOTSUPP; -} - static inline struct opp_table *dev_pm_opp_attach_genpd(struct device *dev= , const char * const *names, struct device ***virt_devs) { return ERR_PTR(-EOPNOTSUPP); --=20 2.31.1.272.g89b43f80a514 From nobody Wed Apr 29 00:43:01 2026 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 8E7CCC433F5 for ; Thu, 26 May 2022 11:47:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236240AbiEZLrC (ORCPT ); Thu, 26 May 2022 07:47:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347229AbiEZLpL (ORCPT ); Thu, 26 May 2022 07:45:11 -0400 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 381B449CA8 for ; Thu, 26 May 2022 04:44:55 -0700 (PDT) Received: by mail-pj1-x102a.google.com with SMTP id pq9-20020a17090b3d8900b001df622bf81dso1498543pjb.3 for ; Thu, 26 May 2022 04:44:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Zj/X9v0Ajk3j0h5jIjtZCy0tKeDQQruHCgdom/4N+fE=; b=U/V4UcPcLkWJkdGIRwJy0tswczFFYYaIGT2CDAXbuN0JoVSeAZUKZXu4Ka2obvSiai L2KHfqeSxBTNCvLL1IK08FgZuPZve4kjb3KOilm1deUNTzZDqjfcEyRZDURlPXioAXek eFXFPvyrw46QHBTLtq3ZhkdaK6LbuneA18MG37t9UlAekE79jRB3cBsCmjzGK4GAgQ/Y eWXv/56iFVf7mc4kHG/UKLVAz51BYJi+Mwijkn42xXEGPsQ2nDjymSGZGvB3ZRPIcTzQ 7kB3eig6NDeuU7IeIHVazkPuQ+0zEx7SYFoUQjcgRrfoTf/h0S6SdVf/BSXC3shdU5qr dZjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Zj/X9v0Ajk3j0h5jIjtZCy0tKeDQQruHCgdom/4N+fE=; b=X58G+/KzaZxSm4p3mxb7N4M1DeAA8uFiCK7Ejv6b9B5QZbMEDhe4IdzHboDIy8wBSf FksbtUuQNwxJRXcT02/kjp11cT8lIspWRRPmbZePkX0Chk8a2JXVizXRQe75XVGFH/N2 LPzwZBh7JCrJCq240J3lp6pS5eev7dxup75YxBxvkf7sVoDJGvnTm0p1pGmv0lKpgYMW PSB34xRWO/ms6MxYy7Qu1fZQJi9LKERR+iNoxhyjasxtIEL32CkVrRaAev6/Ai+IaHgb p7G5LwTlJLFei5F2+QBKVV8/Z75xP9Y/mMG6S8N5ruI2cKS/O3XzloCZtGXAdlfqi7JT OUPA== X-Gm-Message-State: AOAM532py5j4VDO/eb6ZHVHaX3t2ftLKnILMvcZFHzD6f/+rAzT484es +4JctPxGdJ2JM+HCYq6MdsM4MA== X-Google-Smtp-Source: ABdhPJx3oV20cSATo8EtQIznnkfiy5wuf99iIOs0u2A3+24tbOHrxkqOWihSZ2kKVl34dIQ6MIAsmg== X-Received: by 2002:a17:902:c2c7:b0:159:9f9:85f3 with SMTP id c7-20020a170902c2c700b0015909f985f3mr37050021pla.18.1653565494869; Thu, 26 May 2022 04:44:54 -0700 (PDT) Received: from localhost ([122.162.234.2]) by smtp.gmail.com with ESMTPSA id x1-20020a1709027c0100b0016194c1df58sm1315235pll.105.2022.05.26.04.44.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 May 2022 04:44:54 -0700 (PDT) From: Viresh Kumar To: Viresh Kumar , Nishanth Menon , Stephen Boyd , "Rafael J. Wysocki" Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , Rafael Wysocki , Krzysztof Kozlowski , linux-kernel@vger.kernel.org Subject: [PATCH 28/31] OPP: Remove dev_pm_opp_register_set_opp_helper() and friends Date: Thu, 26 May 2022 17:12:27 +0530 Message-Id: X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Now that everyone has migrated to dev_pm_opp_set_config(), remove the public interface for dev_pm_opp_register_set_opp_helper() and friends. Signed-off-by: Viresh Kumar --- drivers/opp/core.c | 89 ++++++++++-------------------------------- include/linux/pm_opp.h | 17 -------- 2 files changed, 21 insertions(+), 85 deletions(-) diff --git a/drivers/opp/core.c b/drivers/opp/core.c index c2590c0c05a0..412af91d2039 100644 --- a/drivers/opp/core.c +++ b/drivers/opp/core.c @@ -2200,7 +2200,7 @@ static void _opp_put_clkname(struct opp_table *opp_ta= ble) } =20 /** - * dev_pm_opp_register_set_opp_helper() - Register custom set OPP helper + * _opp_register_set_opp_helper() - Register custom set OPP helper * @dev: Device for which the helper is getting registered. * @set_opp: Custom set OPP helper. * @@ -2209,32 +2209,18 @@ static void _opp_put_clkname(struct opp_table *opp_= table) * * This must be called before any OPPs are initialized for the device. */ -struct opp_table *dev_pm_opp_register_set_opp_helper(struct device *dev, - int (*set_opp)(struct dev_pm_set_opp_data *data)) +static int _opp_register_set_opp_helper(struct opp_table *opp_table, + struct device *dev, int (*set_opp)(struct dev_pm_set_opp_data *data)) { struct dev_pm_set_opp_data *data; - struct opp_table *opp_table; - - if (!set_opp) - return ERR_PTR(-EINVAL); - - opp_table =3D _add_opp_table(dev, false); - if (IS_ERR(opp_table)) - return opp_table; - - /* This should be called before OPPs are initialized */ - if (WARN_ON(!list_empty(&opp_table->opp_list))) { - dev_pm_opp_put_opp_table(opp_table); - return ERR_PTR(-EBUSY); - } =20 /* Another CPU that shares the OPP table has set the helper ? */ if (opp_table->set_opp) - return opp_table; + return 0; =20 data =3D kzalloc(sizeof(*data), GFP_KERNEL); if (!data) - return ERR_PTR(-ENOMEM); + return -ENOMEM; =20 mutex_lock(&opp_table->lock); opp_table->set_opp_data =3D data; @@ -2247,60 +2233,26 @@ struct opp_table *dev_pm_opp_register_set_opp_helpe= r(struct device *dev, =20 opp_table->set_opp =3D set_opp; =20 - return opp_table; + return 0; } -EXPORT_SYMBOL_GPL(dev_pm_opp_register_set_opp_helper); =20 /** - * dev_pm_opp_unregister_set_opp_helper() - Releases resources blocked for - * set_opp helper - * @opp_table: OPP table returned from dev_pm_opp_register_set_opp_helper(= ). + * _opp_unregister_set_opp_helper() - Releases resources blocked for set_o= pp helper + * @opp_table: OPP table returned from _opp_register_set_opp_helper(). * * Release resources blocked for platform specific set_opp helper. */ -void dev_pm_opp_unregister_set_opp_helper(struct opp_table *opp_table) -{ - if (unlikely(!opp_table)) - return; - - opp_table->set_opp =3D NULL; - - mutex_lock(&opp_table->lock); - kfree(opp_table->set_opp_data); - opp_table->set_opp_data =3D NULL; - mutex_unlock(&opp_table->lock); - - dev_pm_opp_put_opp_table(opp_table); -} -EXPORT_SYMBOL_GPL(dev_pm_opp_unregister_set_opp_helper); - -static void devm_pm_opp_unregister_set_opp_helper(void *data) -{ - dev_pm_opp_unregister_set_opp_helper(data); -} - -/** - * devm_pm_opp_register_set_opp_helper() - Register custom set OPP helper - * @dev: Device for which the helper is getting registered. - * @set_opp: Custom set OPP helper. - * - * This is a resource-managed version of dev_pm_opp_register_set_opp_helpe= r(). - * - * Return: 0 on success and errorno otherwise. - */ -int devm_pm_opp_register_set_opp_helper(struct device *dev, - int (*set_opp)(struct dev_pm_set_opp_data *data)) +static void _opp_unregister_set_opp_helper(struct opp_table *opp_table) { - struct opp_table *opp_table; - - opp_table =3D dev_pm_opp_register_set_opp_helper(dev, set_opp); - if (IS_ERR(opp_table)) - return PTR_ERR(opp_table); + if (opp_table->set_opp) { + opp_table->set_opp =3D NULL; =20 - return devm_add_action_or_reset(dev, devm_pm_opp_unregister_set_opp_helpe= r, - opp_table); + mutex_lock(&opp_table->lock); + kfree(opp_table->set_opp_data); + opp_table->set_opp_data =3D NULL; + mutex_unlock(&opp_table->lock); + } } -EXPORT_SYMBOL_GPL(devm_pm_opp_register_set_opp_helper); =20 static void _opp_detach_genpd(struct opp_table *opp_table) { @@ -2513,9 +2465,11 @@ struct opp_table *dev_pm_opp_set_config(struct devic= e *dev, =20 // Configure opp helper if (config->set_opp) { - ret =3D dev_pm_opp_register_set_opp_helper(dev, config->set_opp); - if (IS_ERR(ret)) + err =3D _opp_register_set_opp_helper(opp_table, dev, config->set_opp); + if (err) { + ret =3D ERR_PTR(err); goto err; + } } =20 // Configure supported hardware @@ -2577,8 +2531,7 @@ void dev_pm_opp_clear_config(struct opp_table *opp_ta= ble) =20 _opp_put_supported_hw(opp_table); =20 - if (opp_table->set_opp) - dev_pm_opp_unregister_set_opp_helper(opp_table); + _opp_unregister_set_opp_helper(opp_table); =20 if (opp_table->prop_name) dev_pm_opp_put_prop_name(opp_table); diff --git a/include/linux/pm_opp.h b/include/linux/pm_opp.h index 7afa8160590d..0ad60c7dca02 100644 --- a/include/linux/pm_opp.h +++ b/include/linux/pm_opp.h @@ -186,9 +186,6 @@ void dev_pm_opp_clear_config(struct opp_table *opp_tabl= e); =20 struct opp_table *dev_pm_opp_set_prop_name(struct device *dev, const char = *name); void dev_pm_opp_put_prop_name(struct opp_table *opp_table); -struct opp_table *dev_pm_opp_register_set_opp_helper(struct device *dev, i= nt (*set_opp)(struct dev_pm_set_opp_data *data)); -void dev_pm_opp_unregister_set_opp_helper(struct opp_table *opp_table); -int devm_pm_opp_register_set_opp_helper(struct device *dev, int (*set_opp)= (struct dev_pm_set_opp_data *data)); struct opp_table *dev_pm_opp_attach_genpd(struct device *dev, const char *= const *names, struct device ***virt_devs); void dev_pm_opp_detach_genpd(struct opp_table *opp_table); int devm_pm_opp_attach_genpd(struct device *dev, const char * const *names= , struct device ***virt_devs); @@ -363,20 +360,6 @@ static inline int dev_pm_opp_unregister_notifier(struc= t device *dev, struct noti return -EOPNOTSUPP; } =20 -static inline struct opp_table *dev_pm_opp_register_set_opp_helper(struct = device *dev, - int (*set_opp)(struct dev_pm_set_opp_data *data)) -{ - return ERR_PTR(-EOPNOTSUPP); -} - -static inline void dev_pm_opp_unregister_set_opp_helper(struct opp_table *= opp_table) {} - -static inline int devm_pm_opp_register_set_opp_helper(struct device *dev, - int (*set_opp)(struct dev_pm_set_opp_data *data)) -{ - return -EOPNOTSUPP; -} - static inline struct opp_table *dev_pm_opp_set_prop_name(struct device *de= v, const char *name) { return ERR_PTR(-EOPNOTSUPP); --=20 2.31.1.272.g89b43f80a514 From nobody Wed Apr 29 00:43:01 2026 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 37C5EC433F5 for ; Thu, 26 May 2022 11:47:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347201AbiEZLq5 (ORCPT ); Thu, 26 May 2022 07:46:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347247AbiEZLpM (ORCPT ); Thu, 26 May 2022 07:45:12 -0400 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4AD3C49902 for ; Thu, 26 May 2022 04:44:58 -0700 (PDT) Received: by mail-pj1-x102e.google.com with SMTP id o9-20020a17090a0a0900b001df3fc52ea7so4201305pjo.3 for ; Thu, 26 May 2022 04:44:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Dbbt9rtTwG4gE+OVtAcGxXUAaT1xVEW1UYgDSsh/rzE=; b=RMJaCg2x3lZF/5iUJrvARxD8NpTd27etPnDG2pI//KDguG2KVnVYA1Vid3+zb9nxDE MOvOtQBNMsI63JABXt/RV3B4/GopT0foiw+o+MN4QCxlG5PMCrGYSrGRhxLVGI6r+qqV 9ezfS0eKACWvFuf0W4F/eN7Bh8E/AwrcvV06Fh5hF1CHAe+57zvywS+cp+lXniH3Q9gC qiL5hu/OiqLhL3uxF3zrekpxdOi92f8hKjGLxCZO3pZpc/KFOoofSRtSg9aJUT//1iVt IoRWc0bRVFsPHfth/4Yq3sJn4AqaeO719xDxIKkex+yMII8GrG0i5+wPs0YQSVWNuYW9 YuVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Dbbt9rtTwG4gE+OVtAcGxXUAaT1xVEW1UYgDSsh/rzE=; b=gJ5eIadcekc4flae3SS9TfVbhU4bkD7cOGTlxQbb4/FbuLP9w6TW353ZU7x7s/FahS xfod/1W2K9rKpTTuIzyuQrZ9vSAGXoIM1upW3KXX3vmudRusDGokcsdfn7MalDKCn1Pq LQ5PU1pOC1gCNjkGoG9IhkvFWkOjsSW3jmI0BTLiILdfdG+QanTfScLAjaJ59wN3/Vqw MXZbFicDd/4OvWS6+AhGt8yB1cuvpnqoaHMXaw0OI6GFfY7QZYIuEoJpNvouddw2L4Ht DHBff4/kUuH/gVu8GG7NLrvQRe5x+DuRWTlN8DlfmEpi532m6YDDrqy1eaPGHlCa8Zll jxrw== X-Gm-Message-State: AOAM5307abIAuWoki361+H2ErVQCP45fF8wtFCc8si0HREtLZSTpguyb 28drqNqoIeXoZzDtsvOtdXkZQw== X-Google-Smtp-Source: ABdhPJwBKKcXOxuOxaT5d0+aqOVq9sUzLdc5/qKsmCx09mE4+x79vnxjnvxlpxxSEytNTlDzdzl3lA== X-Received: by 2002:a17:90a:8d08:b0:1e0:a2dc:c71b with SMTP id c8-20020a17090a8d0800b001e0a2dcc71bmr2227511pjo.72.1653565498266; Thu, 26 May 2022 04:44:58 -0700 (PDT) Received: from localhost ([122.162.234.2]) by smtp.gmail.com with ESMTPSA id m23-20020a17090ade1700b001cd4989fee4sm3460273pjv.48.2022.05.26.04.44.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 May 2022 04:44:57 -0700 (PDT) From: Viresh Kumar To: Viresh Kumar , Nishanth Menon , Stephen Boyd , "Rafael J. Wysocki" Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , Rafael Wysocki , Krzysztof Kozlowski , linux-kernel@vger.kernel.org Subject: [PATCH 29/31] OPP: Remove dev_pm_opp_attach_genpd() and friends Date: Thu, 26 May 2022 17:12:28 +0530 Message-Id: <4315c9a6a29631e1671c9822efddfa6e95ae4d2d.1653564321.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Now that everyone has migrated to dev_pm_opp_set_config(), remove the public interface for dev_pm_opp_attach_genpd() and friends. Signed-off-by: Viresh Kumar --- drivers/opp/core.c | 86 ++++++++++-------------------------------- include/linux/pm_opp.h | 17 --------- 2 files changed, 20 insertions(+), 83 deletions(-) diff --git a/drivers/opp/core.c b/drivers/opp/core.c index 412af91d2039..69c6cf6a0bcc 100644 --- a/drivers/opp/core.c +++ b/drivers/opp/core.c @@ -2254,7 +2254,7 @@ static void _opp_unregister_set_opp_helper(struct opp= _table *opp_table) } } =20 -static void _opp_detach_genpd(struct opp_table *opp_table) +static void _detach_genpd(struct opp_table *opp_table) { int index; =20 @@ -2274,7 +2274,7 @@ static void _opp_detach_genpd(struct opp_table *opp_t= able) } =20 /** - * dev_pm_opp_attach_genpd - Attach genpd(s) for the device and save virtu= al device pointer + * _opp_attach_genpd - Attach genpd(s) for the device and save virtual dev= ice pointer * @dev: Consumer device for which the genpd is getting attached. * @names: Null terminated array of pointers containing names of genpd to = attach. * @virt_devs: Pointer to return the array of virtual devices. @@ -2295,30 +2295,23 @@ static void _opp_detach_genpd(struct opp_table *opp= _table) * The order of entries in the names array must match the order in which * "required-opps" are added in DT. */ -struct opp_table *dev_pm_opp_attach_genpd(struct device *dev, - const char * const *names, struct device ***virt_devs) +static int _opp_attach_genpd(struct opp_table *opp_table, struct device *d= ev, + const char * const *names, struct device ***virt_devs) { - struct opp_table *opp_table; struct device *virt_dev; int index =3D 0, ret =3D -EINVAL; const char * const *name =3D names; =20 - opp_table =3D _add_opp_table(dev, false); - if (IS_ERR(opp_table)) - return opp_table; - if (opp_table->genpd_virt_devs) - return opp_table; + return 0; =20 /* * If the genpd's OPP table isn't already initialized, parsing of the * required-opps fail for dev. We should retry this after genpd's OPP * table is added. */ - if (!opp_table->required_opp_count) { - ret =3D -EPROBE_DEFER; - goto put_table; - } + if (!opp_table->required_opp_count) + return -EPROBE_DEFER; =20 mutex_lock(&opp_table->genpd_virt_dev_lock); =20 @@ -2351,74 +2344,34 @@ struct opp_table *dev_pm_opp_attach_genpd(struct de= vice *dev, *virt_devs =3D opp_table->genpd_virt_devs; mutex_unlock(&opp_table->genpd_virt_dev_lock); =20 - return opp_table; + return 0; =20 err: - _opp_detach_genpd(opp_table); + _detach_genpd(opp_table); unlock: mutex_unlock(&opp_table->genpd_virt_dev_lock); + return ret; =20 -put_table: - dev_pm_opp_put_opp_table(opp_table); - - return ERR_PTR(ret); } -EXPORT_SYMBOL_GPL(dev_pm_opp_attach_genpd); =20 /** - * dev_pm_opp_detach_genpd() - Detach genpd(s) from the device. - * @opp_table: OPP table returned by dev_pm_opp_attach_genpd(). + * _opp_detach_genpd() - Detach genpd(s) from the device. + * @opp_table: OPP table returned by _opp_attach_genpd(). * * This detaches the genpd(s), resets the virtual device pointers, and put= s the * OPP table. */ -void dev_pm_opp_detach_genpd(struct opp_table *opp_table) +static void _opp_detach_genpd(struct opp_table *opp_table) { - if (unlikely(!opp_table)) - return; - /* * Acquire genpd_virt_dev_lock to make sure virt_dev isn't getting * used in parallel. */ mutex_lock(&opp_table->genpd_virt_dev_lock); - _opp_detach_genpd(opp_table); + _detach_genpd(opp_table); mutex_unlock(&opp_table->genpd_virt_dev_lock); - - dev_pm_opp_put_opp_table(opp_table); -} -EXPORT_SYMBOL_GPL(dev_pm_opp_detach_genpd); - -static void devm_pm_opp_detach_genpd(void *data) -{ - dev_pm_opp_detach_genpd(data); } =20 -/** - * devm_pm_opp_attach_genpd - Attach genpd(s) for the device and save virt= ual - * device pointer - * @dev: Consumer device for which the genpd is getting attached. - * @names: Null terminated array of pointers containing names of genpd to = attach. - * @virt_devs: Pointer to return the array of virtual devices. - * - * This is a resource-managed version of dev_pm_opp_attach_genpd(). - * - * Return: 0 on success and errorno otherwise. - */ -int devm_pm_opp_attach_genpd(struct device *dev, const char * const *names, - struct device ***virt_devs) -{ - struct opp_table *opp_table; - - opp_table =3D dev_pm_opp_attach_genpd(dev, names, virt_devs); - if (IS_ERR(opp_table)) - return PTR_ERR(opp_table); - - return devm_add_action_or_reset(dev, devm_pm_opp_detach_genpd, - opp_table); -} -EXPORT_SYMBOL_GPL(devm_pm_opp_attach_genpd); - /** * dev_pm_opp_set_config() - Set OPP configuration for the device. * @dev: Device for which configuration is being set. @@ -2495,10 +2448,12 @@ struct opp_table *dev_pm_opp_set_config(struct devi= ce *dev, =20 // Attach genpds if (config->genpd_names) { - ret =3D dev_pm_opp_attach_genpd(dev, config->genpd_names, - config->virt_devs); - if (IS_ERR(ret)) + err =3D _opp_attach_genpd(opp_table, dev, config->genpd_names, + config->virt_devs); + if (err) { + ret =3D ERR_PTR(err); goto err; + } } =20 return opp_table; @@ -2524,8 +2479,7 @@ EXPORT_SYMBOL_GPL(dev_pm_opp_set_config); */ void dev_pm_opp_clear_config(struct opp_table *opp_table) { - if (opp_table->genpd_virt_devs) - dev_pm_opp_detach_genpd(opp_table); + _opp_detach_genpd(opp_table); =20 _opp_put_regulators(opp_table); =20 diff --git a/include/linux/pm_opp.h b/include/linux/pm_opp.h index 0ad60c7dca02..a310564ab698 100644 --- a/include/linux/pm_opp.h +++ b/include/linux/pm_opp.h @@ -186,9 +186,6 @@ void dev_pm_opp_clear_config(struct opp_table *opp_tabl= e); =20 struct opp_table *dev_pm_opp_set_prop_name(struct device *dev, const char = *name); void dev_pm_opp_put_prop_name(struct opp_table *opp_table); -struct opp_table *dev_pm_opp_attach_genpd(struct device *dev, const char *= const *names, struct device ***virt_devs); -void dev_pm_opp_detach_genpd(struct opp_table *opp_table); -int devm_pm_opp_attach_genpd(struct device *dev, const char * const *names= , struct device ***virt_devs); struct dev_pm_opp *dev_pm_opp_xlate_required_opp(struct opp_table *src_tab= le, struct opp_table *dst_table, struct dev_pm_opp *src_opp); int dev_pm_opp_xlate_performance_state(struct opp_table *src_table, struct= opp_table *dst_table, unsigned int pstate); int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq); @@ -367,20 +364,6 @@ static inline struct opp_table *dev_pm_opp_set_prop_na= me(struct device *dev, con =20 static inline void dev_pm_opp_put_prop_name(struct opp_table *opp_table) {} =20 -static inline struct opp_table *dev_pm_opp_attach_genpd(struct device *dev= , const char * const *names, struct device ***virt_devs) -{ - return ERR_PTR(-EOPNOTSUPP); -} - -static inline void dev_pm_opp_detach_genpd(struct opp_table *opp_table) {} - -static inline int devm_pm_opp_attach_genpd(struct device *dev, - const char * const *names, - struct device ***virt_devs) -{ - return -EOPNOTSUPP; -} - static inline struct opp_table *dev_pm_opp_set_config(struct device *dev, = struct dev_pm_opp_config *config) { return ERR_PTR(-EOPNOTSUPP); --=20 2.31.1.272.g89b43f80a514 From nobody Wed Apr 29 00:43:01 2026 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 EB552C433EF for ; Thu, 26 May 2022 11:47:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346647AbiEZLrN (ORCPT ); Thu, 26 May 2022 07:47:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347319AbiEZLp3 (ORCPT ); Thu, 26 May 2022 07:45:29 -0400 Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4EC2D4114 for ; Thu, 26 May 2022 04:45:03 -0700 (PDT) Received: by mail-pg1-x530.google.com with SMTP id h186so1138005pgc.3 for ; Thu, 26 May 2022 04:45:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TICE0sEo29HZevVnLs4kCPjhRnCI25SlD1yVTGEH4+k=; b=EaFzUtct3u72LMB2wcd38TcNEH3QSE41xyPZ8SYAwkvb4NBp/UO6oQ76kPQM5sVUqr OPGY1Ryvl4luE3l2Bx2HW/Ootx+8vyGDkFIR/P5fC5h0tB2U61+SQB2F3izRnOkuKxmK ma3VEKQpHfZ0ISiBK9IANhZcw80iIh9W79P/ihQEhd9u3qRvz2JCBvsNzV2VGpC21n50 Gi9iFNN4zbPk8732A3C9ymTAyQIucBwc2onCa94c2WmfiiTJdsQOppp3T25qGSgdJYqA YrNT3jqzSSsJ4Fhb7zUOAE0QvGPkE/2oXTc9QaRFZbqmgce+v/ywTrXCuH5rMMDum2UF icHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TICE0sEo29HZevVnLs4kCPjhRnCI25SlD1yVTGEH4+k=; b=q/h4K7o3N3Vi51wdObO+3RF0t1p59fWCOS2OLAZhjN7MPD9pwyb1I1MMChESRk9413 TeSGCNJ92L/0JIWRJ4n99gMdxcckQBt0rBc/35MGp3cTZE5XQgSLwH9Dccc+pBrJ6KYP V2gqKZC7O4rCVp4DtjRZeHa1mATop1gcUlyWdMxQ7X0S9lwep/EkPW7WCTmi+idXDD89 D3Qym+zkJnjzQQLkMoCQHRjR5A3tgB/PpaeNcR5+ifbZTSES746TBakRriZb/Yupi6e1 raxB7UWSDYnDremfQBDAk2YVJlvQ53C47D81HxI6/NLozmRIFYY4GOWLheEcUctxwQfm 1PuQ== X-Gm-Message-State: AOAM532/DuPrfvrVSw34vMOlCeIyejkT6rgPJHCuezBW8oQfCZ0vRv2U /EkJrTOhDrtUidn5y6n/Lf0EYA== X-Google-Smtp-Source: ABdhPJyQKuH/h9iKeWw8+X8qYznTvkFUak07qMZ+pSwWpk+l4Rye1RtzCrJ0MjlevLV8snQkO9rsCA== X-Received: by 2002:a63:6a87:0:b0:3f9:c829:796d with SMTP id f129-20020a636a87000000b003f9c829796dmr25675440pgc.232.1653565501748; Thu, 26 May 2022 04:45:01 -0700 (PDT) Received: from localhost ([122.162.234.2]) by smtp.gmail.com with ESMTPSA id m5-20020a63f605000000b003faebbb772esm1354503pgh.25.2022.05.26.04.45.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 May 2022 04:45:01 -0700 (PDT) From: Viresh Kumar To: Viresh Kumar , Nishanth Menon , Stephen Boyd , "Rafael J. Wysocki" Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , Rafael Wysocki , Krzysztof Kozlowski , linux-kernel@vger.kernel.org Subject: [PATCH 30/31] OPP: Remove dev_pm_opp_set_prop_name() and friends Date: Thu, 26 May 2022 17:12:29 +0530 Message-Id: X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Now that everyone has migrated to dev_pm_opp_set_config(), remove the public interface for dev_pm_opp_set_prop_name() and friends. Signed-off-by: Viresh Kumar --- drivers/opp/core.c | 54 +++++++++++++++--------------------------- include/linux/pm_opp.h | 9 ------- 2 files changed, 19 insertions(+), 44 deletions(-) diff --git a/drivers/opp/core.c b/drivers/opp/core.c index 69c6cf6a0bcc..e6c76b90dbf7 100644 --- a/drivers/opp/core.c +++ b/drivers/opp/core.c @@ -1993,7 +1993,7 @@ static void _opp_put_supported_hw(struct opp_table *o= pp_table) } =20 /** - * dev_pm_opp_set_prop_name() - Set prop-extn name + * _opp_set_prop_name() - Set prop-extn name * @dev: Device for which the prop-name has to be set. * @name: name to postfix to properties. * @@ -2002,50 +2002,33 @@ static void _opp_put_supported_hw(struct opp_table = *opp_table) * which the extension will apply are opp-microvolt and opp-microamp. OPP = core * should postfix the property name with - while looking for them. */ -struct opp_table *dev_pm_opp_set_prop_name(struct device *dev, const char = *name) +static int _opp_set_prop_name(struct opp_table *opp_table, const char *nam= e) { - struct opp_table *opp_table; - - opp_table =3D _add_opp_table(dev, false); - if (IS_ERR(opp_table)) - return opp_table; - - /* Make sure there are no concurrent readers while updating opp_table */ - WARN_ON(!list_empty(&opp_table->opp_list)); - /* Another CPU that shares the OPP table has set the property ? */ - if (opp_table->prop_name) - return opp_table; - - opp_table->prop_name =3D kstrdup(name, GFP_KERNEL); if (!opp_table->prop_name) { - dev_pm_opp_put_opp_table(opp_table); - return ERR_PTR(-ENOMEM); + opp_table->prop_name =3D kstrdup(name, GFP_KERNEL); + if (!opp_table->prop_name) + return -ENOMEM; } =20 - return opp_table; + return 0; } -EXPORT_SYMBOL_GPL(dev_pm_opp_set_prop_name); =20 /** - * dev_pm_opp_put_prop_name() - Releases resources blocked for prop-name - * @opp_table: OPP table returned by dev_pm_opp_set_prop_name(). + * _opp_put_prop_name() - Releases resources blocked for prop-name + * @opp_table: OPP table returned by _opp_set_prop_name(). * * This is required only for the V2 bindings, and is called for a matching - * dev_pm_opp_set_prop_name(). Until this is called, the opp_table structu= re + * _opp_set_prop_name(). Until this is called, the opp_table structure * will not be freed. */ -void dev_pm_opp_put_prop_name(struct opp_table *opp_table) +static void _opp_put_prop_name(struct opp_table *opp_table) { - if (unlikely(!opp_table)) - return; - - kfree(opp_table->prop_name); - opp_table->prop_name =3D NULL; - - dev_pm_opp_put_opp_table(opp_table); + if (opp_table->prop_name) { + kfree(opp_table->prop_name); + opp_table->prop_name =3D NULL; + } } -EXPORT_SYMBOL_GPL(dev_pm_opp_put_prop_name); =20 /** * _opp_set_regulators() - Set regulator names for the device @@ -2411,9 +2394,11 @@ struct opp_table *dev_pm_opp_set_config(struct devic= e *dev, =20 // Configure property names if (config->prop_name) { - ret =3D dev_pm_opp_set_prop_name(dev, config->prop_name); - if (IS_ERR(ret)) + err =3D _opp_set_prop_name(opp_table, config->prop_name); + if (err) { + ret =3D ERR_PTR(err); goto err; + } } =20 // Configure opp helper @@ -2487,8 +2472,7 @@ void dev_pm_opp_clear_config(struct opp_table *opp_ta= ble) =20 _opp_unregister_set_opp_helper(opp_table); =20 - if (opp_table->prop_name) - dev_pm_opp_put_prop_name(opp_table); + _opp_put_prop_name(opp_table); =20 _opp_put_clkname(opp_table); =20 diff --git a/include/linux/pm_opp.h b/include/linux/pm_opp.h index a310564ab698..6cf1bbc71ed2 100644 --- a/include/linux/pm_opp.h +++ b/include/linux/pm_opp.h @@ -184,8 +184,6 @@ struct opp_table *dev_pm_opp_set_config(struct device *= dev, struct dev_pm_opp_co int devm_pm_opp_set_config(struct device *dev, struct dev_pm_opp_config *c= onfig); void dev_pm_opp_clear_config(struct opp_table *opp_table); =20 -struct opp_table *dev_pm_opp_set_prop_name(struct device *dev, const char = *name); -void dev_pm_opp_put_prop_name(struct opp_table *opp_table); struct dev_pm_opp *dev_pm_opp_xlate_required_opp(struct opp_table *src_tab= le, struct opp_table *dst_table, struct dev_pm_opp *src_opp); int dev_pm_opp_xlate_performance_state(struct opp_table *src_table, struct= opp_table *dst_table, unsigned int pstate); int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq); @@ -357,13 +355,6 @@ static inline int dev_pm_opp_unregister_notifier(struc= t device *dev, struct noti return -EOPNOTSUPP; } =20 -static inline struct opp_table *dev_pm_opp_set_prop_name(struct device *de= v, const char *name) -{ - return ERR_PTR(-EOPNOTSUPP); -} - -static inline void dev_pm_opp_put_prop_name(struct opp_table *opp_table) {} - static inline struct opp_table *dev_pm_opp_set_config(struct device *dev, = struct dev_pm_opp_config *config) { return ERR_PTR(-EOPNOTSUPP); --=20 2.31.1.272.g89b43f80a514 From nobody Wed Apr 29 00:43:01 2026 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 518FAC433F5 for ; Thu, 26 May 2022 11:47:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346107AbiEZLrJ (ORCPT ); Thu, 26 May 2022 07:47:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347348AbiEZLqC (ORCPT ); Thu, 26 May 2022 07:46:02 -0400 Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC7DCD413A for ; Thu, 26 May 2022 04:45:05 -0700 (PDT) Received: by mail-pj1-x1031.google.com with SMTP id l7-20020a17090aaa8700b001dd1a5b9965so1516417pjq.2 for ; Thu, 26 May 2022 04:45:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2atvtJh3H0IuR3IXR4bSCu5QJSHWZSUpX9aSXdtS/nA=; b=fHiM6OHlp2/g+Elmqko00m99XbY3C0cuhalgZK9BfZx7dSjS9LWqA1LSi8FEmSzb1W C1F++qlXb4rMzg3/A68rs58ilbq1UPjC0rsgJ/XV0EugVMwY8rN6MjXx5mz94m4UYRcz LKab44yI+jfOk3vjt5yQ3gYXEHSqNVThGUaNWLxIdkPvO4lsWpHWYUM8Ca3mqICz/xCa 1kU/sa1mzPr9wi3c+5/6kCmSvLpxw5onK0JHKyFrjES7Bj+a0XUp/bV0DKNQrKVrwJUj MeUpTxhO+VBQaExMMF2MXkF4976q7OeS95r4Zwpu3NagO8jNPnCxWg0fcPghm7mYnveG VJ0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2atvtJh3H0IuR3IXR4bSCu5QJSHWZSUpX9aSXdtS/nA=; b=G/t7E0XYoAb0gTPT3jOeC+Uc7gIyhT33zkkiYHBNqkI0+ocoCLvu8YW2SXTqVSSBvH /65TMcNBEXmURKqwpefk+qug+gMB6nPE45+hFBLy9yWLiL5PXIXTHufwBL08pIg+8ctP EwHoBbgwqKyGmJN0HafR4w8ZpQm6le+7mgPozjygynpG5tMRNtOmvt6dBFkdI8X1Bn7y KG3Xr8CkDcklZOm5AHW7KlZU2A02CHspKeWZwvzRanOz3iFvnEKxT68iB0SuARHyYLWF wmJ8oN2piXzll21rA4oxGuNS5wWP9wcAUoJIiVdHTuCwDzW3uzOyeLLDtkB57Tjk1CYC djUw== X-Gm-Message-State: AOAM531aVE3T6p063R5NU9wz7kCSkWtKOj9tN8xaA/06eKwANTae+qVA sX0T8O1KPtXjqGdOcT5R+GVG2Q== X-Google-Smtp-Source: ABdhPJz8APqn6IxBdWepFUAUEnNd2ZtU9ziIofE+rnpefgxRaH3ne7Ws/UtzHTmA495wPdlWCuNiUQ== X-Received: by 2002:a17:903:41cd:b0:163:5f72:1610 with SMTP id u13-20020a17090341cd00b001635f721610mr6982121ple.112.1653565504748; Thu, 26 May 2022 04:45:04 -0700 (PDT) Received: from localhost ([122.162.234.2]) by smtp.gmail.com with ESMTPSA id e14-20020a170903240e00b0015e8d4eb1fasm1319085plo.68.2022.05.26.04.45.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 May 2022 04:45:04 -0700 (PDT) From: Viresh Kumar To: Viresh Kumar , Nishanth Menon , Stephen Boyd Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , Rafael Wysocki , Krzysztof Kozlowski , linux-kernel@vger.kernel.org Subject: [PATCH 31/31] OPP: Rearrange dev_pm_opp_set_config() and friends Date: Thu, 26 May 2022 17:12:30 +0530 Message-Id: X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Rearrange the helpers now to make them look clean. Signed-off-by: Viresh Kumar --- drivers/opp/core.c | 49 +++++++++++++++------------------------------- 1 file changed, 16 insertions(+), 33 deletions(-) diff --git a/drivers/opp/core.c b/drivers/opp/core.c index e6c76b90dbf7..a9e39ebfe9da 100644 --- a/drivers/opp/core.c +++ b/drivers/opp/core.c @@ -2370,8 +2370,8 @@ static void _opp_detach_genpd(struct opp_table *opp_t= able) struct opp_table *dev_pm_opp_set_config(struct device *dev, struct dev_pm_opp_config *config) { - struct opp_table *opp_table, *ret; - int err; + struct opp_table *opp_table; + int ret; =20 opp_table =3D _add_opp_table(dev, false); if (IS_ERR(opp_table)) @@ -2379,73 +2379,61 @@ struct opp_table *dev_pm_opp_set_config(struct devi= ce *dev, =20 /* This should be called before OPPs are initialized */ if (WARN_ON(!list_empty(&opp_table->opp_list))) { - ret =3D ERR_PTR(-EBUSY); + ret =3D -EBUSY; goto err; } =20 // Configure clock if (config->clk_name) { - err =3D _opp_set_clkname(opp_table, dev, config->clk_name); - if (err) { - ret =3D ERR_PTR(err); + ret =3D _opp_set_clkname(opp_table, dev, config->clk_name); + if (ret) goto err; - } } =20 // Configure property names if (config->prop_name) { - err =3D _opp_set_prop_name(opp_table, config->prop_name); - if (err) { - ret =3D ERR_PTR(err); + ret =3D _opp_set_prop_name(opp_table, config->prop_name); + if (ret) goto err; - } } =20 // Configure opp helper if (config->set_opp) { - err =3D _opp_register_set_opp_helper(opp_table, dev, config->set_opp); - if (err) { - ret =3D ERR_PTR(err); + ret =3D _opp_register_set_opp_helper(opp_table, dev, config->set_opp); + if (ret) goto err; - } } =20 // Configure supported hardware if (config->supported_hw) { - err =3D _opp_set_supported_hw(opp_table, config->supported_hw, + ret =3D _opp_set_supported_hw(opp_table, config->supported_hw, config->supported_hw_count); - if (err) { - ret =3D ERR_PTR(err); + if (ret) goto err; - } } =20 // Configure supplies if (config->regulator_names) { - err =3D _opp_set_regulators(opp_table, dev, + ret =3D _opp_set_regulators(opp_table, dev, config->regulator_names, config->regulator_count); - if (err) { - ret =3D ERR_PTR(err); + if (ret) goto err; - } } =20 // Attach genpds if (config->genpd_names) { - err =3D _opp_attach_genpd(opp_table, dev, config->genpd_names, + ret =3D _opp_attach_genpd(opp_table, dev, config->genpd_names, config->virt_devs); - if (err) { - ret =3D ERR_PTR(err); + if (ret) goto err; - } } =20 return opp_table; =20 err: dev_pm_opp_clear_config(opp_table); - return ret; + return ERR_PTR(ret); } EXPORT_SYMBOL_GPL(dev_pm_opp_set_config); =20 @@ -2465,15 +2453,10 @@ EXPORT_SYMBOL_GPL(dev_pm_opp_set_config); void dev_pm_opp_clear_config(struct opp_table *opp_table) { _opp_detach_genpd(opp_table); - _opp_put_regulators(opp_table); - _opp_put_supported_hw(opp_table); - _opp_unregister_set_opp_helper(opp_table); - _opp_put_prop_name(opp_table); - _opp_put_clkname(opp_table); =20 dev_pm_opp_put_opp_table(opp_table); --=20 2.31.1.272.g89b43f80a514