From nobody Fri Dec 19 10:34:41 2025 Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B85CB187345 for ; Mon, 2 Sep 2024 22:48:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725317306; cv=none; b=Vg0+y4qjEKIIlpMKIZx5b7K10MqdqZQ9oiMdjl0Sj2opU44itwrv0OaAmb1EZC2ENsZnAtShfonifYLoImvso7rFBTrTpQfMw3aV0s06Yq0o8MuSoUcXKJbwGEmNNCdxmGOBg3ARFoqGW+BK96wWkaSZY9ZwpripQWQqNIniGAI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725317306; c=relaxed/simple; bh=KRl5gIk/xaaSVm4A8qkRf/eQuDGM9FOXcCPGTsi2ir0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=VFCxP/hEt4fC0ZJuSBDSMjNMX7c3Jy7Tw9vvtrzhI/dDq8iZYKozg1EXKzBqpvJTR2iG4B114Fwsqur/FXvS2W3J+kpZwX0vqmYHXx04HHERqOgnSCv9+y0NLa8GAIqHBNXL8NIOYDO0sK1zb56JGIAJtFke12qY6i95vB98MWk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=Ar5Qvbj0; arc=none smtp.client-ip=209.85.167.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Ar5Qvbj0" Received: by mail-lf1-f43.google.com with SMTP id 2adb3069b0e04-533461323cdso5826295e87.2 for ; Mon, 02 Sep 2024 15:48:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1725317303; x=1725922103; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=unxJ+wBaXqYULZDFmCrhH65p4MukCH6nGkbZu7WGkXY=; b=Ar5Qvbj0g0GkgxwwnpK7m3bHr40jSrocPOvqoY2bzcsCcuMYdM4CsBzgMZtc1xmtg6 ZzuWpSa07rEg/QFBXuW8/Ijadb/gXejbpLt1UhrKMjROz8lV8fRAmGAYpVkyMF8LAOPP 9dOB7vFNqNvme/7b39Sxba2Orb0nUyZhWA79wPMqxMbndDYVxaNhlH/XR5oFecg/wZMt bhuoennCGARNQjXjblsPXGdGu/4qjVVtr/1XvltP74TvD0LGmfRw0u0FXdw2eMgbUiDO 4kPIFREmvFDcJb2CMVWHgwAd2rnKUZATfkODqPCGaTRJswXxKLuqy7clljhsG3AfUmDQ 5/yQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725317303; x=1725922103; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=unxJ+wBaXqYULZDFmCrhH65p4MukCH6nGkbZu7WGkXY=; b=iIz2F0eKiOddXJijGgFk77dyFc63V0i5PEiUpIM/Cl5cILOc7I26ah0/cw1s2gZFRm lR5uTzmmdgbvR4fQgOu5NJGd1PCjtyOy5grF6QBPqz9QC+UTXGHFm0cP1bTsP7LpEefx /DYraqLqKITi17efaheQ4l8OfJ/uDoIm4eo5LdSA19qDeZNP4uHhzOPN+eYL5si6Y3js pLveigiQHfseqg4ul5e4GR2l1jAwjjsMpKG4eI5UsepPJ2TGFTIwHBXtA4G3wEGpArsO qfMymg0OI8mbrMnqOeZrG3gs97JaCn6TEfWhPW+WBn8C95gnsJy8RyWP8eYjrsroL7Bp E47g== X-Forwarded-Encrypted: i=1; AJvYcCUoRpe54nBSaUBJcbGKXnZUDPcfz/Vc2a/MsTwiVm5bHvGXjFDIjq3oxnCzj6ODsBSN1TaKTa9ngN9obvA=@vger.kernel.org X-Gm-Message-State: AOJu0YwsxXpWsv5C58w3n4VkPuKEFpD4sjoaqaD4o81bWy2/mwWk6ppI Lft+aPYYG7BCD8DpOCxe9RW34YIfhhhbHoKA4H4WT3dCwudFdmxJUe9qw5MyYTs= X-Google-Smtp-Source: AGHT+IGRv4/CgOPjLgovmViqGy6VQy2jkOlEq31xC1A2H4ZtVtkvJUMee9Gvs1n9YE+bjKaghE76Jw== X-Received: by 2002:a05:6512:2310:b0:533:448f:7632 with SMTP id 2adb3069b0e04-53546af92c5mr7263393e87.1.1725317302670; Mon, 02 Sep 2024 15:48:22 -0700 (PDT) Received: from uffe-tuxpro14.. (h-178-174-189-39.A498.priv.bahnhof.se. [178.174.189.39]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5354079bbf2sm1790646e87.20.2024.09.02.15.48.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Sep 2024 15:48:22 -0700 (PDT) From: Ulf Hansson To: Viresh Kumar , Nishanth Menon , Stephen Boyd , Dikshita Agarwal Cc: Bjorn Andersson , Konrad Dybcio , Nikunj Kela , Bryan O'Donoghue , Thierry Reding , Mikko Perttunen , Jonathan Hunter , Stephan Gerhold , Ilia Lin , Stanimir Varbanov , Vikash Garodia , Ulf Hansson , linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] OPP: Add helper to retrieve the OF node for an OPP table Date: Tue, 3 Sep 2024 00:48:14 +0200 Message-Id: <20240902224815.78220-2-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240902224815.78220-1-ulf.hansson@linaro.org> References: <20240902224815.78220-1-ulf.hansson@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" As being shown from a subsequent change it can be useful for a OPP consumer to retrieve the corresponding OF node for an OPP table. Therefore, let's add an OPP helper for it. Signed-off-by: Ulf Hansson --- drivers/opp/of.c | 12 ++++++++++++ include/linux/pm_opp.h | 6 ++++++ 2 files changed, 18 insertions(+) diff --git a/drivers/opp/of.c b/drivers/opp/of.c index fd5ed2858258..f0950339da55 100644 --- a/drivers/opp/of.c +++ b/drivers/opp/of.c @@ -1461,6 +1461,18 @@ struct device_node *dev_pm_opp_get_of_node(struct de= v_pm_opp *opp) } EXPORT_SYMBOL_GPL(dev_pm_opp_get_of_node); =20 +/** + * dev_pm_opp_table_to_of_node() - Finds the node for an OPP table + * @opp_table: The opp_table to return the node for + * + * Return: The DT node corresponding to the @opp_table. + */ +struct device_node *dev_pm_opp_table_to_of_node(struct opp_table *opp_tabl= e) +{ + return opp_table->np; +} +EXPORT_SYMBOL_GPL(dev_pm_opp_table_to_of_node); + /* * Callback function provided to the Energy Model framework upon registrat= ion. * It provides the power used by @dev at @kHz if it is the frequency of an diff --git a/include/linux/pm_opp.h b/include/linux/pm_opp.h index 451a7465a605..7894e631cded 100644 --- a/include/linux/pm_opp.h +++ b/include/linux/pm_opp.h @@ -469,6 +469,7 @@ void dev_pm_opp_of_cpumask_remove_table(const struct cp= umask *cpumask); int dev_pm_opp_of_get_sharing_cpus(struct device *cpu_dev, struct cpumask = *cpumask); struct device_node *dev_pm_opp_of_get_opp_desc_node(struct device *dev); struct device_node *dev_pm_opp_get_of_node(struct dev_pm_opp *opp); +struct device_node *dev_pm_opp_table_to_of_node(struct opp_table *table); int of_get_required_opp_performance_state(struct device_node *np, int inde= x); bool dev_pm_opp_of_has_required_opp(struct device *dev); int dev_pm_opp_of_find_icc_paths(struct device *dev, struct opp_table *opp= _table); @@ -528,6 +529,11 @@ static inline struct device_node *dev_pm_opp_get_of_no= de(struct dev_pm_opp *opp) return NULL; } =20 +static inline struct device_node *dev_pm_opp_table_to_of_node(struct opp_t= able *table) +{ + return NULL; +} + static inline int dev_pm_opp_of_register_em(struct device *dev, struct cpumask *cpus) { --=20 2.34.1 From nobody Fri Dec 19 10:34:41 2025 Received: from mail-lj1-f175.google.com (mail-lj1-f175.google.com [209.85.208.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E3724188593 for ; Mon, 2 Sep 2024 22:48:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725317308; cv=none; b=am9vRCcAQnAjzrx8gTted8NHqgFSKhMwZVONaZVem25+RJoglBYI08OLFLarYeJi2wQhwILn0zbMTK3waCR4w8OEB52WnE8EkGNAx0S36hXKbvnlbjDOueL3aex0Qkas3pl/34c7mLakJFLKx/FzrFZc8KSk6ihH5/Xw+y5KLyk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725317308; c=relaxed/simple; bh=LzUWQdGTlvvxerr/3ylQ+v75vLm4W6aDvWTRLNpxhCA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Q/dkk1JG1x/3QVLoCrVvYIJ79wbSA29MD1Oq4v0fBoVaNu6X1FSCt7+CPgRDtnADcO9e5eZmyTGw7NFbBLWEgQEvqJgckIKdNlnAkMUV2jBR+5PkZGSi3GPdBBW7ugeJnZgLOioCGYhWua9nUxd8N2DwR7LIksp7rQE0xRZD5WI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=d/PZwawo; arc=none smtp.client-ip=209.85.208.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="d/PZwawo" Received: by mail-lj1-f175.google.com with SMTP id 38308e7fff4ca-2f4f2cda058so50414861fa.1 for ; Mon, 02 Sep 2024 15:48:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1725317305; x=1725922105; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ILko9GrGSTEsXrXVZflQuhfBdNy2+GsUHO1RFuWf+V0=; b=d/PZwawozXkdIZW5PhCclNpY61oTSNzHLZyfglktd8rnGUv6wXZffuMxa2mQnY//8W bruw57jGkeZz27s3oyJeuyJGdsNG0Mh0PhXCggeMMctj3UCXyQBC+QkcMrHmXYb+4Xym Ryp5ys9gPvvuTG3iiAy/AfiBGPBOFVD5bl1E310+MY/KDfkM2hn9DL51AO3R0Lp9t45O FluUxKcJefmvfbUCzjTVuqavDIMDVdk9gv21z32Jcrr7+QdXp/sKoXXz6K8yiPwfHtgI FAT2SMhj9GLyMDPlumijruf/21VXP0xzNL/8gwIe2lw2kCkBaOWudsieGjrxHAAza9Of 4U0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725317305; x=1725922105; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ILko9GrGSTEsXrXVZflQuhfBdNy2+GsUHO1RFuWf+V0=; b=mP+5mE1Ecb8XQltAR+AX85AssptBNDpVHgp2oWVq1HSLLvTOc/PGmXKvmChDlmbu3u GH0TohYl6YXcgibOXzQ05vIepsXLOoLK1ez/G4aPZSPwVncO43ffEbyngQPD9WxjjYEG 1XHehIDoB+SAoCTglZ+dEOkJPN2fOhiQzNlmenbbsO09G0mO5TkXWiOq8wRV5iOJhkje YzPF8fefak0C5q2gMxjOlGqxuWdUwWpo44DZYZC94XQTUaEzrtbacx+p9YesVcbP4qUU kX6VIVtsTlzc+7J49qQ9hIgMb9CRf2i6lh6arB+HnQqt+yESuqpTUO6cK2NSJDVCXZsl PZPw== X-Forwarded-Encrypted: i=1; AJvYcCXc/YFnFwIrPMQKXtQi29FOtSHKhprceAf7iUzMgLZpLRoHFV6dzRn0XryjEz8fYI7FaoXxqoZl3I26O1w=@vger.kernel.org X-Gm-Message-State: AOJu0Yxjso9NTGmjbSCXgHJ5vDS5eZK5w0qyIUa5UsWS19pN/2wJ5UoY R0DKN1XnLHBwBN0vnJVj4rrgSxZwnlaYATC4JZ/FP6wRBSbmxE3YN6o0Gy5E1QI= X-Google-Smtp-Source: AGHT+IFum6vAI4M7Ifv5kv5ZZ8Ww55Gm2DB955sOcPDG5+CQnwdg/OMQzsSkUUI+7Z9IA063dZuH2g== X-Received: by 2002:a05:6512:3088:b0:52c:dc06:d4ad with SMTP id 2adb3069b0e04-535462ee5demr3891202e87.6.1725317304291; Mon, 02 Sep 2024 15:48:24 -0700 (PDT) Received: from uffe-tuxpro14.. (h-178-174-189-39.A498.priv.bahnhof.se. [178.174.189.39]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5354079bbf2sm1790646e87.20.2024.09.02.15.48.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Sep 2024 15:48:23 -0700 (PDT) From: Ulf Hansson To: Viresh Kumar , Nishanth Menon , Stephen Boyd , Dikshita Agarwal Cc: Bjorn Andersson , Konrad Dybcio , Nikunj Kela , Bryan O'Donoghue , Thierry Reding , Mikko Perttunen , Jonathan Hunter , Stephan Gerhold , Ilia Lin , Stanimir Varbanov , Vikash Garodia , Ulf Hansson , linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] OPP/pmdomain: Fix the assignment of the required-devs Date: Tue, 3 Sep 2024 00:48:15 +0200 Message-Id: <20240902224815.78220-3-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240902224815.78220-1-ulf.hansson@linaro.org> References: <20240902224815.78220-1-ulf.hansson@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The recent attempt to make genpd first lookup an OPP table for a device that has been attached to it and then let the OPP core validate whether the OPP table is correct, fails for some configurations. More precisely, if a device has multiple power-domains, which all has an OPP table associated, doesn't necessarily mean that the device's OPP table needs multiple phandles specified in the required-opps. Instead it's perfectly possible to use a single phandle in the required-opps, which is typically where the current code fails to assign the correct required-dev. To fix this problem, let's instead start by letting the OPP core find the device node for the required OPP table and then let genpd search for a corresponding OPP table, allowing us the find the correct required-dev to assign for it. Reported-by: Dikshita Agarwal Fixes: f0d2dcc9b087 ("OPP/pmdomain: Set the required_dev for a required OPP= during genpd attach") Signed-off-by: Ulf Hansson --- drivers/opp/core.c | 15 +++++++----- drivers/pmdomain/core.c | 52 +++++++++++++++++++++++------------------ include/linux/pm_opp.h | 7 ++++-- 3 files changed, 43 insertions(+), 31 deletions(-) diff --git a/drivers/opp/core.c b/drivers/opp/core.c index 66cac7a1d9db..538612886446 100644 --- a/drivers/opp/core.c +++ b/drivers/opp/core.c @@ -2363,7 +2363,7 @@ static void _opp_put_config_regulators_helper(struct = opp_table *opp_table) static int _opp_set_required_dev(struct opp_table *opp_table, struct device *dev, struct device *required_dev, - struct opp_table *required_opp_table) + config_required_dev_t config_required_dev) { int i; =20 @@ -2380,6 +2380,7 @@ static int _opp_set_required_dev(struct opp_table *op= p_table, =20 for (i =3D 0; i < opp_table->required_opp_count; i++) { struct opp_table *table =3D opp_table->required_opp_tables[i]; + struct opp_table *required_opp_table; =20 /* * The OPP table should be available at this point. If not, it's @@ -2396,7 +2397,9 @@ static int _opp_set_required_dev(struct opp_table *op= p_table, * We need to compare the nodes for the OPP tables, rather than * the OPP tables themselves, as we may have separate instances. */ - if (required_opp_table->np =3D=3D table->np) { + required_opp_table =3D config_required_dev(required_dev, + table->np); + if (required_opp_table) { /* * The required_opp_tables parsing is not perfect, as * the OPP core does the parsing solely based on the DT @@ -2422,8 +2425,8 @@ static int _opp_set_required_dev(struct opp_table *op= p_table, } } =20 - dev_err(dev, "Missing OPP table, unable to set the required dev\n"); - return -ENODEV; + /* No matching OPP table found for the required_dev. */ + return -ERANGE; } =20 static void _opp_put_required_dev(struct opp_table *opp_table, @@ -2547,10 +2550,10 @@ int dev_pm_opp_set_config(struct device *dev, struc= t dev_pm_opp_config *config) data->flags |=3D OPP_CONFIG_REGULATOR; } =20 - if (config->required_dev && config->required_opp_table) { + if (config->required_dev && config->config_required_dev) { ret =3D _opp_set_required_dev(opp_table, dev, config->required_dev, - config->required_opp_table); + config->config_required_dev); if (ret < 0) goto err; =20 diff --git a/drivers/pmdomain/core.c b/drivers/pmdomain/core.c index edef1a520110..0ff0b513b2a1 100644 --- a/drivers/pmdomain/core.c +++ b/drivers/pmdomain/core.c @@ -2874,20 +2874,21 @@ static void genpd_dev_pm_sync(struct device *dev) genpd_queue_power_off_work(pd); } =20 -static struct opp_table *genpd_find_opp_table(struct generic_pm_domain *ge= npd, - unsigned int depth) +static struct opp_table *_genpd_find_opp_table(struct generic_pm_domain *g= enpd, + struct device_node *np, + unsigned int depth) { - struct opp_table *opp_table; + struct opp_table *opp_table =3D genpd->opp_table; struct gpd_link *link; =20 - if (genpd->opp_table) - return genpd->opp_table; + if (opp_table && (dev_pm_opp_table_to_of_node(opp_table) =3D=3D np)) + return opp_table; =20 list_for_each_entry(link, &genpd->child_links, child_node) { struct generic_pm_domain *parent =3D link->parent; =20 genpd_lock_nested(parent, depth + 1); - opp_table =3D genpd_find_opp_table(parent, depth + 1); + opp_table =3D _genpd_find_opp_table(parent, np, depth + 1); genpd_unlock(parent); =20 if (opp_table) @@ -2897,12 +2898,27 @@ static struct opp_table *genpd_find_opp_table(struc= t generic_pm_domain *genpd, return NULL; } =20 -static int genpd_set_required_opp_dev(struct device *dev, - struct device *base_dev) +static struct opp_table *genpd_find_opp_table(struct device *dev, + struct device_node *np) { struct generic_pm_domain *genpd =3D dev_to_genpd(dev); struct opp_table *opp_table; - int ret =3D 0; + + genpd_lock(genpd); + opp_table =3D _genpd_find_opp_table(genpd, np, 0); + genpd_unlock(genpd); + + return opp_table; +} + +static int genpd_set_required_opp_dev(struct device *dev, + struct device *base_dev) +{ + struct dev_pm_opp_config config =3D { + .required_dev =3D dev, + .config_required_dev =3D genpd_find_opp_table, + }; + int ret; =20 /* Limit support to non-providers for now. */ if (of_property_present(base_dev->of_node, "#power-domain-cells")) @@ -2911,20 +2927,10 @@ static int genpd_set_required_opp_dev(struct device= *dev, if (!dev_pm_opp_of_has_required_opp(base_dev)) return 0; =20 - genpd_lock(genpd); - opp_table =3D genpd_find_opp_table(genpd, 0); - genpd_unlock(genpd); - - if (opp_table) { - struct dev_pm_opp_config config =3D { - .required_dev =3D dev, - .required_opp_table =3D opp_table, - }; - - ret =3D devm_pm_opp_set_config(base_dev, &config); - if (ret < 0) - dev_err(dev, "failed to set opp config %d\n", ret); - } + ret =3D devm_pm_opp_set_config(base_dev, &config); + ret =3D ret =3D=3D -ERANGE ? 0 : ret; + if (ret < 0) + dev_err(dev, "failed to set opp config %d\n", ret); =20 return ret; } diff --git a/include/linux/pm_opp.h b/include/linux/pm_opp.h index 7894e631cded..0ada4a5057c8 100644 --- a/include/linux/pm_opp.h +++ b/include/linux/pm_opp.h @@ -53,6 +53,9 @@ typedef int (*config_regulators_t)(struct device *dev, typedef int (*config_clks_t)(struct device *dev, struct opp_table *opp_tab= le, struct dev_pm_opp *opp, void *data, bool scaling_down); =20 +typedef struct opp_table *(*config_required_dev_t)(struct device *dev, + struct device_node *opp_table_np); + /** * struct dev_pm_opp_config - Device OPP configuration values * @clk_names: Clk names, NULL terminated array. @@ -63,7 +66,7 @@ typedef int (*config_clks_t)(struct device *dev, struct o= pp_table *opp_table, * @supported_hw_count: Number of elements in the array. * @regulator_names: Array of pointers to the names of the regulator, NULL= terminated. * @required_dev: Required OPP device. - * @required_opp_table: The corresponding required OPP table for @required= _dev. + * @config_required_dev: Custom helper to find the required OPP table for = $required_dev. * * This structure contains platform specific OPP configurations for the de= vice. */ @@ -77,7 +80,7 @@ struct dev_pm_opp_config { unsigned int supported_hw_count; const char * const *regulator_names; struct device *required_dev; - struct opp_table *required_opp_table; + config_required_dev_t config_required_dev; }; =20 #define OPP_LEVEL_UNSET U32_MAX --=20 2.34.1